annotate src/macterm.c @ 62573:b79d54436669

(remote-compile): Use compilation-start.
author Richard M. Stallman <rms@gnu.org>
date Sat, 21 May 2005 04:52:05 +0000
parents 9df01a686e3c
children 35f25c15b8c2 6fef25c75847 f042e7c0fe20
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1 /* Implementation of GUI terminal on the Mac OS.
59583
05a54895186c (mac_draw_string_common): Fix compilation on OSX 10.1.
Andreas Schwab <schwab@suse.de>
parents: 59578
diff changeset
2 Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4 This file is part of GNU Emacs.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6 GNU Emacs is free software; you can redistribute it and/or modify
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8 the Free Software Foundation; either version 2, or (at your option)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9 any later version.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
11 GNU Emacs is distributed in the hope that it will be useful,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
14 GNU General Public License for more details.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
15
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
17 along with GNU Emacs; see the file COPYING. If not, write to
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
20
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
21 /* Contributed by Andrew Choi (akochoi@mac.com). */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
22
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
23 #include <config.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
24 #include <signal.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
25 #include <stdio.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
26 #include <stdlib.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
27 #include "lisp.h"
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
28 #include "charset.h"
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
29 #include "blockinput.h"
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
30
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
31 #include "macterm.h"
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
32
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
33 #ifndef MAC_OSX
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
34 #include <alloca.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
35 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
36
60364
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
37 #if TARGET_API_MAC_CARBON
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
38 /* USE_CARBON_EVENTS determines if the Carbon Event Manager is used to
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
39 obtain events from the event queue. If set to 0, WaitNextEvent is
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
40 used instead. */
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
41 #define USE_CARBON_EVENTS 1
60364
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
42 #else /* not TARGET_API_MAC_CARBON */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
43 #include <Quickdraw.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
44 #include <ToolUtils.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
45 #include <Sound.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
46 #include <Events.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
47 #include <Script.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
48 #include <Resources.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
49 #include <Fonts.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
50 #include <TextUtils.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
51 #include <LowMem.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
52 #include <Controls.h>
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
53 #include <Windows.h>
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
54 #if defined (__MRC__) || (__MSL__ >= 0x6000)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
55 #include <ControlDefinitions.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
56 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
57
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
58 #if __profile__
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
59 #include <profiler.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
60 #endif
60364
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
61 #endif /* not TARGET_API_MAC_CARBON */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
62
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
63 #include "systty.h"
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
64 #include "systime.h"
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
65 #include "atimer.h"
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
66 #include "keymap.h"
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
67
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
68 #include <ctype.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
69 #include <errno.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
70 #include <setjmp.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
71 #include <sys/stat.h>
59384
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
72 #include <sys/param.h>
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
73
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
74 #include "keyboard.h"
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
75 #include "frame.h"
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
76 #include "dispextern.h"
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
77 #include "fontset.h"
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
78 #include "termhooks.h"
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
79 #include "termopts.h"
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
80 #include "termchar.h"
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
81 #include "gnu.h"
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
82 #include "disptab.h"
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
83 #include "buffer.h"
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
84 #include "window.h"
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
85 #include "intervals.h"
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
86 #include "composite.h"
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
87 #include "coding.h"
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
88
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
89 /* Set of macros that handle mapping of Mac modifier keys to emacs. */
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
90 #define macCtrlKey (NILP (Vmac_reverse_ctrl_meta) ? controlKey : \
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
91 (NILP (Vmac_command_key_is_meta) ? optionKey : cmdKey))
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
92 #define macShiftKey (shiftKey)
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
93 #define macMetaKey (NILP (Vmac_reverse_ctrl_meta) ? \
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
94 (NILP (Vmac_command_key_is_meta) ? optionKey : cmdKey) \
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
95 : controlKey)
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
96 #define macAltKey (NILP (Vmac_command_key_is_meta) ? cmdKey : optionKey)
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
97
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
98 #define mac_window_to_frame(wp) (((mac_output *) GetWRefCon (wp))->mFP)
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
99
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
100
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
101 /* Non-nil means Emacs uses toolkit scroll bars. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
102
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
103 Lisp_Object Vx_toolkit_scroll_bars;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
104
59577
a4a748516aa7 * macterm.c (Vmac_use_core_graphics): defined
Steven Tamm <steventamm@mac.com>
parents: 59575
diff changeset
105 /* If Non-nil, the text will be rendered using Core Graphics text rendering which may anti-alias the text. */
a4a748516aa7 * macterm.c (Vmac_use_core_graphics): defined
Steven Tamm <steventamm@mac.com>
parents: 59575
diff changeset
106 Lisp_Object Vmac_use_core_graphics;
a4a748516aa7 * macterm.c (Vmac_use_core_graphics): defined
Steven Tamm <steventamm@mac.com>
parents: 59575
diff changeset
107
a4a748516aa7 * macterm.c (Vmac_use_core_graphics): defined
Steven Tamm <steventamm@mac.com>
parents: 59575
diff changeset
108
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
109 /* Non-zero means that a HELP_EVENT has been generated since Emacs
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
110 start. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
111
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
112 static int any_help_event_p;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
113
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
114 /* Last window where we saw the mouse. Used by mouse-autoselect-window. */
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
115 static Lisp_Object last_window;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
116
50591
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
117 /* Non-zero means make use of UNDERLINE_POSITION font properties. */
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
118
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
119 int x_use_underline_position_properties;
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
120
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
121 /* Non-zero means draw block and hollow cursor as wide as the glyph
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
122 under it. For example, if a block cursor is over a tab, it will be
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
123 drawn as wide as that tab on the display. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
124
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
125
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
126 /* This is a chain of structures for all the X displays currently in
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
127 use. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
128
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
129 struct x_display_info *x_display_list;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
130
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
131 /* This is a list of cons cells, each of the form (NAME
60635
e45b939c1d93 (x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60623
diff changeset
132 FONT-LIST-CACHE . RESOURCE-DATABASE), one for each element of
e45b939c1d93 (x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60623
diff changeset
133 x_display_list and in the same order. NAME is the name of the
e45b939c1d93 (x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60623
diff changeset
134 frame. FONT-LIST-CACHE records previous values returned by
e45b939c1d93 (x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60623
diff changeset
135 x-list-fonts. RESOURCE-DATABASE preserves the X Resource Database
e45b939c1d93 (x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60623
diff changeset
136 equivalent, which is implemented with a Lisp object, for the
e45b939c1d93 (x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60623
diff changeset
137 display. */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
138
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
139 Lisp_Object x_display_name_list;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
140
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
141 /* This is display since Mac does not support multiple ones. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
142 struct mac_display_info one_mac_display_info;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
143
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
144 /* Frame being updated by update_frame. This is declared in term.c.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
145 This is set by update_begin and looked at by all the XT functions.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
146 It is zero while not inside an update. In that case, the XT
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
147 functions assume that `selected_frame' is the frame to apply to. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
148
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
149 extern struct frame *updating_frame;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
150
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
151 extern int waiting_for_input;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
152
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
153 /* This is a frame waiting to be auto-raised, within XTread_socket. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
154
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
155 struct frame *pending_autoraise_frame;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
156
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
157 /* Mouse movement.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
158
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
159 Formerly, we used PointerMotionHintMask (in standard_event_mask)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
160 so that we would have to call XQueryPointer after each MotionNotify
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
161 event to ask for another such event. However, this made mouse tracking
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
162 slow, and there was a bug that made it eventually stop.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
163
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
164 Simply asking for MotionNotify all the time seems to work better.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
165
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
166 In order to avoid asking for motion events and then throwing most
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
167 of them away or busy-polling the server for mouse positions, we ask
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
168 the server for pointer motion hints. This means that we get only
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
169 one event per group of mouse movements. "Groups" are delimited by
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
170 other kinds of events (focus changes and button clicks, for
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
171 example), or by XQueryPointer calls; when one of these happens, we
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
172 get another MotionNotify event the next time the mouse moves. This
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
173 is at least as efficient as getting motion events when mouse
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
174 tracking is on, and I suspect only negligibly worse when tracking
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
175 is off. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
176
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
177 /* Where the mouse was last time we reported a mouse event. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
178
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
179 static Rect last_mouse_glyph;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
180 static Lisp_Object last_mouse_press_frame;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
181
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
182 /* The scroll bar in which the last X motion event occurred.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
183
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
184 If the last X motion event occurred in a scroll bar, we set this so
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
185 XTmouse_position can know whether to report a scroll bar motion or
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
186 an ordinary motion.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
187
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
188 If the last X motion event didn't occur in a scroll bar, we set
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
189 this to Qnil, to tell XTmouse_position to return an ordinary motion
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
190 event. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
191
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
192 static Lisp_Object last_mouse_scroll_bar;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
193
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
194 /* This is a hack. We would really prefer that XTmouse_position would
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
195 return the time associated with the position it returns, but there
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
196 doesn't seem to be any way to wrest the time-stamp from the server
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
197 along with the position query. So, we just keep track of the time
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
198 of the last movement we received, and return that in hopes that
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
199 it's somewhat accurate. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
200
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
201 static Time last_mouse_movement_time;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
202
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
203 struct scroll_bar *tracked_scroll_bar = NULL;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
204
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
205 /* Incremented by XTread_socket whenever it really tries to read
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
206 events. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
207
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
208 #ifdef __STDC__
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
209 static int volatile input_signal_count;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
210 #else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
211 static int input_signal_count;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
212 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
213
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
214 /* Used locally within XTread_socket. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
215
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
216 static int x_noop_count;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
217
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
218 /* Initial values of argv and argc. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
219
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
220 extern char **initial_argv;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
221 extern int initial_argc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
222
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
223 extern Lisp_Object Vcommand_line_args, Vsystem_name;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
224
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
225 /* Tells if a window manager is present or not. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
226
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
227 extern Lisp_Object Vx_no_window_manager;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
228
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
229 extern int errno;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
230
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
231 /* A mask of extra modifier bits to put into every keyboard char. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
232
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
233 extern int extra_keyboard_modifiers;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
234
57783
4cb8cebc3255 2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents: 57425
diff changeset
235 /* The keysyms to use for the various modifiers. */
4cb8cebc3255 2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents: 57425
diff changeset
236
4cb8cebc3255 2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents: 57425
diff changeset
237 static Lisp_Object Qalt, Qhyper, Qsuper, Qmodifier_value;
4cb8cebc3255 2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents: 57425
diff changeset
238
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
239 static Lisp_Object Qvendor_specific_keysyms;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
240
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
241 #if 0
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
242 extern XrmDatabase x_load_resources P_ ((Display *, char *, char *, char *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
243 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
244
46856
eba75fedd593 2002-08-10 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46805
diff changeset
245 extern int inhibit_window_system;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
246
60364
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
247 #if __MRC__ && !TARGET_API_MAC_CARBON
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
248 QDGlobals qd; /* QuickDraw global information structure. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
249 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
250
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
251
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
252 struct frame * x_window_to_frame (struct mac_display_info *, WindowPtr);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
253 struct mac_display_info *mac_display_info_for_display (Display *);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
254 static void x_update_window_end P_ ((struct window *, int, int));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
255 static int x_io_error_quitter P_ ((Display *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
256 int x_catch_errors P_ ((Display *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
257 void x_uncatch_errors P_ ((Display *, int));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
258 void x_lower_frame P_ ((struct frame *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
259 void x_scroll_bar_clear P_ ((struct frame *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
260 int x_had_errors_p P_ ((Display *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
261 void x_wm_set_size_hint P_ ((struct frame *, long, int));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
262 void x_raise_frame P_ ((struct frame *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
263 void x_set_window_size P_ ((struct frame *, int, int, int));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
264 void x_wm_set_window_state P_ ((struct frame *, int));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
265 void x_wm_set_icon_pixmap P_ ((struct frame *, int));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
266 void mac_initialize P_ ((void));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
267 static void x_font_min_bounds P_ ((XFontStruct *, int *, int *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
268 static int x_compute_min_glyph_bounds P_ ((struct frame *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
269 static void x_update_end P_ ((struct frame *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
270 static void XTframe_up_to_date P_ ((struct frame *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
271 static void XTset_terminal_modes P_ ((void));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
272 static void XTreset_terminal_modes P_ ((void));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
273 static void x_clear_frame P_ ((void));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
274 static void frame_highlight P_ ((struct frame *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
275 static void frame_unhighlight P_ ((struct frame *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
276 static void x_new_focus_frame P_ ((struct x_display_info *, struct frame *));
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
277 static void mac_focus_changed P_ ((int, struct mac_display_info *,
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
278 struct frame *, struct input_event *));
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
279 static void x_detect_focus_change P_ ((struct mac_display_info *,
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
280 EventRecord *, struct input_event *));
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
281 static void XTframe_rehighlight P_ ((struct frame *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
282 static void x_frame_rehighlight P_ ((struct x_display_info *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
283 static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *));
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
284 static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int,
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
285 enum text_cursor_kinds));
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
286
58403
c936fa56eb60 (x_clip_to_row): Add area arg. Callers changed.
Kim F. Storm <storm@cua.dk>
parents: 57783
diff changeset
287 static void x_clip_to_row P_ ((struct window *, struct glyph_row *, int, GC));
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
288 static void x_flush P_ ((struct frame *f));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
289 static void x_update_begin P_ ((struct frame *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
290 static void x_update_window_begin P_ ((struct window *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
291 static void x_after_update_window_line P_ ((struct glyph_row *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
292
46860
8b7ade57211d 2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46856
diff changeset
293 static int is_emacs_window (WindowPtr);
8b7ade57211d 2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46856
diff changeset
294
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
295 int x_bitmap_icon (struct frame *, Lisp_Object);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
296 void x_make_frame_visible (struct frame *);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
297
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
298 extern void window_scroll (Lisp_Object, int, int, int);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
299
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
300 /* Defined in macmenu.h. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
301 extern void menubar_selection_callback (FRAME_PTR, int);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
302 extern void set_frame_menubar (FRAME_PTR, int, int);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
303
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
304 /* X display function emulation */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
305
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
306 void
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
307 XFreePixmap (display, pixmap)
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
308 Display *display; /* not used */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
309 Pixmap pixmap;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
310 {
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
311 DisposeGWorld (pixmap);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
312 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
313
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
314
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
315 /* Set foreground color for subsequent QuickDraw commands. Assume
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
316 graphic port has already been set. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
317
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
318 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
319 mac_set_forecolor (unsigned long color)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
320 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
321 RGBColor fg_color;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
322
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
323 fg_color.red = RED16_FROM_ULONG (color);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
324 fg_color.green = GREEN16_FROM_ULONG (color);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
325 fg_color.blue = BLUE16_FROM_ULONG (color);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
326
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
327 RGBForeColor (&fg_color);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
328 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
329
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
330
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
331 /* Set background color for subsequent QuickDraw commands. Assume
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
332 graphic port has already been set. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
333
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
334 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
335 mac_set_backcolor (unsigned long color)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
336 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
337 RGBColor bg_color;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
338
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
339 bg_color.red = RED16_FROM_ULONG (color);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
340 bg_color.green = GREEN16_FROM_ULONG (color);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
341 bg_color.blue = BLUE16_FROM_ULONG (color);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
342
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
343 RGBBackColor (&bg_color);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
344 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
345
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
346 /* Set foreground and background color for subsequent QuickDraw
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
347 commands. Assume that the graphic port has already been set. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
348
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
349 static void
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
350 mac_set_colors (gc, bg_save)
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
351 GC gc;
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
352 RGBColor *bg_save;
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
353 {
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
354 if (bg_save)
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
355 GetBackColor (bg_save);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
356 mac_set_forecolor (gc->foreground);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
357 mac_set_backcolor (gc->background);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
358 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
359
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
360 /* Mac version of XDrawLine. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
361
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
362 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
363 XDrawLine (display, w, gc, x1, y1, x2, y2)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
364 Display *display;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
365 WindowPtr w;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
366 GC gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
367 int x1, y1, x2, y2;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
368 {
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
369 RGBColor old_bg;
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
370
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
371 SetPortWindowPort (w);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
372
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
373 mac_set_colors (gc, &old_bg);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
374
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
375 MoveTo (x1, y1);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
376 LineTo (x2, y2);
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
377
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
378 RGBBackColor (&old_bg);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
379 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
380
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
381 void
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
382 mac_draw_line_to_pixmap (display, p, gc, x1, y1, x2, y2)
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
383 Display *display;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
384 Pixmap p;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
385 GC gc;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
386 int x1, y1, x2, y2;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
387 {
55412
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
388 CGrafPtr old_port;
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
389 GDHandle old_gdh;
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
390
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
391 GetGWorld (&old_port, &old_gdh);
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
392 SetGWorld (p, NULL);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
393
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
394 mac_set_colors (gc, NULL);
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
395
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
396 LockPixels (GetGWorldPixMap (p));
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
397 MoveTo (x1, y1);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
398 LineTo (x2, y2);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
399 UnlockPixels (GetGWorldPixMap (p));
55412
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
400
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
401 SetGWorld (old_port, old_gdh);
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
402 }
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
403
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
404 /* Mac version of XClearArea. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
405
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
406 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
407 XClearArea (display, w, x, y, width, height, exposures)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
408 Display *display;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
409 WindowPtr w;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
410 int x, y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
411 unsigned int width, height;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
412 int exposures;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
413 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
414 struct mac_output *mwp = (mac_output *) GetWRefCon (w);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
415 Rect r;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
416 XGCValues xgc;
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
417 RGBColor old_bg;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
418
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
419 xgc.foreground = mwp->x_compatible.foreground_pixel;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
420 xgc.background = mwp->x_compatible.background_pixel;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
421
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
422 SetPortWindowPort (w);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
423
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
424 mac_set_colors (&xgc, &old_bg);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
425 SetRect (&r, x, y, x + width, y + height);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
426
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
427 EraseRect (&r);
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
428
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
429 RGBBackColor (&old_bg);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
430 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
431
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
432 /* Mac version of XClearWindow. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
433
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
434 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
435 XClearWindow (display, w)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
436 Display *display;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
437 WindowPtr w;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
438 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
439 struct mac_output *mwp = (mac_output *) GetWRefCon (w);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
440 XGCValues xgc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
441
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
442 xgc.foreground = mwp->x_compatible.foreground_pixel;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
443 xgc.background = mwp->x_compatible.background_pixel;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
444
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
445 SetPortWindowPort (w);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
446
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
447 mac_set_colors (&xgc, NULL);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
448
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
449 #if TARGET_API_MAC_CARBON
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
450 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
451 Rect r;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
452
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
453 GetWindowPortBounds (w, &r);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
454 EraseRect (&r);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
455 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
456 #else /* not TARGET_API_MAC_CARBON */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
457 EraseRect (&(w->portRect));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
458 #endif /* not TARGET_API_MAC_CARBON */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
459 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
460
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
461
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
462 /* Mac replacement for XCopyArea. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
463
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
464 static void
53935
60bbfcb6328e (mac_draw_bitmap): Handle 16 bits wide bitmaps directly.
Kim F. Storm <storm@cua.dk>
parents: 53899
diff changeset
465 mac_draw_bitmap (display, w, gc, x, y, width, height, bits, overlay_p)
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
466 Display *display;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
467 WindowPtr w;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
468 GC gc;
53935
60bbfcb6328e (mac_draw_bitmap): Handle 16 bits wide bitmaps directly.
Kim F. Storm <storm@cua.dk>
parents: 53899
diff changeset
469 int x, y, width, height;
60bbfcb6328e (mac_draw_bitmap): Handle 16 bits wide bitmaps directly.
Kim F. Storm <storm@cua.dk>
parents: 53899
diff changeset
470 unsigned short *bits;
53899
e45e1fbbe83e (mac_draw_bitmap): Add overlay_p arg.
Kim F. Storm <storm@cua.dk>
parents: 53885
diff changeset
471 int overlay_p;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
472 {
53935
60bbfcb6328e (mac_draw_bitmap): Handle 16 bits wide bitmaps directly.
Kim F. Storm <storm@cua.dk>
parents: 53899
diff changeset
473 BitMap bitmap;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
474 Rect r;
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
475 RGBColor old_bg;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
476
53935
60bbfcb6328e (mac_draw_bitmap): Handle 16 bits wide bitmaps directly.
Kim F. Storm <storm@cua.dk>
parents: 53899
diff changeset
477 bitmap.rowBytes = sizeof(unsigned short);
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
478 bitmap.baseAddr = (char *)bits;
53935
60bbfcb6328e (mac_draw_bitmap): Handle 16 bits wide bitmaps directly.
Kim F. Storm <storm@cua.dk>
parents: 53899
diff changeset
479 SetRect (&(bitmap.bounds), 0, 0, width, height);
60bbfcb6328e (mac_draw_bitmap): Handle 16 bits wide bitmaps directly.
Kim F. Storm <storm@cua.dk>
parents: 53899
diff changeset
480
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
481 SetPortWindowPort (w);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
482
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
483 mac_set_colors (gc, &old_bg);
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
484 SetRect (&r, x, y, x + width, y + height);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
485
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
486 #if TARGET_API_MAC_CARBON
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
487 LockPortBits (GetWindowPort (w));
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
488 CopyBits (&bitmap, GetPortBitMapForCopyBits (GetWindowPort (w)),
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
489 &(bitmap.bounds), &r, overlay_p ? srcOr : srcCopy, 0);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
490 UnlockPortBits (GetWindowPort (w));
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
491 #else /* not TARGET_API_MAC_CARBON */
53935
60bbfcb6328e (mac_draw_bitmap): Handle 16 bits wide bitmaps directly.
Kim F. Storm <storm@cua.dk>
parents: 53899
diff changeset
492 CopyBits (&bitmap, &(w->portBits), &(bitmap.bounds), &r,
53899
e45e1fbbe83e (mac_draw_bitmap): Add overlay_p arg.
Kim F. Storm <storm@cua.dk>
parents: 53885
diff changeset
493 overlay_p ? srcOr : srcCopy, 0);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
494 #endif /* not TARGET_API_MAC_CARBON */
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
495
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
496 RGBBackColor (&old_bg);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
497 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
498
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
499
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
500 /* Mac replacement for XSetClipRectangles. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
501
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
502 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
503 mac_set_clip_rectangle (display, w, r)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
504 Display *display;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
505 WindowPtr w;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
506 Rect *r;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
507 {
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
508 SetPortWindowPort (w);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
509
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
510 ClipRect (r);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
511 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
512
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
513
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
514 /* Mac replacement for XSetClipMask. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
515
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
516 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
517 mac_reset_clipping (display, w)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
518 Display *display;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
519 WindowPtr w;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
520 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
521 Rect r;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
522
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
523 SetPortWindowPort (w);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
524
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
525 SetRect (&r, -32767, -32767, 32767, 32767);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
526 ClipRect (&r);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
527 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
528
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
529
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
530 /* Mac replacement for XCreateBitmapFromBitmapData. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
531
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
532 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
533 mac_create_bitmap_from_bitmap_data (bitmap, bits, w, h)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
534 BitMap *bitmap;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
535 char *bits;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
536 int w, h;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
537 {
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
538 static unsigned char swap_nibble[16]
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
539 = { 0x0, 0x8, 0x4, 0xc, /* 0000 1000 0100 1100 */
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
540 0x2, 0xa, 0x6, 0xe, /* 0010 1010 0110 1110 */
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
541 0x1, 0x9, 0x5, 0xd, /* 0001 1001 0101 1101 */
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
542 0x3, 0xb, 0x7, 0xf }; /* 0011 1011 0111 1111 */
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
543 int i, j, w1;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
544 char *p;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
545
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
546 w1 = (w + 7) / 8; /* nb of 8bits elt in X bitmap */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
547 bitmap->rowBytes = ((w + 15) / 16) * 2; /* nb of 16bits elt in Mac bitmap */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
548 bitmap->baseAddr = xmalloc (bitmap->rowBytes * h);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
549 bzero (bitmap->baseAddr, bitmap->rowBytes * h);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
550 for (i = 0; i < h; i++)
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
551 {
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
552 p = bitmap->baseAddr + i * bitmap->rowBytes;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
553 for (j = 0; j < w1; j++)
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
554 {
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
555 /* Bitswap XBM bytes to match how Mac does things. */
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
556 unsigned char c = *bits++;
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
557 *p++ = (unsigned char)((swap_nibble[c & 0xf] << 4)
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
558 | (swap_nibble[(c>>4) & 0xf]));;
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
559 }
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
560 }
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
561
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
562 SetRect (&(bitmap->bounds), 0, 0, w, h);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
563 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
564
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
565
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
566 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
567 mac_free_bitmap (bitmap)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
568 BitMap *bitmap;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
569 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
570 xfree (bitmap->baseAddr);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
571 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
572
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
573
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
574 Pixmap
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
575 XCreatePixmap (display, w, width, height, depth)
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
576 Display *display; /* not used */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
577 WindowPtr w;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
578 unsigned int width, height;
58634
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
579 unsigned int depth;
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
580 {
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
581 Pixmap pixmap;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
582 Rect r;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
583 QDErr err;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
584
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
585 SetPortWindowPort (w);
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
586
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
587 SetRect (&r, 0, 0, width, height);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
588 err = NewGWorld (&pixmap, depth, &r, NULL, NULL, 0);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
589 if (err != noErr)
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
590 return NULL;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
591 return pixmap;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
592 }
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
593
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
594
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
595 Pixmap
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
596 XCreatePixmapFromBitmapData (display, w, data, width, height, fg, bg, depth)
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
597 Display *display; /* not used */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
598 WindowPtr w;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
599 char *data;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
600 unsigned int width, height;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
601 unsigned long fg, bg;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
602 unsigned int depth; /* not used */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
603 {
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
604 Pixmap pixmap;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
605 BitMap bitmap;
55412
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
606 CGrafPtr old_port;
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
607 GDHandle old_gdh;
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
608
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
609 pixmap = XCreatePixmap (display, w, width, height, depth);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
610 if (pixmap == NULL)
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
611 return NULL;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
612
55412
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
613 GetGWorld (&old_port, &old_gdh);
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
614 SetGWorld (pixmap, NULL);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
615 mac_create_bitmap_from_bitmap_data (&bitmap, data, width, height);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
616 mac_set_forecolor (fg);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
617 mac_set_backcolor (bg);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
618 LockPixels (GetGWorldPixMap (pixmap));
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
619 #if TARGET_API_MAC_CARBON
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
620 CopyBits (&bitmap, GetPortBitMapForCopyBits (pixmap),
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
621 &bitmap.bounds, &bitmap.bounds, srcCopy, 0);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
622 #else /* not TARGET_API_MAC_CARBON */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
623 CopyBits (&bitmap, &(((GrafPtr)pixmap)->portBits),
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
624 &bitmap.bounds, &bitmap.bounds, srcCopy, 0);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
625 #endif /* not TARGET_API_MAC_CARBON */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
626 UnlockPixels (GetGWorldPixMap (pixmap));
55412
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
627 SetGWorld (old_port, old_gdh);
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
628 mac_free_bitmap (&bitmap);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
629
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
630 return pixmap;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
631 }
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
632
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
633
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
634 /* Mac replacement for XFillRectangle. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
635
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
636 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
637 XFillRectangle (display, w, gc, x, y, width, height)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
638 Display *display;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
639 WindowPtr w;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
640 GC gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
641 int x, y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
642 unsigned int width, height;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
643 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
644 Rect r;
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
645 RGBColor old_bg;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
646
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
647 SetPortWindowPort (w);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
648
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
649 mac_set_colors (gc, &old_bg);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
650 SetRect (&r, x, y, x + width, y + height);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
651
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
652 PaintRect (&r); /* using foreground color of gc */
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
653
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
654 RGBBackColor (&old_bg);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
655 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
656
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
657
58634
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
658 #if 0 /* TODO: figure out if we need to do this on Mac. */
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
659 static void
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
660 mac_fill_rectangle_to_pixmap (display, p, gc, x, y, width, height)
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
661 Display *display;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
662 Pixmap p;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
663 GC gc;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
664 int x, y;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
665 unsigned int width, height;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
666 {
55412
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
667 CGrafPtr old_port;
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
668 GDHandle old_gdh;
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
669 Rect r;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
670
55412
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
671 GetGWorld (&old_port, &old_gdh);
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
672 SetGWorld (p, NULL);
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
673 mac_set_colors (gc, NULL);
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
674 SetRect (&r, x, y, x + width, y + height);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
675
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
676 LockPixels (GetGWorldPixMap (p));
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
677 PaintRect (&r); /* using foreground color of gc */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
678 UnlockPixels (GetGWorldPixMap (p));
55412
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
679
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
680 SetGWorld (old_port, old_gdh);
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
681 }
58634
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
682 #endif
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
683
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
684
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
685 /* Mac replacement for XDrawRectangle: dest is a window. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
686
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
687 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
688 mac_draw_rectangle (display, w, gc, x, y, width, height)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
689 Display *display;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
690 WindowPtr w;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
691 GC gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
692 int x, y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
693 unsigned int width, height;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
694 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
695 Rect r;
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
696 RGBColor old_bg;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
697
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
698 SetPortWindowPort (w);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
699
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
700 mac_set_colors (gc, &old_bg);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
701 SetRect (&r, x, y, x + width + 1, y + height + 1);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
702
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
703 FrameRect (&r); /* using foreground color of gc */
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
704
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
705 RGBBackColor (&old_bg);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
706 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
707
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
708
58634
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
709 #if 0 /* TODO: figure out if we need to do this on Mac. */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
710 /* Mac replacement for XDrawRectangle: dest is a Pixmap. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
711
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
712 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
713 mac_draw_rectangle_to_pixmap (display, p, gc, x, y, width, height)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
714 Display *display;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
715 Pixmap p;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
716 GC gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
717 int x, y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
718 unsigned int width, height;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
719 {
55412
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
720 CGrafPtr old_port;
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
721 GDHandle old_gdh;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
722 Rect r;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
723
55412
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
724 GetGWorld (&old_port, &old_gdh);
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
725 SetGWorld (p, NULL);
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
726 mac_set_colors (gc, NULL);
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
727 SetRect (&r, x, y, x + width + 1, y + height + 1);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
728
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
729 LockPixels (GetGWorldPixMap (p));
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
730 FrameRect (&r); /* using foreground color of gc */
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
731 UnlockPixels (GetGWorldPixMap (p));
55412
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
732
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
733 SetGWorld (old_port, old_gdh);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
734 }
58634
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
735 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
736
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
737
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
738 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
739 mac_draw_string_common (display, w, gc, x, y, buf, nchars, mode,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
740 bytes_per_char)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
741 Display *display;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
742 WindowPtr w;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
743 GC gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
744 int x, y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
745 char *buf;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
746 int nchars, mode, bytes_per_char;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
747 {
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
748 RGBColor old_bg;
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
749
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
750 SetPortWindowPort (w);
59899
96a18b943293 (mac_draw_string_common, x_make_frame_visible): Use
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59804
diff changeset
751 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
59577
a4a748516aa7 * macterm.c (Vmac_use_core_graphics): defined
Steven Tamm <steventamm@mac.com>
parents: 59575
diff changeset
752 UInt32 textFlags, savedFlags;
a4a748516aa7 * macterm.c (Vmac_use_core_graphics): defined
Steven Tamm <steventamm@mac.com>
parents: 59575
diff changeset
753 if (!NILP(Vmac_use_core_graphics)) {
a4a748516aa7 * macterm.c (Vmac_use_core_graphics): defined
Steven Tamm <steventamm@mac.com>
parents: 59575
diff changeset
754 textFlags = kQDUseCGTextRendering;
a4a748516aa7 * macterm.c (Vmac_use_core_graphics): defined
Steven Tamm <steventamm@mac.com>
parents: 59575
diff changeset
755 savedFlags = SwapQDTextFlags(textFlags);
a4a748516aa7 * macterm.c (Vmac_use_core_graphics): defined
Steven Tamm <steventamm@mac.com>
parents: 59575
diff changeset
756 }
a4a748516aa7 * macterm.c (Vmac_use_core_graphics): defined
Steven Tamm <steventamm@mac.com>
parents: 59575
diff changeset
757 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
758
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
759 mac_set_colors (gc, &old_bg);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
760
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
761 TextFont (gc->font->mac_fontnum);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
762 TextSize (gc->font->mac_fontsize);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
763 TextFace (gc->font->mac_fontface);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
764 TextMode (mode);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
765
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
766 MoveTo (x, y);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
767 DrawText (buf, 0, nchars * bytes_per_char);
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
768
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
769 RGBBackColor (&old_bg);
59899
96a18b943293 (mac_draw_string_common, x_make_frame_visible): Use
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59804
diff changeset
770 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
59577
a4a748516aa7 * macterm.c (Vmac_use_core_graphics): defined
Steven Tamm <steventamm@mac.com>
parents: 59575
diff changeset
771 if (!NILP(Vmac_use_core_graphics))
a4a748516aa7 * macterm.c (Vmac_use_core_graphics): defined
Steven Tamm <steventamm@mac.com>
parents: 59575
diff changeset
772 SwapQDTextFlags(savedFlags);
a4a748516aa7 * macterm.c (Vmac_use_core_graphics): defined
Steven Tamm <steventamm@mac.com>
parents: 59575
diff changeset
773 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
774 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
775
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
776
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
777 /* Mac replacement for XDrawString. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
778
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
779 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
780 XDrawString (display, w, gc, x, y, buf, nchars)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
781 Display *display;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
782 WindowPtr w;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
783 GC gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
784 int x, y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
785 char *buf;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
786 int nchars;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
787 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
788 mac_draw_string_common (display, w, gc, x, y, buf, nchars, srcOr, 1);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
789 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
790
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
791
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
792 /* Mac replacement for XDrawString16. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
793
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
794 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
795 XDrawString16 (display, w, gc, x, y, buf, nchars)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
796 Display *display;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
797 WindowPtr w;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
798 GC gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
799 int x, y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
800 XChar2b *buf;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
801 int nchars;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
802 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
803 mac_draw_string_common (display, w, gc, x, y, (char *) buf, nchars, srcOr,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
804 2);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
805 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
806
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
807
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
808 /* Mac replacement for XDrawImageString. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
809
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
810 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
811 XDrawImageString (display, w, gc, x, y, buf, nchars)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
812 Display *display;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
813 WindowPtr w;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
814 GC gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
815 int x, y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
816 char *buf;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
817 int nchars;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
818 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
819 mac_draw_string_common (display, w, gc, x, y, buf, nchars, srcCopy, 1);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
820 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
821
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
822
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
823 /* Mac replacement for XDrawString16. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
824
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
825 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
826 XDrawImageString16 (display, w, gc, x, y, buf, nchars)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
827 Display *display;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
828 WindowPtr w;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
829 GC gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
830 int x, y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
831 XChar2b *buf;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
832 int nchars;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
833 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
834 mac_draw_string_common (display, w, gc, x, y, (char *) buf, nchars, srcCopy,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
835 2);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
836 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
837
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
838
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
839 /* Mac replacement for XCopyArea: dest must be window. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
840
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
841 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
842 mac_copy_area (display, src, dest, gc, src_x, src_y, width, height, dest_x,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
843 dest_y)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
844 Display *display;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
845 Pixmap src;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
846 WindowPtr dest;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
847 GC gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
848 int src_x, src_y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
849 unsigned int width, height;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
850 int dest_x, dest_y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
851 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
852 Rect src_r, dest_r;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
853
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
854 SetPortWindowPort (dest);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
855
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
856 SetRect (&src_r, src_x, src_y, src_x + width, src_y + height);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
857 SetRect (&dest_r, dest_x, dest_y, dest_x + width, dest_y + height);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
858
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
859 ForeColor (blackColor);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
860 BackColor (whiteColor);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
861
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
862 LockPixels (GetGWorldPixMap (src));
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
863 #if TARGET_API_MAC_CARBON
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
864 LockPortBits (GetWindowPort (dest));
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
865 CopyBits (GetPortBitMapForCopyBits (src),
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
866 GetPortBitMapForCopyBits (GetWindowPort (dest)),
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
867 &src_r, &dest_r, srcCopy, 0);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
868 UnlockPortBits (GetWindowPort (dest));
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
869 #else /* not TARGET_API_MAC_CARBON */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
870 CopyBits (&(((GrafPtr)src)->portBits), &(dest->portBits),
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
871 &src_r, &dest_r, srcCopy, 0);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
872 #endif /* not TARGET_API_MAC_CARBON */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
873 UnlockPixels (GetGWorldPixMap (src));
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
874 }
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
875
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
876
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
877 static void
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
878 mac_copy_area_with_mask (display, src, mask, dest, gc, src_x, src_y,
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
879 width, height, dest_x, dest_y)
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
880 Display *display;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
881 Pixmap src, mask;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
882 WindowPtr dest;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
883 GC gc;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
884 int src_x, src_y;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
885 unsigned int width, height;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
886 int dest_x, dest_y;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
887 {
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
888 Rect src_r, dest_r;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
889
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
890 SetPortWindowPort (dest);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
891
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
892 SetRect (&src_r, src_x, src_y, src_x + width, src_y + height);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
893 SetRect (&dest_r, dest_x, dest_y, dest_x + width, dest_y + height);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
894
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
895 ForeColor (blackColor);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
896 BackColor (whiteColor);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
897
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
898 LockPixels (GetGWorldPixMap (src));
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
899 LockPixels (GetGWorldPixMap (mask));
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
900 #if TARGET_API_MAC_CARBON
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
901 LockPortBits (GetWindowPort (dest));
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
902 CopyMask (GetPortBitMapForCopyBits (src), GetPortBitMapForCopyBits (mask),
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
903 GetPortBitMapForCopyBits (GetWindowPort (dest)),
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
904 &src_r, &src_r, &dest_r);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
905 UnlockPortBits (GetWindowPort (dest));
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
906 #else /* not TARGET_API_MAC_CARBON */
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
907 CopyMask (&(((GrafPtr)src)->portBits), &(((GrafPtr)mask)->portBits),
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
908 &(dest->portBits), &src_r, &src_r, &dest_r);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
909 #endif /* not TARGET_API_MAC_CARBON */
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
910 UnlockPixels (GetGWorldPixMap (mask));
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
911 UnlockPixels (GetGWorldPixMap (src));
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
912 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
913
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
914
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
915 #if 0
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
916 /* Convert a pair of local coordinates to global (screen) coordinates.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
917 Assume graphic port has been properly set. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
918 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
919 local_to_global_coord (short *h, short *v)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
920 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
921 Point p;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
922
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
923 p.h = *h;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
924 p.v = *v;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
925
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
926 LocalToGlobal (&p);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
927
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
928 *h = p.h;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
929 *v = p.v;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
930 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
931 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
932
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
933 /* Mac replacement for XCopyArea: used only for scrolling. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
934
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
935 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
936 mac_scroll_area (display, w, gc, src_x, src_y, width, height, dest_x, dest_y)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
937 Display *display;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
938 WindowPtr w;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
939 GC gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
940 int src_x, src_y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
941 unsigned int width, height;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
942 int dest_x, dest_y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
943 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
944 #if TARGET_API_MAC_CARBON
58634
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
945 Rect src_r;
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
946 RgnHandle dummy = NewRgn (); /* For avoiding update events. */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
947
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
948 SetRect (&src_r, src_x, src_y, src_x + width, src_y + height);
58634
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
949 ScrollWindowRect (w, &src_r, dest_x - src_x, dest_y - src_y,
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
950 kScrollWindowNoOptions, dummy);
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
951 DisposeRgn (dummy);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
952 #else /* not TARGET_API_MAC_CARBON */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
953 Rect src_r, dest_r;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
954
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
955 SetPort (w);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
956 #if 0
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
957 mac_set_colors (gc, NULL);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
958 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
959
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
960 SetRect (&src_r, src_x, src_y, src_x + width, src_y + height);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
961 SetRect (&dest_r, dest_x, dest_y, dest_x + width, dest_y + height);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
962
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
963 #if 0
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
964 /* Need to use global coordinates and screenBits since src and dest
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
965 areas overlap in general. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
966 local_to_global_coord (&src_r.left, &src_r.top);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
967 local_to_global_coord (&src_r.right, &src_r.bottom);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
968 local_to_global_coord (&dest_r.left, &dest_r.top);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
969 local_to_global_coord (&dest_r.right, &dest_r.bottom);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
970
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
971 CopyBits (&qd.screenBits, &qd.screenBits, &src_r, &dest_r, srcCopy, 0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
972 #else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
973 /* In Color QuickDraw, set ForeColor and BackColor as follows to avoid
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
974 color mapping in CopyBits. Otherwise, it will be slow. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
975 ForeColor (blackColor);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
976 BackColor (whiteColor);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
977 CopyBits (&(w->portBits), &(w->portBits), &src_r, &dest_r, srcCopy, 0);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
978
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
979 mac_set_colors (gc, NULL);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
980 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
981 #endif /* not TARGET_API_MAC_CARBON */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
982 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
983
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
984
58634
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
985 #if 0 /* TODO: figure out if we need to do this on Mac. */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
986 /* Mac replacement for XCopyArea: dest must be Pixmap. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
987
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
988 static void
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
989 mac_copy_area_to_pixmap (display, src, dest, gc, src_x, src_y, width, height,
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
990 dest_x, dest_y)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
991 Display *display;
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
992 Pixmap src, dest;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
993 GC gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
994 int src_x, src_y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
995 unsigned int width, height;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
996 int dest_x, dest_y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
997 {
55412
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
998 CGrafPtr old_port;
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
999 GDHandle old_gdh;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1000 Rect src_r, dest_r;
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1001
55412
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
1002 GetGWorld (&old_port, &old_gdh);
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1003 SetGWorld (dest, NULL);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1004 ForeColor (blackColor);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1005 BackColor (whiteColor);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1006
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1007 SetRect (&src_r, src_x, src_y, src_x + width, src_y + height);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1008 SetRect (&dest_r, dest_x, dest_y, dest_x + width, dest_y + height);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1009
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1010 LockPixels (GetGWorldPixMap (src));
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1011 LockPixels (GetGWorldPixMap (dest));
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1012 #if TARGET_API_MAC_CARBON
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1013 CopyBits (GetPortBitMapForCopyBits (src), GetPortBitMapForCopyBits (dest),
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1014 &src_r, &dest_r, srcCopy, 0);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1015 #else /* not TARGET_API_MAC_CARBON */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1016 CopyBits (&(((GrafPtr)src)->portBits), &(((GrafPtr)dest)->portBits),
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1017 &src_r, &dest_r, srcCopy, 0);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1018 #endif /* not TARGET_API_MAC_CARBON */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1019 UnlockPixels (GetGWorldPixMap (dest));
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1020 UnlockPixels (GetGWorldPixMap (src));
55412
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
1021
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
1022 SetGWorld (old_port, old_gdh);
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1023 }
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1024
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1025
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1026 static void
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1027 mac_copy_area_with_mask_to_pixmap (display, src, mask, dest, gc, src_x, src_y,
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1028 width, height, dest_x, dest_y)
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1029 Display *display;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1030 Pixmap src, mask, dest;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1031 GC gc;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1032 int src_x, src_y;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1033 unsigned int width, height;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1034 int dest_x, dest_y;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1035 {
55412
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
1036 CGrafPtr old_port;
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
1037 GDHandle old_gdh;
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1038 Rect src_r, dest_r;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1039
55412
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
1040 GetGWorld (&old_port, &old_gdh);
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1041 SetGWorld (dest, NULL);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1042 ForeColor (blackColor);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1043 BackColor (whiteColor);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1044
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1045 SetRect (&src_r, src_x, src_y, src_x + width, src_y + height);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1046 SetRect (&dest_r, dest_x, dest_y, dest_x + width, dest_y + height);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1047
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1048 LockPixels (GetGWorldPixMap (src));
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1049 LockPixels (GetGWorldPixMap (mask));
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1050 LockPixels (GetGWorldPixMap (dest));
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1051 #if TARGET_API_MAC_CARBON
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1052 CopyMask (GetPortBitMapForCopyBits (src), GetPortBitMapForCopyBits (mask),
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1053 GetPortBitMapForCopyBits (dest), &src_r, &src_r, &dest_r);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1054 #else /* not TARGET_API_MAC_CARBON */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1055 CopyMask (&(((GrafPtr)src)->portBits), &(((GrafPtr)mask)->portBits),
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1056 &(((GrafPtr)dest)->portBits), &src_r, &src_r, &dest_r);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1057 #endif /* not TARGET_API_MAC_CARBON */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1058 UnlockPixels (GetGWorldPixMap (dest));
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1059 UnlockPixels (GetGWorldPixMap (mask));
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1060 UnlockPixels (GetGWorldPixMap (src));
55412
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
1061
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
1062 SetGWorld (old_port, old_gdh);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1063 }
58634
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
1064 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1065
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1066
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1067 /* Mac replacement for XChangeGC. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1068
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1069 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1070 XChangeGC (void * ignore, XGCValues* gc, unsigned long mask,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1071 XGCValues *xgcv)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1072 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1073 if (mask & GCForeground)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1074 gc->foreground = xgcv->foreground;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1075 if (mask & GCBackground)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1076 gc->background = xgcv->background;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1077 if (mask & GCFont)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1078 gc->font = xgcv->font;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1079 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1080
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1081
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1082 /* Mac replacement for XCreateGC. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1083
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1084 XGCValues *
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1085 XCreateGC (void * ignore, Window window, unsigned long mask,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1086 XGCValues *xgcv)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1087 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1088 XGCValues *gc = (XGCValues *) xmalloc (sizeof (XGCValues));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1089 bzero (gc, sizeof (XGCValues));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1090
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1091 XChangeGC (ignore, gc, mask, xgcv);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1092
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1093 return gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1094 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1095
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1096
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1097 /* Used in xfaces.c. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1098
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1099 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1100 XFreeGC (display, gc)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1101 Display *display;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1102 GC gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1103 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1104 xfree (gc);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1105 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1106
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1107
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1108 /* Mac replacement for XGetGCValues. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1109
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1110 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1111 XGetGCValues (void* ignore, XGCValues *gc,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1112 unsigned long mask, XGCValues *xgcv)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1113 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1114 XChangeGC (ignore, xgcv, mask, gc);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1115 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1116
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1117
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1118 /* Mac replacement for XSetForeground. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1119
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
1120 void
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1121 XSetForeground (display, gc, color)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1122 Display *display;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1123 GC gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1124 unsigned long color;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1125 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1126 gc->foreground = color;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1127 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1128
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1129
59575
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1130 /* Mac replacement for XSetBackground. */
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1131
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1132 void
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1133 XSetBackground (display, gc, color)
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1134 Display *display;
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1135 GC gc;
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1136 unsigned long color;
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1137 {
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1138 gc->background = color;
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1139 }
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1140
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1141
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1142 /* Mac replacement for XSetWindowBackground. */
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1143
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1144 void
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1145 XSetWindowBackground (display, w, color)
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1146 Display *display;
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1147 WindowPtr w;
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1148 unsigned long color;
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1149 {
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1150 #if !TARGET_API_MAC_CARBON
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1151 AuxWinHandle aw_handle;
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1152 CTabHandle ctab_handle;
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1153 ColorSpecPtr ct_table;
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1154 short ct_size;
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1155 #endif
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1156 RGBColor bg_color;
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1157
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1158 bg_color.red = RED16_FROM_ULONG (color);
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1159 bg_color.green = GREEN16_FROM_ULONG (color);
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1160 bg_color.blue = BLUE16_FROM_ULONG (color);
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1161
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1162 #if TARGET_API_MAC_CARBON
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1163 SetWindowContentColor (w, &bg_color);
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1164 #else
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1165 if (GetAuxWin (w, &aw_handle))
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1166 {
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1167 ctab_handle = (*aw_handle)->awCTable;
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1168 HandToHand ((Handle *) &ctab_handle);
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1169 ct_table = (*ctab_handle)->ctTable;
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1170 ct_size = (*ctab_handle)->ctSize;
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1171 while (ct_size > -1)
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1172 {
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1173 if (ct_table->value == 0)
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1174 {
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1175 ct_table->rgb = bg_color;
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1176 CTabChanged (ctab_handle);
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1177 SetWinColor (w, (WCTabHandle) ctab_handle);
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1178 }
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1179 ct_size--;
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1180 }
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1181 }
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1182 #endif
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1183 }
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1184
011a0c55c1f2 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents: 59407
diff changeset
1185
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1186 /* Mac replacement for XSetFont. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1187
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1188 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1189 XSetFont (display, gc, font)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1190 Display *display;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1191 GC gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1192 XFontStruct *font;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1193 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1194 gc->font = font;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1195 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1196
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1197
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1198 /* x_sync is a no-op on Mac. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1199 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1200 x_sync (f)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1201 void *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1202 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1203 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1204
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1205
58634
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
1206 /* Flush display of frame F, or of all frames if F is null. */
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
1207
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
1208 static void
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
1209 x_flush (f)
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
1210 struct frame *f;
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
1211 {
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
1212 #if TARGET_API_MAC_CARBON
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
1213 BLOCK_INPUT;
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
1214 if (f)
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
1215 QDFlushPortBuffer (GetWindowPort (FRAME_MAC_WINDOW (f)), NULL);
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
1216 else
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
1217 QDFlushPortBuffer (GetQDGlobalsThePort (), NULL);
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
1218 UNBLOCK_INPUT;
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
1219 #endif
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
1220 }
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
1221
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
1222
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1223 /* Remove calls to XFlush by defining XFlush to an empty replacement.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1224 Calls to XFlush should be unnecessary because the X output buffer
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1225 is flushed automatically as needed by calls to XPending,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1226 XNextEvent, or XWindowEvent according to the XFlush man page.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1227 XTread_socket calls XPending. Removing XFlush improves
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1228 performance. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1229
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
1230 #define XFlush(DISPLAY) (void) 0
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1231
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1232
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1233 /* Return the struct mac_display_info corresponding to DPY. There's
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1234 only one. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1235
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1236 struct mac_display_info *
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1237 mac_display_info_for_display (dpy)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1238 Display *dpy;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1239 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1240 return &one_mac_display_info;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1241 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1242
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1243
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1244
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1245 /***********************************************************************
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1246 Starting and ending an update
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1247 ***********************************************************************/
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
1248
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1249 /* Start an update of frame F. This function is installed as a hook
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1250 for update_begin, i.e. it is called when update_begin is called.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1251 This function is called prior to calls to x_update_window_begin for
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1252 each window being updated. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1253
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1254 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1255 x_update_begin (f)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1256 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1257 {
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
1258 #if TARGET_API_MAC_CARBON
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
1259 /* During update of a frame, availability of input events is
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
1260 periodically checked with ReceiveNextEvent if
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
1261 redisplay-dont-pause is nil. That normally flushes window buffer
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
1262 changes for every check, and thus screen update looks waving even
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
1263 if no input is available. So we disable screen updates during
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
1264 update of a frame. */
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
1265 BLOCK_INPUT;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
1266 DisableScreenUpdates ();
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
1267 UNBLOCK_INPUT;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
1268 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1269 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1270
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1271
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1272 /* Start update of window W. Set the global variable updated_window
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1273 to the window being updated and set output_cursor to the cursor
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1274 position of W. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1275
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1276 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1277 x_update_window_begin (w)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1278 struct window *w;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1279 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1280 struct frame *f = XFRAME (WINDOW_FRAME (w));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1281 struct mac_display_info *display_info = FRAME_MAC_DISPLAY_INFO (f);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
1282
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1283 updated_window = w;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1284 set_output_cursor (&w->cursor);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1285
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1286 BLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1287
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1288 if (f == display_info->mouse_face_mouse_frame)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1289 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1290 /* Don't do highlighting for mouse motion during the update. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1291 display_info->mouse_face_defer = 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1292
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1293 /* If F needs to be redrawn, simply forget about any prior mouse
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1294 highlighting. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1295 if (FRAME_GARBAGED_P (f))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1296 display_info->mouse_face_window = Qnil;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1297
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1298 #if 0 /* Rows in a current matrix containing glyphs in mouse-face have
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1299 their mouse_face_p flag set, which means that they are always
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1300 unequal to rows in a desired matrix which never have that
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1301 flag set. So, rows containing mouse-face glyphs are never
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1302 scrolled, and we don't have to switch the mouse highlight off
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1303 here to prevent it from being scrolled. */
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
1304
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1305 /* Can we tell that this update does not affect the window
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1306 where the mouse highlight is? If so, no need to turn off.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1307 Likewise, don't do anything if the frame is garbaged;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1308 in that case, the frame's current matrix that we would use
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1309 is all wrong, and we will redisplay that line anyway. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1310 if (!NILP (display_info->mouse_face_window)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1311 && w == XWINDOW (display_info->mouse_face_window))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1312 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1313 int i;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1314
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
1315 for (i = 0; i < w->desired_matrix->nrows; ++i)
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1316 if (MATRIX_ROW_ENABLED_P (w->desired_matrix, i))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1317 break;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1318
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1319 if (i < w->desired_matrix->nrows)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1320 clear_mouse_face (display_info);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1321 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1322 #endif /* 0 */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1323 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1324
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1325 UNBLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1326 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1327
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1328
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
1329 /* Draw a vertical window border from (x,y0) to (x,y1) */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1330
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1331 static void
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
1332 mac_draw_vertical_window_border (w, x, y0, y1)
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1333 struct window *w;
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
1334 int x, y0, y1;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1335 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1336 struct frame *f = XFRAME (WINDOW_FRAME (w));
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
1337
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
1338 XDrawLine (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
1339 f->output_data.mac->normal_gc, x, y0, x, y1);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1340 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1341
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
1342
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1343 /* End update of window W (which is equal to updated_window).
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1344
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1345 Draw vertical borders between horizontally adjacent windows, and
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1346 display W's cursor if CURSOR_ON_P is non-zero.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1347
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1348 MOUSE_FACE_OVERWRITTEN_P non-zero means that some row containing
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1349 glyphs in mouse-face were overwritten. In that case we have to
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1350 make sure that the mouse-highlight is properly redrawn.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1351
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1352 W may be a menu bar pseudo-window in case we don't have X toolkit
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
1353 support. Such windows don't have a cursor, so don't display it
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1354 here. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1355
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1356 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1357 x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1358 struct window *w;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1359 int cursor_on_p, mouse_face_overwritten_p;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1360 {
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
1361 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (XFRAME (w->frame));
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1362
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1363 if (!w->pseudo_window_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1364 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1365 BLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1366
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1367 if (cursor_on_p)
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
1368 display_and_set_cursor (w, 1, output_cursor.hpos,
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
1369 output_cursor.vpos,
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
1370 output_cursor.x, output_cursor.y);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
1371
57373
38e45bf0128a (x_update_window_end): Fix flicker on vertical line between
Kim F. Storm <storm@cua.dk>
parents: 57357
diff changeset
1372 if (draw_window_fringes (w, 1))
38e45bf0128a (x_update_window_end): Fix flicker on vertical line between
Kim F. Storm <storm@cua.dk>
parents: 57357
diff changeset
1373 x_draw_vertical_border (w);
53606
96c29ac603e8 (x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents: 53579
diff changeset
1374
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1375 UNBLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1376 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1377
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1378 /* If a row with mouse-face was overwritten, arrange for
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1379 XTframe_up_to_date to redisplay the mouse highlight. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1380 if (mouse_face_overwritten_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1381 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1382 dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1383 dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1384 dpyinfo->mouse_face_window = Qnil;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1385 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1386
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1387 #if 0
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1388 /* Unhide the caret. This won't actually show the cursor, unless it
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1389 was visible before the corresponding call to HideCaret in
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1390 x_update_window_begin. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1391 if (w32_use_visible_system_caret)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1392 SendMessage (w32_system_caret_hwnd, WM_EMACS_SHOW_CARET, 0, 0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1393 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1394
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1395 updated_window = NULL;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1396 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1397
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1398
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1399 /* End update of frame F. This function is installed as a hook in
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1400 update_end. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1401
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1402 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1403 x_update_end (f)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1404 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1405 {
56890
e8bafb4b47db (x_update_end): Move SetPortWindowPort to inside
Steven Tamm <steventamm@mac.com>
parents: 56477
diff changeset
1406 /* Mouse highlight may be displayed again. */
e8bafb4b47db (x_update_end): Move SetPortWindowPort to inside
Steven Tamm <steventamm@mac.com>
parents: 56477
diff changeset
1407 FRAME_MAC_DISPLAY_INFO (f)->mouse_face_defer = 0;
e8bafb4b47db (x_update_end): Move SetPortWindowPort to inside
Steven Tamm <steventamm@mac.com>
parents: 56477
diff changeset
1408
e8bafb4b47db (x_update_end): Move SetPortWindowPort to inside
Steven Tamm <steventamm@mac.com>
parents: 56477
diff changeset
1409 BLOCK_INPUT;
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
1410 #if TARGET_API_MAC_CARBON
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
1411 EnableScreenUpdates ();
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
1412 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1413 XFlush (FRAME_MAC_DISPLAY (f));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1414 UNBLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1415 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1416
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1417
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1418 /* This function is called from various places in xdisp.c whenever a
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1419 complete update has been performed. The global variable
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1420 updated_window is not available here. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1421
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1422 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1423 XTframe_up_to_date (f)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1424 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1425 {
55539
db942c4b4345 macterm.c (x_flush, XTframe_up_to_date): use FRAME_MAC_P
Steven Tamm <steventamm@mac.com>
parents: 55412
diff changeset
1426 if (FRAME_MAC_P (f))
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1427 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1428 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1429
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1430 if (dpyinfo->mouse_face_deferred_gc
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1431 || f == dpyinfo->mouse_face_mouse_frame)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1432 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1433 BLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1434 if (dpyinfo->mouse_face_mouse_frame)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1435 note_mouse_highlight (dpyinfo->mouse_face_mouse_frame,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1436 dpyinfo->mouse_face_mouse_x,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1437 dpyinfo->mouse_face_mouse_y);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1438 dpyinfo->mouse_face_deferred_gc = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1439 UNBLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1440 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1441 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1442 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1443
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1444
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1445 /* Draw truncation mark bitmaps, continuation mark bitmaps, overlay
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1446 arrow bitmaps, or clear the fringes if no bitmaps are required
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1447 before DESIRED_ROW is made current. The window being updated is
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1448 found in updated_window. This function is called from
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1449 update_window_line only if it is known that there are differences
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1450 between bitmaps to be drawn between current row and DESIRED_ROW. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1451
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1452 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1453 x_after_update_window_line (desired_row)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1454 struct glyph_row *desired_row;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1455 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1456 struct window *w = updated_window;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1457 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1458 int width, height;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1459
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1460 xassert (w);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
1461
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1462 if (!desired_row->mode_line_p && !w->pseudo_window_p)
53606
96c29ac603e8 (x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents: 53579
diff changeset
1463 desired_row->redraw_fringe_bitmaps_p = 1;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1464
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1465 /* When a window has disappeared, make sure that no rest of
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1466 full-width rows stays visible in the internal border. Could
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1467 check here if updated_window is the leftmost/rightmost window,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1468 but I guess it's not worth doing since vertically split windows
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1469 are almost never used, internal border is rarely set, and the
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1470 overhead is very small. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1471 if (windows_or_buffers_changed
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1472 && desired_row->full_width_p
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1473 && (f = XFRAME (w->frame),
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1474 width = FRAME_INTERNAL_BORDER_WIDTH (f),
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1475 width != 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1476 && (height = desired_row->visible_height,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1477 height > 0))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1478 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1479 int y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, desired_row->y));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1480 /* Internal border is drawn below the tool bar. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1481 if (WINDOWP (f->tool_bar_window)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1482 && w == XWINDOW (f->tool_bar_window))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1483 y -= width;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1484
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1485 BLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1486
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1487 XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1488 0, y, width, height, 0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1489 XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
1490 FRAME_PIXEL_WIDTH (f) - width, y,
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1491 width, height, 0);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
1492
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1493 UNBLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1494 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1495 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1496
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1497
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1498 /* Draw the bitmap WHICH in one of the left or right fringes of
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1499 window W. ROW is the glyph row for which to display the bitmap; it
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1500 determines the vertical position at which the bitmap has to be
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1501 drawn. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1502
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1503 static void
50097
ee703213acfa Remove generic fringe code.
Kim F. Storm <storm@cua.dk>
parents: 49600
diff changeset
1504 x_draw_fringe_bitmap (w, row, p)
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1505 struct window *w;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1506 struct glyph_row *row;
50097
ee703213acfa Remove generic fringe code.
Kim F. Storm <storm@cua.dk>
parents: 49600
diff changeset
1507 struct draw_fringe_bitmap_params *p;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1508 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1509 struct frame *f = XFRAME (WINDOW_FRAME (w));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1510 Display *display = FRAME_MAC_DISPLAY (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1511 WindowPtr window = FRAME_MAC_WINDOW (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1512 XGCValues gcv;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1513 GC gc = f->output_data.mac->normal_gc;
50097
ee703213acfa Remove generic fringe code.
Kim F. Storm <storm@cua.dk>
parents: 49600
diff changeset
1514 struct face *face = p->face;
53606
96c29ac603e8 (x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents: 53579
diff changeset
1515 int rowY;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1516
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1517 /* Must clip because of partially visible lines. */
53606
96c29ac603e8 (x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents: 53579
diff changeset
1518 rowY = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
96c29ac603e8 (x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents: 53579
diff changeset
1519 if (p->y < rowY)
96c29ac603e8 (x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents: 53579
diff changeset
1520 {
96c29ac603e8 (x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents: 53579
diff changeset
1521 /* Adjust position of "bottom aligned" bitmap on partially
96c29ac603e8 (x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents: 53579
diff changeset
1522 visible last row. */
96c29ac603e8 (x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents: 53579
diff changeset
1523 int oldY = row->y;
96c29ac603e8 (x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents: 53579
diff changeset
1524 int oldVH = row->visible_height;
96c29ac603e8 (x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents: 53579
diff changeset
1525 row->visible_height = p->h;
96c29ac603e8 (x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents: 53579
diff changeset
1526 row->y -= rowY - p->y;
58403
c936fa56eb60 (x_clip_to_row): Add area arg. Callers changed.
Kim F. Storm <storm@cua.dk>
parents: 57783
diff changeset
1527 x_clip_to_row (w, row, -1, gc);
53606
96c29ac603e8 (x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents: 53579
diff changeset
1528 row->y = oldY;
96c29ac603e8 (x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents: 53579
diff changeset
1529 row->visible_height = oldVH;
96c29ac603e8 (x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents: 53579
diff changeset
1530 }
96c29ac603e8 (x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents: 53579
diff changeset
1531 else
58403
c936fa56eb60 (x_clip_to_row): Add area arg. Callers changed.
Kim F. Storm <storm@cua.dk>
parents: 57783
diff changeset
1532 x_clip_to_row (w, row, -1, gc);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1533
53885
693745d24f76 (x_draw_fringe_bitmap): Copy unadapted code from
Kim F. Storm <storm@cua.dk>
parents: 53722
diff changeset
1534 if (p->bx >= 0 && !p->overlay_p)
50097
ee703213acfa Remove generic fringe code.
Kim F. Storm <storm@cua.dk>
parents: 49600
diff changeset
1535 {
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1536 XGCValues gcv;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1537 gcv.foreground = face->background;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1538
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1539 #if 0 /* MAC_TODO: stipple */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1540 /* In case the same realized face is used for fringes and
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1541 for something displayed in the text (e.g. face `region' on
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1542 mono-displays, the fill style may have been changed to
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1543 FillSolid in x_draw_glyph_string_background. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1544 if (face->stipple)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1545 XSetFillStyle (FRAME_X_DISPLAY (f), face->gc, FillOpaqueStippled);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1546 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1547 XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->background);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1548 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1549
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1550 XFillRectangle (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1551 &gcv,
50097
ee703213acfa Remove generic fringe code.
Kim F. Storm <storm@cua.dk>
parents: 49600
diff changeset
1552 p->bx, p->by, p->nx, p->ny);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1553
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1554 #if 0 /* MAC_TODO: stipple */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1555 if (!face->stipple)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1556 XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->foreground);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1557 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1558 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1559
53885
693745d24f76 (x_draw_fringe_bitmap): Copy unadapted code from
Kim F. Storm <storm@cua.dk>
parents: 53722
diff changeset
1560 if (p->which)
693745d24f76 (x_draw_fringe_bitmap): Copy unadapted code from
Kim F. Storm <storm@cua.dk>
parents: 53722
diff changeset
1561 {
53935
60bbfcb6328e (mac_draw_bitmap): Handle 16 bits wide bitmaps directly.
Kim F. Storm <storm@cua.dk>
parents: 53899
diff changeset
1562 unsigned short *bits = p->bits + p->dh;
53899
e45e1fbbe83e (mac_draw_bitmap): Add overlay_p arg.
Kim F. Storm <storm@cua.dk>
parents: 53885
diff changeset
1563
53885
693745d24f76 (x_draw_fringe_bitmap): Copy unadapted code from
Kim F. Storm <storm@cua.dk>
parents: 53722
diff changeset
1564 gcv.foreground = (p->cursor_p
693745d24f76 (x_draw_fringe_bitmap): Copy unadapted code from
Kim F. Storm <storm@cua.dk>
parents: 53722
diff changeset
1565 ? (p->overlay_p ? face->background
693745d24f76 (x_draw_fringe_bitmap): Copy unadapted code from
Kim F. Storm <storm@cua.dk>
parents: 53722
diff changeset
1566 : f->output_data.mac->cursor_pixel)
53899
e45e1fbbe83e (mac_draw_bitmap): Add overlay_p arg.
Kim F. Storm <storm@cua.dk>
parents: 53885
diff changeset
1567 : face->foreground);
e45e1fbbe83e (mac_draw_bitmap): Add overlay_p arg.
Kim F. Storm <storm@cua.dk>
parents: 53885
diff changeset
1568 gcv.background = face->background;
e45e1fbbe83e (mac_draw_bitmap): Add overlay_p arg.
Kim F. Storm <storm@cua.dk>
parents: 53885
diff changeset
1569
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
1570 mac_draw_bitmap (display, window, &gcv, p->x, p->y,
53935
60bbfcb6328e (mac_draw_bitmap): Handle 16 bits wide bitmaps directly.
Kim F. Storm <storm@cua.dk>
parents: 53899
diff changeset
1571 p->wd, p->h, bits, p->overlay_p);
50097
ee703213acfa Remove generic fringe code.
Kim F. Storm <storm@cua.dk>
parents: 49600
diff changeset
1572 }
ee703213acfa Remove generic fringe code.
Kim F. Storm <storm@cua.dk>
parents: 49600
diff changeset
1573
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1574 mac_reset_clipping (display, window);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1575 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1576
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1577
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1578 /* This is called when starting Emacs and when restarting after
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1579 suspend. When starting Emacs, no window is mapped. And nothing
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1580 must be done to Emacs's own window if it is suspended (though that
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1581 rarely happens). */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1582
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1583 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1584 XTset_terminal_modes ()
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1585 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1586 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1587
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1588 /* This is called when exiting or suspending Emacs. Exiting will make
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1589 the windows go away, and suspending requires no action. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1590
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1591 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1592 XTreset_terminal_modes ()
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1593 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1594 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1595
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1596
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1597 /***********************************************************************
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1598 Display Iterator
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1599 ***********************************************************************/
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1600
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1601 /* Function prototypes of this page. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1602
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1603 static XCharStruct *x_per_char_metric P_ ((XFontStruct *, XChar2b *));
50157
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
1604 static int mac_encode_char P_ ((int, XChar2b *, struct font_info *, int *));
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1605
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1606
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1607 /* Return a pointer to per-char metric information in FONT of a
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1608 character pointed by B which is a pointer to an XChar2b. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1609
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1610 #define PER_CHAR_METRIC(font, b) \
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1611 ((font)->per_char \
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1612 ? ((font)->per_char + (b)->byte2 - (font)->min_char_or_byte2 \
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1613 + (((font)->min_byte1 || (font)->max_byte1) \
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1614 ? (((b)->byte1 - (font)->min_byte1) \
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1615 * ((font)->max_char_or_byte2 - (font)->min_char_or_byte2 + 1)) \
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1616 : 0)) \
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1617 : &((font)->max_bounds))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1618
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1619
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1620 /* Get metrics of character CHAR2B in FONT. Value is null if CHAR2B
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1621 is not contained in the font. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1622
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1623 static INLINE XCharStruct *
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1624 x_per_char_metric (font, char2b)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1625 XFontStruct *font;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1626 XChar2b *char2b;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1627 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1628 /* The result metric information. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1629 XCharStruct *pcm = NULL;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1630
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1631 xassert (font && char2b);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1632
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1633 if (font->per_char != NULL)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1634 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1635 if (font->min_byte1 == 0 && font->max_byte1 == 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1636 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1637 /* min_char_or_byte2 specifies the linear character index
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1638 corresponding to the first element of the per_char array,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1639 max_char_or_byte2 is the index of the last character. A
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1640 character with non-zero CHAR2B->byte1 is not in the font.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1641 A character with byte2 less than min_char_or_byte2 or
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1642 greater max_char_or_byte2 is not in the font. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1643 if (char2b->byte1 == 0
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1644 && char2b->byte2 >= font->min_char_or_byte2
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1645 && char2b->byte2 <= font->max_char_or_byte2)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1646 pcm = font->per_char + char2b->byte2 - font->min_char_or_byte2;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1647 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1648 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1649 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1650 /* If either min_byte1 or max_byte1 are nonzero, both
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1651 min_char_or_byte2 and max_char_or_byte2 are less than
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1652 256, and the 2-byte character index values corresponding
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1653 to the per_char array element N (counting from 0) are:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1654
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1655 byte1 = N/D + min_byte1
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1656 byte2 = N\D + min_char_or_byte2
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1657
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1658 where:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1659
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1660 D = max_char_or_byte2 - min_char_or_byte2 + 1
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1661 / = integer division
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1662 \ = integer modulus */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1663 if (char2b->byte1 >= font->min_byte1
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1664 && char2b->byte1 <= font->max_byte1
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1665 && char2b->byte2 >= font->min_char_or_byte2
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1666 && char2b->byte2 <= font->max_char_or_byte2)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1667 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1668 pcm = (font->per_char
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1669 + ((font->max_char_or_byte2 - font->min_char_or_byte2 + 1)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1670 * (char2b->byte1 - font->min_byte1))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1671 + (char2b->byte2 - font->min_char_or_byte2));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1672 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1673 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1674 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1675 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1676 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1677 /* If the per_char pointer is null, all glyphs between the first
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1678 and last character indexes inclusive have the same
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1679 information, as given by both min_bounds and max_bounds. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1680 if (char2b->byte2 >= font->min_char_or_byte2
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1681 && char2b->byte2 <= font->max_char_or_byte2)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1682 pcm = &font->max_bounds;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1683 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1684
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1685 return ((pcm == NULL
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1686 || (pcm->width == 0 && (pcm->rbearing - pcm->lbearing) == 0))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1687 ? NULL : pcm);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1688 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1689
50157
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
1690 /* RIF:
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
1691 */
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
1692
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
1693 static XCharStruct *
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
1694 mac_per_char_metric (font, char2b, font_type)
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
1695 XFontStruct *font;
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
1696 XChar2b *char2b;
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
1697 int font_type;
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
1698 {
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
1699 return x_per_char_metric (font, char2b);
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
1700 }
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
1701
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
1702 /* RIF:
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
1703 Encode CHAR2B using encoding information from FONT_INFO. CHAR2B is
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1704 the two-byte form of C. Encoding is returned in *CHAR2B. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1705
50157
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
1706 static int
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
1707 mac_encode_char (c, char2b, font_info, two_byte_p)
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1708 int c;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1709 XChar2b *char2b;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1710 struct font_info *font_info;
50157
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
1711 int *two_byte_p;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1712 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1713 int charset = CHAR_CHARSET (c);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1714 XFontStruct *font = font_info->font;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1715
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1716 /* FONT_INFO may define a scheme by which to encode byte1 and byte2.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1717 This may be either a program in a special encoder language or a
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1718 fixed encoding. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1719 if (font_info->font_encoder)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1720 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1721 /* It's a program. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1722 struct ccl_program *ccl = font_info->font_encoder;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1723
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1724 if (CHARSET_DIMENSION (charset) == 1)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1725 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1726 ccl->reg[0] = charset;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1727 ccl->reg[1] = char2b->byte2;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1728 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1729 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1730 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1731 ccl->reg[0] = charset;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1732 ccl->reg[1] = char2b->byte1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1733 ccl->reg[2] = char2b->byte2;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1734 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
1735
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1736 ccl_driver (ccl, NULL, NULL, 0, 0, NULL);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
1737
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1738 /* We assume that MSBs are appropriately set/reset by CCL
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1739 program. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1740 if (font->max_byte1 == 0) /* 1-byte font */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1741 char2b->byte1 = 0, char2b->byte2 = ccl->reg[1];
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1742 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1743 char2b->byte1 = ccl->reg[1], char2b->byte2 = ccl->reg[2];
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1744 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1745 else if (font_info->encoding[charset])
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1746 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1747 /* Fixed encoding scheme. See fontset.h for the meaning of the
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1748 encoding numbers. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1749 int enc = font_info->encoding[charset];
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
1750
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1751 if ((enc == 1 || enc == 2)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1752 && CHARSET_DIMENSION (charset) == 2)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1753 char2b->byte1 |= 0x80;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
1754
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1755 if (enc == 1 || enc == 3)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1756 char2b->byte2 |= 0x80;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1757
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1758 if (enc == 4)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1759 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1760 int sjis1, sjis2;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1761
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1762 ENCODE_SJIS (char2b->byte1, char2b->byte2, sjis1, sjis2);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1763 char2b->byte1 = sjis1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1764 char2b->byte2 = sjis2;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1765 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1766 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1767
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1768 if (two_byte_p)
50157
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
1769 *two_byte_p = ((XFontStruct *) (font_info->font))->max_byte1 > 0;
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
1770
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
1771 return FONT_TYPE_UNKNOWN;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1772 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1773
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1774
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1775
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1776 /***********************************************************************
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1777 Glyph display
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1778 ***********************************************************************/
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1779
50157
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
1780
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1781 static void x_set_glyph_string_clipping P_ ((struct glyph_string *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1782 static void x_set_glyph_string_gc P_ ((struct glyph_string *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1783 static void x_draw_glyph_string_background P_ ((struct glyph_string *,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1784 int));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1785 static void x_draw_glyph_string_foreground P_ ((struct glyph_string *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1786 static void x_draw_composite_glyph_string_foreground P_ ((struct glyph_string *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1787 static void x_draw_glyph_string_box P_ ((struct glyph_string *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1788 static void x_draw_glyph_string P_ ((struct glyph_string *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1789 static void x_set_cursor_gc P_ ((struct glyph_string *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1790 static void x_set_mode_line_face_gc P_ ((struct glyph_string *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1791 static void x_set_mouse_face_gc P_ ((struct glyph_string *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1792 /*static int x_alloc_lighter_color P_ ((struct frame *, Display *, Colormap,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1793 unsigned long *, double, int));*/
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1794 static void x_setup_relief_color P_ ((struct frame *, struct relief *,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1795 double, int, unsigned long));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1796 static void x_setup_relief_colors P_ ((struct glyph_string *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1797 static void x_draw_image_glyph_string P_ ((struct glyph_string *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1798 static void x_draw_image_relief P_ ((struct glyph_string *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1799 static void x_draw_image_foreground P_ ((struct glyph_string *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1800 static void x_draw_image_foreground_1 P_ ((struct glyph_string *, Pixmap));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1801 static void x_clear_glyph_string_rect P_ ((struct glyph_string *, int,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1802 int, int, int));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1803 static void x_draw_relief_rect P_ ((struct frame *, int, int, int, int,
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
1804 int, int, int, int, int, int,
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
1805 Rect *));
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1806 static void x_draw_box_rect P_ ((struct glyph_string *, int, int, int, int,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1807 int, int, int, Rect *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1808
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1809 #if GLYPH_DEBUG
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1810 static void x_check_font P_ ((struct frame *, XFontStruct *));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1811 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1812
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
1813
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1814 /* Set S->gc to a suitable GC for drawing glyph string S in cursor
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1815 face. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1816
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1817 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1818 x_set_cursor_gc (s)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1819 struct glyph_string *s;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1820 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1821 if (s->font == FRAME_FONT (s->f)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1822 && s->face->background == FRAME_BACKGROUND_PIXEL (s->f)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1823 && s->face->foreground == FRAME_FOREGROUND_PIXEL (s->f)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1824 && !s->cmp)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1825 s->gc = s->f->output_data.mac->cursor_gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1826 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1827 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1828 /* Cursor on non-default face: must merge. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1829 XGCValues xgcv;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1830 unsigned long mask;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1831
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1832 xgcv.background = s->f->output_data.mac->cursor_pixel;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1833 xgcv.foreground = s->face->background;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1834
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1835 /* If the glyph would be invisible, try a different foreground. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1836 if (xgcv.foreground == xgcv.background)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1837 xgcv.foreground = s->face->foreground;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1838 if (xgcv.foreground == xgcv.background)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1839 xgcv.foreground = s->f->output_data.mac->cursor_foreground_pixel;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1840 if (xgcv.foreground == xgcv.background)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1841 xgcv.foreground = s->face->foreground;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1842
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1843 /* Make sure the cursor is distinct from text in this face. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1844 if (xgcv.background == s->face->background
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1845 && xgcv.foreground == s->face->foreground)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1846 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1847 xgcv.background = s->face->foreground;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1848 xgcv.foreground = s->face->background;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1849 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1850
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1851 IF_DEBUG (x_check_font (s->f, s->font));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1852 xgcv.font = s->font;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1853 mask = GCForeground | GCBackground | GCFont;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1854
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1855 if (FRAME_MAC_DISPLAY_INFO (s->f)->scratch_cursor_gc)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1856 XChangeGC (s->display, FRAME_MAC_DISPLAY_INFO (s->f)->scratch_cursor_gc,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1857 mask, &xgcv);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1858 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1859 FRAME_MAC_DISPLAY_INFO (s->f)->scratch_cursor_gc
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1860 = XCreateGC (s->display, s->window, mask, &xgcv);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1861
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1862 s->gc = FRAME_MAC_DISPLAY_INFO (s->f)->scratch_cursor_gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1863 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1864 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1865
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1866
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1867 /* Set up S->gc of glyph string S for drawing text in mouse face. */
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
1868
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1869 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1870 x_set_mouse_face_gc (s)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1871 struct glyph_string *s;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
1872 {
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1873 int face_id;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1874 struct face *face;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1875
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1876 /* What face has to be used last for the mouse face? */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1877 face_id = FRAME_X_DISPLAY_INFO (s->f)->mouse_face_face_id;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1878 face = FACE_FROM_ID (s->f, face_id);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1879 if (face == NULL)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1880 face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
1881
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1882 if (s->first_glyph->type == CHAR_GLYPH)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1883 face_id = FACE_FOR_CHAR (s->f, face, s->first_glyph->u.ch);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1884 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1885 face_id = FACE_FOR_CHAR (s->f, face, 0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1886 s->face = FACE_FROM_ID (s->f, face_id);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1887 PREPARE_FACE_FOR_DISPLAY (s->f, s->face);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1888
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1889 /* If font in this face is same as S->font, use it. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1890 if (s->font == s->face->font)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1891 s->gc = s->face->gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1892 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1893 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1894 /* Otherwise construct scratch_cursor_gc with values from FACE
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1895 but font FONT. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1896 XGCValues xgcv;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1897 unsigned long mask;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
1898
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1899 xgcv.background = s->face->background;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1900 xgcv.foreground = s->face->foreground;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1901 IF_DEBUG (x_check_font (s->f, s->font));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1902 xgcv.font = s->font;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1903 mask = GCForeground | GCBackground | GCFont;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
1904
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1905 if (FRAME_MAC_DISPLAY_INFO (s->f)->scratch_cursor_gc)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1906 XChangeGC (s->display, FRAME_MAC_DISPLAY_INFO (s->f)->scratch_cursor_gc,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1907 mask, &xgcv);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1908 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1909 FRAME_MAC_DISPLAY_INFO (s->f)->scratch_cursor_gc
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1910 = XCreateGC (s->display, s->window, mask, &xgcv);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
1911
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1912 s->gc = FRAME_MAC_DISPLAY_INFO (s->f)->scratch_cursor_gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1913 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1914
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1915 xassert (s->gc != 0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1916 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1917
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1918
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1919 /* Set S->gc of glyph string S to a GC suitable for drawing a mode line.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1920 Faces to use in the mode line have already been computed when the
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1921 matrix was built, so there isn't much to do, here. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1922
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1923 static INLINE void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1924 x_set_mode_line_face_gc (s)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1925 struct glyph_string *s;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
1926 {
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1927 s->gc = s->face->gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1928 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1929
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1930
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1931 /* Set S->gc of glyph string S for drawing that glyph string. Set
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1932 S->stippled_p to a non-zero value if the face of S has a stipple
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1933 pattern. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1934
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1935 static INLINE void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1936 x_set_glyph_string_gc (s)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1937 struct glyph_string *s;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1938 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1939 PREPARE_FACE_FOR_DISPLAY (s->f, s->face);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
1940
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1941 if (s->hl == DRAW_NORMAL_TEXT)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1942 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1943 s->gc = s->face->gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1944 s->stippled_p = s->face->stipple != 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1945 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1946 else if (s->hl == DRAW_INVERSE_VIDEO)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1947 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1948 x_set_mode_line_face_gc (s);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1949 s->stippled_p = s->face->stipple != 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1950 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1951 else if (s->hl == DRAW_CURSOR)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1952 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1953 x_set_cursor_gc (s);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1954 s->stippled_p = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1955 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1956 else if (s->hl == DRAW_MOUSE_FACE)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1957 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1958 x_set_mouse_face_gc (s);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1959 s->stippled_p = s->face->stipple != 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1960 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1961 else if (s->hl == DRAW_IMAGE_RAISED
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1962 || s->hl == DRAW_IMAGE_SUNKEN)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1963 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1964 s->gc = s->face->gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1965 s->stippled_p = s->face->stipple != 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1966 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1967 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1968 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1969 s->gc = s->face->gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1970 s->stippled_p = s->face->stipple != 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1971 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1972
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1973 /* GC must have been set. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1974 xassert (s->gc != 0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1975 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1976
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1977
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1978 /* Set clipping for output of glyph string S. S may be part of a mode
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1979 line or menu if we don't have X toolkit support. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1980
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1981 static INLINE void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1982 x_set_glyph_string_clipping (s)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1983 struct glyph_string *s;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1984 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1985 Rect r;
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
1986 get_glyph_string_clip_rect (s, &r);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1987 mac_set_clip_rectangle (s->display, s->window, &r);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1988 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1989
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1990
50157
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
1991 /* RIF:
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
1992 Compute left and right overhang of glyph string S. If S is a glyph
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1993 string for a composition, assume overhangs don't exist. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1994
50157
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
1995 static void
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
1996 mac_compute_glyph_string_overhangs (s)
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1997 struct glyph_string *s;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
1998 {
59718
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
1999 Rect r;
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
2000 MacFontStruct *font = s->font;
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
2001
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
2002 TextFont (font->mac_fontnum);
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
2003 TextSize (font->mac_fontsize);
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
2004 TextFace (font->mac_fontface);
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
2005
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
2006 if (s->two_byte_p)
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
2007 QDTextBounds (s->nchars * 2, (char *)s->char2b, &r);
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
2008 else
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
2009 {
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
2010 int i;
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
2011 char *buf = xmalloc (s->nchars);
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
2012
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
2013 if (buf == NULL)
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
2014 SetRect (&r, 0, 0, 0, 0);
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
2015 else
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
2016 {
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
2017 for (i = 0; i < s->nchars; ++i)
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
2018 buf[i] = s->char2b[i].byte2;
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
2019 QDTextBounds (s->nchars, buf, &r);
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
2020 xfree (buf);
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
2021 }
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
2022 }
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
2023
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
2024 s->right_overhang = r.right > s->width ? r.right - s->width : 0;
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
2025 s->left_overhang = r.left < 0 ? -r.left : 0;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2026 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2027
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2028
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2029 /* Fill rectangle X, Y, W, H with background color of glyph string S. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2030
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2031 static INLINE void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2032 x_clear_glyph_string_rect (s, x, y, w, h)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2033 struct glyph_string *s;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2034 int x, y, w, h;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2035 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2036 XGCValues xgcv;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2037
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2038 xgcv.foreground = s->gc->background;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2039 XFillRectangle (s->display, s->window, &xgcv, x, y, w, h);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2040 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2041
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2042
58634
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
2043 /* We prefer not to use XDrawImageString (srcCopy text transfer mode)
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
2044 on Mac OS X because:
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
2045 - Screen is double-buffered. (In srcCopy mode, a text is drawn
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
2046 into an offscreen graphics world first. So performance gain
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
2047 cannot be expected.)
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
2048 - It lowers rendering quality.
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
2049 - Some fonts leave garbage on cursor movement. */
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
2050
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2051 /* Draw the background of glyph_string S. If S->background_filled_p
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2052 is non-zero don't draw it. FORCE_P non-zero means draw the
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2053 background even if it wouldn't be drawn normally. This is used
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2054 when a string preceding S draws into the background of S, or S
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2055 contains the first component of a composition. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2056
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2057 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2058 x_draw_glyph_string_background (s, force_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2059 struct glyph_string *s;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2060 int force_p;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2061 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2062 /* Nothing to do if background has already been drawn or if it
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2063 shouldn't be drawn in the first place. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2064 if (!s->background_filled_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2065 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2066 int box_line_width = max (s->face->box_line_width, 0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2067
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2068 #if 0 /* MAC_TODO: stipple */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2069 if (s->stippled_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2070 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2071 /* Fill background with a stipple pattern. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2072 XSetFillStyle (s->display, s->gc, FillOpaqueStippled);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2073 XFillRectangle (s->display, s->window, s->gc, s->x,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2074 s->y + box_line_width,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2075 s->background_width,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2076 s->height - 2 * box_line_width);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2077 XSetFillStyle (s->display, s->gc, FillSolid);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2078 s->background_filled_p = 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2079 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2080 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2081 #endif
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
2082 #ifdef MAC_OS8
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2083 if (FONT_HEIGHT (s->font) < s->height - 2 * box_line_width
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2084 || s->font_not_found_p
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2085 || s->extends_to_end_of_line_p
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2086 || force_p)
58634
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
2087 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2088 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2089 x_clear_glyph_string_rect (s, s->x, s->y + box_line_width,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2090 s->background_width,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2091 s->height - 2 * box_line_width);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2092 s->background_filled_p = 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2093 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2094 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2095 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2096
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2097
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2098 /* Draw the foreground of glyph string S. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2099
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2100 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2101 x_draw_glyph_string_foreground (s)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2102 struct glyph_string *s;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2103 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2104 int i, x;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2105
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2106 /* If first glyph of S has a left box line, start drawing the text
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2107 of S to the right of that box line. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2108 if (s->face->box != FACE_NO_BOX
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2109 && s->first_glyph->left_box_line_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2110 x = s->x + abs (s->face->box_line_width);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2111 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2112 x = s->x;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2113
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2114 /* Draw characters of S as rectangles if S's font could not be
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2115 loaded. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2116 if (s->font_not_found_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2117 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2118 for (i = 0; i < s->nchars; ++i)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2119 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2120 struct glyph *g = s->first_glyph + i;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2121 mac_draw_rectangle (s->display, s->window,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2122 s->gc, x, s->y, g->pixel_width - 1,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2123 s->height - 1);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2124 x += g->pixel_width;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2125 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2126 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2127 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2128 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2129 char *char1b = (char *) s->char2b;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2130 int boff = s->font_info->baseline_offset;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2131
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2132 if (s->font_info->vertical_centering)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2133 boff = VCENTER_BASELINE_OFFSET (s->font, s->f) - boff;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2134
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2135 /* If we can use 8-bit functions, condense S->char2b. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2136 if (!s->two_byte_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2137 for (i = 0; i < s->nchars; ++i)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2138 char1b[i] = s->char2b[i].byte2;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2139
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
2140 #ifdef MAC_OS8
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2141 /* Draw text with XDrawString if background has already been
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2142 filled. Otherwise, use XDrawImageString. (Note that
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2143 XDrawImageString is usually faster than XDrawString.) Always
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2144 use XDrawImageString when drawing the cursor so that there is
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2145 no chance that characters under a box cursor are invisible. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2146 if (s->for_overlaps_p
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2147 || (s->background_filled_p && s->hl != DRAW_CURSOR))
58634
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
2148 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2149 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2150 /* Draw characters with 16-bit or 8-bit functions. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2151 if (s->two_byte_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2152 XDrawString16 (s->display, s->window, s->gc, x,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2153 s->ybase - boff, s->char2b, s->nchars);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2154 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2155 XDrawString (s->display, s->window, s->gc, x,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2156 s->ybase - boff, char1b, s->nchars);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2157 }
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
2158 #ifdef MAC_OS8
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2159 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2160 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2161 if (s->two_byte_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2162 XDrawImageString16 (s->display, s->window, s->gc, x,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2163 s->ybase - boff, s->char2b, s->nchars);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2164 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2165 XDrawImageString (s->display, s->window, s->gc, x,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2166 s->ybase - boff, char1b, s->nchars);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2167 }
58634
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
2168 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2169 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2170 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2171
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2172 /* Draw the foreground of composite glyph string S. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2173
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2174 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2175 x_draw_composite_glyph_string_foreground (s)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2176 struct glyph_string *s;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2177 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2178 int i, x;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2179
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2180 /* If first glyph of S has a left box line, start drawing the text
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2181 of S to the right of that box line. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2182 if (s->face->box != FACE_NO_BOX
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2183 && s->first_glyph->left_box_line_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2184 x = s->x + abs (s->face->box_line_width);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2185 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2186 x = s->x;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2187
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2188 /* S is a glyph string for a composition. S->gidx is the index of
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2189 the first character drawn for glyphs of this composition.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2190 S->gidx == 0 means we are drawing the very first character of
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2191 this composition. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2192
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2193 /* Draw a rectangle for the composition if the font for the very
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2194 first character of the composition could not be loaded. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2195 if (s->font_not_found_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2196 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2197 if (s->gidx == 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2198 mac_draw_rectangle (s->display, s->window, s->gc, x, s->y,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2199 s->width - 1, s->height - 1);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2200 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2201 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2202 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2203 for (i = 0; i < s->nchars; i++, ++s->gidx)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2204 XDrawString16 (s->display, s->window, s->gc,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2205 x + s->cmp->offsets[s->gidx * 2],
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2206 s->ybase - s->cmp->offsets[s->gidx * 2 + 1],
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2207 s->char2b + i, 1);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2208 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2209 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2210
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2211
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2212 #ifdef USE_X_TOOLKIT
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2213
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2214 static struct frame *x_frame_of_widget P_ ((Widget));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2215
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2216
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2217 /* Return the frame on which widget WIDGET is used.. Abort if frame
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2218 cannot be determined. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2219
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2220 static struct frame *
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2221 x_frame_of_widget (widget)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2222 Widget widget;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2223 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2224 struct x_display_info *dpyinfo;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2225 Lisp_Object tail;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2226 struct frame *f;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
2227
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2228 dpyinfo = x_display_info_for_display (XtDisplay (widget));
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
2229
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2230 /* Find the top-level shell of the widget. Note that this function
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2231 can be called when the widget is not yet realized, so XtWindow
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2232 (widget) == 0. That's the reason we can't simply use
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2233 x_any_window_to_frame. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2234 while (!XtIsTopLevelShell (widget))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2235 widget = XtParent (widget);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2236
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2237 /* Look for a frame with that top-level widget. Allocate the color
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2238 on that frame to get the right gamma correction value. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2239 for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2240 if (GC_FRAMEP (XCAR (tail))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2241 && (f = XFRAME (XCAR (tail)),
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2242 (f->output_data.nothing != 1
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2243 && FRAME_X_DISPLAY_INFO (f) == dpyinfo))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2244 && f->output_data.x->widget == widget)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2245 return f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2246
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2247 abort ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2248 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2249
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2250
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2251 /* Allocate the color COLOR->pixel on the screen and display of
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2252 widget WIDGET in colormap CMAP. If an exact match cannot be
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2253 allocated, try the nearest color available. Value is non-zero
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2254 if successful. This is called from lwlib. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2255
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2256 int
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2257 x_alloc_nearest_color_for_widget (widget, cmap, color)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2258 Widget widget;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2259 Colormap cmap;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2260 XColor *color;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2261 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2262 struct frame *f = x_frame_of_widget (widget);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2263 return x_alloc_nearest_color (f, cmap, color);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2264 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2265
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2266
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2267 #endif /* USE_X_TOOLKIT */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2268
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2269 #if 0 /* MAC_TODO */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2270
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2271 /* Allocate the color COLOR->pixel on SCREEN of DISPLAY, colormap
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2272 CMAP. If an exact match can't be allocated, try the nearest color
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2273 available. Value is non-zero if successful. Set *COLOR to the
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2274 color allocated. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2275
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2276 int
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2277 x_alloc_nearest_color (f, cmap, color)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2278 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2279 Colormap cmap;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2280 XColor *color;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2281 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2282 Display *display = FRAME_X_DISPLAY (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2283 Screen *screen = FRAME_X_SCREEN (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2284 int rc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2285
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2286 gamma_correct (f, color);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2287 rc = XAllocColor (display, cmap, color);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2288 if (rc == 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2289 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2290 /* If we got to this point, the colormap is full, so we're going
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2291 to try to get the next closest color. The algorithm used is
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2292 a least-squares matching, which is what X uses for closest
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2293 color matching with StaticColor visuals. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2294 int nearest, i;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2295 unsigned long nearest_delta = ~0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2296 int ncells = XDisplayCells (display, XScreenNumberOfScreen (screen));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2297 XColor *cells = (XColor *) alloca (ncells * sizeof *cells);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2298
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2299 for (i = 0; i < ncells; ++i)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2300 cells[i].pixel = i;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2301 XQueryColors (display, cmap, cells, ncells);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2302
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2303 for (nearest = i = 0; i < ncells; ++i)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2304 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2305 long dred = (color->red >> 8) - (cells[i].red >> 8);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2306 long dgreen = (color->green >> 8) - (cells[i].green >> 8);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2307 long dblue = (color->blue >> 8) - (cells[i].blue >> 8);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2308 unsigned long delta = dred * dred + dgreen * dgreen + dblue * dblue;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2309
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2310 if (delta < nearest_delta)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2311 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2312 nearest = i;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2313 nearest_delta = delta;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2314 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2315 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
2316
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2317 color->red = cells[nearest].red;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2318 color->green = cells[nearest].green;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2319 color->blue = cells[nearest].blue;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2320 rc = XAllocColor (display, cmap, color);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2321 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2322
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2323 #ifdef DEBUG_X_COLORS
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2324 if (rc)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2325 register_color (color->pixel);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2326 #endif /* DEBUG_X_COLORS */
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
2327
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2328 return rc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2329 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2330
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2331
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2332 /* Allocate color PIXEL on frame F. PIXEL must already be allocated.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2333 It's necessary to do this instead of just using PIXEL directly to
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2334 get color reference counts right. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2335
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2336 unsigned long
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2337 x_copy_color (f, pixel)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2338 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2339 unsigned long pixel;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2340 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2341 XColor color;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2342
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2343 color.pixel = pixel;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2344 BLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2345 XQueryColor (FRAME_X_DISPLAY (f), FRAME_X_COLORMAP (f), &color);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2346 XAllocColor (FRAME_X_DISPLAY (f), FRAME_X_COLORMAP (f), &color);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2347 UNBLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2348 #ifdef DEBUG_X_COLORS
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2349 register_color (pixel);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2350 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2351 return color.pixel;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2352 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2353
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2354
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2355 /* Allocate color PIXEL on display DPY. PIXEL must already be allocated.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2356 It's necessary to do this instead of just using PIXEL directly to
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2357 get color reference counts right. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2358
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2359 unsigned long
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2360 x_copy_dpy_color (dpy, cmap, pixel)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2361 Display *dpy;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2362 Colormap cmap;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2363 unsigned long pixel;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2364 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2365 XColor color;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2366
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2367 color.pixel = pixel;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2368 BLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2369 XQueryColor (dpy, cmap, &color);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2370 XAllocColor (dpy, cmap, &color);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2371 UNBLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2372 #ifdef DEBUG_X_COLORS
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2373 register_color (pixel);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2374 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2375 return color.pixel;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2376 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2377
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2378 #endif /* MAC_TODO */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2379
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2380
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2381 /* Brightness beyond which a color won't have its highlight brightness
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2382 boosted.
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2383
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2384 Nominally, highlight colors for `3d' faces are calculated by
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2385 brightening an object's color by a constant scale factor, but this
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2386 doesn't yield good results for dark colors, so for colors who's
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2387 brightness is less than this value (on a scale of 0-255) have to
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2388 use an additional additive factor.
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2389
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2390 The value here is set so that the default menu-bar/mode-line color
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2391 (grey75) will not have its highlights changed at all. */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2392 #define HIGHLIGHT_COLOR_DARK_BOOST_LIMIT 187
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2393
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2394
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2395 /* Allocate a color which is lighter or darker than *COLOR by FACTOR
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2396 or DELTA. Try a color with RGB values multiplied by FACTOR first.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2397 If this produces the same color as COLOR, try a color where all RGB
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2398 values have DELTA added. Return the allocated color in *COLOR.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2399 DISPLAY is the X display, CMAP is the colormap to operate on.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2400 Value is non-zero if successful. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2401
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2402 static int
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2403 mac_alloc_lighter_color (f, color, factor, delta)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2404 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2405 unsigned long *color;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2406 double factor;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2407 int delta;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2408 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2409 unsigned long new;
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2410 long bright;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2411
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2412 /* On Mac, RGB values are 0-255, not 0-65535, so scale delta. */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2413 delta /= 256;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2414
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2415 /* Change RGB values by specified FACTOR. Avoid overflow! */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2416 xassert (factor >= 0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2417 new = RGB_TO_ULONG (min (0xff, (int) (factor * RED_FROM_ULONG (*color))),
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2418 min (0xff, (int) (factor * GREEN_FROM_ULONG (*color))),
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2419 min (0xff, (int) (factor * BLUE_FROM_ULONG (*color))));
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2420
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2421 /* Calculate brightness of COLOR. */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2422 bright = (2 * RED_FROM_ULONG (*color) + 3 * GREEN_FROM_ULONG (*color)
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2423 + BLUE_FROM_ULONG (*color)) / 6;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2424
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2425 /* We only boost colors that are darker than
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2426 HIGHLIGHT_COLOR_DARK_BOOST_LIMIT. */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2427 if (bright < HIGHLIGHT_COLOR_DARK_BOOST_LIMIT)
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2428 /* Make an additive adjustment to NEW, because it's dark enough so
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2429 that scaling by FACTOR alone isn't enough. */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2430 {
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2431 /* How far below the limit this color is (0 - 1, 1 being darker). */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2432 double dimness = 1 - (double)bright / HIGHLIGHT_COLOR_DARK_BOOST_LIMIT;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2433 /* The additive adjustment. */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2434 int min_delta = delta * dimness * factor / 2;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2435
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2436 if (factor < 1)
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2437 new = RGB_TO_ULONG (max (0, min (0xff, (int) (RED_FROM_ULONG (*color)) - min_delta)),
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2438 max (0, min (0xff, (int) (GREEN_FROM_ULONG (*color)) - min_delta)),
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2439 max (0, min (0xff, (int) (BLUE_FROM_ULONG (*color)) - min_delta)));
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2440 else
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2441 new = RGB_TO_ULONG (max (0, min (0xff, (int) (min_delta + RED_FROM_ULONG (*color)))),
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2442 max (0, min (0xff, (int) (min_delta + GREEN_FROM_ULONG (*color)))),
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2443 max (0, min (0xff, (int) (min_delta + BLUE_FROM_ULONG (*color)))));
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2444 }
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2445
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2446 if (new == *color)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2447 new = RGB_TO_ULONG (max (0, min (0xff, (int) (delta + RED_FROM_ULONG (*color)))),
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2448 max (0, min (0xff, (int) (delta + GREEN_FROM_ULONG (*color)))),
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2449 max (0, min (0xff, (int) (delta + BLUE_FROM_ULONG (*color)))));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2450
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2451 /* MAC_TODO: Map to palette and retry with delta if same? */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2452 /* MAC_TODO: Free colors (if using palette)? */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2453
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2454 if (new == *color)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2455 return 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2456
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2457 *color = new;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2458
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2459 return 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2460 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2461
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2462
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2463 /* Set up the foreground color for drawing relief lines of glyph
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2464 string S. RELIEF is a pointer to a struct relief containing the GC
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2465 with which lines will be drawn. Use a color that is FACTOR or
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2466 DELTA lighter or darker than the relief's background which is found
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2467 in S->f->output_data.x->relief_background. If such a color cannot
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2468 be allocated, use DEFAULT_PIXEL, instead. */
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
2469
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2470 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2471 x_setup_relief_color (f, relief, factor, delta, default_pixel)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2472 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2473 struct relief *relief;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2474 double factor;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2475 int delta;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2476 unsigned long default_pixel;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2477 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2478 XGCValues xgcv;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2479 struct mac_output *di = f->output_data.mac;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2480 unsigned long mask = GCForeground;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2481 unsigned long pixel;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2482 unsigned long background = di->relief_background;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2483 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2484
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2485 /* MAC_TODO: Free colors (if using palette)? */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2486
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2487 /* Allocate new color. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2488 xgcv.foreground = default_pixel;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2489 pixel = background;
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2490 if (dpyinfo->n_planes != 1
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2491 && mac_alloc_lighter_color (f, &pixel, factor, delta))
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2492 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2493 relief->allocated_p = 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2494 xgcv.foreground = relief->pixel = pixel;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2495 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
2496
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2497 if (relief->gc == 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2498 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2499 #if 0 /* MAC_TODO: stipple */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2500 xgcv.stipple = dpyinfo->gray;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2501 mask |= GCStipple;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2502 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2503 relief->gc = XCreateGC (NULL, FRAME_MAC_WINDOW (f), mask, &xgcv);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2504 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2505 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2506 XChangeGC (NULL, relief->gc, mask, &xgcv);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2507 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2508
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2509
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2510 /* Set up colors for the relief lines around glyph string S. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2511
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2512 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2513 x_setup_relief_colors (s)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2514 struct glyph_string *s;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2515 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2516 struct mac_output *di = s->f->output_data.mac;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2517 unsigned long color;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2518
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2519 if (s->face->use_box_color_for_shadows_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2520 color = s->face->box_color;
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2521 else if (s->first_glyph->type == IMAGE_GLYPH
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2522 && s->img->pixmap
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2523 && !IMAGE_BACKGROUND_TRANSPARENT (s->img, s->f, 0))
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2524 color = IMAGE_BACKGROUND (s->img, s->f, 0);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2525 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2526 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2527 XGCValues xgcv;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
2528
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2529 /* Get the background color of the face. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2530 XGetGCValues (s->display, s->gc, GCBackground, &xgcv);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2531 color = xgcv.background;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2532 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2533
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2534 if (di->white_relief.gc == 0
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2535 || color != di->relief_background)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2536 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2537 di->relief_background = color;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2538 x_setup_relief_color (s->f, &di->white_relief, 1.2, 0x8000,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2539 WHITE_PIX_DEFAULT (s->f));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2540 x_setup_relief_color (s->f, &di->black_relief, 0.6, 0x4000,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2541 BLACK_PIX_DEFAULT (s->f));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2542 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2543 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2544
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2545
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2546 /* Draw a relief on frame F inside the rectangle given by LEFT_X,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2547 TOP_Y, RIGHT_X, and BOTTOM_Y. WIDTH is the thickness of the relief
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2548 to draw, it must be >= 0. RAISED_P non-zero means draw a raised
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2549 relief. LEFT_P non-zero means draw a relief on the left side of
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2550 the rectangle. RIGHT_P non-zero means draw a relief on the right
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2551 side of the rectangle. CLIP_RECT is the clipping rectangle to use
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2552 when drawing. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2553
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2554 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2555 x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2556 raised_p, top_p, bot_p, left_p, right_p, clip_rect)
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2557 struct frame *f;
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2558 int left_x, top_y, right_x, bottom_y, width;
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2559 int top_p, bot_p, left_p, right_p, raised_p;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2560 Rect *clip_rect;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2561 {
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2562 Display *dpy = FRAME_MAC_DISPLAY (f);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2563 Window window = FRAME_MAC_WINDOW (f);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2564 int i;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2565 GC gc;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
2566
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2567 if (raised_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2568 gc = f->output_data.mac->white_relief.gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2569 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2570 gc = f->output_data.mac->black_relief.gc;
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2571 mac_set_clip_rectangle (dpy, window, clip_rect);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2572
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2573 /* Top. */
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2574 if (top_p)
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2575 for (i = 0; i < width; ++i)
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2576 XDrawLine (dpy, window, gc,
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2577 left_x + i * left_p, top_y + i,
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2578 right_x - i * right_p, top_y + i);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2579
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2580 /* Left. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2581 if (left_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2582 for (i = 0; i < width; ++i)
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2583 XDrawLine (dpy, window, gc,
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2584 left_x + i, top_y + i, left_x + i, bottom_y - i);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2585
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2586 mac_reset_clipping (dpy, window);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2587 if (raised_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2588 gc = f->output_data.mac->black_relief.gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2589 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2590 gc = f->output_data.mac->white_relief.gc;
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2591 mac_set_clip_rectangle (dpy, window,
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2592 clip_rect);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
2593
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2594 /* Bottom. */
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2595 if (bot_p)
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2596 for (i = 0; i < width; ++i)
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2597 XDrawLine (dpy, window, gc,
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2598 left_x + i * left_p, bottom_y - i,
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2599 right_x - i * right_p, bottom_y - i);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
2600
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2601 /* Right. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2602 if (right_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2603 for (i = 0; i < width; ++i)
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2604 XDrawLine (dpy, window, gc,
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2605 right_x - i, top_y + i + 1, right_x - i, bottom_y - i - 1);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2606
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2607 mac_reset_clipping (dpy, window);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2608 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2609
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2610
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2611 /* Draw a box on frame F inside the rectangle given by LEFT_X, TOP_Y,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2612 RIGHT_X, and BOTTOM_Y. WIDTH is the thickness of the lines to
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2613 draw, it must be >= 0. LEFT_P non-zero means draw a line on the
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2614 left side of the rectangle. RIGHT_P non-zero means draw a line
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2615 on the right side of the rectangle. CLIP_RECT is the clipping
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2616 rectangle to use when drawing. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2617
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2618 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2619 x_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2620 left_p, right_p, clip_rect)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2621 struct glyph_string *s;
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2622 int left_x, top_y, right_x, bottom_y, width, left_p, right_p;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2623 Rect *clip_rect;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2624 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2625 XGCValues xgcv;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
2626
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2627 xgcv.foreground = s->face->box_color;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2628 mac_set_clip_rectangle (s->display, s->window, clip_rect);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
2629
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2630 /* Top. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2631 XFillRectangle (s->display, s->window, &xgcv,
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2632 left_x, top_y, right_x - left_x + 1, width);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2633
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2634 /* Left. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2635 if (left_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2636 XFillRectangle (s->display, s->window, &xgcv,
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2637 left_x, top_y, width, bottom_y - top_y + 1);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2638
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2639 /* Bottom. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2640 XFillRectangle (s->display, s->window, &xgcv,
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2641 left_x, bottom_y - width + 1, right_x - left_x + 1, width);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
2642
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2643 /* Right. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2644 if (right_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2645 XFillRectangle (s->display, s->window, &xgcv,
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2646 right_x - width + 1, top_y, width, bottom_y - top_y + 1);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2647
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2648 mac_reset_clipping (s->display, s->window);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2649 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2650
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2651
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2652 /* Draw a box around glyph string S. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2653
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2654 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2655 x_draw_glyph_string_box (s)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2656 struct glyph_string *s;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2657 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2658 int width, left_x, right_x, top_y, bottom_y, last_x, raised_p;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2659 int left_p, right_p;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2660 struct glyph *last_glyph;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2661 Rect clip_rect;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2662
59655
369714ad80ed (x_draw_glyph_string_box): Fix last_x for full width rows.
Kim F. Storm <storm@cua.dk>
parents: 59586
diff changeset
2663 last_x = ((s->row->full_width_p && !s->w->pseudo_window_p)
369714ad80ed (x_draw_glyph_string_box): Fix last_x for full width rows.
Kim F. Storm <storm@cua.dk>
parents: 59586
diff changeset
2664 ? WINDOW_RIGHT_EDGE_X (s->w)
369714ad80ed (x_draw_glyph_string_box): Fix last_x for full width rows.
Kim F. Storm <storm@cua.dk>
parents: 59586
diff changeset
2665 : window_box_right (s->w, s->area));
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
2666
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2667 /* The glyph that may have a right box line. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2668 last_glyph = (s->cmp || s->img
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2669 ? s->first_glyph
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2670 : s->first_glyph + s->nchars - 1);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2671
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2672 width = abs (s->face->box_line_width);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2673 raised_p = s->face->box == FACE_RAISED_BOX;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2674 left_x = s->x;
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2675 right_x = (s->row->full_width_p && s->extends_to_end_of_line_p
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2676 ? last_x - 1
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2677 : min (last_x, s->x + s->background_width) - 1);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2678 top_y = s->y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2679 bottom_y = top_y + s->height - 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2680
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2681 left_p = (s->first_glyph->left_box_line_p
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2682 || (s->hl == DRAW_MOUSE_FACE
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2683 && (s->prev == NULL
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2684 || s->prev->hl != s->hl)));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2685 right_p = (last_glyph->right_box_line_p
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2686 || (s->hl == DRAW_MOUSE_FACE
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2687 && (s->next == NULL
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2688 || s->next->hl != s->hl)));
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
2689
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
2690 get_glyph_string_clip_rect (s, &clip_rect);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2691
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2692 if (s->face->box == FACE_SIMPLE_BOX)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2693 x_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2694 left_p, right_p, &clip_rect);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2695 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2696 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2697 x_setup_relief_colors (s);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2698 x_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y,
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2699 width, raised_p, 1, 1, left_p, right_p, &clip_rect);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2700 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2701 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2702
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2703
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2704 /* Draw foreground of image glyph string S. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2705
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2706 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2707 x_draw_image_foreground (s)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2708 struct glyph_string *s;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2709 {
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2710 int x = s->x;
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2711 int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2712
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2713 /* If first glyph of S has a left box line, start drawing it to the
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2714 right of that line. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2715 if (s->face->box != FACE_NO_BOX
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2716 && s->first_glyph->left_box_line_p
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2717 && s->slice.x == 0)
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2718 x += abs (s->face->box_line_width);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2719
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2720 /* If there is a margin around the image, adjust x- and y-position
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2721 by that margin. */
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2722 if (s->slice.x == 0)
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2723 x += s->img->hmargin;
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2724 if (s->slice.y == 0)
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2725 y += s->img->vmargin;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2726
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2727 if (s->img->pixmap)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2728 {
58634
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
2729 x_set_glyph_string_clipping (s);
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
2730
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2731 if (s->img->mask)
58634
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
2732 mac_copy_area_with_mask (s->display, s->img->pixmap, s->img->mask,
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
2733 s->window, s->gc, s->slice.x, s->slice.y,
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
2734 s->slice.width, s->slice.height, x, y);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2735 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2736 {
58634
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
2737 mac_copy_area (s->display, s->img->pixmap,
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
2738 s->window, s->gc, s->slice.x, s->slice.y,
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
2739 s->slice.width, s->slice.height, x, y);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
2740
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2741 /* When the image has a mask, we can expect that at
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2742 least part of a mouse highlight or a block cursor will
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2743 be visible. If the image doesn't have a mask, make
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2744 a block cursor visible by drawing a rectangle around
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2745 the image. I believe it's looking better if we do
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2746 nothing here for mouse-face. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2747 if (s->hl == DRAW_CURSOR)
45197
0b6da8b7d7ac (x_draw_image_foreground, x_draw_image_foreground_1):
Kim F. Storm <storm@cua.dk>
parents: 45111
diff changeset
2748 {
0b6da8b7d7ac (x_draw_image_foreground, x_draw_image_foreground_1):
Kim F. Storm <storm@cua.dk>
parents: 45111
diff changeset
2749 int r = s->img->relief;
0b6da8b7d7ac (x_draw_image_foreground, x_draw_image_foreground_1):
Kim F. Storm <storm@cua.dk>
parents: 45111
diff changeset
2750 if (r < 0) r = -r;
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2751 mac_draw_rectangle (s->display, s->window, s->gc,
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2752 x - r, y - r,
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2753 s->slice.width + r*2 - 1,
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2754 s->slice.height + r*2 - 1);
45197
0b6da8b7d7ac (x_draw_image_foreground, x_draw_image_foreground_1):
Kim F. Storm <storm@cua.dk>
parents: 45111
diff changeset
2755 }
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2756 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2757 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2758 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2759 /* Draw a rectangle if image could not be loaded. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2760 mac_draw_rectangle (s->display, s->window, s->gc, x, y,
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2761 s->slice.width - 1, s->slice.height - 1);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2762 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2763
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2764
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2765 /* Draw a relief around the image glyph string S. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2766
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2767 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2768 x_draw_image_relief (s)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2769 struct glyph_string *s;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2770 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2771 int x0, y0, x1, y1, thick, raised_p;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2772 Rect r;
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2773 int x = s->x;
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2774 int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
2775
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2776 /* If first glyph of S has a left box line, start drawing it to the
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2777 right of that line. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2778 if (s->face->box != FACE_NO_BOX
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2779 && s->first_glyph->left_box_line_p
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2780 && s->slice.x == 0)
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2781 x += abs (s->face->box_line_width);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
2782
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2783 /* If there is a margin around the image, adjust x- and y-position
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2784 by that margin. */
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2785 if (s->slice.x == 0)
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2786 x += s->img->hmargin;
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2787 if (s->slice.y == 0)
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2788 y += s->img->vmargin;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
2789
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2790 if (s->hl == DRAW_IMAGE_SUNKEN
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2791 || s->hl == DRAW_IMAGE_RAISED)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2792 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2793 thick = tool_bar_button_relief >= 0 ? tool_bar_button_relief : DEFAULT_TOOL_BAR_BUTTON_RELIEF;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2794 raised_p = s->hl == DRAW_IMAGE_RAISED;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2795 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2796 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2797 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2798 thick = abs (s->img->relief);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2799 raised_p = s->img->relief > 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2800 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
2801
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2802 x0 = x - thick;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2803 y0 = y - thick;
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2804 x1 = x + s->slice.width + thick - 1;
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2805 y1 = y + s->slice.height + thick - 1;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
2806
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2807 x_setup_relief_colors (s);
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
2808 get_glyph_string_clip_rect (s, &r);
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2809 x_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p,
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2810 s->slice.y == 0,
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2811 s->slice.y + s->slice.height == s->img->height,
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2812 s->slice.x == 0,
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2813 s->slice.x + s->slice.width == s->img->width,
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2814 &r);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2815 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2816
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2817
58634
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
2818 #if 0 /* TODO: figure out if we need to do this on Mac. */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2819 /* Draw the foreground of image glyph string S to PIXMAP. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2820
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2821 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2822 x_draw_image_foreground_1 (s, pixmap)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2823 struct glyph_string *s;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2824 Pixmap pixmap;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2825 {
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2826 int x = 0;
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2827 int y = s->ybase - s->y - image_ascent (s->img, s->face, &s->slice);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2828
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2829 /* If first glyph of S has a left box line, start drawing it to the
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2830 right of that line. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2831 if (s->face->box != FACE_NO_BOX
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2832 && s->first_glyph->left_box_line_p
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2833 && s->slice.x == 0)
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2834 x += abs (s->face->box_line_width);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2835
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2836 /* If there is a margin around the image, adjust x- and y-position
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2837 by that margin. */
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2838 if (s->slice.x == 0)
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2839 x += s->img->hmargin;
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2840 if (s->slice.y == 0)
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2841 y += s->img->vmargin;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2842
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2843 if (s->img->pixmap)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2844 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2845 if (s->img->mask)
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2846 mac_copy_area_with_mask_to_pixmap (s->display, s->img->pixmap,
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2847 s->img->mask, pixmap, s->gc,
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2848 s->slice.x, s->slice.y,
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2849 s->slice.width, s->slice.height,
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2850 x, y);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2851 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2852 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2853 mac_copy_area_to_pixmap (s->display, s->img->pixmap, pixmap, s->gc,
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2854 s->slice.x, s->slice.y,
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2855 s->slice.width, s->slice.height,
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2856 x, y);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
2857
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2858 /* When the image has a mask, we can expect that at
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2859 least part of a mouse highlight or a block cursor will
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2860 be visible. If the image doesn't have a mask, make
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2861 a block cursor visible by drawing a rectangle around
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2862 the image. I believe it's looking better if we do
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2863 nothing here for mouse-face. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2864 if (s->hl == DRAW_CURSOR)
45197
0b6da8b7d7ac (x_draw_image_foreground, x_draw_image_foreground_1):
Kim F. Storm <storm@cua.dk>
parents: 45111
diff changeset
2865 {
0b6da8b7d7ac (x_draw_image_foreground, x_draw_image_foreground_1):
Kim F. Storm <storm@cua.dk>
parents: 45111
diff changeset
2866 int r = s->img->relief;
0b6da8b7d7ac (x_draw_image_foreground, x_draw_image_foreground_1):
Kim F. Storm <storm@cua.dk>
parents: 45111
diff changeset
2867 if (r < 0) r = -r;
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2868 mac_draw_rectangle (s->display, s->window, s->gc, x - r, y - r,
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2869 s->slice.width + r*2 - 1,
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2870 s->slice.height + r*2 - 1);
45197
0b6da8b7d7ac (x_draw_image_foreground, x_draw_image_foreground_1):
Kim F. Storm <storm@cua.dk>
parents: 45111
diff changeset
2871 }
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2872 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2873 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2874 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2875 /* Draw a rectangle if image could not be loaded. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2876 mac_draw_rectangle_to_pixmap (s->display, pixmap, s->gc, x, y,
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2877 s->slice.width - 1, s->slice.height - 1);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2878 }
58634
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
2879 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2880
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2881
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2882 /* Draw part of the background of glyph string S. X, Y, W, and H
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2883 give the rectangle to draw. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2884
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2885 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2886 x_draw_glyph_string_bg_rect (s, x, y, w, h)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2887 struct glyph_string *s;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2888 int x, y, w, h;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2889 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2890 #if 0 /* MAC_TODO: stipple */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2891 if (s->stippled_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2892 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2893 /* Fill background with a stipple pattern. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2894 XSetFillStyle (s->display, s->gc, FillOpaqueStippled);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2895 XFillRectangle (s->display, s->window, s->gc, x, y, w, h);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2896 XSetFillStyle (s->display, s->gc, FillSolid);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2897 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2898 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2899 #endif /* MAC_TODO */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2900 x_clear_glyph_string_rect (s, x, y, w, h);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2901 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2902
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2903
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
2904 /* Draw image glyph string S.
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2905
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2906 s->y
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2907 s->x +-------------------------
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2908 | s->face->box
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2909 |
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2910 | +-------------------------
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2911 | | s->img->margin
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2912 | |
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2913 | | +-------------------
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2914 | | | the image
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2915
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2916 */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2917
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2918 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2919 x_draw_image_glyph_string (s)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2920 struct glyph_string *s;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2921 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2922 int x, y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2923 int box_line_hwidth = abs (s->face->box_line_width);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2924 int box_line_vwidth = max (s->face->box_line_width, 0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2925 int height;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2926 Pixmap pixmap = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2927
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2928 height = s->height - 2 * box_line_vwidth;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2929
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2930
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2931 /* Fill background with face under the image. Do it only if row is
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2932 taller than image or if image has a clip mask to reduce
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2933 flickering. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2934 s->stippled_p = s->face->stipple != 0;
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2935 if (height > s->slice.height
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2936 || s->img->hmargin
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2937 || s->img->vmargin
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2938 || s->img->mask
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2939 || s->img->pixmap == 0
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2940 || s->width != s->background_width)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2941 {
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2942 x = s->x;
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2943 if (s->first_glyph->left_box_line_p
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2944 && s->slice.x == 0)
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2945 x += box_line_hwidth;
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2946
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2947 y = s->y;
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2948 if (s->slice.y == 0)
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
2949 y += box_line_vwidth;
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2950
58634
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
2951 #if 0 /* TODO: figure out if we need to do this on Mac. */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2952 if (s->img->mask)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2953 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2954 /* Create a pixmap as large as the glyph string. Fill it
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2955 with the background color. Copy the image to it, using
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2956 its mask. Copy the temporary pixmap to the display. */
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2957 int depth = one_mac_display_info.n_planes;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2958
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2959 /* Create a pixmap as large as the glyph string. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2960 pixmap = XCreatePixmap (s->display, s->window,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2961 s->background_width,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2962 s->height, depth);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
2963
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2964 /* Fill the pixmap with the background color/stipple. */
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2965 #if 0 /* TODO: stipple */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2966 if (s->stippled_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2967 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2968 /* Fill background with a stipple pattern. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2969 XSetFillStyle (s->display, s->gc, FillOpaqueStippled);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2970 XFillRectangle (s->display, pixmap, s->gc,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2971 0, 0, s->background_width, s->height);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2972 XSetFillStyle (s->display, s->gc, FillSolid);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2973 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2974 else
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2975 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2976 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2977 XGCValues xgcv;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2978 XGetGCValues (s->display, s->gc, GCForeground | GCBackground,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2979 &xgcv);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2980 XSetForeground (s->display, s->gc, xgcv.background);
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2981 mac_fill_rectangle_to_pixmap (s->display, pixmap, s->gc,
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2982 0, 0, s->background_width,
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
2983 s->height);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2984 XSetForeground (s->display, s->gc, xgcv.foreground);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2985 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2986 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2987 else
58634
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
2988 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2989 x_draw_glyph_string_bg_rect (s, x, y, s->background_width, height);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
2990
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2991 s->background_filled_p = 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2992 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2993
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2994 /* Draw the foreground. */
58634
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
2995 #if 0 /* TODO: figure out if we need to do this on Mac. */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2996 if (pixmap != 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2997 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2998 x_draw_image_foreground_1 (s, pixmap);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
2999 x_set_glyph_string_clipping (s);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3000 mac_copy_area (s->display, pixmap, s->window, s->gc,
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
3001 0, 0, s->background_width, s->height, s->x, s->y);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3002 mac_reset_clipping (s->display, s->window);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3003 XFreePixmap (s->display, pixmap);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3004 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3005 else
58634
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
3006 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3007 x_draw_image_foreground (s);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3008
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3009 /* If we must draw a relief around the image, do it. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3010 if (s->img->relief
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3011 || s->hl == DRAW_IMAGE_RAISED
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3012 || s->hl == DRAW_IMAGE_SUNKEN)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3013 x_draw_image_relief (s);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3014 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3015
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3016
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3017 /* Draw stretch glyph string S. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3018
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3019 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3020 x_draw_stretch_glyph_string (s)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3021 struct glyph_string *s;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3022 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3023 xassert (s->first_glyph->type == STRETCH_GLYPH);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3024 s->stippled_p = s->face->stipple != 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3025
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3026 if (s->hl == DRAW_CURSOR
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3027 && !x_stretch_cursor_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3028 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3029 /* If `x-stretch-block-cursor' is nil, don't draw a block cursor
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3030 as wide as the stretch glyph. */
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
3031 int width = min (FRAME_COLUMN_WIDTH (s->f), s->background_width);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3032
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3033 /* Draw cursor. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3034 x_draw_glyph_string_bg_rect (s, s->x, s->y, width, s->height);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3035
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3036 /* Clear rest using the GC of the original non-cursor face. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3037 if (width < s->background_width)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3038 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3039 int x = s->x + width, y = s->y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3040 int w = s->background_width - width, h = s->height;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3041 Rect r;
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
3042 GC gc;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3043
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3044 if (s->row->mouse_face_p
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3045 && cursor_in_mouse_face_p (s->w))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3046 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3047 x_set_mouse_face_gc (s);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3048 gc = s->gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3049 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3050 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3051 gc = s->face->gc;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
3052
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
3053 get_glyph_string_clip_rect (s, &r);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3054 mac_set_clip_rectangle (s->display, s->window, &r);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3055
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3056 #if 0 /* MAC_TODO: stipple */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3057 if (s->face->stipple)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3058 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3059 /* Fill background with a stipple pattern. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3060 XSetFillStyle (s->display, gc, FillOpaqueStippled);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3061 XFillRectangle (s->display, s->window, gc, x, y, w, h);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3062 XSetFillStyle (s->display, gc, FillSolid);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3063 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3064 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3065 #endif /* MAC_TODO */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3066 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3067 XGCValues xgcv;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3068 XGetGCValues (s->display, gc, GCForeground | GCBackground, &xgcv);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3069 XSetForeground (s->display, gc, xgcv.background);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3070 XFillRectangle (s->display, s->window, gc, x, y, w, h);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3071 XSetForeground (s->display, gc, xgcv.foreground);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3072 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3073
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3074 mac_reset_clipping (s->display, s->window);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3075 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3076 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3077 else if (!s->background_filled_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3078 x_draw_glyph_string_bg_rect (s, s->x, s->y, s->background_width,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3079 s->height);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
3080
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3081 s->background_filled_p = 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3082 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3083
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3084
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3085 /* Draw glyph string S. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3086
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3087 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3088 x_draw_glyph_string (s)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3089 struct glyph_string *s;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3090 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3091 int relief_drawn_p = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3092
59718
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
3093 /* If S draws into the background of its successor that does not
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
3094 draw a cursor, draw the background of the successor first so that
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
3095 S can draw into it. This makes S->next use XDrawString instead
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
3096 of XDrawImageString. */
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
3097 if (s->next && s->right_overhang && !s->for_overlaps_p
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
3098 && s->next->hl != DRAW_CURSOR)
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3099 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3100 xassert (s->next->img == NULL);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3101 x_set_glyph_string_gc (s->next);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3102 x_set_glyph_string_clipping (s->next);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3103 x_draw_glyph_string_background (s->next, 1);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3104 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3105
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3106 /* Set up S->gc, set clipping and draw S. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3107 x_set_glyph_string_gc (s);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3108
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3109 /* Draw relief (if any) in advance for char/composition so that the
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3110 glyph string can be drawn over it. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3111 if (!s->for_overlaps_p
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3112 && s->face->box != FACE_NO_BOX
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3113 && (s->first_glyph->type == CHAR_GLYPH
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3114 || s->first_glyph->type == COMPOSITE_GLYPH))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3115
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3116 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3117 x_set_glyph_string_clipping (s);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3118 x_draw_glyph_string_background (s, 1);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3119 x_draw_glyph_string_box (s);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3120 x_set_glyph_string_clipping (s);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3121 relief_drawn_p = 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3122 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3123 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3124 x_set_glyph_string_clipping (s);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3125
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3126 switch (s->first_glyph->type)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3127 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3128 case IMAGE_GLYPH:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3129 x_draw_image_glyph_string (s);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3130 break;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3131
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3132 case STRETCH_GLYPH:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3133 x_draw_stretch_glyph_string (s);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3134 break;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3135
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3136 case CHAR_GLYPH:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3137 if (s->for_overlaps_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3138 s->background_filled_p = 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3139 else
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
3140 x_draw_glyph_string_background (s, 0);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3141 x_draw_glyph_string_foreground (s);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3142 break;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3143
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3144 case COMPOSITE_GLYPH:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3145 if (s->for_overlaps_p || s->gidx > 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3146 s->background_filled_p = 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3147 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3148 x_draw_glyph_string_background (s, 1);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3149 x_draw_composite_glyph_string_foreground (s);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3150 break;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3151
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3152 default:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3153 abort ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3154 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3155
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3156 if (!s->for_overlaps_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3157 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3158 /* Draw underline. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3159 if (s->face->underline_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3160 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3161 unsigned long h = 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3162 unsigned long dy = s->height - h;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
3163
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3164 if (s->face->underline_defaulted_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3165 XFillRectangle (s->display, s->window, s->gc, s->x, s->y + dy,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3166 s->width, h);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3167 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3168 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3169 XGCValues xgcv;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3170 XGetGCValues (s->display, s->gc, GCForeground, &xgcv);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3171 XSetForeground (s->display, s->gc, s->face->underline_color);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3172 XFillRectangle (s->display, s->window, s->gc, s->x, s->y + dy,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3173 s->width, h);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3174 XSetForeground (s->display, s->gc, xgcv.foreground);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3175 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3176 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3177
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3178 /* Draw overline. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3179 if (s->face->overline_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3180 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3181 unsigned long dy = 0, h = 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3182
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3183 if (s->face->overline_color_defaulted_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3184 XFillRectangle (s->display, s->window, s->gc, s->x, s->y + dy,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3185 s->width, h);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3186 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3187 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3188 XGCValues xgcv;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3189 XGetGCValues (s->display, s->gc, GCForeground, &xgcv);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3190 XSetForeground (s->display, s->gc, s->face->overline_color);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3191 XFillRectangle (s->display, s->window, s->gc, s->x, s->y + dy,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3192 s->width, h);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3193 XSetForeground (s->display, s->gc, xgcv.foreground);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3194 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3195 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
3196
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3197 /* Draw strike-through. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3198 if (s->face->strike_through_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3199 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3200 unsigned long h = 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3201 unsigned long dy = (s->height - h) / 2;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3202
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3203 if (s->face->strike_through_color_defaulted_p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3204 XFillRectangle (s->display, s->window, s->gc, s->x, s->y + dy,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3205 s->width, h);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3206 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3207 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3208 XGCValues xgcv;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3209 XGetGCValues (s->display, s->gc, GCForeground, &xgcv);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3210 XSetForeground (s->display, s->gc, s->face->strike_through_color);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3211 XFillRectangle (s->display, s->window, s->gc, s->x, s->y + dy,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3212 s->width, h);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3213 XSetForeground (s->display, s->gc, xgcv.foreground);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3214 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3215 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
3216
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
3217 /* Draw relief if not yet drawn. */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3218 if (!relief_drawn_p && s->face->box != FACE_NO_BOX)
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
3219 x_draw_glyph_string_box (s);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3220 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3221
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3222 /* Reset clipping. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3223 mac_reset_clipping (s->display, s->window);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3224 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3225
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
3226 /* Shift display to make room for inserted glyphs. */
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
3227
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
3228 void
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
3229 mac_shift_glyphs_for_insert (f, x, y, width, height, shift_by)
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
3230 struct frame *f;
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
3231 int x, y, width, height, shift_by;
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
3232 {
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3233 mac_scroll_area (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
3234 f->output_data.mac->normal_gc,
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
3235 x, y, width, height,
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
3236 x + shift_by, y);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3237 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3238
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3239 /* Delete N glyphs at the nominal cursor position. Not implemented
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3240 for X frames. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3241
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3242 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3243 x_delete_glyphs (n)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3244 register int n;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3245 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3246 abort ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3247 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3248
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3249
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3250 /* Clear entire frame. If updating_frame is non-null, clear that
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3251 frame. Otherwise clear the selected frame. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3252
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3253 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3254 x_clear_frame ()
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3255 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3256 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3257
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3258 if (updating_frame)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3259 f = updating_frame;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3260 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3261 f = SELECTED_FRAME ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3262
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3263 /* Clearing the frame will erase any cursor, so mark them all as no
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3264 longer visible. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3265 mark_window_cursors_off (XWINDOW (FRAME_ROOT_WINDOW (f)));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3266 output_cursor.hpos = output_cursor.vpos = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3267 output_cursor.x = -1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3268
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3269 /* We don't set the output cursor here because there will always
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3270 follow an explicit cursor_to. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3271 BLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3272 XClearWindow (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3273
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3274 /* We have to clear the scroll bars, too. If we have changed
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3275 colors or something like that, then they should be notified. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3276 x_scroll_bar_clear (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3277
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3278 XFlush (FRAME_MAC_DISPLAY (f));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3279 UNBLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3280 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3281
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3282
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3283
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3284 /* Invert the middle quarter of the frame for .15 sec. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3285
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3286 /* We use the select system call to do the waiting, so we have to make
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3287 sure it's available. If it isn't, we just won't do visual bells. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3288
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3289 #if defined (HAVE_TIMEVAL) && defined (HAVE_SELECT)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3290
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
3291
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3292 /* Subtract the `struct timeval' values X and Y, storing the result in
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3293 *RESULT. Return 1 if the difference is negative, otherwise 0. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3294
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3295 static int
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3296 timeval_subtract (result, x, y)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3297 struct timeval *result, x, y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3298 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3299 /* Perform the carry for the later subtraction by updating y. This
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3300 is safer because on some systems the tv_sec member is unsigned. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3301 if (x.tv_usec < y.tv_usec)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3302 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3303 int nsec = (y.tv_usec - x.tv_usec) / 1000000 + 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3304 y.tv_usec -= 1000000 * nsec;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3305 y.tv_sec += nsec;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3306 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
3307
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3308 if (x.tv_usec - y.tv_usec > 1000000)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3309 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3310 int nsec = (y.tv_usec - x.tv_usec) / 1000000;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3311 y.tv_usec += 1000000 * nsec;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3312 y.tv_sec -= nsec;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3313 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3314
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3315 /* Compute the time remaining to wait. tv_usec is certainly
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3316 positive. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3317 result->tv_sec = x.tv_sec - y.tv_sec;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3318 result->tv_usec = x.tv_usec - y.tv_usec;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3319
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3320 /* Return indication of whether the result should be considered
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3321 negative. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3322 return x.tv_sec < y.tv_sec;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3323 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3324
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3325 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3326 XTflash (f)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3327 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3328 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3329 BLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3330
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3331 FlashMenuBar (0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3332
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3333 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3334 struct timeval wakeup;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3335
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3336 EMACS_GET_TIME (wakeup);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3337
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3338 /* Compute time to wait until, propagating carry from usecs. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3339 wakeup.tv_usec += 150000;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3340 wakeup.tv_sec += (wakeup.tv_usec / 1000000);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3341 wakeup.tv_usec %= 1000000;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3342
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3343 /* Keep waiting until past the time wakeup. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3344 while (1)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3345 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3346 struct timeval timeout;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3347
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3348 EMACS_GET_TIME (timeout);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3349
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3350 /* In effect, timeout = wakeup - timeout.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3351 Break if result would be negative. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3352 if (timeval_subtract (&timeout, wakeup, timeout))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3353 break;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3354
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3355 /* Try to wait that long--but we might wake up sooner. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3356 select (0, NULL, NULL, NULL, &timeout);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3357 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3358 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
3359
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3360 FlashMenuBar (0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3361
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3362 UNBLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3363 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3364
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3365 #endif /* defined (HAVE_TIMEVAL) && defined (HAVE_SELECT) */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3366
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3367
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3368 /* Make audible bell. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3369
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3370 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3371 XTring_bell ()
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3372 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3373 struct frame *f = SELECTED_FRAME ();
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
3374
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3375 #if defined (HAVE_TIMEVAL) && defined (HAVE_SELECT)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3376 if (visible_bell)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3377 XTflash (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3378 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3379 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3380 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3381 BLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3382 SysBeep (1);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3383 XFlush (FRAME_MAC_DISPLAY (f));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3384 UNBLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3385 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3386 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3387
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3388
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3389
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3390 /* Specify how many text lines, from the top of the window,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3391 should be affected by insert-lines and delete-lines operations.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3392 This, and those operations, are used only within an update
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3393 that is bounded by calls to x_update_begin and x_update_end. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3394
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
3395 static void
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3396 XTset_terminal_window (n)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3397 register int n;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3398 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3399 /* This function intentionally left blank. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3400 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3401
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3402
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3403
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3404 /***********************************************************************
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3405 Line Dance
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3406 ***********************************************************************/
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3407
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3408 /* Perform an insert-lines or delete-lines operation, inserting N
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3409 lines or deleting -N lines at vertical position VPOS. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3410
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3411 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3412 x_ins_del_lines (vpos, n)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3413 int vpos, n;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3414 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3415 abort ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3416 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3417
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3418
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3419 /* Scroll part of the display as described by RUN. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3420
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3421 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3422 x_scroll_run (w, run)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3423 struct window *w;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3424 struct run *run;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3425 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3426 struct frame *f = XFRAME (w->frame);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3427 int x, y, width, height, from_y, to_y, bottom_y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3428
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3429 /* Get frame-relative bounding box of the text display area of W,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3430 without mode lines. Include in this box the left and right
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
3431 fringe of W. */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3432 window_box (w, -1, &x, &y, &width, &height);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3433
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3434 from_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->current_y);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3435 to_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->desired_y);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3436 bottom_y = y + height;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3437
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3438 if (to_y < from_y)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3439 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3440 /* Scrolling up. Make sure we don't copy part of the mode
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3441 line at the bottom. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3442 if (from_y + run->height > bottom_y)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3443 height = bottom_y - from_y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3444 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3445 height = run->height;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3446 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3447 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3448 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3449 /* Scolling down. Make sure we don't copy over the mode line.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3450 at the bottom. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3451 if (to_y + run->height > bottom_y)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3452 height = bottom_y - to_y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3453 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3454 height = run->height;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3455 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3456
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3457 BLOCK_INPUT;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
3458
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3459 /* Cursor off. Will be switched on again in x_update_window_end. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3460 updated_window = w;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3461 x_clear_cursor (w);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3462
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3463 mac_scroll_area (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3464 f->output_data.mac->normal_gc,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3465 x, from_y,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3466 width, height,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3467 x, to_y);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
3468
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3469 UNBLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3470 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3471
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3472
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3473
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3474 /***********************************************************************
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3475 Exposure Events
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3476 ***********************************************************************/
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
3477
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3478
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3479 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3480 frame_highlight (f)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3481 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3482 {
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3483 OSErr err;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3484 ControlRef root_control;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3485
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3486 BLOCK_INPUT;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3487 err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control);
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3488 if (err == noErr)
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3489 ActivateControl (root_control);
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3490 UNBLOCK_INPUT;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3491 x_update_cursor (f, 1);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3492 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3493
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3494 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3495 frame_unhighlight (f)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3496 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3497 {
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3498 OSErr err;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3499 ControlRef root_control;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3500
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3501 BLOCK_INPUT;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3502 err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control);
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3503 if (err == noErr)
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3504 DeactivateControl (root_control);
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3505 UNBLOCK_INPUT;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3506 x_update_cursor (f, 1);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3507 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3508
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3509 /* The focus has changed. Update the frames as necessary to reflect
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3510 the new situation. Note that we can't change the selected frame
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3511 here, because the Lisp code we are interrupting might become confused.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3512 Each event gets marked with the frame in which it occurred, so the
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3513 Lisp code can tell when the switch took place by examining the events. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3514
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3515 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3516 x_new_focus_frame (dpyinfo, frame)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3517 struct x_display_info *dpyinfo;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3518 struct frame *frame;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3519 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3520 struct frame *old_focus = dpyinfo->x_focus_frame;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3521
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3522 if (frame != dpyinfo->x_focus_frame)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3523 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3524 /* Set this before calling other routines, so that they see
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3525 the correct value of x_focus_frame. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3526 dpyinfo->x_focus_frame = frame;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3527
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3528 if (old_focus && old_focus->auto_lower)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3529 x_lower_frame (old_focus);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3530
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3531 #if 0
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3532 selected_frame = frame;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3533 XSETFRAME (XWINDOW (selected_frame->selected_window)->frame,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3534 selected_frame);
51048
7ac9c3bea5ea (Fselect_window): Add optional arg `norecord'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50701
diff changeset
3535 Fselect_window (selected_frame->selected_window, Qnil);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3536 choose_minibuf_frame ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3537 #endif /* ! 0 */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3538
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3539 if (dpyinfo->x_focus_frame && dpyinfo->x_focus_frame->auto_raise)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3540 pending_autoraise_frame = dpyinfo->x_focus_frame;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3541 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3542 pending_autoraise_frame = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3543 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3544
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3545 x_frame_rehighlight (dpyinfo);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3546 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3547
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3548 /* Handle FocusIn and FocusOut state changes for FRAME.
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3549 If FRAME has focus and there exists more than one frame, puts
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3550 a FOCUS_IN_EVENT into *BUFP. */
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3551
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3552 static void
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3553 mac_focus_changed (type, dpyinfo, frame, bufp)
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3554 int type;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3555 struct mac_display_info *dpyinfo;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3556 struct frame *frame;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3557 struct input_event *bufp;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3558 {
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3559 if (type == activeFlag)
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3560 {
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3561 if (dpyinfo->x_focus_event_frame != frame)
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3562 {
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3563 x_new_focus_frame (dpyinfo, frame);
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3564 dpyinfo->x_focus_event_frame = frame;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3565
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3566 /* Don't stop displaying the initial startup message
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3567 for a switch-frame event we don't need. */
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3568 if (GC_NILP (Vterminal_frame)
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3569 && GC_CONSP (Vframe_list)
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3570 && !GC_NILP (XCDR (Vframe_list)))
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3571 {
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3572 bufp->kind = FOCUS_IN_EVENT;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3573 XSETFRAME (bufp->frame_or_window, frame);
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3574 }
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3575 }
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3576 }
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3577 else
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3578 {
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3579 if (dpyinfo->x_focus_event_frame == frame)
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3580 {
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3581 dpyinfo->x_focus_event_frame = 0;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3582 x_new_focus_frame (dpyinfo, 0);
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3583 }
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3584 }
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3585 }
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3586
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3587 /* The focus may have changed. Figure out if it is a real focus change,
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3588 by checking both FocusIn/Out and Enter/LeaveNotify events.
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3589
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3590 Returns FOCUS_IN_EVENT event in *BUFP. */
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3591
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3592 static void
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3593 x_detect_focus_change (dpyinfo, event, bufp)
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3594 struct mac_display_info *dpyinfo;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3595 EventRecord *event;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3596 struct input_event *bufp;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3597 {
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3598 struct frame *frame;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3599
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3600 frame = mac_window_to_frame ((WindowPtr) event->message);
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3601 if (! frame)
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3602 return;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3603
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3604 /* On Mac, this is only called from focus events, so no switch needed. */
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3605 mac_focus_changed ((event->modifiers & activeFlag),
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3606 dpyinfo, frame, bufp);
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3607 }
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3608
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
3609
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3610 /* Handle an event saying the mouse has moved out of an Emacs frame. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3611
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3612 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3613 x_mouse_leave (dpyinfo)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3614 struct x_display_info *dpyinfo;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3615 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3616 x_new_focus_frame (dpyinfo, dpyinfo->x_focus_event_frame);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3617 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3618
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3619 /* The focus has changed, or we have redirected a frame's focus to
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3620 another frame (this happens when a frame uses a surrogate
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3621 mini-buffer frame). Shift the highlight as appropriate.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3622
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3623 The FRAME argument doesn't necessarily have anything to do with which
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3624 frame is being highlighted or un-highlighted; we only use it to find
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3625 the appropriate X display info. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3626
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3627 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3628 XTframe_rehighlight (frame)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3629 struct frame *frame;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3630 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3631 x_frame_rehighlight (FRAME_X_DISPLAY_INFO (frame));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3632 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3633
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3634 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3635 x_frame_rehighlight (dpyinfo)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3636 struct x_display_info *dpyinfo;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3637 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3638 struct frame *old_highlight = dpyinfo->x_highlight_frame;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3639
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3640 if (dpyinfo->x_focus_frame)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3641 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3642 dpyinfo->x_highlight_frame
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3643 = ((GC_FRAMEP (FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame)))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3644 ? XFRAME (FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3645 : dpyinfo->x_focus_frame);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3646 if (! FRAME_LIVE_P (dpyinfo->x_highlight_frame))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3647 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3648 FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame) = Qnil;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3649 dpyinfo->x_highlight_frame = dpyinfo->x_focus_frame;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3650 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3651 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3652 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3653 dpyinfo->x_highlight_frame = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3654
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3655 if (dpyinfo->x_highlight_frame != old_highlight)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3656 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3657 if (old_highlight)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3658 frame_unhighlight (old_highlight);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3659 if (dpyinfo->x_highlight_frame)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3660 frame_highlight (dpyinfo->x_highlight_frame);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3661 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3662 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3663
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3664
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3665
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3666 /* Keyboard processing - modifier keys, vendor-specific keysyms, etc. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3667
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3668 #if 0 /* MAC_TODO */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3669 /* Initialize mode_switch_bit and modifier_meaning. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3670 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3671 x_find_modifier_meanings (dpyinfo)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3672 struct x_display_info *dpyinfo;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3673 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3674 int min_code, max_code;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3675 KeySym *syms;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3676 int syms_per_code;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3677 XModifierKeymap *mods;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3678
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3679 dpyinfo->meta_mod_mask = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3680 dpyinfo->shift_lock_mask = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3681 dpyinfo->alt_mod_mask = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3682 dpyinfo->super_mod_mask = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3683 dpyinfo->hyper_mod_mask = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3684
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3685 #ifdef HAVE_X11R4
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3686 XDisplayKeycodes (dpyinfo->display, &min_code, &max_code);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3687 #else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3688 min_code = dpyinfo->display->min_keycode;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3689 max_code = dpyinfo->display->max_keycode;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3690 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3691
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3692 syms = XGetKeyboardMapping (dpyinfo->display,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3693 min_code, max_code - min_code + 1,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3694 &syms_per_code);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3695 mods = XGetModifierMapping (dpyinfo->display);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3696
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3697 /* Scan the modifier table to see which modifier bits the Meta and
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3698 Alt keysyms are on. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3699 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3700 int row, col; /* The row and column in the modifier table. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3701
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3702 for (row = 3; row < 8; row++)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3703 for (col = 0; col < mods->max_keypermod; col++)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3704 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3705 KeyCode code
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3706 = mods->modifiermap[(row * mods->max_keypermod) + col];
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3707
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3708 /* Zeroes are used for filler. Skip them. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3709 if (code == 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3710 continue;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3711
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3712 /* Are any of this keycode's keysyms a meta key? */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3713 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3714 int code_col;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3715
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3716 for (code_col = 0; code_col < syms_per_code; code_col++)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3717 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3718 int sym = syms[((code - min_code) * syms_per_code) + code_col];
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3719
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3720 switch (sym)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3721 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3722 case XK_Meta_L:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3723 case XK_Meta_R:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3724 dpyinfo->meta_mod_mask |= (1 << row);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3725 break;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3726
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3727 case XK_Alt_L:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3728 case XK_Alt_R:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3729 dpyinfo->alt_mod_mask |= (1 << row);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3730 break;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3731
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3732 case XK_Hyper_L:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3733 case XK_Hyper_R:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3734 dpyinfo->hyper_mod_mask |= (1 << row);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3735 break;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3736
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3737 case XK_Super_L:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3738 case XK_Super_R:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3739 dpyinfo->super_mod_mask |= (1 << row);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3740 break;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3741
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3742 case XK_Shift_Lock:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3743 /* Ignore this if it's not on the lock modifier. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3744 if ((1 << row) == LockMask)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3745 dpyinfo->shift_lock_mask = LockMask;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3746 break;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3747 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3748 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3749 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3750 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3751 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3752
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3753 /* If we couldn't find any meta keys, accept any alt keys as meta keys. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3754 if (! dpyinfo->meta_mod_mask)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3755 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3756 dpyinfo->meta_mod_mask = dpyinfo->alt_mod_mask;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3757 dpyinfo->alt_mod_mask = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3758 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3759
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3760 /* If some keys are both alt and meta,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3761 make them just meta, not alt. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3762 if (dpyinfo->alt_mod_mask & dpyinfo->meta_mod_mask)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3763 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3764 dpyinfo->alt_mod_mask &= ~dpyinfo->meta_mod_mask;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3765 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3766
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3767 XFree ((char *) syms);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3768 XFreeModifiermap (mods);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3769 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3770
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3771 #endif /* MAC_TODO */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3772
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3773 /* Convert between the modifier bits X uses and the modifier bits
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3774 Emacs uses. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3775
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3776 static unsigned int
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3777 x_mac_to_emacs_modifiers (dpyinfo, state)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3778 struct x_display_info *dpyinfo;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3779 unsigned short state;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3780 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3781 return (((state & shiftKey) ? shift_modifier : 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3782 | ((state & controlKey) ? ctrl_modifier : 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3783 | ((state & cmdKey) ? meta_modifier : 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3784 | ((state & optionKey) ? alt_modifier : 0));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3785 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3786
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3787 #if 0 /* MAC_TODO */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3788 static unsigned short
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3789 x_emacs_to_x_modifiers (dpyinfo, state)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3790 struct x_display_info *dpyinfo;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3791 unsigned int state;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3792 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3793 return ( ((state & alt_modifier) ? dpyinfo->alt_mod_mask : 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3794 | ((state & super_modifier) ? dpyinfo->super_mod_mask : 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3795 | ((state & hyper_modifier) ? dpyinfo->hyper_mod_mask : 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3796 | ((state & shift_modifier) ? ShiftMask : 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3797 | ((state & ctrl_modifier) ? ControlMask : 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3798 | ((state & meta_modifier) ? dpyinfo->meta_mod_mask : 0));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3799 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3800 #endif /* MAC_TODO */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3801
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3802 /* Convert a keysym to its name. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3803
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3804 char *
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3805 x_get_keysym_name (keysym)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3806 int keysym;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3807 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3808 char *value;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3809
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3810 BLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3811 #if 0
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3812 value = XKeysymToString (keysym);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3813 #else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3814 value = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3815 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3816 UNBLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3817
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3818 return value;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3819 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3820
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3821
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3822
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
3823 #if 0
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3824 /* Mouse clicks and mouse movement. Rah. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3825
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3826 /* Prepare a mouse-event in *RESULT for placement in the input queue.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3827
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3828 If the event is a button press, then note that we have grabbed
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3829 the mouse. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3830
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3831 static Lisp_Object
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3832 construct_mouse_click (result, event, f)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3833 struct input_event *result;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3834 EventRecord *event;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3835 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3836 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3837 Point mouseLoc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3838
45803
9484de301252 Rename enum event_kind items.
Pavel Janík <Pavel@Janik.cz>
parents: 45197
diff changeset
3839 result->kind = MOUSE_CLICK_EVENT;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3840 result->code = 0; /* only one mouse button */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3841 result->timestamp = event->when;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3842 result->modifiers = event->what == mouseDown ? down_modifier : up_modifier;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3843
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3844 mouseLoc = event->where;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3845
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
3846 SetPortWindowPort (FRAME_MAC_WINDOW (f));
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3847
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3848 GlobalToLocal (&mouseLoc);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3849 XSETINT (result->x, mouseLoc.h);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3850 XSETINT (result->y, mouseLoc.v);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3851
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3852 XSETFRAME (result->frame_or_window, f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3853
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3854 result->arg = Qnil;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3855 return Qnil;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3856 }
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
3857 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3858
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3859
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3860 /* Function to report a mouse movement to the mainstream Emacs code.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3861 The input handler calls this.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3862
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3863 We have received a mouse movement event, which is given in *event.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3864 If the mouse is over a different glyph than it was last time, tell
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3865 the mainstream emacs code by setting mouse_moved. If not, ask for
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3866 another motion event, so we can check again the next time it moves. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3867
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3868 static Point last_mouse_motion_position;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3869 static Lisp_Object last_mouse_motion_frame;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3870
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3871 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3872 note_mouse_movement (frame, pos)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3873 FRAME_PTR frame;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3874 Point *pos;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3875 {
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
3876 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (frame);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3877 #if TARGET_API_MAC_CARBON
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3878 Rect r;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3879 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3880
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3881 last_mouse_movement_time = TickCount () * (1000 / 60); /* to milliseconds */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3882 last_mouse_motion_position = *pos;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3883 XSETFRAME (last_mouse_motion_frame, frame);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3884
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3885 #if TARGET_API_MAC_CARBON
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3886 if (!PtInRect (*pos, GetWindowPortBounds (FRAME_MAC_WINDOW (frame), &r)))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3887 #else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3888 if (!PtInRect (*pos, &FRAME_MAC_WINDOW (frame)->portRect))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3889 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3890 {
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
3891 if (frame == dpyinfo->mouse_face_mouse_frame)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
3892 /* This case corresponds to LeaveNotify in X11. */
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
3893 {
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
3894 /* If we move outside the frame, then we're certainly no
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
3895 longer on any text in the frame. */
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
3896 clear_mouse_face (dpyinfo);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
3897 dpyinfo->mouse_face_mouse_frame = 0;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
3898 if (!dpyinfo->grabbed)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
3899 rif->define_frame_cursor (frame,
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
3900 frame->output_data.mac->nontext_cursor);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
3901 }
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3902 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3903 /* Has the mouse moved off the glyph it was on at the last sighting? */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3904 else if (pos->h < last_mouse_glyph.left
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3905 || pos->h >= last_mouse_glyph.right
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3906 || pos->v < last_mouse_glyph.top
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3907 || pos->v >= last_mouse_glyph.bottom)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3908 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3909 frame->mouse_moved = 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3910 last_mouse_scroll_bar = Qnil;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3911 note_mouse_highlight (frame, pos->h, pos->v);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3912 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3913 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3914
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3915 /* This is used for debugging, to turn off note_mouse_highlight. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3916
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3917 int disable_mouse_highlight;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3918
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3919
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3920
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3921 /************************************************************************
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3922 Mouse Face
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3923 ************************************************************************/
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3924
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
3925 static struct scroll_bar *x_window_to_scroll_bar ();
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
3926 static void x_scroll_bar_report_motion ();
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
3927 static int glyph_rect P_ ((struct frame *f, int, int, Rect *));
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
3928
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
3929
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
3930 /* MAC TODO: This should be called from somewhere (or removed) ++KFS */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3931
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3932 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3933 redo_mouse_highlight ()
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3934 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3935 if (!NILP (last_mouse_motion_frame)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3936 && FRAME_LIVE_P (XFRAME (last_mouse_motion_frame)))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3937 note_mouse_highlight (XFRAME (last_mouse_motion_frame),
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3938 last_mouse_motion_position.h,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3939 last_mouse_motion_position.v);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3940 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3941
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3942
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3943 /* Try to determine frame pixel position and size of the glyph under
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3944 frame pixel coordinates X/Y on frame F . Return the position and
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3945 size in *RECT. Value is non-zero if we could compute these
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3946 values. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3947
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3948 static int
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3949 glyph_rect (f, x, y, rect)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3950 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3951 int x, y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3952 Rect *rect;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3953 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3954 Lisp_Object window;
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
3955
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
3956 window = window_from_coordinates (f, x, y, 0, &x, &y, 0);
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
3957
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3958 if (!NILP (window))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3959 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3960 struct window *w = XWINDOW (window);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3961 struct glyph_row *r = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3962 struct glyph_row *end = r + w->current_matrix->nrows - 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3963
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3964 for (; r < end && r->enabled_p; ++r)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3965 if (r->y <= y && r->y + r->height > y)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3966 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3967 /* Found the row at y. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3968 struct glyph *g = r->glyphs[TEXT_AREA];
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3969 struct glyph *end = g + r->used[TEXT_AREA];
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3970 int gx;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3971
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3972 rect->top = WINDOW_TO_FRAME_PIXEL_Y (w, r->y);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3973 rect->bottom = rect->top + r->height;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3974
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3975 if (x < r->x)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3976 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3977 /* x is to the left of the first glyph in the row. */
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
3978 /* Shouldn't this be a pixel value?
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
3979 WINDOW_LEFT_EDGE_X (w) seems to be the right value.
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
3980 ++KFS */
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
3981 rect->left = WINDOW_LEFT_EDGE_COL (w);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3982 rect->right = WINDOW_TO_FRAME_PIXEL_X (w, r->x);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3983 return 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3984 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3985
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3986 for (gx = r->x; g < end; gx += g->pixel_width, ++g)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3987 if (gx <= x && gx + g->pixel_width > x)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3988 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3989 /* x is on a glyph. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3990 rect->left = WINDOW_TO_FRAME_PIXEL_X (w, gx);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3991 rect->right = rect->left + g->pixel_width;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3992 return 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3993 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3994
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3995 /* x is to the right of the last glyph in the row. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
3996 rect->left = WINDOW_TO_FRAME_PIXEL_X (w, gx);
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
3997 /* Shouldn't this be a pixel value?
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
3998 WINDOW_RIGHT_EDGE_X (w) seems to be the right value.
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
3999 ++KFS */
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
4000 rect->right = WINDOW_RIGHT_EDGE_COL (w);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4001 return 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4002 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4003 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4004
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4005 /* The y is not on any row. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4006 return 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4007 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4008
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
4009 /* MAC TODO: This should be called from somewhere (or removed) ++KFS */
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
4010
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4011 /* Record the position of the mouse in last_mouse_glyph. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4012 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4013 remember_mouse_glyph (f1, gx, gy)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4014 struct frame * f1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4015 int gx, gy;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4016 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4017 if (!glyph_rect (f1, gx, gy, &last_mouse_glyph))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4018 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4019 int width = FRAME_SMALLEST_CHAR_WIDTH (f1);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4020 int height = FRAME_SMALLEST_FONT_HEIGHT (f1);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4021
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
4022 /* Arrange for the division in FRAME_PIXEL_X_TO_COL etc. to
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4023 round down even for negative values. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4024 if (gx < 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4025 gx -= width - 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4026 if (gy < 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4027 gy -= height - 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4028 #if 0
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4029 /* This was the original code from XTmouse_position, but it seems
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4030 to give the position of the glyph diagonally next to the one
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4031 the mouse is over. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4032 gx = (gx + width - 1) / width * width;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4033 gy = (gy + height - 1) / height * height;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4034 #else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4035 gx = gx / width * width;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4036 gy = gy / height * height;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4037 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4038
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4039 last_mouse_glyph.left = gx;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4040 last_mouse_glyph.top = gy;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4041 last_mouse_glyph.right = gx + width;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4042 last_mouse_glyph.bottom = gy + height;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4043 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4044 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4045
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
4046
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
4047 static struct frame *
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
4048 mac_focus_frame (dpyinfo)
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
4049 struct mac_display_info *dpyinfo;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
4050 {
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
4051 if (dpyinfo->x_focus_frame)
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
4052 return dpyinfo->x_focus_frame;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
4053 else
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
4054 /* Mac version may get events, such as a menu bar click, even when
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
4055 all the frames are invisible. In this case, we regard the
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
4056 event came to the selected frame. */
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
4057 return SELECTED_FRAME ();
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
4058 }
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
4059
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
4060
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4061 /* Return the current position of the mouse.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4062 *fp should be a frame which indicates which display to ask about.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4063
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4064 If the mouse movement started in a scroll bar, set *fp, *bar_window,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4065 and *part to the frame, window, and scroll bar part that the mouse
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4066 is over. Set *x and *y to the portion and whole of the mouse's
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4067 position on the scroll bar.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4068
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4069 If the mouse movement started elsewhere, set *fp to the frame the
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4070 mouse is on, *bar_window to nil, and *x and *y to the character cell
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4071 the mouse is over.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4072
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4073 Set *time to the server time-stamp for the time at which the mouse
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4074 was at this position.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4075
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4076 Don't store anything if we don't have a valid set of values to report.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4077
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4078 This clears the mouse_moved flag, so we can wait for the next mouse
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4079 movement. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4080
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4081 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4082 XTmouse_position (fp, insist, bar_window, part, x, y, time)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4083 FRAME_PTR *fp;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4084 int insist;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4085 Lisp_Object *bar_window;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4086 enum scroll_bar_part *part;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4087 Lisp_Object *x, *y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4088 unsigned long *time;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4089 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4090 Point mouse_pos;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4091 int ignore1, ignore2;
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
4092 struct frame *f = mac_focus_frame (FRAME_MAC_DISPLAY_INFO (*fp));
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
4093 WindowPtr wp = FRAME_MAC_WINDOW (f);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4094 Lisp_Object frame, tail;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4095
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4096 BLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4097
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4098 if (! NILP (last_mouse_scroll_bar) && insist == 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4099 x_scroll_bar_report_motion (fp, bar_window, part, x, y, time);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4100 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4101 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4102 /* Clear the mouse-moved flag for every frame on this display. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4103 FOR_EACH_FRAME (tail, frame)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4104 XFRAME (frame)->mouse_moved = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4105
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4106 last_mouse_scroll_bar = Qnil;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4107
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
4108 SetPortWindowPort (wp);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4109
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4110 GetMouse (&mouse_pos);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4111
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4112 pixel_to_glyph_coords (f, mouse_pos.h, mouse_pos.v, &ignore1, &ignore2,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4113 &last_mouse_glyph, insist);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4114
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4115 *bar_window = Qnil;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4116 *part = scroll_bar_handle;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4117 *fp = f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4118 XSETINT (*x, mouse_pos.h);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4119 XSETINT (*y, mouse_pos.v);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4120 *time = last_mouse_movement_time;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4121 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
4122
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4123 UNBLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4124 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4125
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4126
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4127 /************************************************************************
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4128 Toolkit scroll bars
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4129 ************************************************************************/
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4130
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4131 #ifdef USE_TOOLKIT_SCROLL_BARS
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4132
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4133 static pascal void scroll_bar_timer_callback P_ ((EventLoopTimerRef, void *));
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4134 static OSStatus install_scroll_bar_timer P_ ((void));
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4135 static OSStatus set_scroll_bar_timer P_ ((EventTimerInterval));
62281
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
4136 static int control_part_code_to_scroll_bar_part P_ ((ControlPartCode));
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4137 static void construct_scroll_bar_click P_ ((struct scroll_bar *, int,
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4138 unsigned long,
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4139 struct input_event *));
62281
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
4140 static OSErr get_control_part_bounds P_ ((ControlHandle, ControlPartCode,
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
4141 Rect *));
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4142 static void x_scroll_bar_handle_press P_ ((struct scroll_bar *,
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4143 ControlPartCode,
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4144 unsigned long,
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4145 struct input_event *));
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4146 static void x_scroll_bar_handle_release P_ ((struct scroll_bar *,
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4147 unsigned long,
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4148 struct input_event *));
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4149 static void x_scroll_bar_handle_drag P_ ((WindowPtr, struct scroll_bar *,
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4150 Point, unsigned long,
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4151 struct input_event *));
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4152 static void x_set_toolkit_scroll_bar_thumb P_ ((struct scroll_bar *,
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4153 int, int, int));
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4154
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4155 /* Last scroll bar part sent in x_scroll_bar_handle_*. */
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4156
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4157 static int last_scroll_bar_part;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4158
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4159 static EventLoopTimerRef scroll_bar_timer;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4160
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4161 static int scroll_bar_timer_event_posted_p;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4162
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4163 #define SCROLL_BAR_FIRST_DELAY 0.5
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4164 #define SCROLL_BAR_CONTINUOUS_DELAY (1.0 / 15)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4165
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4166 static pascal void
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4167 scroll_bar_timer_callback (timer, data)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4168 EventLoopTimerRef timer;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4169 void *data;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4170 {
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4171 EventRef event = NULL;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4172 OSErr err;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4173
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4174 err = CreateEvent (NULL, kEventClassMouse, kEventMouseMoved, 0,
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4175 kEventAttributeNone, &event);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4176 if (err == noErr)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4177 {
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4178 Point mouse_pos;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4179
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4180 GetMouse (&mouse_pos);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4181 LocalToGlobal (&mouse_pos);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4182 err = SetEventParameter (event, kEventParamMouseLocation, typeQDPoint,
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4183 sizeof (Point), &mouse_pos);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4184 }
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4185 if (err == noErr)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4186 {
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4187 UInt32 modifiers = GetCurrentKeyModifiers ();
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4188
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4189 err = SetEventParameter (event, kEventParamKeyModifiers, typeUInt32,
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4190 sizeof (UInt32), &modifiers);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4191 }
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4192 if (err == noErr)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4193 err = PostEventToQueue (GetCurrentEventQueue (), event,
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4194 kEventPriorityStandard);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4195 if (err == noErr)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4196 scroll_bar_timer_event_posted_p = 1;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4197
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4198 if (event)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4199 ReleaseEvent (event);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4200 }
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4201
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4202 static OSStatus
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4203 install_scroll_bar_timer ()
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4204 {
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4205 static EventLoopTimerUPP scroll_bar_timer_callbackUPP = NULL;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4206
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4207 if (scroll_bar_timer_callbackUPP == NULL)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4208 scroll_bar_timer_callbackUPP =
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4209 NewEventLoopTimerUPP (scroll_bar_timer_callback);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4210
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4211 if (scroll_bar_timer == NULL)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4212 /* Mac OS X and CarbonLib 1.5 and later allow us to specify
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4213 kEventDurationForever as delays. */
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4214 return
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4215 InstallEventLoopTimer (GetCurrentEventLoop (),
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4216 kEventDurationForever, kEventDurationForever,
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4217 scroll_bar_timer_callbackUPP, NULL,
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4218 &scroll_bar_timer);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4219 }
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4220
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4221 static OSStatus
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4222 set_scroll_bar_timer (delay)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4223 EventTimerInterval delay;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4224 {
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4225 if (scroll_bar_timer == NULL)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4226 install_scroll_bar_timer ();
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4227
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4228 scroll_bar_timer_event_posted_p = 0;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4229
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4230 return SetEventLoopTimerNextFireTime (scroll_bar_timer, delay);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4231 }
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4232
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4233 static int
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4234 control_part_code_to_scroll_bar_part (part_code)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4235 ControlPartCode part_code;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4236 {
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4237 switch (part_code)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4238 {
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4239 case kControlUpButtonPart: return scroll_bar_up_arrow;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4240 case kControlDownButtonPart: return scroll_bar_down_arrow;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4241 case kControlPageUpPart: return scroll_bar_above_handle;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4242 case kControlPageDownPart: return scroll_bar_below_handle;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4243 case kControlIndicatorPart: return scroll_bar_handle;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4244 }
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4245
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4246 return -1;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4247 }
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4248
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4249 static void
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4250 construct_scroll_bar_click (bar, part, timestamp, bufp)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4251 struct scroll_bar *bar;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4252 int part;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4253 unsigned long timestamp;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4254 struct input_event *bufp;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4255 {
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4256 bufp->kind = SCROLL_BAR_CLICK_EVENT;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4257 bufp->frame_or_window = bar->window;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4258 bufp->arg = Qnil;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4259 bufp->part = part;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4260 bufp->code = 0;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4261 bufp->timestamp = timestamp;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4262 XSETINT (bufp->x, 0);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4263 XSETINT (bufp->y, 0);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4264 bufp->modifiers = 0;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4265 }
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4266
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4267 static OSErr
62281
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
4268 get_control_part_bounds (ch, part_code, rect)
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4269 ControlHandle ch;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4270 ControlPartCode part_code;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4271 Rect *rect;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4272 {
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4273 RgnHandle region = NewRgn ();
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4274 OSStatus err;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4275
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4276 err = GetControlRegion (ch, part_code, region);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4277 if (err == noErr)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4278 GetRegionBounds (region, rect);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4279 DisposeRgn (region);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4280
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4281 return err;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4282 }
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4283
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4284 static void
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4285 x_scroll_bar_handle_press (bar, part_code, timestamp, bufp)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4286 struct scroll_bar *bar;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4287 ControlPartCode part_code;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4288 unsigned long timestamp;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4289 struct input_event *bufp;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4290 {
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4291 int part = control_part_code_to_scroll_bar_part (part_code);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4292
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4293 if (part < 0)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4294 return;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4295
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4296 if (part != scroll_bar_handle)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4297 {
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4298 construct_scroll_bar_click (bar, part, timestamp, bufp);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4299 HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), part_code);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4300 set_scroll_bar_timer (SCROLL_BAR_FIRST_DELAY);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4301 }
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4302
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4303 last_scroll_bar_part = part;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4304 bar->dragging = Qnil;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4305 tracked_scroll_bar = bar;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4306 }
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4307
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4308 static void
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4309 x_scroll_bar_handle_release (bar, timestamp, bufp)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4310 struct scroll_bar *bar;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4311 unsigned long timestamp;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4312 struct input_event *bufp;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4313 {
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4314 if (last_scroll_bar_part != scroll_bar_handle
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4315 || !GC_NILP (bar->dragging))
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4316 construct_scroll_bar_click (bar, scroll_bar_end_scroll, timestamp, bufp);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4317
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4318 HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), 0);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4319 set_scroll_bar_timer (kEventDurationForever);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4320
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4321 last_scroll_bar_part = -1;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4322 bar->dragging = Qnil;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4323 tracked_scroll_bar = NULL;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4324 }
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4325
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4326 static void
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4327 x_scroll_bar_handle_drag (win, bar, mouse_pos, timestamp, bufp)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4328 WindowPtr win;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4329 struct scroll_bar *bar;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4330 Point mouse_pos;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4331 unsigned long timestamp;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4332 struct input_event *bufp;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4333 {
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4334 ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4335
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4336 if (last_scroll_bar_part == scroll_bar_handle)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4337 {
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4338 int top, top_range;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4339 Rect r;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4340
62281
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
4341 get_control_part_bounds (SCROLL_BAR_CONTROL_HANDLE (bar),
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
4342 kControlIndicatorPart, &r);
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4343
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4344 if (GC_NILP (bar->dragging))
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4345 XSETINT (bar->dragging, mouse_pos.v - r.top);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4346
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4347 top = mouse_pos.v - XINT (bar->dragging) - XINT (bar->track_top);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4348 top_range = (XINT (bar->track_height) - (r.bottom - r.top)) *
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4349 (1.0 + (float) GetControlViewSize (ch) / GetControl32BitMaximum (ch))
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4350 + .5;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4351
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4352 if (top < 0)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4353 top = 0;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4354 if (top > top_range)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4355 top = top_range;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4356
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4357 construct_scroll_bar_click (bar, scroll_bar_handle, timestamp, bufp);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4358 XSETINT (bufp->x, top);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4359 XSETINT (bufp->y, top_range);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4360 }
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
4361 else
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4362 {
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4363 ControlPartCode part_code;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4364 int unhilite_p = 0, part;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4365
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4366 if (ch != FindControlUnderMouse (mouse_pos, win, &part_code))
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4367 unhilite_p = 1;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4368 else
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4369 {
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4370 part = control_part_code_to_scroll_bar_part (part_code);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4371
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4372 switch (last_scroll_bar_part)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4373 {
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4374 case scroll_bar_above_handle:
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4375 case scroll_bar_below_handle:
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4376 if (part != scroll_bar_above_handle
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4377 && part != scroll_bar_below_handle)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4378 unhilite_p = 1;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4379 break;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4380
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4381 case scroll_bar_up_arrow:
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4382 case scroll_bar_down_arrow:
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4383 if (part != scroll_bar_up_arrow
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4384 && part != scroll_bar_down_arrow)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4385 unhilite_p = 1;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4386 break;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4387 }
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4388 }
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4389
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4390 if (unhilite_p)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4391 HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), 0);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4392 else if (part != last_scroll_bar_part
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4393 || scroll_bar_timer_event_posted_p)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4394 {
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4395 construct_scroll_bar_click (bar, part, timestamp, bufp);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4396 last_scroll_bar_part = part;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4397 HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), part_code);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4398 set_scroll_bar_timer (SCROLL_BAR_CONTINUOUS_DELAY);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4399 }
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4400 }
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4401 }
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4402
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4403 /* Set the thumb size and position of scroll bar BAR. We are currently
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4404 displaying PORTION out of a whole WHOLE, and our position POSITION. */
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4405
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4406 static void
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4407 x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4408 struct scroll_bar *bar;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4409 int portion, position, whole;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4410 {
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4411 ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4412
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4413 int value, viewsize, maximum;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4414
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4415 if (whole == 0 || XINT (bar->track_height) == 0)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4416 value = 0, viewsize = 1, maximum = 0;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4417 else
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4418 {
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4419 value = position;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4420 viewsize = portion;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4421 maximum = max (0, whole - portion);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4422 }
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4423
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4424 BLOCK_INPUT;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4425
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4426 SetControl32BitMinimum (ch, 0);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4427 SetControl32BitMaximum (ch, maximum);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4428 SetControl32BitValue (ch, value);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4429 SetControlViewSize (ch, viewsize);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4430
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4431 UNBLOCK_INPUT;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4432 }
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4433
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4434 #endif /* USE_TOOLKIT_SCROLL_BARS */
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4435
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
4436
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
4437
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4438 /************************************************************************
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4439 Scroll bars, general
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4440 ************************************************************************/
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
4441
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4442 /* Create a scroll bar and return the scroll bar vector for it. W is
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4443 the Emacs window on which to create the scroll bar. TOP, LEFT,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4444 WIDTH and HEIGHT are the pixel coordinates and dimensions of the
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4445 scroll bar. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4446
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4447 static struct scroll_bar *
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4448 x_scroll_bar_create (w, top, left, width, height, disp_top, disp_height)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4449 struct window *w;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4450 int top, left, width, height, disp_top, disp_height;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4451 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4452 struct frame *f = XFRAME (w->frame);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4453 struct scroll_bar *bar
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4454 = XSCROLL_BAR (Fmake_vector (make_number (SCROLL_BAR_VEC_SIZE), Qnil));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4455 Rect r;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4456 ControlHandle ch;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4457
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4458 BLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4459
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4460 r.left = left;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4461 r.top = disp_top;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4462 r.right = left + width;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4463 r.bottom = disp_top + disp_height;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
4464
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
4465 #if TARGET_API_MAC_CARBON
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4466 ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", 1, 0, 0, 0,
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4467 kControlScrollBarProc, (long) bar);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4468 #else
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4469 ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", 1, 0, 0, 0,
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4470 scrollBarProc, (long) bar);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4471 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4472 SET_SCROLL_BAR_CONTROL_HANDLE (bar, ch);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4473
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4474 XSETWINDOW (bar->window, w);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4475 XSETINT (bar->top, top);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4476 XSETINT (bar->left, left);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4477 XSETINT (bar->width, width);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4478 XSETINT (bar->height, height);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4479 XSETINT (bar->start, 0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4480 XSETINT (bar->end, 0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4481 bar->dragging = Qnil;
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4482 #ifdef USE_TOOLKIT_SCROLL_BARS
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4483 bar->track_top = Qnil;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4484 bar->track_height = Qnil;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4485 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4486
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4487 /* Add bar to its frame's list of scroll bars. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4488 bar->next = FRAME_SCROLL_BARS (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4489 bar->prev = Qnil;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4490 XSETVECTOR (FRAME_SCROLL_BARS (f), bar);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4491 if (!NILP (bar->next))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4492 XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4493
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4494 UNBLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4495 return bar;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4496 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4497
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4498
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4499 /* Draw BAR's handle in the proper position.
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
4500
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4501 If the handle is already drawn from START to END, don't bother
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4502 redrawing it, unless REBUILD is non-zero; in that case, always
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4503 redraw it. (REBUILD is handy for drawing the handle after expose
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4504 events.)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4505
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4506 Normally, we want to constrain the start and end of the handle to
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4507 fit inside its rectangle, but if the user is dragging the scroll
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4508 bar handle, we want to let them drag it down all the way, so that
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4509 the bar's top is as far down as it goes; otherwise, there's no way
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4510 to move to the very end of the buffer. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4511
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4512 #ifndef USE_TOOLKIT_SCROLL_BARS
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4513
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4514 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4515 x_scroll_bar_set_handle (bar, start, end, rebuild)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4516 struct scroll_bar *bar;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4517 int start, end;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4518 int rebuild;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4519 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4520 int dragging = ! NILP (bar->dragging);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4521 ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4522 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4523 int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, XINT (bar->height));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4524 int length = end - start;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4525
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4526 /* If the display is already accurate, do nothing. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4527 if (! rebuild
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4528 && start == XINT (bar->start)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4529 && end == XINT (bar->end))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4530 return;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4531
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4532 BLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4533
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4534 /* Make sure the values are reasonable, and try to preserve the
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4535 distance between start and end. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4536 if (start < 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4537 start = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4538 else if (start > top_range)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4539 start = top_range;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4540 end = start + length;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
4541
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4542 if (end < start)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4543 end = start;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4544 else if (end > top_range && ! dragging)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4545 end = top_range;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4546
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4547 /* Store the adjusted setting in the scroll bar. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4548 XSETINT (bar->start, start);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4549 XSETINT (bar->end, end);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4550
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4551 /* Clip the end position, just for display. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4552 if (end > top_range)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4553 end = top_range;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4554
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4555 /* Draw bottom positions VERTICAL_SCROLL_BAR_MIN_HANDLE pixels below
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4556 top positions, to make sure the handle is always at least that
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4557 many pixels tall. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4558 end += VERTICAL_SCROLL_BAR_MIN_HANDLE;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4559
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4560 SetControlMinimum (ch, 0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4561 /* Don't inadvertently activate deactivated scroll bars */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4562 if (GetControlMaximum (ch) != -1)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4563 SetControlMaximum (ch, top_range + VERTICAL_SCROLL_BAR_MIN_HANDLE
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4564 - (end - start));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4565 SetControlValue (ch, start);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4566 #if TARGET_API_MAC_CARBON
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4567 SetControlViewSize (ch, end - start);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4568 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4569
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4570 UNBLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4571 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4572
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4573 #endif /* !USE_TOOLKIT_SCROLL_BARS */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4574
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4575 /* Destroy scroll bar BAR, and set its Emacs window's scroll bar to
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4576 nil. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4577
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4578 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4579 x_scroll_bar_remove (bar)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4580 struct scroll_bar *bar;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4581 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4582 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4583
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4584 BLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4585
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4586 /* Destroy the Mac scroll bar control */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4587 DisposeControl (SCROLL_BAR_CONTROL_HANDLE (bar));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4588
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4589 /* Disassociate this scroll bar from its window. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4590 XWINDOW (bar->window)->vertical_scroll_bar = Qnil;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4591
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4592 UNBLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4593 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4594
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4595 /* Set the handle of the vertical scroll bar for WINDOW to indicate
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4596 that we are displaying PORTION characters out of a total of WHOLE
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4597 characters, starting at POSITION. If WINDOW has no scroll bar,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4598 create one. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4599 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4600 XTset_vertical_scroll_bar (w, portion, whole, position)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4601 struct window *w;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4602 int portion, whole, position;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4603 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4604 struct frame *f = XFRAME (w->frame);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4605 struct scroll_bar *bar;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4606 int top, height, left, sb_left, width, sb_width, disp_top, disp_height;
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
4607 int window_y, window_height;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4608
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4609 /* Get window dimensions. */
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
4610 window_box (w, -1, 0, &window_y, 0, &window_height);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4611 top = window_y;
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
4612 width = WINDOW_CONFIG_SCROLL_BAR_COLS (w) * FRAME_COLUMN_WIDTH (f);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4613 height = window_height;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4614
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4615 /* Compute the left edge of the scroll bar area. */
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
4616 left = WINDOW_SCROLL_BAR_AREA_X (w);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4617
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4618 /* Compute the width of the scroll bar which might be less than
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4619 the width of the area reserved for the scroll bar. */
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
4620 if (WINDOW_CONFIG_SCROLL_BAR_WIDTH (w) > 0)
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
4621 sb_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4622 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4623 sb_width = width;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4624
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4625 /* Compute the left edge of the scroll bar. */
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
4626 if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4627 sb_left = left;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4628 else
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4629 sb_left = left + width - sb_width;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
4630
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4631 /* Adjustments according to Inside Macintosh to make it look nice */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4632 disp_top = top;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4633 disp_height = height;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4634 if (disp_top == 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4635 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4636 disp_top = -1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4637 disp_height++;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4638 }
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
4639 else if (disp_top == FRAME_PIXEL_HEIGHT (f) - 16)
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4640 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4641 disp_top++;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4642 disp_height--;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4643 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
4644
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
4645 if (sb_left + sb_width == FRAME_PIXEL_WIDTH (f))
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4646 sb_left++;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
4647
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4648 /* Does the scroll bar exist yet? */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4649 if (NILP (w->vertical_scroll_bar))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4650 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4651 BLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4652 XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4653 left, top, width, height, 0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4654 UNBLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4655 bar = x_scroll_bar_create (w, top, sb_left, sb_width, height, disp_top,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4656 disp_height);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4657 XSETVECTOR (w->vertical_scroll_bar, bar);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4658 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4659 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4660 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4661 /* It may just need to be moved and resized. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4662 ControlHandle ch;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
4663
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4664 bar = XSCROLL_BAR (w->vertical_scroll_bar);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4665 ch = SCROLL_BAR_CONTROL_HANDLE (bar);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4666
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4667 BLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4668
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4669 /* If already correctly positioned, do nothing. */
62281
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
4670 if (!(XINT (bar->left) == sb_left
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
4671 && XINT (bar->top) == top
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
4672 && XINT (bar->width) == sb_width
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
4673 && XINT (bar->height) == height))
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
4674 {
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4675 /* Clear areas not covered by the scroll bar because it's not as
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4676 wide as the area reserved for it . This makes sure a
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4677 previous mode line display is cleared after C-x 2 C-x 1, for
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4678 example. */
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
4679 int area_width = WINDOW_SCROLL_BAR_AREA_WIDTH (w);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4680 XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4681 left, top, area_width, height, 0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4682
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4683 #if 0
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
4684 if (sb_left + sb_width >= FRAME_PIXEL_WIDTH (f))
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4685 XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4686 sb_left - 1, top, 1, height, 0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4687 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4688
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4689 HideControl (ch);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4690 MoveControl (ch, sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, disp_top);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4691 SizeControl (ch, sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4692 disp_height);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4693 ShowControl (ch);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
4694
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4695 /* Remember new settings. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4696 XSETINT (bar->left, sb_left);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4697 XSETINT (bar->top, top);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4698 XSETINT (bar->width, sb_width);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4699 XSETINT (bar->height, height);
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4700 #ifdef USE_TOOLKIT_SCROLL_BARS
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4701 bar->track_top = Qnil;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4702 bar->track_height = Qnil;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4703 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4704 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4705
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4706 UNBLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4707 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4708
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4709 #ifdef USE_TOOLKIT_SCROLL_BARS
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4710 if (NILP (bar->track_top))
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4711 {
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4712 ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4713 Rect r0, r1;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4714
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4715 BLOCK_INPUT;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4716
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4717 SetControl32BitMinimum (ch, 0);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4718 SetControl32BitMaximum (ch, 1);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4719 SetControlViewSize (ch, 1);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4720
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4721 /* Move the scroll bar thumb to the top. */
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4722 SetControl32BitValue (ch, 0);
62281
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
4723 get_control_part_bounds (ch, kControlIndicatorPart, &r0);
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4724
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4725 /* Move the scroll bar thumb to the bottom. */
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4726 SetControl32BitValue (ch, 1);
62281
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
4727 get_control_part_bounds (ch, kControlIndicatorPart, &r1);
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4728
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4729 UnionRect (&r0, &r1, &r0);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4730 XSETINT (bar->track_top, r0.top);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4731 XSETINT (bar->track_height, r0.bottom - r0.top);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4732
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4733 UNBLOCK_INPUT;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4734 }
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4735
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4736 x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4737 #else /* not USE_TOOLKIT_SCROLL_BARS */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4738 /* Set the scroll bar's current state, unless we're currently being
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4739 dragged. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4740 if (NILP (bar->dragging))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4741 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4742 int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, height);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4743
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4744 if (whole == 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4745 x_scroll_bar_set_handle (bar, 0, top_range, 0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4746 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4747 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4748 int start = ((double) position * top_range) / whole;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4749 int end = ((double) (position + portion) * top_range) / whole;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4750 x_scroll_bar_set_handle (bar, start, end, 0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4751 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4752 }
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4753 #endif /* not USE_TOOLKIT_SCROLL_BARS */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4754 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4755
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4756
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4757 /* The following three hooks are used when we're doing a thorough
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4758 redisplay of the frame. We don't explicitly know which scroll bars
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4759 are going to be deleted, because keeping track of when windows go
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4760 away is a real pain - "Can you say set-window-configuration, boys
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4761 and girls?" Instead, we just assert at the beginning of redisplay
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4762 that *all* scroll bars are to be removed, and then save a scroll bar
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4763 from the fiery pit when we actually redisplay its window. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4764
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4765 /* Arrange for all scroll bars on FRAME to be removed at the next call
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4766 to `*judge_scroll_bars_hook'. A scroll bar may be spared if
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4767 `*redeem_scroll_bar_hook' is applied to its window before the judgment. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4768
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4769 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4770 XTcondemn_scroll_bars (frame)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4771 FRAME_PTR frame;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4772 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4773 /* Transfer all the scroll bars to FRAME_CONDEMNED_SCROLL_BARS. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4774 while (! NILP (FRAME_SCROLL_BARS (frame)))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4775 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4776 Lisp_Object bar;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4777 bar = FRAME_SCROLL_BARS (frame);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4778 FRAME_SCROLL_BARS (frame) = XSCROLL_BAR (bar)->next;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4779 XSCROLL_BAR (bar)->next = FRAME_CONDEMNED_SCROLL_BARS (frame);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4780 XSCROLL_BAR (bar)->prev = Qnil;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4781 if (! NILP (FRAME_CONDEMNED_SCROLL_BARS (frame)))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4782 XSCROLL_BAR (FRAME_CONDEMNED_SCROLL_BARS (frame))->prev = bar;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4783 FRAME_CONDEMNED_SCROLL_BARS (frame) = bar;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4784 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4785 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4786
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4787
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4788 /* Un-mark WINDOW's scroll bar for deletion in this judgment cycle.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4789 Note that WINDOW isn't necessarily condemned at all. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4790
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4791 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4792 XTredeem_scroll_bar (window)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4793 struct window *window;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4794 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4795 struct scroll_bar *bar;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4796
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4797 /* We can't redeem this window's scroll bar if it doesn't have one. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4798 if (NILP (window->vertical_scroll_bar))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4799 abort ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4800
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4801 bar = XSCROLL_BAR (window->vertical_scroll_bar);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4802
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4803 /* Unlink it from the condemned list. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4804 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4805 FRAME_PTR f = XFRAME (WINDOW_FRAME (window));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4806
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4807 if (NILP (bar->prev))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4808 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4809 /* If the prev pointer is nil, it must be the first in one of
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4810 the lists. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4811 if (EQ (FRAME_SCROLL_BARS (f), window->vertical_scroll_bar))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4812 /* It's not condemned. Everything's fine. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4813 return;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4814 else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f),
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4815 window->vertical_scroll_bar))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4816 FRAME_CONDEMNED_SCROLL_BARS (f) = bar->next;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4817 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4818 /* If its prev pointer is nil, it must be at the front of
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4819 one or the other! */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4820 abort ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4821 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4822 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4823 XSCROLL_BAR (bar->prev)->next = bar->next;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4824
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4825 if (! NILP (bar->next))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4826 XSCROLL_BAR (bar->next)->prev = bar->prev;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4827
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4828 bar->next = FRAME_SCROLL_BARS (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4829 bar->prev = Qnil;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4830 XSETVECTOR (FRAME_SCROLL_BARS (f), bar);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4831 if (! NILP (bar->next))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4832 XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4833 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4834 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4835
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4836 /* Remove all scroll bars on FRAME that haven't been saved since the
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4837 last call to `*condemn_scroll_bars_hook'. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4838
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4839 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4840 XTjudge_scroll_bars (f)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4841 FRAME_PTR f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4842 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4843 Lisp_Object bar, next;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4844
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4845 bar = FRAME_CONDEMNED_SCROLL_BARS (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4846
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4847 /* Clear out the condemned list now so we won't try to process any
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4848 more events on the hapless scroll bars. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4849 FRAME_CONDEMNED_SCROLL_BARS (f) = Qnil;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4850
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4851 for (; ! NILP (bar); bar = next)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4852 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4853 struct scroll_bar *b = XSCROLL_BAR (bar);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4854
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4855 x_scroll_bar_remove (b);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4856
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4857 next = b->next;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4858 b->next = b->prev = Qnil;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4859 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4860
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4861 /* Now there should be no references to the condemned scroll bars,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4862 and they should get garbage-collected. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4863 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4864
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4865
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4866 /* Handle a mouse click on the scroll bar BAR. If *EMACS_EVENT's kind
45803
9484de301252 Rename enum event_kind items.
Pavel Janík <Pavel@Janik.cz>
parents: 45197
diff changeset
4867 is set to something other than NO_EVENT, it is enqueued.
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4868
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4869 This may be called from a signal handler, so we have to ignore GC
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4870 mark bits. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4871
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4872 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4873 x_scroll_bar_handle_click (bar, part_code, er, bufp)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4874 struct scroll_bar *bar;
62281
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
4875 ControlPartCode part_code;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4876 EventRecord *er;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4877 struct input_event *bufp;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4878 {
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
4879 int win_y, top_range;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
4880
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4881 if (! GC_WINDOWP (bar->window))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4882 abort ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4883
45803
9484de301252 Rename enum event_kind items.
Pavel Janík <Pavel@Janik.cz>
parents: 45197
diff changeset
4884 bufp->kind = SCROLL_BAR_CLICK_EVENT;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4885 bufp->frame_or_window = bar->window;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4886 bufp->arg = Qnil;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4887
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4888 bar->dragging = Qnil;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
4889
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4890 switch (part_code)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4891 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4892 case kControlUpButtonPart:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4893 bufp->part = scroll_bar_up_arrow;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4894 break;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4895 case kControlDownButtonPart:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4896 bufp->part = scroll_bar_down_arrow;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4897 break;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4898 case kControlPageUpPart:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4899 bufp->part = scroll_bar_above_handle;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4900 break;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4901 case kControlPageDownPart:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4902 bufp->part = scroll_bar_below_handle;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4903 break;
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
4904 #if TARGET_API_MAC_CARBON
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4905 default:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4906 #else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4907 case kControlIndicatorPart:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4908 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4909 if (er->what == mouseDown)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4910 bar->dragging = make_number (0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4911 XSETVECTOR (last_mouse_scroll_bar, bar);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4912 bufp->part = scroll_bar_handle;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4913 break;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4914 }
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
4915
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
4916 win_y = XINT (bufp->y) - XINT (bar->top);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
4917 top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (0/*dummy*/, XINT (bar->height));
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
4918
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
4919 win_y -= VERTICAL_SCROLL_BAR_TOP_BORDER;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
4920
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
4921 win_y -= 24;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
4922
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
4923 if (! NILP (bar->dragging))
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
4924 win_y -= XINT (bar->dragging);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
4925
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
4926 if (win_y < 0)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
4927 win_y = 0;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
4928 if (win_y > top_range)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
4929 win_y = top_range;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
4930
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
4931 XSETINT (bufp->x, win_y);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
4932 XSETINT (bufp->y, top_range);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4933 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4934
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4935 #ifndef USE_TOOLKIT_SCROLL_BARS
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4936
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4937 /* Handle some mouse motion while someone is dragging the scroll bar.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4938
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4939 This may be called from a signal handler, so we have to ignore GC
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4940 mark bits. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4941
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4942 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4943 x_scroll_bar_note_movement (bar, y_pos, t)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4944 struct scroll_bar *bar;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4945 int y_pos;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4946 Time t;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4947 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4948 FRAME_PTR f = XFRAME (XWINDOW (bar->window)->frame);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4949
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4950 last_mouse_movement_time = t;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4951
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4952 f->mouse_moved = 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4953 XSETVECTOR (last_mouse_scroll_bar, bar);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4954
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4955 /* If we're dragging the bar, display it. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4956 if (! GC_NILP (bar->dragging))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4957 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4958 /* Where should the handle be now? */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4959 int new_start = y_pos - 24;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4960
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4961 if (new_start != XINT (bar->start))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4962 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4963 int new_end = new_start + (XINT (bar->end) - XINT (bar->start));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4964
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4965 x_scroll_bar_set_handle (bar, new_start, new_end, 0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4966 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4967 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4968 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4969
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
4970 #endif /* !USE_TOOLKIT_SCROLL_BARS */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4971
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4972 /* Return information to the user about the current position of the
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4973 mouse on the scroll bar. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4974
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4975 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4976 x_scroll_bar_report_motion (fp, bar_window, part, x, y, time)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4977 FRAME_PTR *fp;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4978 Lisp_Object *bar_window;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4979 enum scroll_bar_part *part;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4980 Lisp_Object *x, *y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4981 unsigned long *time;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4982 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4983 struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar);
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
4984 ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar);
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
4985 #if TARGET_API_MAC_CARBON
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
4986 WindowPtr wp = GetControlOwner (ch);
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
4987 #else
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
4988 WindowPtr wp = (*ch)->contrlOwner;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
4989 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4990 Point mouse_pos;
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
4991 struct frame *f = mac_window_to_frame (wp);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4992 int win_y, top_range;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4993
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
4994 SetPortWindowPort (wp);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4995
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4996 GetMouse (&mouse_pos);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4997
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4998 win_y = mouse_pos.v - XINT (bar->top);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
4999 top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, XINT (bar->height));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5000
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5001 win_y -= VERTICAL_SCROLL_BAR_TOP_BORDER;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5002
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5003 win_y -= 24;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5004
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5005 if (! NILP (bar->dragging))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5006 win_y -= XINT (bar->dragging);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5007
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5008 if (win_y < 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5009 win_y = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5010 if (win_y > top_range)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5011 win_y = top_range;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5012
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5013 *fp = f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5014 *bar_window = bar->window;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5015
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5016 if (! NILP (bar->dragging))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5017 *part = scroll_bar_handle;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5018 else if (win_y < XINT (bar->start))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5019 *part = scroll_bar_above_handle;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5020 else if (win_y < XINT (bar->end) + VERTICAL_SCROLL_BAR_MIN_HANDLE)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5021 *part = scroll_bar_handle;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5022 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5023 *part = scroll_bar_below_handle;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5024
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5025 XSETINT (*x, win_y);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5026 XSETINT (*y, top_range);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5027
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5028 f->mouse_moved = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5029 last_mouse_scroll_bar = Qnil;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5030
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5031 *time = last_mouse_movement_time;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5032 }
62281
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
5033
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
5034
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
5035 /* The screen has been cleared so we may have changed foreground or
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
5036 background colors, and the scroll bars may need to be redrawn.
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
5037 Clear out the scroll bars, and ask for expose events, so we can
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
5038 redraw them. */
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
5039
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
5040 void
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
5041 x_scroll_bar_clear (f)
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
5042 FRAME_PTR f;
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
5043 {
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
5044 XTcondemn_scroll_bars (f);
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
5045 XTjudge_scroll_bars (f);
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
5046 }
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
5047
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5048
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5049 /***********************************************************************
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5050 Text Cursor
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5051 ***********************************************************************/
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5052
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5053 /* Set clipping for output in glyph row ROW. W is the window in which
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5054 we operate. GC is the graphics context to set clipping in.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5055
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5056 ROW may be a text row or, e.g., a mode line. Text rows must be
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5057 clipped to the interior of the window dedicated to text display,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5058 mode lines must be clipped to the whole window. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5059
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5060 static void
58403
c936fa56eb60 (x_clip_to_row): Add area arg. Callers changed.
Kim F. Storm <storm@cua.dk>
parents: 57783
diff changeset
5061 x_clip_to_row (w, row, area, gc)
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5062 struct window *w;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5063 struct glyph_row *row;
58403
c936fa56eb60 (x_clip_to_row): Add area arg. Callers changed.
Kim F. Storm <storm@cua.dk>
parents: 57783
diff changeset
5064 int area;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5065 GC gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5066 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5067 struct frame *f = XFRAME (WINDOW_FRAME (w));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5068 Rect clip_rect;
58403
c936fa56eb60 (x_clip_to_row): Add area arg. Callers changed.
Kim F. Storm <storm@cua.dk>
parents: 57783
diff changeset
5069 int window_x, window_y, window_width;
c936fa56eb60 (x_clip_to_row): Add area arg. Callers changed.
Kim F. Storm <storm@cua.dk>
parents: 57783
diff changeset
5070
c936fa56eb60 (x_clip_to_row): Add area arg. Callers changed.
Kim F. Storm <storm@cua.dk>
parents: 57783
diff changeset
5071 window_box (w, area, &window_x, &window_y, &window_width, 0);
c936fa56eb60 (x_clip_to_row): Add area arg. Callers changed.
Kim F. Storm <storm@cua.dk>
parents: 57783
diff changeset
5072
c936fa56eb60 (x_clip_to_row): Add area arg. Callers changed.
Kim F. Storm <storm@cua.dk>
parents: 57783
diff changeset
5073 clip_rect.left = window_x;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5074 clip_rect.top = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5075 clip_rect.top = max (clip_rect.top, window_y);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5076 clip_rect.right = clip_rect.left + window_width;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5077 clip_rect.bottom = clip_rect.top + row->visible_height;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5078
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5079 mac_set_clip_rectangle (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f), &clip_rect);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5080 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5081
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5082
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5083 /* Draw a hollow box cursor on window W in glyph row ROW. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5084
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5085 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5086 x_draw_hollow_cursor (w, row)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5087 struct window *w;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5088 struct glyph_row *row;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5089 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5090 struct frame *f = XFRAME (WINDOW_FRAME (w));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5091 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5092 Display *dpy = FRAME_MAC_DISPLAY (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5093 int x, y, wd, h;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5094 XGCValues xgcv;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5095 struct glyph *cursor_glyph;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5096 GC gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5097
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5098 /* Get the glyph the cursor is on. If we can't tell because
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5099 the current matrix is invalid or such, give up. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5100 cursor_glyph = get_phys_cursor_glyph (w);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5101 if (cursor_glyph == NULL)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5102 return;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5103
59748
1df465faf1df (x_draw_hollow_cursor): Use get_phys_cursor_geometry.
Kim F. Storm <storm@cua.dk>
parents: 59718
diff changeset
5104 /* Compute frame-relative coordinates for phys cursor. */
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5105 x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x);
59748
1df465faf1df (x_draw_hollow_cursor): Use get_phys_cursor_geometry.
Kim F. Storm <storm@cua.dk>
parents: 59718
diff changeset
5106 y = get_phys_cursor_geometry (w, row, cursor_glyph, &h);
1df465faf1df (x_draw_hollow_cursor): Use get_phys_cursor_geometry.
Kim F. Storm <storm@cua.dk>
parents: 59718
diff changeset
5107 wd = w->phys_cursor_width;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
5108
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5109 /* The foreground of cursor_gc is typically the same as the normal
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5110 background color, which can cause the cursor box to be invisible. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5111 xgcv.foreground = f->output_data.mac->cursor_pixel;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5112 if (dpyinfo->scratch_cursor_gc)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5113 XChangeGC (dpy, dpyinfo->scratch_cursor_gc, GCForeground, &xgcv);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5114 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5115 dpyinfo->scratch_cursor_gc = XCreateGC (dpy, FRAME_MAC_WINDOW (f),
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5116 GCForeground, &xgcv);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5117 gc = dpyinfo->scratch_cursor_gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5118
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5119 /* Set clipping, draw the rectangle, and reset clipping again. */
58403
c936fa56eb60 (x_clip_to_row): Add area arg. Callers changed.
Kim F. Storm <storm@cua.dk>
parents: 57783
diff changeset
5120 x_clip_to_row (w, row, TEXT_AREA, gc);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5121 mac_draw_rectangle (dpy, FRAME_MAC_WINDOW (f), gc, x, y, wd, h);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5122 mac_reset_clipping (dpy, FRAME_MAC_WINDOW (f));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5123 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5124
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5125
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5126 /* Draw a bar cursor on window W in glyph row ROW.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5127
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5128 Implementation note: One would like to draw a bar cursor with an
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5129 angle equal to the one given by the font property XA_ITALIC_ANGLE.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5130 Unfortunately, I didn't find a font yet that has this property set.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5131 --gerd. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5132
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5133 static void
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5134 x_draw_bar_cursor (w, row, width, kind)
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5135 struct window *w;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5136 struct glyph_row *row;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5137 int width;
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5138 enum text_cursor_kinds kind;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5139 {
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5140 struct frame *f = XFRAME (w->frame);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5141 struct glyph *cursor_glyph;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5142
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5143 /* If cursor is out of bounds, don't draw garbage. This can happen
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5144 in mini-buffer windows when switching between echo area glyphs
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5145 and mini-buffer. */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5146 cursor_glyph = get_phys_cursor_glyph (w);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5147 if (cursor_glyph == NULL)
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5148 return;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5149
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5150 /* If on an image, draw like a normal cursor. That's usually better
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5151 visible than drawing a bar, esp. if the image is large so that
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5152 the bar might not be in the window. */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5153 if (cursor_glyph->type == IMAGE_GLYPH)
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5154 {
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5155 struct glyph_row *row;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5156 row = MATRIX_ROW (w->current_matrix, w->phys_cursor.vpos);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5157 draw_phys_cursor_glyph (w, row, DRAW_CURSOR);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5158 }
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5159 else
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5160 {
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5161 Display *dpy = FRAME_MAC_DISPLAY (f);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5162 Window window = FRAME_MAC_WINDOW (f);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5163 GC gc = FRAME_MAC_DISPLAY_INFO (f)->scratch_cursor_gc;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5164 unsigned long mask = GCForeground | GCBackground;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5165 struct face *face = FACE_FROM_ID (f, cursor_glyph->face_id);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5166 XGCValues xgcv;
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5167
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5168 /* If the glyph's background equals the color we normally draw
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5169 the bar cursor in, the bar cursor in its normal color is
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5170 invisible. Use the glyph's foreground color instead in this
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5171 case, on the assumption that the glyph's colors are chosen so
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5172 that the glyph is legible. */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5173 if (face->background == f->output_data.mac->cursor_pixel)
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5174 xgcv.background = xgcv.foreground = face->foreground;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5175 else
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5176 xgcv.background = xgcv.foreground = f->output_data.mac->cursor_pixel;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
5177
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5178 if (gc)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5179 XChangeGC (dpy, gc, mask, &xgcv);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5180 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5181 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5182 gc = XCreateGC (dpy, window, mask, &xgcv);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5183 FRAME_MAC_DISPLAY_INFO (f)->scratch_cursor_gc = gc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5184 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5185
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5186 if (width < 0)
47138
4a0541418bc5 (x_specified_cursor_type): Remove prototype.
Kim F. Storm <storm@cua.dk>
parents: 47030
diff changeset
5187 width = FRAME_CURSOR_WIDTH (f);
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5188 width = min (cursor_glyph->pixel_width, width);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5189
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5190 w->phys_cursor_width = width;
58403
c936fa56eb60 (x_clip_to_row): Add area arg. Callers changed.
Kim F. Storm <storm@cua.dk>
parents: 57783
diff changeset
5191 x_clip_to_row (w, row, TEXT_AREA, gc);
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5192
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5193 if (kind == BAR_CURSOR)
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5194 XFillRectangle (dpy, window, gc,
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5195 WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x),
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5196 WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y),
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5197 width, row->height);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5198 else
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5199 XFillRectangle (dpy, window, gc,
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5200 WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x),
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5201 WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y +
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5202 row->height - width),
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5203 cursor_glyph->pixel_width,
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5204 width);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5205
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5206 mac_reset_clipping (dpy, FRAME_MAC_WINDOW (f));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5207 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5208 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5209
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5210
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
5211 /* RIF: Define cursor CURSOR on frame F. */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5212
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5213 static void
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
5214 mac_define_frame_cursor (f, cursor)
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
5215 struct frame *f;
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
5216 Cursor cursor;
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
5217 {
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
5218 SetThemeCursor (cursor);
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
5219 }
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
5220
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
5221
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
5222 /* RIF: Clear area on frame F. */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5223
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5224 static void
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
5225 mac_clear_frame_area (f, x, y, width, height)
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
5226 struct frame *f;
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
5227 int x, y, width, height;
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
5228 {
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
5229 XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
5230 x, y, width, height, 0);
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
5231 }
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
5232
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
5233
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
5234 /* RIF: Draw cursor on window W. */
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
5235
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
5236 static void
50243
3fb54e5a7201 (struct redisplay_interface): Add active_p argument to
Kim F. Storm <storm@cua.dk>
parents: 50222
diff changeset
5237 mac_draw_window_cursor (w, glyph_row, x, y, cursor_type, cursor_width, on_p, active_p)
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5238 struct window *w;
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
5239 struct glyph_row *glyph_row;
50243
3fb54e5a7201 (struct redisplay_interface): Add active_p argument to
Kim F. Storm <storm@cua.dk>
parents: 50222
diff changeset
5240 int x, y;
3fb54e5a7201 (struct redisplay_interface): Add active_p argument to
Kim F. Storm <storm@cua.dk>
parents: 50222
diff changeset
5241 int cursor_type, cursor_width;
3fb54e5a7201 (struct redisplay_interface): Add active_p argument to
Kim F. Storm <storm@cua.dk>
parents: 50222
diff changeset
5242 int on_p, active_p;
3fb54e5a7201 (struct redisplay_interface): Add active_p argument to
Kim F. Storm <storm@cua.dk>
parents: 50222
diff changeset
5243 {
3fb54e5a7201 (struct redisplay_interface): Add active_p argument to
Kim F. Storm <storm@cua.dk>
parents: 50222
diff changeset
5244 if (on_p)
3fb54e5a7201 (struct redisplay_interface): Add active_p argument to
Kim F. Storm <storm@cua.dk>
parents: 50222
diff changeset
5245 {
3fb54e5a7201 (struct redisplay_interface): Add active_p argument to
Kim F. Storm <storm@cua.dk>
parents: 50222
diff changeset
5246 w->phys_cursor_type = cursor_type;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5247 w->phys_cursor_on_p = 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5248
53606
96c29ac603e8 (x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents: 53579
diff changeset
5249 if (glyph_row->exact_window_width_line_p
96c29ac603e8 (x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents: 53579
diff changeset
5250 && w->phys_cursor.hpos >= glyph_row->used[TEXT_AREA])
96c29ac603e8 (x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents: 53579
diff changeset
5251 {
96c29ac603e8 (x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents: 53579
diff changeset
5252 glyph_row->cursor_in_fringe_p = 1;
96c29ac603e8 (x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents: 53579
diff changeset
5253 draw_fringe_bitmap (w, glyph_row, 0);
96c29ac603e8 (x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents: 53579
diff changeset
5254 }
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5255 else
50243
3fb54e5a7201 (struct redisplay_interface): Add active_p argument to
Kim F. Storm <storm@cua.dk>
parents: 50222
diff changeset
5256 switch (cursor_type)
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5257 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5258 case HOLLOW_BOX_CURSOR:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5259 x_draw_hollow_cursor (w, glyph_row);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5260 break;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5261
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5262 case FILLED_BOX_CURSOR:
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
5263 draw_phys_cursor_glyph (w, glyph_row, DRAW_CURSOR);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5264 break;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5265
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5266 case BAR_CURSOR:
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5267 x_draw_bar_cursor (w, glyph_row, cursor_width, BAR_CURSOR);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5268 break;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5269
47138
4a0541418bc5 (x_specified_cursor_type): Remove prototype.
Kim F. Storm <storm@cua.dk>
parents: 47030
diff changeset
5270 case HBAR_CURSOR:
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5271 x_draw_bar_cursor (w, glyph_row, cursor_width, HBAR_CURSOR);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5272 break;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5273
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5274 case NO_CURSOR:
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5275 w->phys_cursor_width = 0;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5276 break;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5277
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5278 default:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5279 abort ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5280 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5281 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5282 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5283
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5284
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5285 /* Icons. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5286
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5287 #if 0 /* MAC_TODO: no icon support yet. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5288 int
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5289 x_bitmap_icon (f, icon)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5290 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5291 Lisp_Object icon;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5292 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5293 HANDLE hicon;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5294
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5295 if (FRAME_W32_WINDOW (f) == 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5296 return 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5297
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5298 if (NILP (icon))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5299 hicon = LoadIcon (hinst, EMACS_CLASS);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5300 else if (STRINGP (icon))
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46169
diff changeset
5301 hicon = LoadImage (NULL, (LPCTSTR) SDATA (icon), IMAGE_ICON, 0, 0,
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5302 LR_DEFAULTSIZE | LR_LOADFROMFILE);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5303 else if (SYMBOLP (icon))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5304 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5305 LPCTSTR name;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5306
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5307 if (EQ (icon, intern ("application")))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5308 name = (LPCTSTR) IDI_APPLICATION;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5309 else if (EQ (icon, intern ("hand")))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5310 name = (LPCTSTR) IDI_HAND;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5311 else if (EQ (icon, intern ("question")))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5312 name = (LPCTSTR) IDI_QUESTION;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5313 else if (EQ (icon, intern ("exclamation")))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5314 name = (LPCTSTR) IDI_EXCLAMATION;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5315 else if (EQ (icon, intern ("asterisk")))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5316 name = (LPCTSTR) IDI_ASTERISK;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5317 else if (EQ (icon, intern ("winlogo")))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5318 name = (LPCTSTR) IDI_WINLOGO;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5319 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5320 return 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5321
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5322 hicon = LoadIcon (NULL, name);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5323 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5324 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5325 return 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5326
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5327 if (hicon == NULL)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5328 return 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5329
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5330 PostMessage (FRAME_W32_WINDOW (f), WM_SETICON, (WPARAM) ICON_BIG,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5331 (LPARAM) hicon);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5332
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5333 return 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5334 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5335 #endif /* MAC_TODO */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5336
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5337 /************************************************************************
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5338 Handling X errors
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5339 ************************************************************************/
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5340
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5341 /* Display Error Handling functions not used on W32. Listing them here
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5342 helps diff stay in step when comparing w32term.c with xterm.c.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5343
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5344 x_error_catcher (display, error)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5345 x_catch_errors (dpy)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5346 x_catch_errors_unwind (old_val)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5347 x_check_errors (dpy, format)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5348 x_had_errors_p (dpy)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5349 x_clear_errors (dpy)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5350 x_uncatch_errors (dpy, count)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5351 x_trace_wire ()
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5352 x_connection_signal (signalnum)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5353 x_connection_closed (dpy, error_message)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5354 x_error_quitter (display, error)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5355 x_error_handler (display, error)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5356 x_io_error_quitter (display)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5357
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5358 */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5359
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5360
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5361 /* Changing the font of the frame. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5362
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5363 /* Give frame F the font named FONTNAME as its default font, and
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5364 return the full name of that font. FONTNAME may be a wildcard
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5365 pattern; in that case, we choose some font that fits the pattern.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5366 The return value shows which font we chose. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5367
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5368 Lisp_Object
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5369 x_new_font (f, fontname)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5370 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5371 register char *fontname;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5372 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5373 struct font_info *fontp
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5374 = FS_LOAD_FONT (f, 0, fontname, -1);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5375
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5376 if (!fontp)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5377 return Qnil;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5378
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5379 FRAME_FONT (f) = (XFontStruct *) (fontp->font);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5380 FRAME_BASELINE_OFFSET (f) = fontp->baseline_offset;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5381 FRAME_FONTSET (f) = -1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5382
59325
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
5383 FRAME_COLUMN_WIDTH (f) = fontp->average_width;
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
5384 FRAME_SPACE_WIDTH (f) = fontp->space_width;
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5385 FRAME_LINE_HEIGHT (f) = FONT_HEIGHT (FRAME_FONT (f));
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5386
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5387 compute_fringe_widths (f, 1);
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5388
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5389 /* Compute the scroll bar width in character columns. */
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5390 if (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0)
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5391 {
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5392 int wid = FRAME_COLUMN_WIDTH (f);
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
5393 FRAME_CONFIG_SCROLL_BAR_COLS (f)
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5394 = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) + wid-1) / wid;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5395 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5396 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5397 {
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5398 int wid = FRAME_COLUMN_WIDTH (f);
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5399 FRAME_CONFIG_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5400 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5401
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5402 /* Now make the frame display the given font. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5403 if (FRAME_MAC_WINDOW (f) != 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5404 {
45848
39cdf9669519 In src/:
Andrew Choi <akochoi@shaw.ca>
parents: 45803
diff changeset
5405 XSetFont (FRAME_MAC_DISPLAY (f), f->output_data.mac->normal_gc,
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5406 FRAME_FONT (f));
45848
39cdf9669519 In src/:
Andrew Choi <akochoi@shaw.ca>
parents: 45803
diff changeset
5407 XSetFont (FRAME_MAC_DISPLAY (f), f->output_data.mac->reverse_gc,
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5408 FRAME_FONT (f));
45848
39cdf9669519 In src/:
Andrew Choi <akochoi@shaw.ca>
parents: 45803
diff changeset
5409 XSetFont (FRAME_MAC_DISPLAY (f), f->output_data.mac->cursor_gc,
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5410 FRAME_FONT (f));
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5411
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
5412 /* Don't change the size of a tip frame; there's no point in
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
5413 doing it because it's done in Fx_show_tip, and it leads to
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
5414 problems because the tip frame has no widget. */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5415 if (NILP (tip_frame) || XFRAME (tip_frame) != f)
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5416 x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5417 }
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5418
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5419 return build_string (fontp->full_name);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5420 }
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
5421
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5422 /* Give frame F the fontset named FONTSETNAME as its default font, and
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5423 return the full name of that fontset. FONTSETNAME may be a wildcard
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5424 pattern; in that case, we choose some fontset that fits the pattern.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5425 The return value shows which fontset we chose. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5426
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5427 Lisp_Object
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5428 x_new_fontset (f, fontsetname)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5429 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5430 char *fontsetname;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5431 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5432 int fontset = fs_query_fontset (build_string (fontsetname), 0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5433 Lisp_Object result;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5434
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5435 if (fontset < 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5436 return Qnil;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5437
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5438 if (FRAME_FONTSET (f) == fontset)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5439 /* This fontset is already set in frame F. There's nothing more
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5440 to do. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5441 return fontset_name (fontset);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5442
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46169
diff changeset
5443 result = x_new_font (f, (SDATA (fontset_ascii (fontset))));
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5444
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5445 if (!STRINGP (result))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5446 /* Can't load ASCII font. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5447 return Qnil;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5448
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5449 /* Since x_new_font doesn't update any fontset information, do it now. */
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
5450 FRAME_FONTSET (f) = fontset;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5451
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5452 return build_string (fontsetname);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5453 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5454
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5455
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5456 /***********************************************************************
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5457 TODO: W32 Input Methods
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5458 ***********************************************************************/
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5459 /* Listing missing functions from xterm.c helps diff stay in step.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5460
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5461 xim_destroy_callback (xim, client_data, call_data)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5462 xim_open_dpy (dpyinfo, resource_name)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5463 struct xim_inst_t
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5464 xim_instantiate_callback (display, client_data, call_data)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5465 xim_initialize (dpyinfo, resource_name)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5466 xim_close_dpy (dpyinfo)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5467
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5468 */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5469
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5470
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5471 void
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5472 mac_get_window_bounds (f, inner, outer)
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5473 struct frame *f;
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5474 Rect *inner, *outer;
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5475 {
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5476 #if TARGET_API_MAC_CARBON
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5477 GetWindowBounds (FRAME_MAC_WINDOW (f), kWindowContentRgn, inner);
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5478 GetWindowBounds (FRAME_MAC_WINDOW (f), kWindowStructureRgn, outer);
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5479 #else /* not TARGET_API_MAC_CARBON */
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5480 RgnHandle region = NewRgn ();
57373
38e45bf0128a (x_update_window_end): Fix flicker on vertical line between
Kim F. Storm <storm@cua.dk>
parents: 57357
diff changeset
5481
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5482 GetWindowRegion (FRAME_MAC_WINDOW (f), kWindowContentRgn, region);
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5483 *inner = (*region)->rgnBBox;
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5484 GetWindowRegion (FRAME_MAC_WINDOW (f), kWindowStructureRgn, region);
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5485 *outer = (*region)->rgnBBox;
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5486 DisposeRgn (region);
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5487 #endif /* not TARGET_API_MAC_CARBON */
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5488 }
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5489
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5490
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5491 /* Calculate the absolute position in frame F
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5492 from its current recorded position values and gravity. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5493
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5494 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5495 x_calc_absolute_position (f)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5496 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5497 {
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5498 int width_diff = 0, height_diff = 0;
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5499 int flags = f->size_hint_flags;
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5500 Rect inner, outer;
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5501
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5502 /* We have nothing to do if the current position
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5503 is already for the top-left corner. */
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5504 if (! ((flags & XNegative) || (flags & YNegative)))
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5505 return;
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5506
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5507 /* Find the offsets of the outside upper-left corner of
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5508 the inner window, with respect to the outer window. */
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5509 mac_get_window_bounds (f, &inner, &outer);
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5510
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5511 width_diff = (outer.right - outer.left) - (inner.right - inner.left);
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5512 height_diff = (outer.bottom - outer.top) - (inner.bottom - inner.top);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5513
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5514 /* Treat negative positions as relative to the leftmost bottommost
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5515 position that fits on the screen. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5516 if (flags & XNegative)
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5517 f->left_pos = (FRAME_MAC_DISPLAY_INFO (f)->width
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5518 - width_diff
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5519 - FRAME_PIXEL_WIDTH (f)
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5520 + f->left_pos);
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5521
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5522 if (flags & YNegative)
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5523 f->top_pos = (FRAME_MAC_DISPLAY_INFO (f)->height
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5524 - height_diff
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5525 - FRAME_PIXEL_HEIGHT (f)
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5526 + f->top_pos);
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5527
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5528 /* The left_pos and top_pos
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5529 are now relative to the top and left screen edges,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5530 so the flags should correspond. */
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5531 f->size_hint_flags &= ~ (XNegative | YNegative);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5532 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5533
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5534 /* CHANGE_GRAVITY is 1 when calling from Fset_frame_position,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5535 to really change the position, and 0 when calling from
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5536 x_make_frame_visible (in that case, XOFF and YOFF are the current
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5537 position values). It is -1 when calling from x_set_frame_parameters,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5538 which means, do adjust for borders but don't change the gravity. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5539
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5540 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5541 x_set_offset (f, xoff, yoff, change_gravity)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5542 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5543 register int xoff, yoff;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5544 int change_gravity;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5545 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5546 if (change_gravity > 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5547 {
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5548 f->top_pos = yoff;
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5549 f->left_pos = xoff;
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5550 f->size_hint_flags &= ~ (XNegative | YNegative);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5551 if (xoff < 0)
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5552 f->size_hint_flags |= XNegative;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5553 if (yoff < 0)
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5554 f->size_hint_flags |= YNegative;
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5555 f->win_gravity = NorthWestGravity;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5556 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5557 x_calc_absolute_position (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5558
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5559 BLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5560 x_wm_set_size_hint (f, (long) 0, 0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5561
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5562 #if TARGET_API_MAC_CARBON
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5563 MoveWindowStructure (FRAME_MAC_WINDOW (f), f->left_pos, f->top_pos);
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5564 /* If the title bar is completely outside the screen, adjust the
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5565 position. */
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5566 ConstrainWindowToScreen (FRAME_MAC_WINDOW (f), kWindowTitleBarRgn,
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5567 kWindowConstrainMoveRegardlessOfFit
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5568 | kWindowConstrainAllowPartial, NULL, NULL);
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5569 x_real_positions (f, &f->left_pos, &f->top_pos);
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5570 #else
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5571 {
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5572 Rect inner, outer, screen_rect, dummy;
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5573 RgnHandle region = NewRgn ();
57373
38e45bf0128a (x_update_window_end): Fix flicker on vertical line between
Kim F. Storm <storm@cua.dk>
parents: 57357
diff changeset
5574
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5575 mac_get_window_bounds (f, &inner, &outer);
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5576 f->x_pixels_diff = inner.left - outer.left;
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5577 f->y_pixels_diff = inner.top - outer.top;
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5578 MoveWindow (FRAME_MAC_WINDOW (f), f->left_pos + f->x_pixels_diff,
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5579 f->top_pos + f->y_pixels_diff, false);
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5580
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5581 /* If the title bar is completely outside the screen, adjust the
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5582 position. The variable `outer' holds the title bar rectangle.
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5583 The variable `inner' holds slightly smaller one than `outer',
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5584 so that the calculation of overlapping may not become too
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5585 strict. */
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5586 GetWindowRegion (FRAME_MAC_WINDOW (f), kWindowTitleBarRgn, region);
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5587 outer = (*region)->rgnBBox;
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5588 DisposeRgn (region);
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5589 inner = outer;
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5590 InsetRect (&inner, 8, 8);
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5591 screen_rect = qd.screenBits.bounds;
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5592 screen_rect.top += GetMBarHeight ();
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5593
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5594 if (!SectRect (&inner, &screen_rect, &dummy))
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5595 {
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5596 if (inner.right <= screen_rect.left)
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5597 f->left_pos = screen_rect.left;
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5598 else if (inner.left >= screen_rect.right)
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5599 f->left_pos = screen_rect.right - (outer.right - outer.left);
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5600
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5601 if (inner.bottom <= screen_rect.top)
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5602 f->top_pos = screen_rect.top;
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5603 else if (inner.top >= screen_rect.bottom)
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5604 f->top_pos = screen_rect.bottom - (outer.bottom - outer.top);
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5605
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5606 MoveWindow (FRAME_MAC_WINDOW (f), f->left_pos + f->x_pixels_diff,
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5607 f->top_pos + f->y_pixels_diff, false);
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5608 }
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5609 }
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
5610 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5611
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5612 UNBLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5613 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5614
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5615 /* Call this to change the size of frame F's x-window.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5616 If CHANGE_GRAVITY is 1, we change to top-left-corner window gravity
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5617 for this size change and subsequent size changes.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5618 Otherwise we leave the window gravity unchanged. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5619
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5620 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5621 x_set_window_size (f, change_gravity, cols, rows)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5622 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5623 int change_gravity;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5624 int cols, rows;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5625 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5626 int pixelwidth, pixelheight;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
5627
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5628 BLOCK_INPUT;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
5629
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5630 check_frame_size (f, &rows, &cols);
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5631 f->scroll_bar_actual_width
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5632 = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5633
50097
ee703213acfa Remove generic fringe code.
Kim F. Storm <storm@cua.dk>
parents: 49600
diff changeset
5634 compute_fringe_widths (f, 0);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5635
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5636 pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols);
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5637 pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows);
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5638
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5639 f->win_gravity = NorthWestGravity;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5640 x_wm_set_size_hint (f, (long) 0, 0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5641
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5642 SizeWindow (FRAME_MAC_WINDOW (f), pixelwidth, pixelheight, 0);
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
5643 #if TARGET_API_MAC_CARBON
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
5644 if (f->output_data.mac->hourglass_control)
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
5645 MoveControl (f->output_data.mac->hourglass_control,
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
5646 pixelwidth - HOURGLASS_WIDTH, 0);
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
5647 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5648
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5649 /* Now, strictly speaking, we can't be sure that this is accurate,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5650 but the window manager will get around to dealing with the size
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5651 change request eventually, and we'll hear how it went when the
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5652 ConfigureNotify event gets here.
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
5653
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5654 We could just not bother storing any of this information here,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5655 and let the ConfigureNotify event set everything up, but that
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5656 might be kind of confusing to the Lisp code, since size changes
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5657 wouldn't be reported in the frame parameters until some random
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5658 point in the future when the ConfigureNotify event arrives.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5659
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5660 We pass 1 for DELAY since we can't run Lisp code inside of
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5661 a BLOCK_INPUT. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5662 change_frame_size (f, rows, cols, 0, 1, 0);
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5663 FRAME_PIXEL_WIDTH (f) = pixelwidth;
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5664 FRAME_PIXEL_HEIGHT (f) = pixelheight;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5665
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5666 /* We've set {FRAME,PIXEL}_{WIDTH,HEIGHT} to the values we hope to
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5667 receive in the ConfigureNotify event; if we get what we asked
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5668 for, then the event won't cause the screen to become garbaged, so
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5669 we have to make sure to do it here. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5670 SET_FRAME_GARBAGED (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5671
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5672 XFlush (FRAME_X_DISPLAY (f));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5673
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5674 /* If cursor was outside the new size, mark it as off. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5675 mark_window_cursors_off (XWINDOW (f->root_window));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5676
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5677 /* Clear out any recollection of where the mouse highlighting was,
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
5678 since it might be in a place that's outside the new frame size.
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5679 Actually checking whether it is outside is a pain in the neck,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5680 so don't try--just let the highlighting be done afresh with new size. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5681 cancel_mouse_face (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5682
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5683 UNBLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5684 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5685
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5686 /* Mouse warping. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5687
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5688 void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5689
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5690 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5691 x_set_mouse_position (f, x, y)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5692 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5693 int x, y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5694 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5695 int pix_x, pix_y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5696
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5697 pix_x = FRAME_COL_TO_PIXEL_X (f, x) + FRAME_COLUMN_WIDTH (f) / 2;
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5698 pix_y = FRAME_LINE_TO_PIXEL_Y (f, y) + FRAME_LINE_HEIGHT (f) / 2;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5699
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5700 if (pix_x < 0) pix_x = 0;
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5701 if (pix_x > FRAME_PIXEL_WIDTH (f)) pix_x = FRAME_PIXEL_WIDTH (f);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5702
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5703 if (pix_y < 0) pix_y = 0;
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5704 if (pix_y > FRAME_PIXEL_HEIGHT (f)) pix_y = FRAME_PIXEL_HEIGHT (f);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5705
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5706 x_set_mouse_pixel_position (f, pix_x, pix_y);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5707 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5708
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5709 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5710 x_set_mouse_pixel_position (f, pix_x, pix_y)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5711 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5712 int pix_x, pix_y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5713 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5714 #if 0 /* MAC_TODO: CursorDeviceMoveTo is non-Carbon */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5715 BLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5716
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5717 XWarpPointer (FRAME_X_DISPLAY (f), None, FRAME_X_WINDOW (f),
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5718 0, 0, 0, 0, pix_x, pix_y);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5719 UNBLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5720 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5721 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5722
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5723
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5724 /* focus shifting, raising and lowering. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5725
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5726 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5727 x_focus_on_frame (f)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5728 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5729 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5730 #if 0 /* This proves to be unpleasant. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5731 x_raise_frame (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5732 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5733 #if 0
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5734 /* I don't think that the ICCCM allows programs to do things like this
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5735 without the interaction of the window manager. Whatever you end up
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5736 doing with this code, do it to x_unfocus_frame too. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5737 XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5738 RevertToPointerRoot, CurrentTime);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5739 #endif /* ! 0 */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5740 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5741
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5742 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5743 x_unfocus_frame (f)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5744 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5745 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5746 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5747
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5748 /* Raise frame F. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5749 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5750 x_raise_frame (f)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5751 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5752 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5753 if (f->async_visible)
57425
0867872551d9 macterm.c (x_raise_frame): Add BLOCK_INPUT around SelectWindow
Steven Tamm <steventamm@mac.com>
parents: 57373
diff changeset
5754 {
0867872551d9 macterm.c (x_raise_frame): Add BLOCK_INPUT around SelectWindow
Steven Tamm <steventamm@mac.com>
parents: 57373
diff changeset
5755 BLOCK_INPUT;
0867872551d9 macterm.c (x_raise_frame): Add BLOCK_INPUT around SelectWindow
Steven Tamm <steventamm@mac.com>
parents: 57373
diff changeset
5756 SelectWindow (FRAME_MAC_WINDOW (f));
0867872551d9 macterm.c (x_raise_frame): Add BLOCK_INPUT around SelectWindow
Steven Tamm <steventamm@mac.com>
parents: 57373
diff changeset
5757 UNBLOCK_INPUT;
0867872551d9 macterm.c (x_raise_frame): Add BLOCK_INPUT around SelectWindow
Steven Tamm <steventamm@mac.com>
parents: 57373
diff changeset
5758 }
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5759 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5760
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5761 /* Lower frame F. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5762 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5763 x_lower_frame (f)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5764 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5765 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5766 if (f->async_visible)
57425
0867872551d9 macterm.c (x_raise_frame): Add BLOCK_INPUT around SelectWindow
Steven Tamm <steventamm@mac.com>
parents: 57373
diff changeset
5767 {
0867872551d9 macterm.c (x_raise_frame): Add BLOCK_INPUT around SelectWindow
Steven Tamm <steventamm@mac.com>
parents: 57373
diff changeset
5768 BLOCK_INPUT;
0867872551d9 macterm.c (x_raise_frame): Add BLOCK_INPUT around SelectWindow
Steven Tamm <steventamm@mac.com>
parents: 57373
diff changeset
5769 SendBehind (FRAME_MAC_WINDOW (f), nil);
0867872551d9 macterm.c (x_raise_frame): Add BLOCK_INPUT around SelectWindow
Steven Tamm <steventamm@mac.com>
parents: 57373
diff changeset
5770 UNBLOCK_INPUT;
0867872551d9 macterm.c (x_raise_frame): Add BLOCK_INPUT around SelectWindow
Steven Tamm <steventamm@mac.com>
parents: 57373
diff changeset
5771 }
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5772 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5773
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5774 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5775 XTframe_raise_lower (f, raise_flag)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5776 FRAME_PTR f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5777 int raise_flag;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5778 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5779 if (raise_flag)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5780 x_raise_frame (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5781 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5782 x_lower_frame (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5783 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5784
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5785 /* Change of visibility. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5786
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5787 /* This tries to wait until the frame is really visible.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5788 However, if the window manager asks the user where to position
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5789 the frame, this will return before the user finishes doing that.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5790 The frame will not actually be visible at that time,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5791 but it will become visible later when the window manager
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5792 finishes with it. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5793
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5794 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5795 x_make_frame_visible (f)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5796 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5797 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5798 Lisp_Object type;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5799 int original_top, original_left;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5800
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5801 BLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5802
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5803 if (! FRAME_VISIBLE_P (f))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5804 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5805 /* We test FRAME_GARBAGED_P here to make sure we don't
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5806 call x_set_offset a second time
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5807 if we get to x_make_frame_visible a second time
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5808 before the window gets really visible. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5809 if (! FRAME_ICONIFIED_P (f)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5810 && ! f->output_data.mac->asked_for_visible)
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
5811 x_set_offset (f, f->left_pos, f->top_pos, 0);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5812
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5813 f->output_data.mac->asked_for_visible = 1;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
5814
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
5815 #if TARGET_API_MAC_CARBON
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
5816 if (!(FRAME_SIZE_HINTS (f)->flags & (USPosition | PPosition)))
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
5817 {
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
5818 struct frame *sf = SELECTED_FRAME ();
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
5819 if (!FRAME_MAC_P (sf))
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
5820 RepositionWindow (FRAME_MAC_WINDOW (f), NULL,
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
5821 kWindowCenterOnMainScreen);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
5822 else
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
5823 RepositionWindow (FRAME_MAC_WINDOW (f),
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
5824 FRAME_MAC_WINDOW (sf),
59899
96a18b943293 (mac_draw_string_common, x_make_frame_visible): Use
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59804
diff changeset
5825 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
5826 kWindowCascadeStartAtParentWindowScreen
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
5827 #else
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
5828 kWindowCascadeOnParentWindowScreen
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
5829 #endif
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
5830 );
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
5831 x_real_positions (f, &f->left_pos, &f->top_pos);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
5832 }
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
5833 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5834 ShowWindow (FRAME_MAC_WINDOW (f));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5835 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5836
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5837 XFlush (FRAME_MAC_DISPLAY (f));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5838
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5839 /* Synchronize to ensure Emacs knows the frame is visible
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5840 before we do anything else. We do this loop with input not blocked
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5841 so that incoming events are handled. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5842 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5843 Lisp_Object frame;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5844 int count;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5845
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5846 /* This must come after we set COUNT. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5847 UNBLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5848
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5849 XSETFRAME (frame, f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5850
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5851 /* Wait until the frame is visible. Process X events until a
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5852 MapNotify event has been seen, or until we think we won't get a
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5853 MapNotify at all.. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5854 for (count = input_signal_count + 10;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5855 input_signal_count < count && !FRAME_VISIBLE_P (f);)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5856 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5857 /* Force processing of queued events. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5858 x_sync (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5859
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5860 /* Machines that do polling rather than SIGIO have been
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5861 observed to go into a busy-wait here. So we'll fake an
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5862 alarm signal to let the handler know that there's something
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5863 to be read. We used to raise a real alarm, but it seems
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5864 that the handler isn't always enabled here. This is
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5865 probably a bug. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5866 if (input_polling_used ())
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5867 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5868 /* It could be confusing if a real alarm arrives while
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5869 processing the fake one. Turn it off and let the
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5870 handler reset it. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5871 extern void poll_for_input_1 P_ ((void));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5872 int old_poll_suppress_count = poll_suppress_count;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5873 poll_suppress_count = 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5874 poll_for_input_1 ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5875 poll_suppress_count = old_poll_suppress_count;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5876 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5877
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5878 /* See if a MapNotify event has been processed. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5879 FRAME_SAMPLE_VISIBILITY (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5880 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5881 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5882 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5883
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5884 /* Change from mapped state to withdrawn state. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5885
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5886 /* Make the frame visible (mapped and not iconified). */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5887
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5888 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5889 x_make_frame_invisible (f)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5890 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5891 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5892 /* Don't keep the highlight on an invisible frame. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5893 if (FRAME_MAC_DISPLAY_INFO (f)->x_highlight_frame == f)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5894 FRAME_MAC_DISPLAY_INFO (f)->x_highlight_frame = 0;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
5895
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5896 BLOCK_INPUT;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
5897
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
5898 /* Before unmapping the window, update the WM_SIZE_HINTS property to claim
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
5899 that the current position of the window is user-specified, rather than
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
5900 program-specified, so that when the window is mapped again, it will be
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
5901 placed at the same location, without forcing the user to position it
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
5902 by hand again (they have already done that once for this window.) */
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
5903 x_wm_set_size_hint (f, (long) 0, 1);
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
5904
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5905 HideWindow (FRAME_MAC_WINDOW (f));
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
5906
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5907 /* We can't distinguish this from iconification
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5908 just by the event that we get from the server.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5909 So we can't win using the usual strategy of letting
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5910 FRAME_SAMPLE_VISIBILITY set this. So do it by hand,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5911 and synchronize with the server to make sure we agree. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5912 f->visible = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5913 FRAME_ICONIFIED_P (f) = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5914 f->async_visible = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5915 f->async_iconified = 0;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
5916
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5917 UNBLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5918 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5919
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5920 /* Change window state from mapped to iconified. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5921
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5922 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5923 x_iconify_frame (f)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5924 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5925 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5926 /* Don't keep the highlight on an invisible frame. */
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
5927 if (FRAME_MAC_DISPLAY_INFO (f)->x_highlight_frame == f)
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
5928 FRAME_MAC_DISPLAY_INFO (f)->x_highlight_frame = 0;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
5929
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
5930 #if 0
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
5931 /* Review: Since window is still visible in dock, still allow updates? */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5932 if (f->async_iconified)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5933 return;
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
5934 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5935
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5936 BLOCK_INPUT;
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
5937
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
5938 CollapseWindow (FRAME_MAC_WINDOW (f), true);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
5939
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5940 UNBLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5941 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5942
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5943
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5944 /* Free X resources of frame F. */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5945
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5946 void
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5947 x_free_frame_resources (f)
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5948 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5949 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5950 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
5951 WindowPtr wp = FRAME_MAC_WINDOW (f);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5952
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5953 BLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5954
60364
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
5955 if (wp != tip_window)
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
5956 remove_window_handler (wp);
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
5957
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
5958 DisposeWindow (wp);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
5959 if (wp == tip_window)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
5960 /* Neither WaitNextEvent nor ReceiveNextEvent receives `window
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
5961 closed' event. So we reset tip_window here. */
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
5962 tip_window = NULL;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5963
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5964 free_frame_menubar (f);
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5965
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5966 if (FRAME_FACE_CACHE (f))
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5967 free_frame_faces (f);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5968
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5969 x_free_gcs (f);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5970
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
5971 if (FRAME_SIZE_HINTS (f))
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
5972 xfree (FRAME_SIZE_HINTS (f));
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
5973
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5974 xfree (f->output_data.mac);
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5975 f->output_data.mac = NULL;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5976
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5977 if (f == dpyinfo->x_focus_frame)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5978 dpyinfo->x_focus_frame = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5979 if (f == dpyinfo->x_focus_event_frame)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5980 dpyinfo->x_focus_event_frame = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5981 if (f == dpyinfo->x_highlight_frame)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5982 dpyinfo->x_highlight_frame = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5983
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5984 if (f == dpyinfo->mouse_face_mouse_frame)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5985 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5986 dpyinfo->mouse_face_beg_row
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5987 = dpyinfo->mouse_face_beg_col = -1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5988 dpyinfo->mouse_face_end_row
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5989 = dpyinfo->mouse_face_end_col = -1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5990 dpyinfo->mouse_face_window = Qnil;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5991 dpyinfo->mouse_face_deferred_gc = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5992 dpyinfo->mouse_face_mouse_frame = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5993 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5994
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5995 UNBLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
5996 }
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5997
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5998
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
5999 /* Destroy the X window of frame F. */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6000
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6001 void
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6002 x_destroy_window (f)
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6003 struct frame *f;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6004 {
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6005 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6006
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6007 x_free_frame_resources (f);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6008
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6009 dpyinfo->reference_count--;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6010 }
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6011
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6012
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6013 /* Setting window manager hints. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6014
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6015 /* Set the normal size hints for the window manager, for frame F.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6016 FLAGS is the flags word to use--or 0 meaning preserve the flags
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6017 that the window now has.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6018 If USER_POSITION is nonzero, we set the USPosition
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6019 flag (this is useful when FLAGS is 0). */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6020 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6021 x_wm_set_size_hint (f, flags, user_position)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6022 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6023 long flags;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6024 int user_position;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6025 {
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6026 int base_width, base_height, width_inc, height_inc;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6027 int min_rows = 0, min_cols = 0;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6028 XSizeHints *size_hints;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6029
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6030 base_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 0);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6031 base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 0);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6032 width_inc = FRAME_COLUMN_WIDTH (f);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6033 height_inc = FRAME_LINE_HEIGHT (f);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6034
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6035 check_frame_size (f, &min_rows, &min_cols);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6036
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6037 size_hints = FRAME_SIZE_HINTS (f);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6038 if (size_hints == NULL)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6039 {
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6040 size_hints = FRAME_SIZE_HINTS (f) = xmalloc (sizeof (XSizeHints));
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6041 bzero (size_hints, sizeof (XSizeHints));
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6042 }
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6043
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6044 size_hints->flags |= PResizeInc | PMinSize | PBaseSize ;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6045 size_hints->width_inc = width_inc;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6046 size_hints->height_inc = height_inc;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6047 size_hints->min_width = base_width + min_cols * width_inc;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6048 size_hints->min_height = base_height + min_rows * height_inc;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6049 size_hints->base_width = base_width;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6050 size_hints->base_height = base_height;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6051
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6052 if (flags)
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6053 size_hints->flags = flags;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6054 else if (user_position)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6055 {
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6056 size_hints->flags &= ~ PPosition;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6057 size_hints->flags |= USPosition;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6058 }
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6059 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6060
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6061 #if 0 /* MAC_TODO: hide application instead of iconify? */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6062 /* Used for IconicState or NormalState */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6063
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6064 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6065 x_wm_set_window_state (f, state)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6066 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6067 int state;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6068 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6069 #ifdef USE_X_TOOLKIT
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6070 Arg al[1];
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6071
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6072 XtSetArg (al[0], XtNinitialState, state);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6073 XtSetValues (f->output_data.x->widget, al, 1);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6074 #else /* not USE_X_TOOLKIT */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6075 Window window = FRAME_X_WINDOW (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6076
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6077 f->output_data.x->wm_hints.flags |= StateHint;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6078 f->output_data.x->wm_hints.initial_state = state;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6079
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6080 XSetWMHints (FRAME_X_DISPLAY (f), window, &f->output_data.x->wm_hints);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6081 #endif /* not USE_X_TOOLKIT */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6082 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6083
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6084 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6085 x_wm_set_icon_pixmap (f, pixmap_id)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6086 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6087 int pixmap_id;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6088 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6089 Pixmap icon_pixmap;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6090
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6091 #ifndef USE_X_TOOLKIT
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6092 Window window = FRAME_X_WINDOW (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6093 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6094
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6095 if (pixmap_id > 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6096 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6097 icon_pixmap = x_bitmap_pixmap (f, pixmap_id);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6098 f->output_data.x->wm_hints.icon_pixmap = icon_pixmap;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6099 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6100 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6101 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6102 /* It seems there is no way to turn off use of an icon pixmap.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6103 The following line does it, only if no icon has yet been created,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6104 for some window managers. But with mwm it crashes.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6105 Some people say it should clear the IconPixmapHint bit in this case,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6106 but that doesn't work, and the X consortium said it isn't the
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6107 right thing at all. Since there is no way to win,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6108 best to explicitly give up. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6109 #if 0
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6110 f->output_data.x->wm_hints.icon_pixmap = None;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6111 #else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6112 return;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6113 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6114 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6115
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6116 #ifdef USE_X_TOOLKIT /* same as in x_wm_set_window_state. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6117
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6118 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6119 Arg al[1];
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6120 XtSetArg (al[0], XtNiconPixmap, icon_pixmap);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6121 XtSetValues (f->output_data.x->widget, al, 1);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6122 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6123
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6124 #else /* not USE_X_TOOLKIT */
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
6125
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6126 f->output_data.x->wm_hints.flags |= IconPixmapHint;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6127 XSetWMHints (FRAME_X_DISPLAY (f), window, &f->output_data.x->wm_hints);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6128
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6129 #endif /* not USE_X_TOOLKIT */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6130 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6131
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6132 #endif /* MAC_TODO */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6133
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6134 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6135 x_wm_set_icon_position (f, icon_x, icon_y)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6136 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6137 int icon_x, icon_y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6138 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6139 #if 0 /* MAC_TODO: no icons on Mac */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6140 #ifdef USE_X_TOOLKIT
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6141 Window window = XtWindow (f->output_data.x->widget);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6142 #else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6143 Window window = FRAME_X_WINDOW (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6144 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6145
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6146 f->output_data.x->wm_hints.flags |= IconPositionHint;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6147 f->output_data.x->wm_hints.icon_x = icon_x;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6148 f->output_data.x->wm_hints.icon_y = icon_y;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6149
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6150 XSetWMHints (FRAME_X_DISPLAY (f), window, &f->output_data.x->wm_hints);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6151 #endif /* MAC_TODO */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6152 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6153
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6154
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6155 /***********************************************************************
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6156 Fonts
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6157 ***********************************************************************/
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6158
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6159 /* Return a pointer to struct font_info of font FONT_IDX of frame F. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6160
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6161 struct font_info *
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6162 x_get_font_info (f, font_idx)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6163 FRAME_PTR f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6164 int font_idx;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6165 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6166 return (FRAME_MAC_FONT_TABLE (f) + font_idx);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6167 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6168
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6169 /* the global font name table */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6170 char **font_name_table = NULL;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6171 int font_name_table_size = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6172 int font_name_count = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6173
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6174 /* Alist linking character set strings to Mac text encoding and Emacs
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6175 coding system. */
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6176 static Lisp_Object Vmac_charset_info_alist;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6177
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6178 static Lisp_Object
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6179 create_text_encoding_info_alist ()
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6180 {
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6181 Lisp_Object result = Qnil, rest;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6182
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6183 for (rest = Vmac_charset_info_alist; CONSP (rest); rest = XCDR (rest))
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6184 {
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6185 Lisp_Object charset_info = XCAR (rest);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6186 Lisp_Object charset, coding_system, text_encoding;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6187 Lisp_Object existing_info;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6188
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6189 if (!(CONSP (charset_info)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6190 && STRINGP (charset = XCAR (charset_info))
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6191 && CONSP (XCDR (charset_info))
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6192 && INTEGERP (text_encoding = XCAR (XCDR (charset_info)))
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6193 && CONSP (XCDR (XCDR (charset_info)))
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6194 && SYMBOLP (coding_system = XCAR (XCDR (XCDR (charset_info))))))
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6195 continue;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6196
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6197 existing_info = assq_no_quit (text_encoding, result);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6198 if (NILP (existing_info))
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6199 result = Fcons (list3 (text_encoding, coding_system, charset),
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6200 result);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6201 else
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6202 if (NILP (Fmember (charset, XCDR (XCDR (existing_info)))))
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6203 XSETCDR (XCDR (existing_info),
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6204 Fcons (charset, XCDR (XCDR (existing_info))));
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6205 }
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6206
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6207 return result;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6208 }
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6209
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6210
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6211 static void
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6212 decode_mac_font_name (name, size, coding_system)
58634
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
6213 char *name;
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
6214 int size;
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6215 Lisp_Object coding_system;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6216 {
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6217 struct coding_system coding;
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6218 char *buf, *p;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6219
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6220 for (p = name; *p; p++)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6221 if (!isascii (*p) || iscntrl (*p))
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6222 break;
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6223
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6224 if (*p == '\0'
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6225 || NILP (coding_system) || NILP (Fcoding_system_p (coding_system)))
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6226 return;
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6227
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6228 setup_coding_system (coding_system, &coding);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6229 coding.src_multibyte = 0;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6230 coding.dst_multibyte = 1;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6231 coding.mode |= CODING_MODE_LAST_BLOCK;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6232 coding.composing = COMPOSITION_DISABLED;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6233 buf = (char *) alloca (size);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6234
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6235 decode_coding (&coding, name, buf, strlen (name), size - 1);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6236 bcopy (buf, name, coding.produced);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6237 name[coding.produced] = '\0';
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6238 }
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6239
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6240
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6241 static char *
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6242 mac_to_x_fontname (name, size, style, charset)
58634
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
6243 char *name;
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
6244 int size;
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
6245 Style style;
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6246 char *charset;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6247 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6248 char foundry[32], family[32], cs[32];
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6249 char xf[256], *result, *p;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6250
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6251 if (sscanf (name, "%31[^-]-%31[^-]-%31s", foundry, family, cs) == 3)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6252 charset = cs;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6253 else
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6254 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6255 strcpy(foundry, "Apple");
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6256 strcpy(family, name);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6257 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6258
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6259 sprintf(xf, "-%s-%s-%s-%c-normal--%d-%d-75-75-m-%d-%s",
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6260 foundry, family, style & bold ? "bold" : "medium",
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6261 style & italic ? 'i' : 'r', size, size * 10, size * 10, charset);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
6262
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6263 result = (char *) xmalloc (strlen (xf) + 1);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6264 strcpy (result, xf);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6265 for (p = result; *p; p++)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6266 *p = tolower(*p);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6267 return result;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6268 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
6269
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6270
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6271 /* Convert an X font spec to the corresponding mac font name, which
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6272 can then be passed to GetFNum after conversion to a Pascal string.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6273 For ordinary Mac fonts, this should just be their names, like
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6274 "monaco", "Taipei", etc. Fonts converted from the GNU intlfonts
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6275 collection contain their charset designation in their names, like
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6276 "ETL-Fixed-iso8859-1", "ETL-Fixed-koi8-r", etc. Both types of font
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6277 names are handled accordingly. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6278 static void
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6279 x_font_name_to_mac_font_name (xf, mf, mf_decoded, style, cs)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6280 char *xf, *mf, *mf_decoded;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6281 Style *style;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6282 char *cs;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6283 {
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6284 char foundry[32], family[32], weight[20], slant[2], *p;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6285 Lisp_Object charset_info, coding_system = Qnil;
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6286 struct coding_system coding;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6287
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6288 strcpy (mf, "");
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6289
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6290 if (sscanf (xf, "-%31[^-]-%31[^-]-%19[^-]-%1[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]-%31s",
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6291 foundry, family, weight, slant, cs) != 5 &&
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6292 sscanf (xf, "-%31[^-]-%31[^-]-%19[^-]-%1[^-]-%*[^-]--%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]-%31s",
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6293 foundry, family, weight, slant, cs) != 5)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6294 return;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6295
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6296 *style = normal;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6297 if (strcmp (weight, "bold") == 0)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6298 *style |= bold;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6299 if (*slant == 'i')
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6300 *style |= italic;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6301
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6302 charset_info = Fassoc (build_string (cs), Vmac_charset_info_alist);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6303 if (!NILP (charset_info))
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6304 {
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6305 strcpy (mf_decoded, family);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6306 coding_system = Fcar (Fcdr (Fcdr (charset_info)));
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6307 }
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6308 else
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6309 sprintf (mf_decoded, "%s-%s-%s", foundry, family, cs);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6310
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6311 for (p = mf_decoded; *p; p++)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6312 if (!isascii (*p) || iscntrl (*p))
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6313 break;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6314
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6315 if (*p == '\0'
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6316 || NILP (coding_system) || NILP (Fcoding_system_p (coding_system)))
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6317 strcpy (mf, mf_decoded);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6318 else
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6319 {
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6320 setup_coding_system (coding_system, &coding);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6321 coding.src_multibyte = 1;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6322 coding.dst_multibyte = 1;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6323 coding.mode |= CODING_MODE_LAST_BLOCK;
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6324 encode_coding (&coding, mf_decoded, mf,
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6325 strlen (mf_decoded), sizeof (Str32) - 1);
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6326 mf[coding.produced] = '\0';
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6327 }
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6328 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6329
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6330
45848
39cdf9669519 In src/:
Andrew Choi <akochoi@shaw.ca>
parents: 45803
diff changeset
6331 static void
39cdf9669519 In src/:
Andrew Choi <akochoi@shaw.ca>
parents: 45803
diff changeset
6332 add_font_name_table_entry (char *font_name)
39cdf9669519 In src/:
Andrew Choi <akochoi@shaw.ca>
parents: 45803
diff changeset
6333 {
39cdf9669519 In src/:
Andrew Choi <akochoi@shaw.ca>
parents: 45803
diff changeset
6334 if (font_name_table_size == 0)
39cdf9669519 In src/:
Andrew Choi <akochoi@shaw.ca>
parents: 45803
diff changeset
6335 {
39cdf9669519 In src/:
Andrew Choi <akochoi@shaw.ca>
parents: 45803
diff changeset
6336 font_name_table_size = 16;
39cdf9669519 In src/:
Andrew Choi <akochoi@shaw.ca>
parents: 45803
diff changeset
6337 font_name_table = (char **)
39cdf9669519 In src/:
Andrew Choi <akochoi@shaw.ca>
parents: 45803
diff changeset
6338 xmalloc (font_name_table_size * sizeof (char *));
39cdf9669519 In src/:
Andrew Choi <akochoi@shaw.ca>
parents: 45803
diff changeset
6339 }
39cdf9669519 In src/:
Andrew Choi <akochoi@shaw.ca>
parents: 45803
diff changeset
6340 else if (font_name_count + 1 >= font_name_table_size)
39cdf9669519 In src/:
Andrew Choi <akochoi@shaw.ca>
parents: 45803
diff changeset
6341 {
39cdf9669519 In src/:
Andrew Choi <akochoi@shaw.ca>
parents: 45803
diff changeset
6342 font_name_table_size += 16;
39cdf9669519 In src/:
Andrew Choi <akochoi@shaw.ca>
parents: 45803
diff changeset
6343 font_name_table = (char **)
39cdf9669519 In src/:
Andrew Choi <akochoi@shaw.ca>
parents: 45803
diff changeset
6344 xrealloc (font_name_table,
39cdf9669519 In src/:
Andrew Choi <akochoi@shaw.ca>
parents: 45803
diff changeset
6345 font_name_table_size * sizeof (char *));
39cdf9669519 In src/:
Andrew Choi <akochoi@shaw.ca>
parents: 45803
diff changeset
6346 }
39cdf9669519 In src/:
Andrew Choi <akochoi@shaw.ca>
parents: 45803
diff changeset
6347
39cdf9669519 In src/:
Andrew Choi <akochoi@shaw.ca>
parents: 45803
diff changeset
6348 font_name_table[font_name_count++] = font_name;
39cdf9669519 In src/:
Andrew Choi <akochoi@shaw.ca>
parents: 45803
diff changeset
6349 }
39cdf9669519 In src/:
Andrew Choi <akochoi@shaw.ca>
parents: 45803
diff changeset
6350
39cdf9669519 In src/:
Andrew Choi <akochoi@shaw.ca>
parents: 45803
diff changeset
6351 /* Sets up the table font_name_table to contain the list of all fonts
39cdf9669519 In src/:
Andrew Choi <akochoi@shaw.ca>
parents: 45803
diff changeset
6352 in the system the first time the table is used so that the Resource
39cdf9669519 In src/:
Andrew Choi <akochoi@shaw.ca>
parents: 45803
diff changeset
6353 Manager need not be accessed every time this information is
39cdf9669519 In src/:
Andrew Choi <akochoi@shaw.ca>
parents: 45803
diff changeset
6354 needed. */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6355
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6356 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6357 init_font_name_table ()
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6358 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6359 #if TARGET_API_MAC_CARBON
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6360 FMFontFamilyIterator ffi;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6361 FMFontFamilyInstanceIterator ffii;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6362 FMFontFamily ff;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6363 Lisp_Object text_encoding_info_alist;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6364 struct gcpro gcpro1;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6365
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6366 /* Create a dummy instance iterator here to avoid creating and
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6367 destroying it in the loop. */
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6368 if (FMCreateFontFamilyInstanceIterator (0, &ffii) != noErr)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6369 return;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6370 /* Create an iterator to enumerate the font families. */
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6371 if (FMCreateFontFamilyIterator (NULL, NULL, kFMDefaultOptions, &ffi)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6372 != noErr)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6373 {
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6374 FMDisposeFontFamilyInstanceIterator (&ffii);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6375 return;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6376 }
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6377
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6378 text_encoding_info_alist = create_text_encoding_info_alist ();
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6379
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6380 GCPRO1 (text_encoding_info_alist);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6381
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6382 while (FMGetNextFontFamily (&ffi, &ff) == noErr)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6383 {
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6384 Str255 name;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6385 FMFont font;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6386 FMFontStyle style;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6387 FMFontSize size;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6388 TextEncoding encoding;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6389 TextEncodingBase sc;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6390 Lisp_Object text_encoding_info;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6391
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6392 if (FMGetFontFamilyName (ff, name) != noErr)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6393 break;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6394 p2cstr (name);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6395 if (*name == '.')
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6396 continue;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6397
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6398 if (FMGetFontFamilyTextEncoding (ff, &encoding) != noErr)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6399 break;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6400 sc = GetTextEncodingBase (encoding);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6401 text_encoding_info = assq_no_quit (make_number (sc),
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6402 text_encoding_info_alist);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6403 if (!NILP (text_encoding_info))
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6404 decode_mac_font_name (name, sizeof (name),
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6405 XCAR (XCDR (text_encoding_info)));
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6406 else
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6407 text_encoding_info = assq_no_quit (make_number (kTextEncodingMacRoman),
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6408 text_encoding_info_alist);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6409
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6410 /* Point the instance iterator at the current font family. */
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6411 if (FMResetFontFamilyInstanceIterator (ff, &ffii) != noErr)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6412 break;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6413
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6414 while (FMGetNextFontFamilyInstance (&ffii, &font, &style, &size)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6415 == noErr)
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6416 {
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6417 Lisp_Object rest = XCDR (XCDR (text_encoding_info));
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6418
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6419 for (; !NILP (rest); rest = XCDR (rest))
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6420 {
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6421 char *cs = SDATA (XCAR (rest));
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6422
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6423 if (size == 0)
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6424 {
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6425 add_font_name_table_entry (mac_to_x_fontname (name, size,
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6426 style, cs));
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6427 add_font_name_table_entry (mac_to_x_fontname (name, size,
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6428 italic, cs));
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6429 add_font_name_table_entry (mac_to_x_fontname (name, size,
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6430 bold, cs));
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6431 add_font_name_table_entry (mac_to_x_fontname (name, size,
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6432 italic | bold,
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6433 cs));
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6434 }
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6435 else
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6436 {
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6437 add_font_name_table_entry (mac_to_x_fontname (name, size,
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6438 style, cs));
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6439 }
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6440 }
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6441 }
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6442 }
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6443
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6444 UNGCPRO;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6445
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6446 /* Dispose of the iterators. */
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6447 FMDisposeFontFamilyIterator (&ffi);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6448 FMDisposeFontFamilyInstanceIterator (&ffii);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6449 #else /* !TARGET_API_MAC_CARBON */
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6450 GrafPtr port;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6451 SInt16 fontnum, old_fontnum;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6452 int num_mac_fonts = CountResources('FOND');
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6453 int i, j;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6454 Handle font_handle, font_handle_2;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6455 short id, scriptcode;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6456 ResType type;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6457 Str32 name;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6458 struct FontAssoc *fat;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6459 struct AsscEntry *assc_entry;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6460 Lisp_Object text_encoding_info_alist, text_encoding_info;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6461 struct gcpro gcpro1;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6462
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6463 GetPort (&port); /* save the current font number used */
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6464 old_fontnum = port->txFont;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6465
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6466 text_encoding_info_alist = create_text_encoding_info_alist ();
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6467
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6468 GCPRO1 (text_encoding_info_alist);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6469
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6470 for (i = 1; i <= num_mac_fonts; i++) /* get all available fonts */
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6471 {
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6472 font_handle = GetIndResource ('FOND', i);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6473 if (!font_handle)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6474 continue;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6475
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6476 GetResInfo (font_handle, &id, &type, name);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6477 GetFNum (name, &fontnum);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6478 p2cstr (name);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6479 if (fontnum == 0)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6480 continue;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6481
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6482 TextFont (fontnum);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6483 scriptcode = FontToScript (fontnum);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6484 text_encoding_info = assq_no_quit (make_number (scriptcode),
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6485 text_encoding_info_alist);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6486 if (!NILP (text_encoding_info))
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6487 decode_mac_font_name (name, sizeof (name),
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6488 XCAR (XCDR (text_encoding_info)));
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6489 else
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6490 text_encoding_info = assq_no_quit (make_number (smRoman),
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6491 text_encoding_info_alist);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6492 do
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6493 {
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6494 HLock (font_handle);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6495
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6496 if (GetResourceSizeOnDisk (font_handle)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6497 >= sizeof (struct FamRec))
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6498 {
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6499 fat = (struct FontAssoc *) (*font_handle
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6500 + sizeof (struct FamRec));
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6501 assc_entry
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6502 = (struct AsscEntry *) (*font_handle
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6503 + sizeof (struct FamRec)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6504 + sizeof (struct FontAssoc));
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6505
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6506 for (j = 0; j <= fat->numAssoc; j++, assc_entry++)
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6507 {
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6508 Lisp_Object rest = XCDR (XCDR (text_encoding_info));
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6509
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6510 for (; !NILP (rest); rest = XCDR (rest))
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6511 {
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6512 char *cs = SDATA (XCAR (rest));
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6513
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6514 add_font_name_table_entry (mac_to_x_fontname (name,
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6515 assc_entry->fontSize,
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6516 assc_entry->fontStyle,
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6517 cs));
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6518 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6519 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6520 }
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6521
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6522 HUnlock (font_handle);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6523 font_handle_2 = GetNextFOND (font_handle);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6524 ReleaseResource (font_handle);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6525 font_handle = font_handle_2;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6526 }
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6527 while (ResError () == noErr && font_handle);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6528 }
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6529
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6530 UNGCPRO;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6531
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6532 TextFont (old_fontnum);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6533 #endif /* !TARGET_API_MAC_CARBON */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6534 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6535
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6536
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6537 void
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6538 mac_clear_font_name_table ()
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6539 {
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6540 int i;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6541
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6542 for (i = 0; i < font_name_count; i++)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6543 xfree (font_name_table[i]);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6544 xfree (font_name_table);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6545 font_name_table = NULL;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6546 font_name_table_size = font_name_count = 0;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6547 }
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6548
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6549
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6550 enum xlfd_scalable_field_index
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6551 {
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6552 XLFD_SCL_PIXEL_SIZE,
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6553 XLFD_SCL_POINT_SIZE,
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6554 XLFD_SCL_AVGWIDTH,
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6555 XLFD_SCL_LAST
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6556 };
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6557
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6558 static int xlfd_scalable_fields[] =
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6559 {
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6560 6, /* PIXEL_SIZE */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6561 7, /* POINT_SIZE */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6562 11, /* AVGWIDTH */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6563 -1
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6564 };
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6565
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6566 static Lisp_Object
59034
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6567 mac_c_string_match (regexp, string, nonspecial, exact)
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6568 Lisp_Object regexp;
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6569 const char *string, *nonspecial;
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6570 int exact;
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6571 {
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6572 if (exact)
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6573 {
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6574 if (strcmp (string, nonspecial) == 0)
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6575 return build_string (string);
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6576 }
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6577 else if (strstr (string, nonspecial))
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6578 {
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6579 Lisp_Object str = build_string (string);
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6580
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6581 if (fast_string_match (regexp, str) >= 0)
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6582 return str;
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6583 }
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6584
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6585 return Qnil;
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6586 }
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6587
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6588 static Lisp_Object
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6589 mac_do_list_fonts (pattern, maxnames)
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6590 char *pattern;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6591 int maxnames;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6592 {
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6593 int i, n_fonts = 0;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6594 Lisp_Object font_list = Qnil, pattern_regex, fontname;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6595 char *regex = (char *) alloca (strlen (pattern) * 2 + 3);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6596 char scaled[256];
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6597 char *ptr;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6598 int scl_val[XLFD_SCL_LAST], *field, *val;
59034
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6599 char *longest_start, *cur_start, *nonspecial;
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
6600 int longest_len, exact;
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6601
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6602 if (font_name_table == NULL) /* Initialize when first used. */
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6603 init_font_name_table ();
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
6604
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6605 for (i = 0; i < XLFD_SCL_LAST; i++)
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6606 scl_val[i] = -1;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6607
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6608 /* If the pattern contains 14 dashes and one of PIXEL_SIZE,
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6609 POINT_SIZE, and AVGWIDTH fields is explicitly specified, scalable
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6610 fonts are scaled according to the specified size. */
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6611 ptr = pattern;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6612 i = 0;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6613 field = xlfd_scalable_fields;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6614 val = scl_val;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6615 if (*ptr == '-')
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6616 do
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6617 {
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6618 ptr++;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6619 if (i == *field)
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6620 {
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6621 if ('0' <= *ptr && *ptr <= '9')
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6622 {
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6623 *val = *ptr++ - '0';
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6624 while ('0' <= *ptr && *ptr <= '9' && *val < 10000)
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6625 *val = *val * 10 + *ptr++ - '0';
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6626 if (*ptr != '-')
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6627 *val = -1;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6628 }
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6629 field++;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6630 val++;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6631 }
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6632 ptr = strchr (ptr, '-');
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6633 i++;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6634 }
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6635 while (ptr && i < 14);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6636
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6637 if (i == 14 && ptr == NULL)
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6638 {
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6639 if (scl_val[XLFD_SCL_PIXEL_SIZE] < 0)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6640 scl_val[XLFD_SCL_PIXEL_SIZE] =
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6641 (scl_val[XLFD_SCL_POINT_SIZE] > 0 ? scl_val[XLFD_SCL_POINT_SIZE] / 10
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6642 : (scl_val[XLFD_SCL_AVGWIDTH] > 0 ? scl_val[XLFD_SCL_AVGWIDTH] / 10
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6643 : -1));
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6644 if (scl_val[XLFD_SCL_POINT_SIZE] < 0)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6645 scl_val[XLFD_SCL_POINT_SIZE] =
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6646 (scl_val[XLFD_SCL_PIXEL_SIZE] > 0 ? scl_val[XLFD_SCL_PIXEL_SIZE] * 10
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6647 : (scl_val[XLFD_SCL_AVGWIDTH] > 0 ? scl_val[XLFD_SCL_AVGWIDTH]
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6648 : -1));
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6649 if (scl_val[XLFD_SCL_AVGWIDTH] < 0)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6650 scl_val[XLFD_SCL_AVGWIDTH] =
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6651 (scl_val[XLFD_SCL_PIXEL_SIZE] > 0 ? scl_val[XLFD_SCL_PIXEL_SIZE] * 10
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6652 : (scl_val[XLFD_SCL_POINT_SIZE] > 0 ? scl_val[XLFD_SCL_POINT_SIZE]
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6653 : -1));
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6654 }
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6655 else
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6656 scl_val[XLFD_SCL_PIXEL_SIZE] = -1;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6657
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6658 ptr = regex;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6659 *ptr++ = '^';
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6660
59034
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6661 longest_start = cur_start = ptr;
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
6662 longest_len = 0;
59034
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6663 exact = 1;
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6664
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6665 /* Turn pattern into a regexp and do a regexp match. Also find the
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6666 longest substring containing no special characters. */
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6667 for (; *pattern; pattern++)
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6668 {
59034
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6669 if (*pattern == '?' || *pattern == '*')
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6670 {
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
6671 if (ptr - cur_start > longest_len)
59034
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6672 {
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6673 longest_start = cur_start;
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
6674 longest_len = ptr - cur_start;
59034
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6675 }
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6676 exact = 0;
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6677
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6678 if (*pattern == '?')
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6679 *ptr++ = '.';
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6680 else /* if (*pattern == '*') */
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6681 {
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6682 *ptr++ = '.';
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6683 *ptr++ = '*';
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6684 }
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
6685 cur_start = ptr;
59034
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6686 }
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6687 else
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
6688 *ptr++ = tolower (*pattern);
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
6689 }
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
6690
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
6691 if (ptr - cur_start > longest_len)
59034
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6692 {
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6693 longest_start = cur_start;
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
6694 longest_len = ptr - cur_start;
59034
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6695 }
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6696
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6697 *ptr = '$';
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6698 *(ptr + 1) = '\0';
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6699
59034
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6700 nonspecial = xmalloc (longest_len + 1);
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6701 strncpy (nonspecial, longest_start, longest_len);
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6702 nonspecial[longest_len] = '\0';
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6703
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6704 pattern_regex = build_string (regex);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6705
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6706 for (i = 0; i < font_name_count; i++)
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6707 {
59034
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6708 fontname = mac_c_string_match (pattern_regex, font_name_table[i],
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6709 nonspecial, exact);
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6710 if (!NILP (fontname))
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6711 {
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6712 font_list = Fcons (fontname, font_list);
59034
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6713 if (exact || maxnames > 0 && ++n_fonts >= maxnames)
59041
b978ab01b88e (mac_do_list_fonts): Fix memory leak
Steven Tamm <steventamm@mac.com>
parents: 59034
diff changeset
6714 break;
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6715 }
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6716 else if (scl_val[XLFD_SCL_PIXEL_SIZE] > 0
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6717 && (ptr = strstr (font_name_table[i], "-0-0-75-75-m-0-")))
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6718 {
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6719 int former_len = ptr - font_name_table[i];
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6720
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6721 memcpy (scaled, font_name_table[i], former_len);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6722 sprintf (scaled + former_len,
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6723 "-%d-%d-75-75-m-%d-%s",
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6724 scl_val[XLFD_SCL_PIXEL_SIZE],
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6725 scl_val[XLFD_SCL_POINT_SIZE],
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6726 scl_val[XLFD_SCL_AVGWIDTH],
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6727 ptr + sizeof ("-0-0-75-75-m-0-") - 1);
59034
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6728 fontname = mac_c_string_match (pattern_regex, scaled,
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6729 nonspecial, exact);
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6730 if (!NILP (fontname))
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6731 {
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6732 font_list = Fcons (fontname, font_list);
59034
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6733 if (exact || maxnames > 0 && ++n_fonts >= maxnames)
59041
b978ab01b88e (mac_do_list_fonts): Fix memory leak
Steven Tamm <steventamm@mac.com>
parents: 59034
diff changeset
6734 break;
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6735 }
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6736 }
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6737 }
59034
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6738
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6739 xfree (nonspecial);
2dd8aacd82ce * term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents: 58634
diff changeset
6740
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6741 return font_list;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6742 }
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6743
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6744 /* Return a list of names of available fonts matching PATTERN on frame F.
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6745
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6746 Frame F null means we have not yet created any frame on Mac, and
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6747 consult the first display in x_display_list. MAXNAMES sets a limit
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6748 on how many fonts to match. */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6749
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6750 Lisp_Object
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6751 x_list_fonts (f, pattern, size, maxnames)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6752 struct frame *f;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6753 Lisp_Object pattern;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6754 int size, maxnames;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6755 {
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6756 Lisp_Object list = Qnil, patterns, tem, key;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6757 struct mac_display_info *dpyinfo
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6758 = f ? FRAME_MAC_DISPLAY_INFO (f) : x_display_list;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6759
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6760 xassert (size <= 0);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6761
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6762 patterns = Fassoc (pattern, Valternate_fontname_alist);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6763 if (NILP (patterns))
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6764 patterns = Fcons (pattern, Qnil);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6765
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6766 for (; CONSP (patterns); patterns = XCDR (patterns))
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6767 {
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6768 pattern = XCAR (patterns);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6769
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6770 if (!STRINGP (pattern))
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6771 continue;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6772
60635
e45b939c1d93 (x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60623
diff changeset
6773 tem = XCAR (XCDR (dpyinfo->name_list_element));
46169
36989d5089ee 2002-07-03 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46168
diff changeset
6774 key = Fcons (pattern, make_number (maxnames));
36989d5089ee 2002-07-03 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46168
diff changeset
6775
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6776 list = Fassoc (key, tem);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6777 if (!NILP (list))
46169
36989d5089ee 2002-07-03 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46168
diff changeset
6778 {
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6779 list = Fcdr_safe (list);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6780 /* We have a cashed list. Don't have to get the list again. */
46169
36989d5089ee 2002-07-03 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46168
diff changeset
6781 goto label_cached;
36989d5089ee 2002-07-03 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46168
diff changeset
6782 }
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6783
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6784 BLOCK_INPUT;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6785 list = mac_do_list_fonts (SDATA (pattern), maxnames);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6786 UNBLOCK_INPUT;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6787
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6788 /* MAC_TODO: add code for matching outline fonts here */
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6789
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6790 /* Now store the result in the cache. */
60635
e45b939c1d93 (x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60623
diff changeset
6791 XSETCAR (XCDR (dpyinfo->name_list_element),
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6792 Fcons (Fcons (key, list),
60635
e45b939c1d93 (x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60623
diff changeset
6793 XCAR (XCDR (dpyinfo->name_list_element))));
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6794
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6795 label_cached:
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6796 if (NILP (list)) continue; /* Try the remaining alternatives. */
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6797 }
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6798
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6799 return list;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6800 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6801
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6802
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6803 #if GLYPH_DEBUG
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6804
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6805 /* Check that FONT is valid on frame F. It is if it can be found in F's
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6806 font table. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6807
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6808 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6809 x_check_font (f, font)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6810 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6811 XFontStruct *font;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6812 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6813 int i;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6814 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6815
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6816 xassert (font != NULL);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6817
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6818 for (i = 0; i < dpyinfo->n_fonts; i++)
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
6819 if (dpyinfo->font_table[i].name
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6820 && font == dpyinfo->font_table[i].font)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6821 break;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6822
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6823 xassert (i < dpyinfo->n_fonts);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6824 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6825
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6826 #endif /* GLYPH_DEBUG != 0 */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6827
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6828 /* Set *W to the minimum width, *H to the minimum font height of FONT.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6829 Note: There are (broken) X fonts out there with invalid XFontStruct
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6830 min_bounds contents. For example, handa@etl.go.jp reports that
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6831 "-adobe-courier-medium-r-normal--*-180-*-*-m-*-iso8859-1" fonts
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6832 have font->min_bounds.width == 0. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6833
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6834 static INLINE void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6835 x_font_min_bounds (font, w, h)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6836 MacFontStruct *font;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6837 int *w, *h;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6838 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6839 *h = FONT_HEIGHT (font);
59325
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
6840 *w = font->min_bounds.width;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6841 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6842
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6843
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6844 /* Compute the smallest character width and smallest font height over
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6845 all fonts available on frame F. Set the members smallest_char_width
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6846 and smallest_font_height in F's x_display_info structure to
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6847 the values computed. Value is non-zero if smallest_font_height or
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6848 smallest_char_width become smaller than they were before. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6849
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6850 int
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6851 x_compute_min_glyph_bounds (f)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6852 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6853 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6854 int i;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6855 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6856 MacFontStruct *font;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6857 int old_width = dpyinfo->smallest_char_width;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6858 int old_height = dpyinfo->smallest_font_height;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
6859
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6860 dpyinfo->smallest_font_height = 100000;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6861 dpyinfo->smallest_char_width = 100000;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
6862
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6863 for (i = 0; i < dpyinfo->n_fonts; ++i)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6864 if (dpyinfo->font_table[i].name)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6865 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6866 struct font_info *fontp = dpyinfo->font_table + i;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6867 int w, h;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
6868
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6869 font = (MacFontStruct *) fontp->font;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6870 xassert (font != (MacFontStruct *) ~0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6871 x_font_min_bounds (font, &w, &h);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
6872
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6873 dpyinfo->smallest_font_height = min (dpyinfo->smallest_font_height, h);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6874 dpyinfo->smallest_char_width = min (dpyinfo->smallest_char_width, w);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6875 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6876
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6877 xassert (dpyinfo->smallest_char_width > 0
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6878 && dpyinfo->smallest_font_height > 0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6879
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6880 return (dpyinfo->n_fonts == 1
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6881 || dpyinfo->smallest_char_width < old_width
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6882 || dpyinfo->smallest_font_height < old_height);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6883 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6884
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6885
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6886 /* Determine whether given string is a fully-specified XLFD: all 14
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6887 fields are present, none is '*'. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6888
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6889 static int
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6890 is_fully_specified_xlfd (char *p)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6891 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6892 int i;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6893 char *q;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6894
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6895 if (*p != '-')
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6896 return 0;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
6897
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6898 for (i = 0; i < 13; i++)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6899 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6900 q = strchr (p + 1, '-');
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6901 if (q == NULL)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6902 return 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6903 if (q - p == 2 && *(p + 1) == '*')
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6904 return 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6905 p = q;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6906 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6907
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6908 if (strchr (p + 1, '-') != NULL)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6909 return 0;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
6910
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6911 if (*(p + 1) == '*' && *(p + 2) == '\0')
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6912 return 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6913
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6914 return 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6915 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6916
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6917
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6918 const int kDefaultFontSize = 12;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6919
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6920
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6921 /* XLoadQueryFont creates and returns an internal representation for a
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6922 font in a MacFontStruct struct. There is really no concept
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6923 corresponding to "loading" a font on the Mac. But we check its
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6924 existence and find the font number and all other information for it
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6925 and store them in the returned MacFontStruct. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6926
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6927 static MacFontStruct *
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6928 XLoadQueryFont (Display *dpy, char *fontname)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6929 {
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6930 int i, size, point_size, avgwidth, is_two_byte_font, char_width;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6931 char *name;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6932 GrafPtr port;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6933 SInt16 old_fontnum, old_fontsize;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6934 Style old_fontface;
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6935 Str32 mfontname, mfontname_decoded, charset;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6936 SInt16 fontnum;
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6937 Style fontface;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6938 #if TARGET_API_MAC_CARBON
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6939 TextEncoding encoding;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6940 int scriptcode;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6941 #else
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6942 short scriptcode;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6943 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6944 MacFontStruct *font;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6945 FontInfo the_fontinfo;
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6946 #ifdef MAC_OSX
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6947 UInt32 old_flags, new_flags;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6948 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6949
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6950 if (is_fully_specified_xlfd (fontname))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6951 name = fontname;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6952 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6953 {
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6954 Lisp_Object matched_fonts;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6955
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6956 matched_fonts = mac_do_list_fonts (fontname, 1);
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6957 if (NILP (matched_fonts))
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6958 return NULL;
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
6959 name = SDATA (XCAR (matched_fonts));
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6960 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6961
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6962 GetPort (&port); /* save the current font number used */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6963 #if TARGET_API_MAC_CARBON
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6964 old_fontnum = GetPortTextFont (port);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6965 old_fontsize = GetPortTextSize (port);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6966 old_fontface = GetPortTextFace (port);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6967 #else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6968 old_fontnum = port->txFont;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6969 old_fontsize = port->txSize;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6970 old_fontface = port->txFace;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6971 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6972
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6973 if (sscanf (name, "-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]--%d-%d-%*[^-]-%*[^-]-%*c-%d-%*s", &size, &point_size, &avgwidth) != 3)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6974 size = 0;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6975 else
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6976 {
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6977 if (size == 0)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6978 if (point_size > 0)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6979 size = point_size / 10;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6980 else if (avgwidth > 0)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6981 size = avgwidth / 10;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6982 }
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6983 if (size == 0)
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6984 size = kDefaultFontSize;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6985
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6986 x_font_name_to_mac_font_name (name, mfontname, mfontname_decoded,
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6987 &fontface, charset);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6988 c2pstr (mfontname);
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6989 #if TARGET_API_MAC_CARBON
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6990 fontnum = FMGetFontFamilyFromName (mfontname);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6991 if (fontnum == kInvalidFontFamily
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6992 || FMGetFontFamilyTextEncoding (fontnum, &encoding) != noErr)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6993 return NULL;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6994 scriptcode = GetTextEncodingBase (encoding);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6995 #else
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6996 GetFNum (mfontname, &fontnum);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6997 if (fontnum == 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
6998 return NULL;
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
6999 scriptcode = FontToScript (fontnum);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
7000 #endif
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7001
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7002 font = (MacFontStruct *) xmalloc (sizeof (struct MacFontStruct));
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7003
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7004 font->mac_fontnum = fontnum;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7005 font->mac_fontsize = size;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7006 font->mac_fontface = fontface;
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
7007 font->mac_scriptcode = scriptcode;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7008
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7009 /* Apple Japanese (SJIS) font is listed as both
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7010 "*-jisx0208.1983-sjis" (Japanese script) and "*-jisx0201.1976-0"
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7011 (Roman script) in init_font_name_table (). The latter should be
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7012 treated as a one-byte font. */
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
7013 if (scriptcode == smJapanese && strcmp (charset, "jisx0201.1976-0") == 0)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
7014 font->mac_scriptcode = smRoman;
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
7015
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
7016 font->full_name = mac_to_x_fontname (mfontname_decoded, size, fontface, charset);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7017
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7018 is_two_byte_font = font->mac_scriptcode == smJapanese ||
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7019 font->mac_scriptcode == smTradChinese ||
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7020 font->mac_scriptcode == smSimpChinese ||
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7021 font->mac_scriptcode == smKorean;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7022
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7023 TextFont (fontnum);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7024 TextSize (size);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7025 TextFace (fontface);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7026
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7027 GetFontInfo (&the_fontinfo);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7028
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7029 font->ascent = the_fontinfo.ascent;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7030 font->descent = the_fontinfo.descent;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7031
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7032 font->min_byte1 = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7033 if (is_two_byte_font)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7034 font->max_byte1 = 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7035 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7036 font->max_byte1 = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7037 font->min_char_or_byte2 = 0x20;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7038 font->max_char_or_byte2 = 0xff;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7039
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7040 if (is_two_byte_font)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7041 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7042 /* Use the width of an "ideographic space" of that font because
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7043 the_fontinfo.widMax returns the wrong width for some fonts. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7044 switch (font->mac_scriptcode)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7045 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7046 case smJapanese:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7047 char_width = StringWidth("\p\x81\x40");
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7048 break;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7049 case smTradChinese:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7050 char_width = StringWidth("\p\xa1\x40");
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7051 break;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7052 case smSimpChinese:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7053 char_width = StringWidth("\p\xa1\xa1");
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7054 break;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7055 case smKorean:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7056 char_width = StringWidth("\p\xa1\xa1");
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7057 break;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7058 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7059 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7060 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7061 /* Do this instead of use the_fontinfo.widMax, which incorrectly
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7062 returns 15 for 12-point Monaco! */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7063 char_width = CharWidth ('m');
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7064
59718
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7065 if (is_two_byte_font)
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7066 {
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7067 font->per_char = NULL;
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7068
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7069 if (fontface & italic)
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7070 font->max_bounds.rbearing = char_width + 1;
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7071 else
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7072 font->max_bounds.rbearing = char_width;
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7073 font->max_bounds.lbearing = 0;
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7074 font->max_bounds.width = char_width;
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7075 font->max_bounds.ascent = the_fontinfo.ascent;
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7076 font->max_bounds.descent = the_fontinfo.descent;
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7077
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7078 font->min_bounds = font->max_bounds;
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7079 }
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7080 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7081 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7082 font->per_char = (XCharStruct *)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7083 xmalloc (sizeof (XCharStruct) * (0xff - 0x20 + 1));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7084 {
59718
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7085 int c, min_width, max_width;
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7086 Rect char_bounds, min_bounds, max_bounds;
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7087 char ch;
59325
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7088
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7089 min_width = max_width = char_width;
59718
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7090 SetRect (&min_bounds, -32767, -32767, 32767, 32767);
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7091 SetRect (&max_bounds, 0, 0, 0, 0);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7092 for (c = 0x20; c <= 0xff; c++)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7093 {
59718
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7094 ch = c;
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7095 char_width = CharWidth (ch);
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7096 QDTextBounds (1, &ch, &char_bounds);
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7097 STORE_XCHARSTRUCT (font->per_char[c - 0x20],
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7098 char_width, char_bounds);
59407
b0b469611a56 * macterm.c (XLoadQueryFont): Correctly handle 0 size
Steven Tamm <steventamm@mac.com>
parents: 59384
diff changeset
7099 /* Some Japanese fonts (in SJIS encoding) return 0 as the
b0b469611a56 * macterm.c (XLoadQueryFont): Correctly handle 0 size
Steven Tamm <steventamm@mac.com>
parents: 59384
diff changeset
7100 character width of 0x7f. */
b0b469611a56 * macterm.c (XLoadQueryFont): Correctly handle 0 size
Steven Tamm <steventamm@mac.com>
parents: 59384
diff changeset
7101 if (char_width > 0)
b0b469611a56 * macterm.c (XLoadQueryFont): Correctly handle 0 size
Steven Tamm <steventamm@mac.com>
parents: 59384
diff changeset
7102 {
b0b469611a56 * macterm.c (XLoadQueryFont): Correctly handle 0 size
Steven Tamm <steventamm@mac.com>
parents: 59384
diff changeset
7103 min_width = min (min_width, char_width);
b0b469611a56 * macterm.c (XLoadQueryFont): Correctly handle 0 size
Steven Tamm <steventamm@mac.com>
parents: 59384
diff changeset
7104 max_width = max (max_width, char_width);
b0b469611a56 * macterm.c (XLoadQueryFont): Correctly handle 0 size
Steven Tamm <steventamm@mac.com>
parents: 59384
diff changeset
7105 }
59718
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7106 if (!EmptyRect (&char_bounds))
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7107 {
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7108 SetRect (&min_bounds,
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7109 max (min_bounds.left, char_bounds.left),
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7110 max (min_bounds.top, char_bounds.top),
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7111 min (min_bounds.right, char_bounds.right),
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7112 min (min_bounds.bottom, char_bounds.bottom));
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7113 UnionRect (&max_bounds, &char_bounds, &max_bounds);
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7114 }
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7115 }
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7116 STORE_XCHARSTRUCT (font->min_bounds, min_width, min_bounds);
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7117 STORE_XCHARSTRUCT (font->max_bounds, max_width, max_bounds);
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7118 if (min_width == max_width
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7119 && max_bounds.left >= 0 && max_bounds.right <= max_width)
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7120 {
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7121 /* Fixed width and no overhangs. */
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7122 xfree (font->per_char);
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7123 font->per_char = NULL;
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
7124 }
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7125 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7126 }
59586
2f6084ef9fec (syms_of_macterm) <mac-allow-anti-aliasing>: Doc fix.
Kim F. Storm <storm@cua.dk>
parents: 59585
diff changeset
7127
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7128 TextFont (old_fontnum); /* restore previous font number, size and face */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7129 TextSize (old_fontsize);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7130 TextFace (old_fontface);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7131
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7132 return font;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7133 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7134
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7135
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7136 void
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7137 mac_unload_font (dpyinfo, font)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7138 struct mac_display_info *dpyinfo;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7139 XFontStruct *font;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7140 {
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
7141 xfree (font->full_name);
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7142 if (font->per_char)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7143 xfree (font->per_char);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7144 xfree (font);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7145 }
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7147
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7148 /* Load font named FONTNAME of the size SIZE for frame F, and return a
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7149 pointer to the structure font_info while allocating it dynamically.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7150 If SIZE is 0, load any size of font.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7151 If loading is failed, return NULL. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7152
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7153 struct font_info *
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7154 x_load_font (f, fontname, size)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7155 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7156 register char *fontname;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7157 int size;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7158 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7159 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7160 Lisp_Object font_names;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7161
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7162 /* Get a list of all the fonts that match this name. Once we
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7163 have a list of matching fonts, we compare them against the fonts
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7164 we already have by comparing names. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7165 font_names = x_list_fonts (f, build_string (fontname), size, 1);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7166
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7167 if (!NILP (font_names))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7168 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7169 Lisp_Object tail;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7170 int i;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7171
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7172 for (i = 0; i < dpyinfo->n_fonts; i++)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7173 for (tail = font_names; CONSP (tail); tail = XCDR (tail))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7174 if (dpyinfo->font_table[i].name
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7175 && (!strcmp (dpyinfo->font_table[i].name,
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46169
diff changeset
7176 SDATA (XCAR (tail)))
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7177 || !strcmp (dpyinfo->font_table[i].full_name,
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46169
diff changeset
7178 SDATA (XCAR (tail)))))
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7179 return (dpyinfo->font_table + i);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7180 }
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
7181 else
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
7182 return NULL;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7183
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7184 /* Load the font and add it to the table. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7185 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7186 char *full_name;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7187 struct MacFontStruct *font;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7188 struct font_info *fontp;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7189 unsigned long value;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7190 int i;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7191
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
7192 fontname = (char *) SDATA (XCAR (font_names));
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7193
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7194 BLOCK_INPUT;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7195 font = (MacFontStruct *) XLoadQueryFont (FRAME_MAC_DISPLAY (f), fontname);
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7196 UNBLOCK_INPUT;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7197 if (!font)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7198 return NULL;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7199
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7200 /* Find a free slot in the font table. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7201 for (i = 0; i < dpyinfo->n_fonts; ++i)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7202 if (dpyinfo->font_table[i].name == NULL)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7203 break;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7204
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7205 /* If no free slot found, maybe enlarge the font table. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7206 if (i == dpyinfo->n_fonts
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7207 && dpyinfo->n_fonts == dpyinfo->font_table_size)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7208 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7209 int sz;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7210 dpyinfo->font_table_size = max (16, 2 * dpyinfo->font_table_size);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7211 sz = dpyinfo->font_table_size * sizeof *dpyinfo->font_table;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7212 dpyinfo->font_table
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7213 = (struct font_info *) xrealloc (dpyinfo->font_table, sz);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7214 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7215
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7216 fontp = dpyinfo->font_table + i;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7217 if (i == dpyinfo->n_fonts)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7218 ++dpyinfo->n_fonts;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7219
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7220 /* Now fill in the slots of *FONTP. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7221 BLOCK_INPUT;
52742
7f9bdf6cf89b (x_load_font): Clear all members of FONTP before start filling them.
Kenichi Handa <handa@m17n.org>
parents: 52401
diff changeset
7222 bzero (fontp, sizeof (*fontp));
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7223 fontp->font = font;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7224 fontp->font_idx = i;
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
7225 fontp->name = (char *) xmalloc (strlen (fontname) + 1);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
7226 bcopy (fontname, fontp->name, strlen (fontname) + 1);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7227
59325
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7228 if (font->min_bounds.width == font->max_bounds.width)
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7229 {
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7230 /* Fixed width font. */
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7231 fontp->average_width = fontp->space_width = font->min_bounds.width;
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7232 }
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7233 else
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7234 {
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7235 XChar2b char2b;
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7236 XCharStruct *pcm;
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7237
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7238 char2b.byte1 = 0x00, char2b.byte2 = 0x20;
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7239 pcm = mac_per_char_metric (font, &char2b, 0);
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7240 if (pcm)
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7241 fontp->space_width = pcm->width;
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7242 else
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7243 fontp->space_width = FONT_WIDTH (font);
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7244
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7245 if (pcm)
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7246 {
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7247 int width = pcm->width;
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7248 for (char2b.byte2 = 33; char2b.byte2 <= 126; char2b.byte2++)
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7249 if ((pcm = mac_per_char_metric (font, &char2b, 0)) != NULL)
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7250 width += pcm->width;
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7251 fontp->average_width = width / 95;
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7252 }
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7253 else
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7254 fontp->average_width = FONT_WIDTH (font);
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7255 }
68eaccfa130a * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents: 59199
diff changeset
7256
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
7257 fontp->full_name = (char *) xmalloc (strlen (font->full_name) + 1);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
7258 bcopy (font->full_name, fontp->full_name, strlen (font->full_name) + 1);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7259
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7260 fontp->size = font->max_bounds.width;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7261 fontp->height = FONT_HEIGHT (font);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7262 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7263 /* For some font, ascent and descent in max_bounds field is
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7264 larger than the above value. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7265 int max_height = font->max_bounds.ascent + font->max_bounds.descent;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7266 if (max_height > fontp->height)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7267 fontp->height = max_height;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7268 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7269
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7270 /* The slot `encoding' specifies how to map a character
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7271 code-points (0x20..0x7F or 0x2020..0x7F7F) of each charset to
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7272 the font code-points (0:0x20..0x7F, 1:0xA0..0xFF), or
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7273 (0:0x2020..0x7F7F, 1:0xA0A0..0xFFFF, 3:0x20A0..0x7FFF,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7274 2:0xA020..0xFF7F). For the moment, we don't know which charset
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7275 uses this font. So, we set information in fontp->encoding[1]
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7276 which is never used by any charset. If mapping can't be
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7277 decided, set FONT_ENCODING_NOT_DECIDED. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7278 if (font->mac_scriptcode == smJapanese)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7279 fontp->encoding[1] = 4;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7280 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7281 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7282 fontp->encoding[1]
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7283 = (font->max_byte1 == 0
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7284 /* 1-byte font */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7285 ? (font->min_char_or_byte2 < 0x80
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7286 ? (font->max_char_or_byte2 < 0x80
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7287 ? 0 /* 0x20..0x7F */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7288 : FONT_ENCODING_NOT_DECIDED) /* 0x20..0xFF */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7289 : 1) /* 0xA0..0xFF */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7290 /* 2-byte font */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7291 : (font->min_byte1 < 0x80
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7292 ? (font->max_byte1 < 0x80
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7293 ? (font->min_char_or_byte2 < 0x80
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7294 ? (font->max_char_or_byte2 < 0x80
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7295 ? 0 /* 0x2020..0x7F7F */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7296 : FONT_ENCODING_NOT_DECIDED) /* 0x2020..0x7FFF */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7297 : 3) /* 0x20A0..0x7FFF */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7298 : FONT_ENCODING_NOT_DECIDED) /* 0x20??..0xA0?? */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7299 : (font->min_char_or_byte2 < 0x80
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7300 ? (font->max_char_or_byte2 < 0x80
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7301 ? 2 /* 0xA020..0xFF7F */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7302 : FONT_ENCODING_NOT_DECIDED) /* 0xA020..0xFFFF */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7303 : 1))); /* 0xA0A0..0xFFFF */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7304 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7305
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7306 #if 0 /* MAC_TODO: fill these out with more reasonably values */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7307 fontp->baseline_offset
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7308 = (XGetFontProperty (font, dpyinfo->Xatom_MULE_BASELINE_OFFSET, &value)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7309 ? (long) value : 0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7310 fontp->relative_compose
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7311 = (XGetFontProperty (font, dpyinfo->Xatom_MULE_RELATIVE_COMPOSE, &value)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7312 ? (long) value : 0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7313 fontp->default_ascent
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7314 = (XGetFontProperty (font, dpyinfo->Xatom_MULE_DEFAULT_ASCENT, &value)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7315 ? (long) value : 0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7316 #else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7317 fontp->baseline_offset = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7318 fontp->relative_compose = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7319 fontp->default_ascent = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7320 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7321
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7322 /* Set global flag fonts_changed_p to non-zero if the font loaded
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7323 has a character with a smaller width than any other character
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7324 before, or if the font loaded has a smalle>r height than any
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7325 other font loaded before. If this happens, it will make a
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7326 glyph matrix reallocation necessary. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7327 fonts_changed_p = x_compute_min_glyph_bounds (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7328 UNBLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7329 return fontp;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7330 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7331 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7332
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7333
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7334 /* Return a pointer to struct font_info of a font named FONTNAME for
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7335 frame F. If no such font is loaded, return NULL. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7336
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7337 struct font_info *
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7338 x_query_font (f, fontname)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7339 struct frame *f;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7340 register char *fontname;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7341 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7342 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7343 int i;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7344
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7345 for (i = 0; i < dpyinfo->n_fonts; i++)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7346 if (dpyinfo->font_table[i].name
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7347 && (!strcmp (dpyinfo->font_table[i].name, fontname)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7348 || !strcmp (dpyinfo->font_table[i].full_name, fontname)))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7349 return (dpyinfo->font_table + i);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7350 return NULL;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7351 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7352
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7353
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7354 /* Find a CCL program for a font specified by FONTP, and set the member
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7355 `encoder' of the structure. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7356
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7357 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7358 x_find_ccl_program (fontp)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7359 struct font_info *fontp;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7360 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7361 Lisp_Object list, elt;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7362
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7363 for (list = Vfont_ccl_encoder_alist; CONSP (list); list = XCDR (list))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7364 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7365 elt = XCAR (list);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7366 if (CONSP (elt)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7367 && STRINGP (XCAR (elt))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7368 && (fast_c_string_match_ignore_case (XCAR (elt), fontp->name)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7369 >= 0))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7370 break;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7371 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7372 if (! NILP (list))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7373 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7374 struct ccl_program *ccl
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7375 = (struct ccl_program *) xmalloc (sizeof (struct ccl_program));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7376
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7377 if (setup_ccl_program (ccl, XCDR (elt)) < 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7378 xfree (ccl);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7379 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7380 fontp->font_encoder = ccl;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7381 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7382 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7383
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7384
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7385
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7386 /* The Mac Event loop code */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7387
60364
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
7388 #if !TARGET_API_MAC_CARBON
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7389 #include <Events.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7390 #include <Quickdraw.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7391 #include <Balloons.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7392 #include <Devices.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7393 #include <Fonts.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7394 #include <Gestalt.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7395 #include <Menus.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7396 #include <Processes.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7397 #include <Sound.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7398 #include <ToolUtils.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7399 #include <TextUtils.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7400 #include <Dialogs.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7401 #include <Script.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7402 #include <Types.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7403 #include <Resources.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7404
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7405 #if __MWERKS__
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7406 #include <unix.h>
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7407 #endif
60364
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
7408 #endif /* ! TARGET_API_MAC_CARBON */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7409
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7410 #define M_APPLE 128
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7411 #define I_ABOUT 1
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7412
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7413 #define WINDOW_RESOURCE 128
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7414 #define TERM_WINDOW_RESOURCE 129
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7415
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7416 #define DEFAULT_NUM_COLS 80
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7417
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7418 #define MIN_DOC_SIZE 64
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7419 #define MAX_DOC_SIZE 32767
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7420
61786
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
7421 #if 0
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7422 /* sleep time for WaitNextEvent */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7423 #define WNE_SLEEP_AT_SUSPEND 10
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7424 #define WNE_SLEEP_AT_RESUME 1
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7425
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7426 /* the flag appl_is_suspended is used both for determining the sleep
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7427 time to be passed to WaitNextEvent and whether the cursor should be
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7428 drawn when updating the display. The cursor is turned off when
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7429 Emacs is suspended. Redrawing it is unnecessary and what needs to
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7430 be done depends on whether the cursor lies inside or outside the
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7431 redraw region. So we might as well skip drawing it when Emacs is
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7432 suspended. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7433 static Boolean app_is_suspended = false;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7434 static long app_sleep_time = WNE_SLEEP_AT_RESUME;
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7435 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7436
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7437 #define EXTRA_STACK_ALLOC (256 * 1024)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7438
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7439 #define ARGV_STRING_LIST_ID 129
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7440 #define ABOUT_ALERT_ID 128
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7441 #define RAM_TOO_LARGE_ALERT_ID 129
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7442
53956
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
7443 /* Contains the string "reverse", which is a constant for mouse button emu.*/
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
7444 Lisp_Object Qreverse;
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
7445
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7446 /* True if using command key as meta key. */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7447 Lisp_Object Vmac_command_key_is_meta;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7448
57783
4cb8cebc3255 2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents: 57425
diff changeset
7449 /* Modifier associated with the option key, or nil for normal behavior. */
4cb8cebc3255 2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents: 57425
diff changeset
7450 Lisp_Object Vmac_option_modifier;
4cb8cebc3255 2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents: 57425
diff changeset
7451
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7452 /* True if the ctrl and meta keys should be reversed. */
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7453 Lisp_Object Vmac_reverse_ctrl_meta;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7454
53956
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
7455 /* True if the option and command modifiers should be used to emulate
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
7456 a three button mouse */
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
7457 Lisp_Object Vmac_emulate_three_button_mouse;
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
7458
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7459 #if USE_CARBON_EVENTS
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7460 /* True if the mouse wheel button (i.e. button 4) should map to
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7461 mouse-2, instead of mouse-3. */
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7462 Lisp_Object Vmac_wheel_button_is_mouse_2;
46860
8b7ade57211d 2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46856
diff changeset
7463
8b7ade57211d 2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46856
diff changeset
7464 /* If Non-nil, the Mac "Command" key is passed on to the Mac Toolbox
8b7ade57211d 2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46856
diff changeset
7465 for processing before Emacs sees it. */
8b7ade57211d 2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46856
diff changeset
7466 Lisp_Object Vmac_pass_command_to_system;
8b7ade57211d 2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46856
diff changeset
7467
8b7ade57211d 2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46856
diff changeset
7468 /* If Non-nil, the Mac "Control" key is passed on to the Mac Toolbox
8b7ade57211d 2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46856
diff changeset
7469 for processing before Emacs sees it. */
8b7ade57211d 2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46856
diff changeset
7470 Lisp_Object Vmac_pass_control_to_system;
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7471 #endif
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7472
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7473 /* Set in term/mac-win.el to indicate that event loop can now generate
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7474 drag and drop events. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7475 Lisp_Object Qmac_ready_for_drag_n_drop;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7476
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7477 Lisp_Object drag_and_drop_file_list;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7478
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7479 Point saved_menu_event_location;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7480
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7481 /* Apple Events */
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7482 static void init_required_apple_events (void);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7483 static pascal OSErr
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7484 do_ae_open_application (const AppleEvent *, AppleEvent *, long);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7485 static pascal OSErr
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7486 do_ae_print_documents (const AppleEvent *, AppleEvent *, long);
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7487 static pascal OSErr do_ae_open_documents (AppleEvent *, AppleEvent *, long);
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7488 static pascal OSErr do_ae_quit_application (AppleEvent *, AppleEvent *, long);
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7489
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7490 #if TARGET_API_MAC_CARBON
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7491 /* Drag and Drop */
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
7492 static pascal OSErr mac_do_track_drag (DragTrackingMessage, WindowPtr, void*, DragReference);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7493 static pascal OSErr mac_do_receive_drag (WindowPtr, void*, DragReference);
60364
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
7494 static DragTrackingHandlerUPP mac_do_track_dragUPP = NULL;
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
7495 static DragReceiveHandlerUPP mac_do_receive_dragUPP = NULL;
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7496 #endif
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7497
61786
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
7498 static Lisp_Object Qapplication, Qabout;
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7499 #if USE_CARBON_EVENTS
60364
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
7500 #ifdef MAC_OSX
61786
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
7501 extern void init_service_handler ();
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
7502 static Lisp_Object Qpreferences, Qservices, Qpaste, Qperform;
60364
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
7503 #endif
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7504 /* Window Event Handler */
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7505 static pascal OSStatus mac_handle_window_event (EventHandlerCallRef,
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7506 EventRef, void *);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7507 #endif
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
7508 OSErr install_window_handler (WindowPtr);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7509
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7510 extern void init_emacs_passwd_dir ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7511 extern int emacs_main (int, char **, char **);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7512
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7513 extern void initialize_applescript();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7514 extern void terminate_applescript();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7515
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7516 static unsigned int
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7517 #if USE_CARBON_EVENTS
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7518 mac_to_emacs_modifiers (UInt32 mods)
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7519 #else
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7520 mac_to_emacs_modifiers (EventModifiers mods)
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7521 #endif
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7522 {
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7523 unsigned int result = 0;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7524 if (mods & macShiftKey)
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7525 result |= shift_modifier;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7526 if (mods & macCtrlKey)
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7527 result |= ctrl_modifier;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7528 if (mods & macMetaKey)
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7529 result |= meta_modifier;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7530 if (NILP (Vmac_command_key_is_meta) && (mods & macAltKey))
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7531 result |= alt_modifier;
57783
4cb8cebc3255 2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents: 57425
diff changeset
7532 if (!NILP (Vmac_option_modifier) && (mods & optionKey)) {
4cb8cebc3255 2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents: 57425
diff changeset
7533 Lisp_Object val = Fget(Vmac_option_modifier, Qmodifier_value);
4cb8cebc3255 2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents: 57425
diff changeset
7534 if (!NILP(val))
4cb8cebc3255 2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents: 57425
diff changeset
7535 result |= XUINT(val);
4cb8cebc3255 2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents: 57425
diff changeset
7536 }
4cb8cebc3255 2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents: 57425
diff changeset
7537
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7538 return result;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7539 }
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7540
53956
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
7541 static int
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
7542 mac_get_emulated_btn ( UInt32 modifiers )
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
7543 {
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
7544 int result = 0;
55583
21f88361795c Various fixes to support USE_LSB_TAG with carbon emacs. Mostly fixing
Steven Tamm <steventamm@mac.com>
parents: 55539
diff changeset
7545 if (!NILP (Vmac_emulate_three_button_mouse)) {
21f88361795c Various fixes to support USE_LSB_TAG with carbon emacs. Mostly fixing
Steven Tamm <steventamm@mac.com>
parents: 55539
diff changeset
7546 int cmdIs3 = !EQ (Vmac_emulate_three_button_mouse, Qreverse);
56277
fd126130c3cd macterm.c (mac_get_emulated_btn)
Steven Tamm <steventamm@mac.com>
parents: 56271
diff changeset
7547 if (modifiers & cmdKey)
53956
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
7548 result = cmdIs3 ? 2 : 1;
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
7549 else if (modifiers & optionKey)
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
7550 result = cmdIs3 ? 1 : 2;
53956
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
7551 }
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
7552 return result;
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
7553 }
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
7554
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7555 #if USE_CARBON_EVENTS
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7556 /* Obtains the event modifiers from the event ref and then calls
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7557 mac_to_emacs_modifiers. */
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7558 static int
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7559 mac_event_to_emacs_modifiers (EventRef eventRef)
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7560 {
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7561 UInt32 mods = 0;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7562 GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32, NULL,
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7563 sizeof (UInt32), NULL, &mods);
55583
21f88361795c Various fixes to support USE_LSB_TAG with carbon emacs. Mostly fixing
Steven Tamm <steventamm@mac.com>
parents: 55539
diff changeset
7564 if (!NILP (Vmac_emulate_three_button_mouse) &&
53956
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
7565 GetEventClass(eventRef) == kEventClassMouse)
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
7566 {
56277
fd126130c3cd macterm.c (mac_get_emulated_btn)
Steven Tamm <steventamm@mac.com>
parents: 56271
diff changeset
7567 mods &= ~(optionKey | cmdKey);
53956
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
7568 }
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7569 return mac_to_emacs_modifiers (mods);
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7570 }
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7571
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7572 /* Given an event ref, return the code to use for the mouse button
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7573 code in the emacs input_event. */
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7574 static int
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7575 mac_get_mouse_btn (EventRef ref)
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7576 {
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7577 EventMouseButton result = kEventMouseButtonPrimary;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7578 GetEventParameter (ref, kEventParamMouseButton, typeMouseButton, NULL,
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7579 sizeof (EventMouseButton), NULL, &result);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7580 switch (result)
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7581 {
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7582 case kEventMouseButtonPrimary:
55583
21f88361795c Various fixes to support USE_LSB_TAG with carbon emacs. Mostly fixing
Steven Tamm <steventamm@mac.com>
parents: 55539
diff changeset
7583 if (NILP (Vmac_emulate_three_button_mouse))
53956
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
7584 return 0;
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
7585 else {
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
7586 UInt32 mods = 0;
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
7587 GetEventParameter (ref, kEventParamKeyModifiers, typeUInt32, NULL,
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
7588 sizeof (UInt32), NULL, &mods);
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
7589 return mac_get_emulated_btn(mods);
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
7590 }
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7591 case kEventMouseButtonSecondary:
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7592 return NILP (Vmac_wheel_button_is_mouse_2) ? 1 : 2;
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7593 case kEventMouseButtonTertiary:
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7594 case 4: /* 4 is the number for the mouse wheel button */
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7595 return NILP (Vmac_wheel_button_is_mouse_2) ? 2 : 1;
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7596 default:
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7597 return 0;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7598 }
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7599 }
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7600
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7601 /* Normally, ConvertEventRefToEventRecord will correctly handle all
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7602 events. However the click of the mouse wheel is not converted to a
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7603 mouseDown or mouseUp event. This calls ConvertEventRef, but then
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7604 checks to see if it is a mouse up or down carbon event that has not
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7605 been converted, and if so, converts it by hand (to be picked up in
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7606 the XTread_socket loop). */
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7607 static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec)
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7608 {
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7609 Boolean result = ConvertEventRefToEventRecord (eventRef, eventRec);
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7610 /* Do special case for mouse wheel button. */
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7611 if (!result && GetEventClass (eventRef) == kEventClassMouse)
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7612 {
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7613 UInt32 kind = GetEventKind (eventRef);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7614 if (kind == kEventMouseDown && !(eventRec->what == mouseDown))
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7615 {
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7616 eventRec->what = mouseDown;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7617 result=1;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7618 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7619 if (kind == kEventMouseUp && !(eventRec->what == mouseUp))
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7620 {
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7621 eventRec->what = mouseUp;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7622 result=1;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7623 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7624 if (result)
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7625 {
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7626 /* Need where and when. */
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7627 UInt32 mods;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7628 GetEventParameter (eventRef, kEventParamMouseLocation,
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7629 typeQDPoint, NULL, sizeof (Point),
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7630 NULL, &eventRec->where);
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7631 /* Use two step process because new event modifiers are
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7632 32-bit and old are 16-bit. Currently, only loss is
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7633 NumLock & Fn. */
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7634 GetEventParameter (eventRef, kEventParamKeyModifiers,
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7635 typeUInt32, NULL, sizeof (UInt32),
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7636 NULL, &mods);
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7637 eventRec->modifiers = mods;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7638
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7639 eventRec->when = EventTimeToTicks (GetEventTime (eventRef));
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7640 }
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7641 }
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7642 return result;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7643 }
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7644
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
7645 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7646
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7647 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7648 do_get_menus (void)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7649 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7650 Handle menubar_handle;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7651 MenuHandle menu_handle;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7652
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7653 menubar_handle = GetNewMBar (128);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7654 if(menubar_handle == NULL)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7655 abort ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7656 SetMenuBar (menubar_handle);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7657 DrawMenuBar ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7658
61786
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
7659 #if !TARGET_API_MAC_CARBON
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7660 menu_handle = GetMenuHandle (M_APPLE);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7661 if(menu_handle != NULL)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7662 AppendResMenu (menu_handle,'DRVR');
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7663 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7664 abort ();
61786
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
7665 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7666 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7667
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7668
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7669 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7670 do_init_managers (void)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7671 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7672 #if !TARGET_API_MAC_CARBON
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7673 InitGraf (&qd.thePort);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7674 InitFonts ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7675 FlushEvents (everyEvent, 0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7676 InitWindows ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7677 InitMenus ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7678 TEInit ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7679 InitDialogs (NULL);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7680 #endif /* !TARGET_API_MAC_CARBON */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7681 InitCursor ();
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7682
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7683 #if !TARGET_API_MAC_CARBON
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7684 /* set up some extra stack space for use by emacs */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7685 SetApplLimit ((Ptr) ((long) GetApplLimit () - EXTRA_STACK_ALLOC));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7686
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7687 /* MaxApplZone must be called for AppleScript to execute more
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7688 complicated scripts */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7689 MaxApplZone ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7690 MoreMasters ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7691 #endif /* !TARGET_API_MAC_CARBON */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7692 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7693
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7694 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7695 do_check_ram_size (void)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7696 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7697 SInt32 physical_ram_size, logical_ram_size;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7698
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7699 if (Gestalt (gestaltPhysicalRAMSize, &physical_ram_size) != noErr
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7700 || Gestalt (gestaltLogicalRAMSize, &logical_ram_size) != noErr
53579
862b91168878 (do_check_ram_size): Don't hardcode the lisp address space size.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 53475
diff changeset
7701 || physical_ram_size > (1 << VALBITS)
862b91168878 (do_check_ram_size): Don't hardcode the lisp address space size.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 53475
diff changeset
7702 || logical_ram_size > (1 << VALBITS))
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7703 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7704 StopAlert (RAM_TOO_LARGE_ALERT_ID, NULL);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7705 exit (1);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7706 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7707 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7708
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7709 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7710 do_window_update (WindowPtr win)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7711 {
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
7712 struct frame *f = mac_window_to_frame (win);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
7713
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7714 BeginUpdate (win);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7715
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7716 /* The tooltip has been drawn already. Avoid the SET_FRAME_GARBAGED
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7717 below. */
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7718 if (win != tip_window)
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7719 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7720 if (f->async_visible == 0)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7721 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7722 f->async_visible = 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7723 f->async_iconified = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7724 SET_FRAME_GARBAGED (f);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7725
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7726 /* An update event is equivalent to MapNotify on X, so report
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7727 visibility changes properly. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7728 if (! NILP(Vframe_list) && ! NILP (XCDR (Vframe_list)))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7729 /* Force a redisplay sooner or later to update the
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7730 frame titles in case this is the second frame. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7731 record_asynch_buffer_change ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7732 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7733 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7734 {
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7735 Rect r;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7736
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7737 #if TARGET_API_MAC_CARBON
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7738 {
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7739 RgnHandle region = NewRgn ();
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7740
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7741 GetPortVisibleRegion (GetWindowPort (win), region);
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
7742 GetRegionBounds (region, &r);
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
7743 expose_frame (f, r.left, r.top, r.right - r.left, r.bottom - r.top);
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7744 UpdateControls (win, region);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7745 DisposeRgn (region);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7746 }
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7747 #else
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
7748 r = (*win->visRgn)->rgnBBox;
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
7749 expose_frame (f, r.left, r.top, r.right - r.left, r.bottom - r.top);
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7750 UpdateControls (win, win->visRgn);
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
7751 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7752 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7753 }
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7754
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7755 EndUpdate (win);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7756 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7757
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7758 static int
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7759 is_emacs_window (WindowPtr win)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7760 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7761 Lisp_Object tail, frame;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7762
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7763 if (!win)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7764 return 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7765
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7766 FOR_EACH_FRAME (tail, frame)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7767 if (FRAME_MAC_P (XFRAME (frame)))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7768 if (FRAME_MAC_WINDOW (XFRAME (frame)) == win)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7769 return 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7770
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7771 return 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7772 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7773
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7774 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7775 do_app_resume ()
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7776 {
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7777 /* Window-activate events will do the job. */
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7778 #if 0
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7779 app_is_suspended = false;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7780 app_sleep_time = WNE_SLEEP_AT_RESUME;
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7781 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7782 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7783
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7784 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7785 do_app_suspend ()
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7786 {
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7787 /* Window-deactivate events will do the job. */
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7788 #if 0
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7789 app_is_suspended = true;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7790 app_sleep_time = WNE_SLEEP_AT_SUSPEND;
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7791 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7792 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7793
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7794
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7795 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7796 do_apple_menu (SInt16 menu_item)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7797 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7798 #if !TARGET_API_MAC_CARBON
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7799 Str255 item_name;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7800 SInt16 da_driver_refnum;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7801
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7802 if (menu_item == I_ABOUT)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7803 NoteAlert (ABOUT_ALERT_ID, NULL);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7804 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7805 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7806 GetMenuItemText (GetMenuHandle (M_APPLE), menu_item, item_name);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7807 da_driver_refnum = OpenDeskAcc (item_name);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7808 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7809 #endif /* !TARGET_API_MAC_CARBON */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7810 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7811
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7812 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7813 do_menu_choice (SInt32 menu_choice)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7814 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7815 SInt16 menu_id, menu_item;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7816
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7817 menu_id = HiWord (menu_choice);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7818 menu_item = LoWord (menu_choice);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7819
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7820 switch (menu_id)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7821 {
61786
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
7822 case 0:
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
7823 break;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
7824
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7825 case M_APPLE:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7826 do_apple_menu (menu_item);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7827 break;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7828
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7829 default:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7830 {
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
7831 struct frame *f = mac_focus_frame (&one_mac_display_info);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7832 MenuHandle menu = GetMenuHandle (menu_id);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7833 if (menu)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7834 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7835 UInt32 refcon;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7836
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7837 GetMenuItemRefCon (menu, menu_item, &refcon);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7838 menubar_selection_callback (f, refcon);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7839 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7840 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7841 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7842
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7843 HiliteMenu (0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7844 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7845
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7846
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7847 /* Handle drags in size box. Based on code contributed by Ben
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7848 Mesander and IM - Window Manager A. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7849
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7850 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7851 do_grow_window (WindowPtr w, EventRecord *e)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7852 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7853 Rect limit_rect;
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7854 int rows, columns, width, height;
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
7855 struct frame *f = mac_window_to_frame (w);
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7856 XSizeHints *size_hints = FRAME_SIZE_HINTS (f);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7857 int min_width = MIN_DOC_SIZE, min_height = MIN_DOC_SIZE;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7858 #if TARGET_API_MAC_CARBON
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7859 Rect new_rect;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7860 #else
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7861 long grow_size;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7862 #endif
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7863
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7864 if (size_hints->flags & PMinSize)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7865 {
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7866 min_width = size_hints->min_width;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7867 min_height = size_hints->min_height;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7868 }
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7869 SetRect (&limit_rect, min_width, min_height, MAX_DOC_SIZE, MAX_DOC_SIZE);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7870
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7871 #if TARGET_API_MAC_CARBON
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7872 if (!ResizeWindow (w, e->where, &limit_rect, &new_rect))
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7873 return;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7874 height = new_rect.bottom - new_rect.top;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7875 width = new_rect.right - new_rect.left;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7876 #else
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7877 grow_size = GrowWindow (w, e->where, &limit_rect);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7878 /* see if it really changed size */
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7879 if (grow_size == 0)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7880 return;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7881 height = HiWord (grow_size);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7882 width = LoWord (grow_size);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7883 #endif
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7884
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7885 if (width != FRAME_PIXEL_WIDTH (f)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7886 || height != FRAME_PIXEL_HEIGHT (f))
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7887 {
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7888 rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, height);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7889 columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, width);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7890
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7891 x_set_window_size (f, 0, columns, rows);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7892 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7893 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7894
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7895
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7896 /* Handle clicks in zoom box. Calculation of "standard state" based
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7897 on code in IM - Window Manager A and code contributed by Ben
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7898 Mesander. The standard state of an Emacs window is 80-characters
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7899 wide (DEFAULT_NUM_COLS) and as tall as will fit on the screen. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7900
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7901 static void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7902 do_zoom_window (WindowPtr w, int zoom_in_or_out)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7903 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7904 GrafPtr save_port;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7905 Rect zoom_rect, port_rect;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7906 Point top_left;
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7907 int w_title_height, columns, rows, width, height;
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
7908 struct frame *f = mac_window_to_frame (w);
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
7909 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7910
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7911 #if TARGET_API_MAC_CARBON
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7912 {
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7913 Point standard_size;
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7914
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7915 standard_size.h = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, DEFAULT_NUM_COLS);
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
7916 standard_size.v = dpyinfo->height;
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7917
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7918 if (IsWindowInStandardState (w, &standard_size, &zoom_rect))
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7919 zoom_in_or_out = inZoomIn;
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7920 else
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7921 {
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7922 /* Adjust the standard size according to character boundaries. */
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7923
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7924 columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, zoom_rect.right - zoom_rect.left);
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7925 rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, zoom_rect.bottom - zoom_rect.top);
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7926 standard_size.h = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, columns);
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7927 standard_size.v = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows);
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7928 GetWindowBounds (w, kWindowContentRgn, &port_rect);
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7929 if (IsWindowInStandardState (w, &standard_size, &zoom_rect)
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7930 && port_rect.left == zoom_rect.left
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7931 && port_rect.top == zoom_rect.top)
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7932 zoom_in_or_out = inZoomIn;
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7933 else
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7934 zoom_in_or_out = inZoomOut;
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7935 }
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7936
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7937 ZoomWindowIdeal (w, zoom_in_or_out, &standard_size);
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7938 }
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7939 #else /* not TARGET_API_MAC_CARBON */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7940 GetPort (&save_port);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7941
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
7942 SetPortWindowPort (w);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7943
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7944 /* Clear window to avoid flicker. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7945 EraseRect (&(w->portRect));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7946 if (zoom_in_or_out == inZoomOut)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7947 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7948 SetPt (&top_left, w->portRect.left, w->portRect.top);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7949 LocalToGlobal (&top_left);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7950
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7951 /* calculate height of window's title bar */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7952 w_title_height = top_left.v - 1
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7953 - (**((WindowPeek) w)->strucRgn).rgnBBox.top + GetMBarHeight ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7954
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7955 /* get maximum height of window into zoom_rect.bottom - zoom_rect.top */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7956 zoom_rect = qd.screenBits.bounds;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7957 zoom_rect.top += w_title_height;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7958 InsetRect (&zoom_rect, 8, 4); /* not too tight */
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
7959
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7960 zoom_rect.right = zoom_rect.left
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
7961 + FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, DEFAULT_NUM_COLS);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7962
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7963 /* Adjust the standard size according to character boundaries. */
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7964 rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, zoom_rect.bottom - zoom_rect.top);
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7965 zoom_rect.bottom =
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7966 zoom_rect.top + FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows);
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7967
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7968 (**((WStateDataHandle) ((WindowPeek) w)->dataHandle)).stdState
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7969 = zoom_rect;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7970 }
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7971
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
7972 ZoomWindow (w, zoom_in_or_out, f == mac_focus_frame (dpyinfo));
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7973
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7974 SetPort (save_port);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7975 #endif /* not TARGET_API_MAC_CARBON */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7976
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7977 /* retrieve window size and update application values */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7978 #if TARGET_API_MAC_CARBON
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7979 GetWindowPortBounds (w, &port_rect);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7980 #else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7981 port_rect = w->portRect;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
7982 #endif
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7983 height = port_rect.bottom - port_rect.top;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7984 width = port_rect.right - port_rect.left;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7985
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7986 if (width != FRAME_PIXEL_WIDTH (f)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7987 || height != FRAME_PIXEL_HEIGHT (f))
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7988 {
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7989 rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, height);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7990 columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, width);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7991
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7992 change_frame_size (f, rows, columns, 0, 1, 0);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7993 SET_FRAME_GARBAGED (f);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7994 cancel_mouse_face (f);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7995
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7996 FRAME_PIXEL_WIDTH (f) = width;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7997 FRAME_PIXEL_HEIGHT (f) = height;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
7998 }
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
7999 x_real_positions (f, &f->left_pos, &f->top_pos);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8000 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8001
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8002 /* Intialize AppleEvent dispatcher table for the required events. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8003 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8004 init_required_apple_events ()
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8005 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8006 OSErr err;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8007 long result;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8008
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8009 /* Make sure we have apple events before starting. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8010 err = Gestalt (gestaltAppleEventsAttr, &result);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8011 if (err != noErr)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8012 abort ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8013
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8014 if (!(result & (1 << gestaltAppleEventsPresent)))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8015 abort ();
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
8016
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8017 #if TARGET_API_MAC_CARBON
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8018 err = AEInstallEventHandler(kCoreEventClass, kAEOpenApplication,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8019 NewAEEventHandlerUPP
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8020 ((AEEventHandlerProcPtr) do_ae_open_application),
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8021 0L, false);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8022 #else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8023 err = AEInstallEventHandler(kCoreEventClass, kAEOpenApplication,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8024 NewAEEventHandlerProc
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8025 ((AEEventHandlerProcPtr) do_ae_open_application),
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8026 0L, false);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8027 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8028 if (err != noErr)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8029 abort ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8030
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8031 #if TARGET_API_MAC_CARBON
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8032 err = AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8033 NewAEEventHandlerUPP
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8034 ((AEEventHandlerProcPtr) do_ae_open_documents),
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8035 0L, false);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8036 #else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8037 err = AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8038 NewAEEventHandlerProc
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8039 ((AEEventHandlerProcPtr) do_ae_open_documents),
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8040 0L, false);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8041 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8042 if (err != noErr)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8043 abort ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8044
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8045 #if TARGET_API_MAC_CARBON
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8046 err = AEInstallEventHandler(kCoreEventClass, kAEPrintDocuments,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8047 NewAEEventHandlerUPP
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8048 ((AEEventHandlerProcPtr) do_ae_print_documents),
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8049 0L, false);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8050 #else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8051 err = AEInstallEventHandler(kCoreEventClass, kAEPrintDocuments,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8052 NewAEEventHandlerProc
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8053 ((AEEventHandlerProcPtr) do_ae_print_documents),
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8054 0L, false);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8055 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8056 if (err != noErr)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8057 abort ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8058
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8059 #if TARGET_API_MAC_CARBON
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8060 err = AEInstallEventHandler(kCoreEventClass, kAEQuitApplication,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8061 NewAEEventHandlerUPP
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8062 ((AEEventHandlerProcPtr) do_ae_quit_application),
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8063 0L, false);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8064 #else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8065 err = AEInstallEventHandler(kCoreEventClass, kAEQuitApplication,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8066 NewAEEventHandlerProc
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8067 ((AEEventHandlerProcPtr) do_ae_quit_application),
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8068 0L, false);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8069 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8070 if (err != noErr)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8071 abort ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8072 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8073
61786
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8074 void
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8075 mac_store_application_menu_event (event)
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8076 #if USE_CARBON_EVENTS
61786
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8077 EventRef event;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8078 #else
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8079 UInt32 event;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8080 #endif
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8081 {
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8082 struct input_event buf;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8083 Lisp_Object frame, entry;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8084
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8085 EVENT_INIT (buf);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8086
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8087 XSETFRAME (frame, mac_focus_frame (&one_mac_display_info));
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8088 buf.kind = MENU_BAR_EVENT;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8089 buf.frame_or_window = frame;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8090 buf.arg = frame;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8091 kbd_buffer_store_event (&buf);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8092
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8093 buf.arg = Qapplication;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8094 kbd_buffer_store_event (&buf);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8095
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8096 #if USE_CARBON_EVENTS
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8097 switch (GetEventClass (event))
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8098 {
60364
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
8099 #ifdef MAC_OSX
61786
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8100 case kEventClassService:
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8101 buf.arg = Qservices;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8102 kbd_buffer_store_event (&buf);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8103 switch (GetEventKind (event))
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8104 {
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8105 case kEventServicePaste:
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8106 entry = Qpaste;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8107 break;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8108
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8109 case kEventServicePerform:
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8110 {
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8111 OSErr err;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8112 CFStringRef message;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8113
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8114 err = GetEventParameter (event, kEventParamServiceMessageName,
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8115 typeCFStringRef, NULL,
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8116 sizeof (CFStringRef), NULL, &message);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8117 buf.arg = Qperform;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8118 kbd_buffer_store_event (&buf);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8119 if (err == noErr && message)
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8120 entry = intern (SDATA (cfstring_to_lisp (message)));
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8121 else
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8122 entry = Qnil;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8123 }
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8124 break;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8125
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8126 default:
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8127 abort ();
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8128 }
61786
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8129 break;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8130 #endif /* MAC_OSX */
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8131 case kEventClassCommand:
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8132 {
61786
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8133 HICommand command;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8134
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8135 GetEventParameter(event, kEventParamDirectObject, typeHICommand,
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8136 NULL, sizeof (HICommand), NULL, &command);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8137 switch (command.commandID)
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8138 {
61786
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8139 case kHICommandAbout:
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8140 entry = Qabout;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8141 break;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8142 #ifdef MAC_OSX
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8143 case kHICommandPreferences:
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8144 entry = Qpreferences;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8145 break;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8146 #endif /* MAC_OSX */
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8147 case kHICommandQuit:
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8148 entry = Qquit;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8149 break;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8150 default:
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8151 abort ();
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8152 }
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8153 }
61786
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8154 break;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8155
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8156 default:
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8157 abort ();
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8158 }
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8159 #else /* USE_CARBON_EVENTS */
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8160 switch (event)
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8161 {
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8162 case kHICommandAbout:
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8163 entry = Qabout;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8164 break;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8165 case kHICommandQuit:
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8166 entry = Qquit;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8167 break;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8168 default:
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8169 abort ();
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8170 }
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8171 #endif
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8172
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8173 buf.arg = entry;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8174 kbd_buffer_store_event (&buf);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8175 }
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8176
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8177 #if USE_CARBON_EVENTS
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8178 static pascal OSStatus
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8179 mac_handle_command_event (next_handler, event, data)
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8180 EventHandlerCallRef next_handler;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8181 EventRef event;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8182 void *data;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8183 {
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8184 HICommand command;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8185 OSErr result;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8186
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8187 GetEventParameter(event, kEventParamDirectObject, typeHICommand, NULL,
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8188 sizeof (HICommand), NULL, &command);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8189
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8190 switch (command.commandID)
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8191 {
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8192 case kHICommandAbout:
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8193 #ifdef MAC_OSX
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8194 case kHICommandPreferences:
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8195 #endif /* MAC_OSX */
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8196 result = CallNextEventHandler (next_handler, event);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8197 if (result != eventNotHandledErr)
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8198 return result;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8199
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8200 mac_store_application_menu_event (event);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8201 return noErr;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8202
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8203 default:
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8204 break;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8205 }
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8206
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8207 return eventNotHandledErr;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8208 }
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8209
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8210 static OSErr
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8211 init_command_handler (window)
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8212 WindowPtr window;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8213 {
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8214 OSErr err = noErr;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8215 EventTypeSpec specs[] = {{kEventClassCommand, kEventCommandProcess}};
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8216 static EventHandlerUPP handle_command_eventUPP = NULL;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8217
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8218 if (handle_command_eventUPP == NULL)
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8219 handle_command_eventUPP = NewEventHandlerUPP (mac_handle_command_event);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8220 return InstallApplicationEventHandler (handle_command_eventUPP,
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8221 GetEventTypeCount (specs), specs,
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8222 NULL, NULL);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8223 }
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8224
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8225 static pascal OSStatus
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8226 mac_handle_window_event (next_handler, event, data)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8227 EventHandlerCallRef next_handler;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8228 EventRef event;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8229 void *data;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8230 {
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8231 WindowPtr wp;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8232 OSStatus result;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8233 UInt32 attributes;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8234 XSizeHints *size_hints;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8235
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8236 GetEventParameter (event, kEventParamDirectObject, typeWindowRef,
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8237 NULL, sizeof (WindowPtr), NULL, &wp);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8238
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8239 switch (GetEventKind (event))
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8240 {
59384
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8241 case kEventWindowUpdate:
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8242 result = CallNextEventHandler (next_handler, event);
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8243 if (result != eventNotHandledErr)
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8244 return result;
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8245
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8246 do_window_update (wp);
61786
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8247 return noErr;
59384
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8248
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8249 case kEventWindowBoundsChanging:
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8250 result = CallNextEventHandler (next_handler, event);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8251 if (result != eventNotHandledErr)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8252 return result;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8253
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8254 GetEventParameter (event, kEventParamAttributes, typeUInt32,
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8255 NULL, sizeof (UInt32), NULL, &attributes);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8256 size_hints = FRAME_SIZE_HINTS (mac_window_to_frame (wp));
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8257 if ((attributes & kWindowBoundsChangeUserResize)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8258 && ((size_hints->flags & (PResizeInc | PBaseSize | PMinSize))
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8259 == (PResizeInc | PBaseSize | PMinSize)))
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8260 {
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8261 Rect bounds;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8262 int width, height;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8263
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8264 GetEventParameter (event, kEventParamCurrentBounds,
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8265 typeQDRectangle,
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8266 NULL, sizeof (Rect), NULL, &bounds);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8267 width = bounds.right - bounds.left;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8268 height = bounds.bottom - bounds.top;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8269
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8270 if (width < size_hints->min_width)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8271 width = size_hints->min_width;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8272 else
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8273 width = size_hints->base_width
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8274 + (int) ((width - size_hints->base_width)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8275 / (float) size_hints->width_inc + .5)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8276 * size_hints->width_inc;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8277
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8278 if (height < size_hints->min_height)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8279 height = size_hints->min_height;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8280 else
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8281 height = size_hints->base_height
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8282 + (int) ((height - size_hints->base_height)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8283 / (float) size_hints->height_inc + .5)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8284 * size_hints->height_inc;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8285
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8286 bounds.right = bounds.left + width;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8287 bounds.bottom = bounds.top + height;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8288 SetEventParameter (event, kEventParamCurrentBounds,
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8289 typeQDRectangle, sizeof (Rect), &bounds);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8290 return noErr;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8291 }
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8292 break;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8293 }
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8294
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8295 return eventNotHandledErr;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8296 }
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8297 #endif /* USE_CARBON_EVENTS */
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8298
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8299
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8300 OSErr
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8301 install_window_handler (window)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8302 WindowPtr window;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8303 {
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8304 OSErr err = noErr;
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8305 #if USE_CARBON_EVENTS
59384
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8306 EventTypeSpec specs[] = {{kEventClassWindow, kEventWindowUpdate},
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8307 {kEventClassWindow, kEventWindowBoundsChanging}};
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8308 static EventHandlerUPP handle_window_event_UPP = NULL;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8309
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8310 if (handle_window_event_UPP == NULL)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8311 handle_window_event_UPP = NewEventHandlerUPP (mac_handle_window_event);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8312
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8313 err = InstallWindowEventHandler (window, handle_window_event_UPP,
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8314 GetEventTypeCount (specs), specs,
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8315 NULL, NULL);
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8316 #endif
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8317 #if TARGET_API_MAC_CARBON
60364
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
8318 if (mac_do_track_dragUPP == NULL)
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
8319 mac_do_track_dragUPP = NewDragTrackingHandlerUPP (mac_do_track_drag);
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
8320 if (mac_do_receive_dragUPP == NULL)
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
8321 mac_do_receive_dragUPP = NewDragReceiveHandlerUPP (mac_do_receive_drag);
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
8322
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8323 if (err == noErr)
60364
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
8324 err = InstallTrackingHandler (mac_do_track_dragUPP, window, NULL);
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8325 if (err == noErr)
60364
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
8326 err = InstallReceiveHandler (mac_do_receive_dragUPP, window, NULL);
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8327 #endif
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8328 return err;
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8329 }
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8330
60364
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
8331 void
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
8332 remove_window_handler (window)
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
8333 WindowPtr window;
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
8334 {
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
8335 #if TARGET_API_MAC_CARBON
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
8336 if (mac_do_track_dragUPP)
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
8337 RemoveTrackingHandler (mac_do_track_dragUPP, window);
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
8338 if (mac_do_receive_dragUPP)
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
8339 RemoveReceiveHandler (mac_do_receive_dragUPP, window);
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
8340 #endif
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
8341 }
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8342
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8343 /* Open Application Apple Event */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8344 static pascal OSErr
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8345 do_ae_open_application(const AppleEvent *pae, AppleEvent *preply, long prefcon)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8346 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8347 return noErr;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8348 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8349
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8350
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8351 /* Defined in mac.c. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8352 extern int
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8353 path_from_vol_dir_name (char *, int, short, long, char *);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8354
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8355
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8356 /* Called when we receive an AppleEvent with an ID of
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8357 "kAEOpenDocuments". This routine gets the direct parameter,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8358 extracts the FSSpecs in it, and puts their names on a list. */
59199
d6563f85d9e5 * macterm.c (SelectionRange): Add Xcode position apple event struct.
Steven Tamm <steventamm@mac.com>
parents: 59189
diff changeset
8359 #pragma options align=mac68k
d6563f85d9e5 * macterm.c (SelectionRange): Add Xcode position apple event struct.
Steven Tamm <steventamm@mac.com>
parents: 59189
diff changeset
8360 typedef struct SelectionRange {
d6563f85d9e5 * macterm.c (SelectionRange): Add Xcode position apple event struct.
Steven Tamm <steventamm@mac.com>
parents: 59189
diff changeset
8361 short unused1; // 0 (not used)
d6563f85d9e5 * macterm.c (SelectionRange): Add Xcode position apple event struct.
Steven Tamm <steventamm@mac.com>
parents: 59189
diff changeset
8362 short lineNum; // line to select (<0 to specify range)
d6563f85d9e5 * macterm.c (SelectionRange): Add Xcode position apple event struct.
Steven Tamm <steventamm@mac.com>
parents: 59189
diff changeset
8363 long startRange; // start of selection range (if line < 0)
d6563f85d9e5 * macterm.c (SelectionRange): Add Xcode position apple event struct.
Steven Tamm <steventamm@mac.com>
parents: 59189
diff changeset
8364 long endRange; // end of selection range (if line < 0)
d6563f85d9e5 * macterm.c (SelectionRange): Add Xcode position apple event struct.
Steven Tamm <steventamm@mac.com>
parents: 59189
diff changeset
8365 long unused2; // 0 (not used)
d6563f85d9e5 * macterm.c (SelectionRange): Add Xcode position apple event struct.
Steven Tamm <steventamm@mac.com>
parents: 59189
diff changeset
8366 long theDate; // modification date/time
d6563f85d9e5 * macterm.c (SelectionRange): Add Xcode position apple event struct.
Steven Tamm <steventamm@mac.com>
parents: 59189
diff changeset
8367 } SelectionRange;
d6563f85d9e5 * macterm.c (SelectionRange): Add Xcode position apple event struct.
Steven Tamm <steventamm@mac.com>
parents: 59189
diff changeset
8368 #pragma options align=reset
d6563f85d9e5 * macterm.c (SelectionRange): Add Xcode position apple event struct.
Steven Tamm <steventamm@mac.com>
parents: 59189
diff changeset
8369
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
8370 static pascal OSErr
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8371 do_ae_open_documents(AppleEvent *message, AppleEvent *reply, long refcon)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8372 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8373 OSErr err, err2;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8374 AEDesc the_desc;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8375 AEKeyword keyword;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8376 DescType actual_type;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8377 Size actual_size;
59199
d6563f85d9e5 * macterm.c (SelectionRange): Add Xcode position apple event struct.
Steven Tamm <steventamm@mac.com>
parents: 59189
diff changeset
8378 SelectionRange position;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8379
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8380 err = AEGetParamDesc (message, keyDirectObject, typeAEList, &the_desc);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8381 if (err != noErr)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8382 goto descriptor_error_exit;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8383
59199
d6563f85d9e5 * macterm.c (SelectionRange): Add Xcode position apple event struct.
Steven Tamm <steventamm@mac.com>
parents: 59189
diff changeset
8384 err = AEGetParamPtr (message, keyAEPosition, typeChar, &actual_type, &position, sizeof(SelectionRange), &actual_size);
d6563f85d9e5 * macterm.c (SelectionRange): Add Xcode position apple event struct.
Steven Tamm <steventamm@mac.com>
parents: 59189
diff changeset
8385 if (err == noErr)
d6563f85d9e5 * macterm.c (SelectionRange): Add Xcode position apple event struct.
Steven Tamm <steventamm@mac.com>
parents: 59189
diff changeset
8386 drag_and_drop_file_list = Fcons (list3 (make_number (position.lineNum + 1),
d6563f85d9e5 * macterm.c (SelectionRange): Add Xcode position apple event struct.
Steven Tamm <steventamm@mac.com>
parents: 59189
diff changeset
8387 make_number (position.startRange + 1),
d6563f85d9e5 * macterm.c (SelectionRange): Add Xcode position apple event struct.
Steven Tamm <steventamm@mac.com>
parents: 59189
diff changeset
8388 make_number (position.endRange + 1)),
d6563f85d9e5 * macterm.c (SelectionRange): Add Xcode position apple event struct.
Steven Tamm <steventamm@mac.com>
parents: 59189
diff changeset
8389 drag_and_drop_file_list);
d6563f85d9e5 * macterm.c (SelectionRange): Add Xcode position apple event struct.
Steven Tamm <steventamm@mac.com>
parents: 59189
diff changeset
8390
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8391 /* Check to see that we got all of the required parameters from the
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8392 event descriptor. For an 'odoc' event this should just be the
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8393 file list. */
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
8394 err = AEGetAttributePtr(message, keyMissedKeywordAttr, typeWildCard,
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8395 &actual_type, (Ptr) &keyword,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8396 sizeof (keyword), &actual_size);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8397 /* No error means that we found some unused parameters.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8398 errAEDescNotFound means that there are no more parameters. If we
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8399 get an error code other than that, flag it. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8400 if ((err == noErr) || (err != errAEDescNotFound))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8401 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8402 err = errAEEventNotHandled;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8403 goto error_exit;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8404 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8405 err = noErr;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8406
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8407 /* Got all the parameters we need. Now, go through the direct
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8408 object list and parse it up. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8409 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8410 long num_files_to_open;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8411
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8412 err = AECountItems (&the_desc, &num_files_to_open);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8413 if (err == noErr)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8414 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8415 int i;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
8416
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8417 /* AE file list is one based so just use that for indexing here. */
59384
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8418 for (i = 1; i <= num_files_to_open; i++)
46121
2198a6632b2b In mac:
Andrew Choi <akochoi@shaw.ca>
parents: 45890
diff changeset
8419 {
60364
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
8420 char unix_path_name[MAXPATHLEN];
59384
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8421 #ifdef MAC_OSX
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8422 FSRef fref;
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8423
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8424 err = AEGetNthPtr (&the_desc, i, typeFSRef, &keyword,
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8425 &actual_type, &fref, sizeof (FSRef),
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8426 &actual_size);
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8427 if (err != noErr || actual_type != typeFSRef)
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8428 continue;
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8429
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8430 if (FSRefMakePath (&fref, unix_path_name, sizeof (unix_path_name))
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8431 == noErr)
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8432 #else
46121
2198a6632b2b In mac:
Andrew Choi <akochoi@shaw.ca>
parents: 45890
diff changeset
8433 FSSpec fs;
2198a6632b2b In mac:
Andrew Choi <akochoi@shaw.ca>
parents: 45890
diff changeset
8434
2198a6632b2b In mac:
Andrew Choi <akochoi@shaw.ca>
parents: 45890
diff changeset
8435 err = AEGetNthPtr(&the_desc, i, typeFSS, &keyword, &actual_type,
2198a6632b2b In mac:
Andrew Choi <akochoi@shaw.ca>
parents: 45890
diff changeset
8436 (Ptr) &fs, sizeof (fs), &actual_size);
59384
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8437 if (err != noErr) continue;
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8438
60364
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
8439 if (fsspec_to_posix_pathname (&fs, unix_path_name,
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
8440 sizeof (unix_path_name) - 1) == noErr)
46121
2198a6632b2b In mac:
Andrew Choi <akochoi@shaw.ca>
parents: 45890
diff changeset
8441 #endif
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8442 /* x-dnd functions expect undecoded filenames. */
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8443 drag_and_drop_file_list =
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8444 Fcons (make_unibyte_string (unix_path_name,
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8445 strlen (unix_path_name)),
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8446 drag_and_drop_file_list);
46121
2198a6632b2b In mac:
Andrew Choi <akochoi@shaw.ca>
parents: 45890
diff changeset
8447 }
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8448 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8449 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8450
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8451 error_exit:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8452 /* Nuke the coerced file list in any case */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8453 err2 = AEDisposeDesc(&the_desc);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8454
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8455 descriptor_error_exit:
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8456 /* InvalRect(&(gFrontMacWindowP->mWP->portRect)); */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8457 return err;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8458 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8459
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8460
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8461 #if TARGET_API_MAC_CARBON
47635
b8d711da249c Whitespace changes.
Richard M. Stallman <rms@gnu.org>
parents: 47634
diff changeset
8462 static pascal OSErr
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8463 mac_do_track_drag (DragTrackingMessage message, WindowPtr window,
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8464 void *handlerRefCon, DragReference theDrag)
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8465 {
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8466 static int can_accept;
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8467 short items;
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8468 short index;
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8469 ItemReference theItem;
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8470 FlavorFlags theFlags;
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8471 OSErr result;
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8472
59384
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8473 if (GetFrontWindowOfClass (kMovableModalWindowClass, false))
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8474 return dragNotAcceptedErr;
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8475
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8476 switch (message)
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8477 {
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8478 case kDragTrackingEnterHandler:
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8479 CountDragItems (theDrag, &items);
59384
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8480 can_accept = 0;
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8481 for (index = 1; index <= items; index++)
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8482 {
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8483 GetDragItemReferenceNumber (theDrag, index, &theItem);
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8484 result = GetFlavorFlags (theDrag, theItem, flavorTypeHFS, &theFlags);
59384
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8485 if (result == noErr)
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8486 {
59384
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8487 can_accept = 1;
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8488 break;
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8489 }
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8490 }
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8491 break;
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8492
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8493 case kDragTrackingEnterWindow:
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8494 if (can_accept)
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8495 {
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8496 RgnHandle hilite_rgn = NewRgn ();
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8497 Rect r;
59384
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8498 struct frame *f = mac_window_to_frame (window);
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8499
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8500 GetWindowPortBounds (window, &r);
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8501 OffsetRect (&r, -r.left, -r.top);
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8502 RectRgn (hilite_rgn, &r);
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8503 ShowDragHilite (theDrag, hilite_rgn, true);
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8504 DisposeRgn (hilite_rgn);
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8505 SetThemeCursor (kThemeCopyArrowCursor);
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8506 }
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8507 break;
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8508
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8509 case kDragTrackingInWindow:
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8510 break;
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8511
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8512 case kDragTrackingLeaveWindow:
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8513 if (can_accept)
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8514 {
59384
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8515 struct frame *f = mac_window_to_frame (window);
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8516
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8517 HideDragHilite (theDrag);
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8518 SetThemeCursor (kThemeArrowCursor);
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8519 }
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8520 break;
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8521
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8522 case kDragTrackingLeaveHandler:
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8523 break;
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8524 }
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8525
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8526 return noErr;
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8527 }
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8528
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8529 static pascal OSErr
47635
b8d711da249c Whitespace changes.
Richard M. Stallman <rms@gnu.org>
parents: 47634
diff changeset
8530 mac_do_receive_drag (WindowPtr window, void *handlerRefCon,
b8d711da249c Whitespace changes.
Richard M. Stallman <rms@gnu.org>
parents: 47634
diff changeset
8531 DragReference theDrag)
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8532 {
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8533 short items;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8534 short index;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8535 FlavorFlags theFlags;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8536 Point mouse;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8537 OSErr result;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8538 ItemReference theItem;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8539 HFSFlavor data;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8540 Size size = sizeof (HFSFlavor);
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8541
59384
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8542 if (GetFrontWindowOfClass (kMovableModalWindowClass, false))
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8543 return dragNotAcceptedErr;
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8544
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8545 drag_and_drop_file_list = Qnil;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8546 GetDragMouse (theDrag, &mouse, 0L);
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8547 CountDragItems (theDrag, &items);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
8548 for (index = 1; index <= items; index++)
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8549 {
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8550 /* Only handle file references. */
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8551 GetDragItemReferenceNumber (theDrag, index, &theItem);
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8552 result = GetFlavorFlags (theDrag, theItem, flavorTypeHFS, &theFlags);
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8553 if (result == noErr)
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8554 {
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8555 #ifdef MAC_OSX
59384
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8556 FSRef fref;
60364
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
8557 #endif
59384
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
8558 char unix_path_name[MAXPATHLEN];
60364
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
8559
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8560 GetFlavorData (theDrag, theItem, flavorTypeHFS, &data, &size, 0L);
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8561 #ifdef MAC_OSX
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8562 /* Use Carbon routines, otherwise it converts the file name
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8563 to /Macintosh HD/..., which is not correct. */
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8564 FSpMakeFSRef (&data.fileSpec, &fref);
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8565 if (! FSRefMakePath (&fref, unix_path_name, sizeof (unix_path_name)));
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8566 #else
60364
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
8567 if (fsspec_to_posix_pathname (&data.fileSpec, unix_path_name,
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
8568 sizeof (unix_path_name) - 1) == noErr)
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8569 #endif
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8570 /* x-dnd functions expect undecoded filenames. */
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8571 drag_and_drop_file_list =
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8572 Fcons (make_unibyte_string (unix_path_name,
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8573 strlen (unix_path_name)),
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8574 drag_and_drop_file_list);
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8575 }
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8576 }
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8577 /* If there are items in the list, construct an event and post it to
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8578 the queue like an interrupt using kbd_buffer_store_event. */
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
8579 if (!NILP (drag_and_drop_file_list))
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8580 {
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8581 struct input_event event;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8582 Lisp_Object frame;
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8583 struct frame *f = mac_window_to_frame (window);
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8584 SInt16 modifiers;
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8585
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8586 GlobalToLocal (&mouse);
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8587 GetDragModifiers (theDrag, NULL, NULL, &modifiers);
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8588
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8589 event.kind = DRAG_N_DROP_EVENT;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8590 event.code = 0;
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8591 event.modifiers = mac_to_emacs_modifiers (modifiers);
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8592 event.timestamp = TickCount () * (1000 / 60);
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8593 XSETINT (event.x, mouse.h);
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8594 XSETINT (event.y, mouse.v);
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8595 XSETFRAME (frame, f);
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8596 event.frame_or_window = Fcons (frame, drag_and_drop_file_list);
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8597 event.arg = Qnil;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8598 /* Post to the interrupt queue */
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8599 kbd_buffer_store_event (&event);
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8600 /* MAC_TODO: Mimic behavior of windows by switching contexts to Emacs */
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8601 {
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8602 ProcessSerialNumber psn;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8603 GetCurrentProcess (&psn);
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8604 SetFrontProcess (&psn);
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8605 }
59189
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8606
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8607 return noErr;
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8608 }
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8609 else
60ffced08532 * term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents: 59146
diff changeset
8610 return dragNotAcceptedErr;
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8611 }
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8612 #endif
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8613
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8614
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8615 /* Print Document Apple Event */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8616 static pascal OSErr
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8617 do_ae_print_documents (const AppleEvent *pAE, AppleEvent *reply, long refcon)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8618 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8619 return errAEEventNotHandled;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8620 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8621
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8622
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8623 static pascal OSErr
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8624 do_ae_quit_application (AppleEvent* message, AppleEvent *reply, long refcon)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8625 {
61786
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8626 #if USE_CARBON_EVENTS
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8627 OSErr err;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8628 EventRef event = NULL;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8629 static const HICommand quit_command = {kEventAttributeNone, kHICommandQuit};
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8630
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8631 err = CreateEvent (NULL, kEventClassCommand, kEventCommandProcess, 0,
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8632 kEventAttributeUserEvent, &event);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8633 if (err == noErr)
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8634 err = SetEventParameter (event, kEventParamDirectObject, typeHICommand,
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8635 sizeof (HICommand), &quit_command);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8636 if (err == noErr)
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8637 mac_store_application_menu_event (event);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8638 if (event)
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8639 ReleaseEvent (event);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8640
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8641 if (err == noErr)
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8642 return noErr;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8643 else
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8644 return errAEEventNotHandled;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8645 #else
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8646 mac_store_application_menu_event (kHICommandQuit);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8647
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8648 return noErr;
61786
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
8649 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8650 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8651
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8652
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8653 #if __profile__
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8654 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8655 profiler_exit_proc ()
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8656 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8657 ProfilerDump ("\pEmacs.prof");
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8658 ProfilerTerm ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8659 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8660 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8661
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8662 /* These few functions implement Emacs as a normal Mac application
62281
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
8663 (almost): set up the heap and the Toolbox, handle necessary system
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
8664 events plus a few simple menu events. They also set up Emacs's
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
8665 access to functions defined in the rest of this file. Emacs uses
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
8666 function hooks to perform all its terminal I/O. A complete list of
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
8667 these functions appear in termhooks.h. For what they do, read the
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
8668 comments there and see also w32term.c and xterm.c. What's
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
8669 noticeably missing here is the event loop, which is normally
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
8670 present in most Mac application. After performing the necessary
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
8671 Mac initializations, main passes off control to emacs_main
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
8672 (corresponding to main in emacs.c). Emacs_main calls XTread_socket
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
8673 (defined further below) to read input. This is where
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
8674 WaitNextEvent/ReceiveNextEvent is called to process Mac events. */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8675
60364
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
8676 #ifdef MAC_OS8
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8677 #undef main
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
8678 int
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8679 main (void)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8680 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8681 #if __profile__ /* is the profiler on? */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8682 if (ProfilerInit(collectDetailed, bestTimeBase, 5000, 200))
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8683 exit(1);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8684 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8685
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8686 #if __MWERKS__
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8687 /* set creator and type for files created by MSL */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8688 _fcreator = 'EMAx';
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8689 _ftype = 'TEXT';
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8690 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8691
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8692 do_init_managers ();
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
8693
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8694 do_get_menus ();
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
8695
53651
c7d570b7ba42 (main) [USE_LSB_TAG]: Don't range check the ram.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 53606
diff changeset
8696 #ifndef USE_LSB_TAG
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8697 do_check_ram_size ();
53651
c7d570b7ba42 (main) [USE_LSB_TAG]: Don't range check the ram.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 53606
diff changeset
8698 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8699
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8700 init_emacs_passwd_dir ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8701
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8702 init_environ ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8703
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8704 initialize_applescript ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8705
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8706 init_required_apple_events ();
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
8707
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8708 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8709 char **argv;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8710 int argc = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8711
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8712 /* set up argv array from STR# resource */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8713 get_string_list (&argv, ARGV_STRING_LIST_ID);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8714 while (argv[argc])
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8715 argc++;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8716
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8717 /* free up AppleScript resources on exit */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8718 atexit (terminate_applescript);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8719
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8720 #if __profile__ /* is the profiler on? */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8721 atexit (profiler_exit_proc);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8722 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8723
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8724 /* 3rd param "envp" never used in emacs_main */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8725 (void) emacs_main (argc, argv, 0);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8726 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8727
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8728 /* Never reached - real exit in Fkill_emacs */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8729 return 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8730 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8731 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8732
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8733 /* Table for translating Mac keycode to X keysym values. Contributed
60611
4536f307a219 (keycode_to_xkeysym_table): Change mapping so that it coincide with
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60364
diff changeset
8734 by Sudhir Shenoy.
4536f307a219 (keycode_to_xkeysym_table): Change mapping so that it coincide with
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60364
diff changeset
8735 Mapping for special keys is now identical to that in Apple X11
4536f307a219 (keycode_to_xkeysym_table): Change mapping so that it coincide with
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60364
diff changeset
8736 except `clear' (-> <clear>) on the KeyPad, `enter' (-> <kp-enter>)
4536f307a219 (keycode_to_xkeysym_table): Change mapping so that it coincide with
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60364
diff changeset
8737 on the right of the Cmd key on laptops, and fn + `enter' (->
4536f307a219 (keycode_to_xkeysym_table): Change mapping so that it coincide with
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60364
diff changeset
8738 <linefeed>). */
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8739 static unsigned char keycode_to_xkeysym_table[] = {
49504
0ffb4e489776 2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents: 49346
diff changeset
8740 /*0x00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0ffb4e489776 2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents: 49346
diff changeset
8741 /*0x10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0ffb4e489776 2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents: 49346
diff changeset
8742 /*0x20*/ 0, 0, 0, 0, 0x0d /*return*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0ffb4e489776 2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents: 49346
diff changeset
8743
0ffb4e489776 2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents: 49346
diff changeset
8744 /*0x30*/ 0x09 /*tab*/, 0 /*0x0020 space*/, 0, 0x08 /*backspace*/,
60611
4536f307a219 (keycode_to_xkeysym_table): Change mapping so that it coincide with
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60364
diff changeset
8745 /*0x34*/ 0x8d /*enter on laptops*/, 0x1b /*escape*/, 0, 0,
49504
0ffb4e489776 2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents: 49346
diff changeset
8746 /*0x38*/ 0, 0, 0, 0,
0ffb4e489776 2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents: 49346
diff changeset
8747 /*0x3C*/ 0, 0, 0, 0,
0ffb4e489776 2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents: 49346
diff changeset
8748
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
8749 /*0x40*/ 0, 0xae /*kp-.*/, 0, 0xaa /*kp-**/,
60611
4536f307a219 (keycode_to_xkeysym_table): Change mapping so that it coincide with
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60364
diff changeset
8750 /*0x44*/ 0, 0xab /*kp-+*/, 0, 0x0b /*clear*/,
49504
0ffb4e489776 2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents: 49346
diff changeset
8751 /*0x48*/ 0, 0, 0, 0xaf /*kp-/*/,
0ffb4e489776 2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents: 49346
diff changeset
8752 /*0x4C*/ 0x8d /*kp-enter*/, 0, 0xad /*kp--*/, 0,
0ffb4e489776 2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents: 49346
diff changeset
8753
0ffb4e489776 2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents: 49346
diff changeset
8754 /*0x50*/ 0, 0xbd /*kp-=*/, 0xb0 /*kp-0*/, 0xb1 /*kp-1*/,
0ffb4e489776 2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents: 49346
diff changeset
8755 /*0x54*/ 0xb2 /*kp-2*/, 0xb3 /*kp-3*/, 0xb4 /*kp-4*/, 0xb5 /*kp-5*/,
0ffb4e489776 2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents: 49346
diff changeset
8756 /*0x58*/ 0xb6 /*kp-6*/, 0xb7 /*kp-7*/, 0, 0xb8 /*kp-8*/,
0ffb4e489776 2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents: 49346
diff changeset
8757 /*0x5C*/ 0xb9 /*kp-9*/, 0, 0, 0,
0ffb4e489776 2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents: 49346
diff changeset
8758
0ffb4e489776 2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents: 49346
diff changeset
8759 /*0x60*/ 0xc2 /*f5*/, 0xc3 /*f6*/, 0xc4 /*f7*/, 0xc0 /*f3*/,
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
8760 /*0x64*/ 0xc5 /*f8*/, 0xc6 /*f9*/, 0, 0xc8 /*f11*/,
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
8761 /*0x68*/ 0, 0xca /*f13*/, 0, 0xcb /*f14*/,
60611
4536f307a219 (keycode_to_xkeysym_table): Change mapping so that it coincide with
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60364
diff changeset
8762 /*0x6C*/ 0, 0xc7 /*f10*/, 0x0a /*fn+enter on laptops*/, 0xc9 /*f12*/,
4536f307a219 (keycode_to_xkeysym_table): Change mapping so that it coincide with
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60364
diff changeset
8763
4536f307a219 (keycode_to_xkeysym_table): Change mapping so that it coincide with
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60364
diff changeset
8764 /*0x70*/ 0, 0xcc /*f15*/, 0x6a /*help*/, 0x50 /*home*/,
4536f307a219 (keycode_to_xkeysym_table): Change mapping so that it coincide with
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60364
diff changeset
8765 /*0x74*/ 0x55 /*pgup*/, 0xff /*delete*/, 0xc1 /*f4*/, 0x57 /*end*/,
4536f307a219 (keycode_to_xkeysym_table): Change mapping so that it coincide with
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60364
diff changeset
8766 /*0x78*/ 0xbf /*f2*/, 0x56 /*pgdown*/, 0xbe /*f1*/, 0x51 /*left*/,
49504
0ffb4e489776 2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents: 49346
diff changeset
8767 /*0x7C*/ 0x53 /*right*/, 0x54 /*down*/, 0x52 /*up*/, 0
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8768 };
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8769
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8770 static int
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8771 keycode_to_xkeysym (int keyCode, int *xKeySym)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8772 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8773 *xKeySym = keycode_to_xkeysym_table [keyCode & 0x7f];
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8774 return *xKeySym != 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8775 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8776
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8777 #if !USE_CARBON_EVENTS
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8778 static RgnHandle mouse_region = NULL;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8779
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8780 Boolean
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8781 mac_wait_next_event (er, sleep_time, dequeue)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8782 EventRecord *er;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8783 UInt32 sleep_time;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8784 Boolean dequeue;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8785 {
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8786 static EventRecord er_buf = {nullEvent};
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8787 UInt32 target_tick, current_tick;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8788 EventMask event_mask;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8789
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8790 if (mouse_region == NULL)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8791 mouse_region = NewRgn ();
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8792
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8793 event_mask = everyEvent;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8794 if (NILP (Fboundp (Qmac_ready_for_drag_n_drop)))
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8795 event_mask -= highLevelEventMask;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8796
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8797 current_tick = TickCount ();
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8798 target_tick = current_tick + sleep_time;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8799
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8800 if (er_buf.what == nullEvent)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8801 while (!WaitNextEvent (event_mask, &er_buf,
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8802 target_tick - current_tick, mouse_region))
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8803 {
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8804 current_tick = TickCount ();
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8805 if (target_tick <= current_tick)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8806 return false;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8807 }
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8808
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8809 *er = er_buf;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8810 if (dequeue)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8811 er_buf.what = nullEvent;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8812 return true;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8813 }
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8814 #endif /* not USE_CARBON_EVENTS */
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8815
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8816 /* Emacs calls this whenever it wants to read an input event from the
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8817 user. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8818 int
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8819 XTread_socket (sd, expected, hold_quit)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8820 int sd, expected;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8821 struct input_event *hold_quit;
54165
88d1b7a60637 (XTread_socket): Remove bufp_r and numcharsp args. Add hold_quit arg.
Kim F. Storm <storm@cua.dk>
parents: 54150
diff changeset
8822 {
88d1b7a60637 (XTread_socket): Remove bufp_r and numcharsp args. Add hold_quit arg.
Kim F. Storm <storm@cua.dk>
parents: 54150
diff changeset
8823 struct input_event inev;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
8824 int count = 0;
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8825 #if USE_CARBON_EVENTS
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8826 EventRef eventRef;
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8827 EventTargetRef toolbox_dispatcher;
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8828 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8829 EventRecord er;
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8830 struct mac_display_info *dpyinfo = &one_mac_display_info;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8831
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8832 if (interrupt_input_blocked)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8833 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8834 interrupt_input_pending = 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8835 return -1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8836 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8837
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8838 interrupt_input_pending = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8839 BLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8840
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8841 /* So people can tell when we have read the available input. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8842 input_signal_count++;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
8843
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8844 #if USE_CARBON_EVENTS
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8845 toolbox_dispatcher = GetEventDispatcherTarget ();
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8846
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
8847 while (!ReceiveNextEvent (0, NULL, kEventDurationNoWait,
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8848 kEventRemoveFromQueue, &eventRef))
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8849 #else /* !USE_CARBON_EVENTS */
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8850 while (mac_wait_next_event (&er, 0, true))
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8851 #endif /* !USE_CARBON_EVENTS */
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8852 {
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8853 int do_help = 0;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8854 struct frame *f;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8855
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8856 /* It is necessary to set this (additional) argument slot of an
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8857 event to nil because keyboard.c protects incompletely
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8858 processed event from being garbage collected by placing them
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8859 in the kbd_buffer_gcpro vector. */
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8860 EVENT_INIT (inev);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8861 inev.kind = NO_EVENT;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8862 inev.arg = Qnil;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8863
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8864 #if USE_CARBON_EVENTS
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8865 /* Handle new events */
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
8866 if (!mac_convert_event_ref (eventRef, &er))
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
8867 switch (GetEventClass (eventRef))
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8868 {
56271
98f2b9da67f0 macterm.c (XTread_socket): Correctly set the frame position
Steven Tamm <steventamm@mac.com>
parents: 56146
diff changeset
8869 case kEventClassWindow:
57373
38e45bf0128a (x_update_window_end): Fix flicker on vertical line between
Kim F. Storm <storm@cua.dk>
parents: 57357
diff changeset
8870 if (GetEventKind (eventRef) == kEventWindowBoundsChanged)
56271
98f2b9da67f0 macterm.c (XTread_socket): Correctly set the frame position
Steven Tamm <steventamm@mac.com>
parents: 56146
diff changeset
8871 {
98f2b9da67f0 macterm.c (XTread_socket): Correctly set the frame position
Steven Tamm <steventamm@mac.com>
parents: 56146
diff changeset
8872 WindowPtr window_ptr;
98f2b9da67f0 macterm.c (XTread_socket): Correctly set the frame position
Steven Tamm <steventamm@mac.com>
parents: 56146
diff changeset
8873 GetEventParameter(eventRef, kEventParamDirectObject,
98f2b9da67f0 macterm.c (XTread_socket): Correctly set the frame position
Steven Tamm <steventamm@mac.com>
parents: 56146
diff changeset
8874 typeWindowRef, NULL, sizeof(WindowPtr),
98f2b9da67f0 macterm.c (XTread_socket): Correctly set the frame position
Steven Tamm <steventamm@mac.com>
parents: 56146
diff changeset
8875 NULL, &window_ptr);
98f2b9da67f0 macterm.c (XTread_socket): Correctly set the frame position
Steven Tamm <steventamm@mac.com>
parents: 56146
diff changeset
8876 f = mac_window_to_frame (window_ptr);
98f2b9da67f0 macterm.c (XTread_socket): Correctly set the frame position
Steven Tamm <steventamm@mac.com>
parents: 56146
diff changeset
8877 if (f && !f->async_iconified)
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
8878 x_real_positions (f, &f->left_pos, &f->top_pos);
56271
98f2b9da67f0 macterm.c (XTread_socket): Correctly set the frame position
Steven Tamm <steventamm@mac.com>
parents: 56146
diff changeset
8879 SendEventToEventTarget (eventRef, toolbox_dispatcher);
98f2b9da67f0 macterm.c (XTread_socket): Correctly set the frame position
Steven Tamm <steventamm@mac.com>
parents: 56146
diff changeset
8880 }
98f2b9da67f0 macterm.c (XTread_socket): Correctly set the frame position
Steven Tamm <steventamm@mac.com>
parents: 56146
diff changeset
8881 break;
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8882 case kEventClassMouse:
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
8883 if (GetEventKind (eventRef) == kEventMouseWheelMoved)
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8884 {
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8885 SInt32 delta;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8886 Point point;
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
8887 struct frame *f = mac_focus_frame (dpyinfo);
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
8888 WindowPtr window_ptr;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
8889
61615
351bda10c1b0 (XTread_socket): Don't beep on keyboard input even if no frame is
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61574
diff changeset
8890 #if 0
351bda10c1b0 (XTread_socket): Don't beep on keyboard input even if no frame is
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61574
diff changeset
8891 if (dpyinfo->x_focus_frame == NULL)
49346
91abf17b00d5 * macterm.c (XTread_socket): Checks for valid, visible window
Steven Tamm <steventamm@mac.com>
parents: 49015
diff changeset
8892 {
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
8893 /* Beep if wheel move occurs when all the frames
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
8894 are invisible. */
49346
91abf17b00d5 * macterm.c (XTread_socket): Checks for valid, visible window
Steven Tamm <steventamm@mac.com>
parents: 49015
diff changeset
8895 SysBeep(1);
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8896 break;
49346
91abf17b00d5 * macterm.c (XTread_socket): Checks for valid, visible window
Steven Tamm <steventamm@mac.com>
parents: 49015
diff changeset
8897 }
61615
351bda10c1b0 (XTread_socket): Don't beep on keyboard input even if no frame is
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61574
diff changeset
8898 #endif
49346
91abf17b00d5 * macterm.c (XTread_socket): Checks for valid, visible window
Steven Tamm <steventamm@mac.com>
parents: 49015
diff changeset
8899
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8900 GetEventParameter(eventRef, kEventParamMouseWheelDelta,
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8901 typeSInt32, NULL, sizeof (SInt32),
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8902 NULL, &delta);
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8903 GetEventParameter(eventRef, kEventParamMouseLocation,
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8904 typeQDPoint, NULL, sizeof (Point),
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8905 NULL, &point);
54165
88d1b7a60637 (XTread_socket): Remove bufp_r and numcharsp args. Add hold_quit arg.
Kim F. Storm <storm@cua.dk>
parents: 54150
diff changeset
8906 inev.kind = WHEEL_EVENT;
88d1b7a60637 (XTread_socket): Remove bufp_r and numcharsp args. Add hold_quit arg.
Kim F. Storm <storm@cua.dk>
parents: 54150
diff changeset
8907 inev.code = 0;
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8908 inev.modifiers = (mac_event_to_emacs_modifiers (eventRef)
54165
88d1b7a60637 (XTread_socket): Remove bufp_r and numcharsp args. Add hold_quit arg.
Kim F. Storm <storm@cua.dk>
parents: 54150
diff changeset
8909 | ((delta < 0) ? down_modifier
88d1b7a60637 (XTread_socket): Remove bufp_r and numcharsp args. Add hold_quit arg.
Kim F. Storm <storm@cua.dk>
parents: 54150
diff changeset
8910 : up_modifier));
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
8911 window_ptr = FRAME_MAC_WINDOW (f);
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8912 SetPortWindowPort (window_ptr);
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8913 GlobalToLocal (&point);
54165
88d1b7a60637 (XTread_socket): Remove bufp_r and numcharsp args. Add hold_quit arg.
Kim F. Storm <storm@cua.dk>
parents: 54150
diff changeset
8914 XSETINT (inev.x, point.h);
88d1b7a60637 (XTread_socket): Remove bufp_r and numcharsp args. Add hold_quit arg.
Kim F. Storm <storm@cua.dk>
parents: 54150
diff changeset
8915 XSETINT (inev.y, point.v);
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8916 XSETFRAME (inev.frame_or_window,
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8917 mac_window_to_frame (window_ptr));
54165
88d1b7a60637 (XTread_socket): Remove bufp_r and numcharsp args. Add hold_quit arg.
Kim F. Storm <storm@cua.dk>
parents: 54150
diff changeset
8918 inev.timestamp = EventTimeToTicks (GetEventTime (eventRef))*(1000/60);
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8919 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
8920 else
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8921 SendEventToEventTarget (eventRef, toolbox_dispatcher);
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8922
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8923 break;
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
8924
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8925 default:
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8926 /* Send the event to the appropriate receiver. */
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8927 SendEventToEventTarget (eventRef, toolbox_dispatcher);
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8928 }
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
8929 else
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8930 #endif /* USE_CARBON_EVENTS */
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8931 switch (er.what)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8932 {
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8933 case mouseDown:
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8934 case mouseUp:
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8935 {
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8936 WindowPtr window_ptr;
62281
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
8937 ControlPartCode part_code;
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8938 int tool_bar_p = 0;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8939
56278
3d525d0266de macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents: 56277
diff changeset
8940 #if USE_CARBON_EVENTS
3d525d0266de macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents: 56277
diff changeset
8941 /* This is needed to send mouse events like aqua window
3d525d0266de macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents: 56277
diff changeset
8942 buttons to the correct handler. */
3d525d0266de macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents: 56277
diff changeset
8943 if (SendEventToEventTarget (eventRef, toolbox_dispatcher)
3d525d0266de macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents: 56277
diff changeset
8944 != eventNotHandledErr)
3d525d0266de macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents: 56277
diff changeset
8945 break;
3d525d0266de macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents: 56277
diff changeset
8946 #endif
3d525d0266de macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents: 56277
diff changeset
8947
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8948 if (dpyinfo->grabbed && last_mouse_frame
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8949 && FRAME_LIVE_P (last_mouse_frame))
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8950 {
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8951 window_ptr = FRAME_MAC_WINDOW (last_mouse_frame);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8952 part_code = inContent;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8953 }
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8954 else
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8955 {
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
8956 part_code = FindWindow (er.where, &window_ptr);
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8957 if (tip_window && window_ptr == tip_window)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8958 {
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8959 HideWindow (tip_window);
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
8960 part_code = FindWindow (er.where, &window_ptr);
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8961 }
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8962 }
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8963
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
8964 if (er.what != mouseDown && part_code != inContent)
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
8965 break;
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
8966
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8967 switch (part_code)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8968 {
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8969 case inMenuBar:
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
8970 f = mac_focus_frame (dpyinfo);
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
8971 saved_menu_event_location = er.where;
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
8972 inev.kind = MENU_BAR_ACTIVATE_EVENT;
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
8973 XSETFRAME (inev.frame_or_window, f);
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8974 break;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8975
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8976 case inContent:
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
8977 if (window_ptr != FRAME_MAC_WINDOW (mac_focus_frame (dpyinfo)))
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8978 SelectWindow (window_ptr);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8979 else
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8980 {
62281
9df01a686e3c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 62103
diff changeset
8981 ControlPartCode control_part_code;
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8982 ControlHandle ch;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8983 Point mouse_loc = er.where;
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
8984 #ifdef MAC_OSX
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
8985 ControlKind control_kind;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
8986 #endif
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8987
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8988 f = mac_window_to_frame (window_ptr);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8989 /* convert to local coordinates of new window */
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8990 SetPortWindowPort (window_ptr);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8991
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8992 GlobalToLocal (&mouse_loc);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8993 #if TARGET_API_MAC_CARBON
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8994 ch = FindControlUnderMouse (mouse_loc, window_ptr,
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
8995 &control_part_code);
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
8996 #ifdef MAC_OSX
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
8997 if (ch)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
8998 GetControlKind (ch, &control_kind);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
8999 #endif
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
9000 #else
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9001 control_part_code = FindControl (mouse_loc, window_ptr,
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9002 &ch);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9003 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9004
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
9005 #if USE_CARBON_EVENTS
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9006 inev.code = mac_get_mouse_btn (eventRef);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9007 inev.modifiers = mac_event_to_emacs_modifiers (eventRef);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9008 #else
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9009 inev.code = mac_get_emulated_btn (er.modifiers);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9010 inev.modifiers = mac_to_emacs_modifiers (er.modifiers);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9011 #endif
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9012 XSETINT (inev.x, mouse_loc.h);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9013 XSETINT (inev.y, mouse_loc.v);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9014 inev.timestamp = er.when * (1000 / 60);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9015 /* ticks to milliseconds */
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9016
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9017 if (dpyinfo->grabbed && tracked_scroll_bar
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9018 || ch != 0
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9019 #ifndef USE_TOOLKIT_SCROLL_BARS
60623
5a3fa411c713 (activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60611
diff changeset
9020 /* control_part_code becomes kControlNoPart if
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9021 a progress indicator is clicked. */
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9022 && control_part_code != kControlNoPart
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9023 #else /* USE_TOOLKIT_SCROLL_BARS */
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9024 #ifdef MAC_OSX
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9025 && control_kind.kind == kControlKindScrollBar
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9026 #endif /* MAC_OSX */
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9027 #endif /* USE_TOOLKIT_SCROLL_BARS */
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9028 )
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9029 {
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9030 struct scroll_bar *bar;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9031
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9032 if (dpyinfo->grabbed && tracked_scroll_bar)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9033 {
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9034 bar = tracked_scroll_bar;
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9035 #ifndef USE_TOOLKIT_SCROLL_BARS
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9036 control_part_code = kControlIndicatorPart;
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9037 #endif
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9038 }
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9039 else
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9040 bar = (struct scroll_bar *) GetControlReference (ch);
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9041 #ifdef USE_TOOLKIT_SCROLL_BARS
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9042 /* Make the "Ctrl-Mouse-2 splits window" work
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9043 for toolkit scroll bars. */
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9044 if (er.modifiers & controlKey)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9045 x_scroll_bar_handle_click (bar, control_part_code,
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9046 &er, &inev);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9047 else if (er.what == mouseDown)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9048 x_scroll_bar_handle_press (bar, control_part_code,
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9049 inev.timestamp, &inev);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9050 else
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9051 x_scroll_bar_handle_release (bar, inev.timestamp,
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9052 &inev);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9053 #else /* not USE_TOOLKIT_SCROLL_BARS */
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9054 x_scroll_bar_handle_click (bar, control_part_code,
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9055 &er, &inev);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9056 if (er.what == mouseDown
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9057 && control_part_code == kControlIndicatorPart)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9058 tracked_scroll_bar = bar;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9059 else
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9060 tracked_scroll_bar = NULL;
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9061 #endif /* not USE_TOOLKIT_SCROLL_BARS */
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9062 }
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9063 else
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9064 {
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9065 Lisp_Object window;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9066 int x = mouse_loc.h;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9067 int y = mouse_loc.v;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9068
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9069 window = window_from_coordinates (f, x, y, 0, 0, 0, 1);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9070 if (EQ (window, f->tool_bar_window))
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9071 {
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9072 if (er.what == mouseDown)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9073 handle_tool_bar_click (f, x, y, 1, 0);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9074 else
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9075 handle_tool_bar_click (f, x, y, 0,
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9076 inev.modifiers);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9077 tool_bar_p = 1;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9078 }
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9079 else
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9080 {
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9081 XSETFRAME (inev.frame_or_window, f);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9082 inev.kind = MOUSE_CLICK_EVENT;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9083 }
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9084 }
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9085
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9086 if (er.what == mouseDown)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9087 {
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9088 dpyinfo->grabbed |= (1 << inev.code);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9089 last_mouse_frame = f;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9090 /* Ignore any mouse motion that happened
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9091 before this event; any subsequent
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9092 mouse-movement Emacs events should reflect
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9093 only motion after the ButtonPress. */
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9094 if (f != 0)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9095 f->mouse_moved = 0;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9096
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9097 if (!tool_bar_p)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9098 last_tool_bar_item = -1;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9099 }
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9100 else
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9101 {
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
9102 if ((dpyinfo->grabbed & (1 << inev.code)) == 0)
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9103 /* If a button is released though it was not
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9104 previously pressed, that would be because
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9105 of multi-button emulation. */
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9106 dpyinfo->grabbed = 0;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9107 else
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9108 dpyinfo->grabbed &= ~(1 << inev.code);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9109 }
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9110
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9111 #ifdef USE_TOOLKIT_SCROLL_BARS
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9112 if (inev.kind == MOUSE_CLICK_EVENT)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9113 #endif
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9114 switch (er.what)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9115 {
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9116 case mouseDown:
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9117 inev.modifiers |= down_modifier;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9118 break;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9119 case mouseUp:
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9120 inev.modifiers |= up_modifier;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9121 break;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9122 }
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9123 }
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9124 break;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9125
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9126 case inDrag:
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9127 #if TARGET_API_MAC_CARBON
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
9128 DragWindow (window_ptr, er.where, NULL);
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9129 #else /* not TARGET_API_MAC_CARBON */
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9130 DragWindow (window_ptr, er.where, &qd.screenBits.bounds);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9131 #endif /* not TARGET_API_MAC_CARBON */
56271
98f2b9da67f0 macterm.c (XTread_socket): Correctly set the frame position
Steven Tamm <steventamm@mac.com>
parents: 56146
diff changeset
9132 /* Update the frame parameters. */
98f2b9da67f0 macterm.c (XTread_socket): Correctly set the frame position
Steven Tamm <steventamm@mac.com>
parents: 56146
diff changeset
9133 {
98f2b9da67f0 macterm.c (XTread_socket): Correctly set the frame position
Steven Tamm <steventamm@mac.com>
parents: 56146
diff changeset
9134 struct frame *f = mac_window_to_frame (window_ptr);
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
9135
56271
98f2b9da67f0 macterm.c (XTread_socket): Correctly set the frame position
Steven Tamm <steventamm@mac.com>
parents: 56146
diff changeset
9136 if (f && !f->async_iconified)
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
9137 x_real_positions (f, &f->left_pos, &f->top_pos);
56271
98f2b9da67f0 macterm.c (XTread_socket): Correctly set the frame position
Steven Tamm <steventamm@mac.com>
parents: 56146
diff changeset
9138 }
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9139 break;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9140
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9141 case inGoAway:
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9142 if (TrackGoAway (window_ptr, er.where))
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9143 {
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9144 inev.kind = DELETE_WINDOW_EVENT;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9145 XSETFRAME (inev.frame_or_window,
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9146 mac_window_to_frame (window_ptr));
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9147 }
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9148 break;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9149
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9150 /* window resize handling added --ben */
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9151 case inGrow:
57357
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
9152 do_grow_window (window_ptr, &er);
05fe2d3ca439 macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents: 56890
diff changeset
9153 break;
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9154
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9155 /* window zoom handling added --ben */
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9156 case inZoomIn:
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9157 case inZoomOut:
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9158 if (TrackBox (window_ptr, er.where, part_code))
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9159 do_zoom_window (window_ptr, part_code);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9160 break;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9161
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9162 default:
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9163 break;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9164 }
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9165 }
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9166 break;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9167
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9168 case updateEvt:
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9169 #if USE_CARBON_EVENTS
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9170 if (SendEventToEventTarget (eventRef, toolbox_dispatcher)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9171 != eventNotHandledErr)
46860
8b7ade57211d 2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46856
diff changeset
9172 break;
59384
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
9173 #else
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9174 do_window_update ((WindowPtr) er.message);
59384
a1edc5959dcf * macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents: 59325
diff changeset
9175 #endif
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9176 break;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9177
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9178 case osEvt:
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9179 #if USE_CARBON_EVENTS
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9180 if (SendEventToEventTarget (eventRef, toolbox_dispatcher)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9181 != eventNotHandledErr)
46860
8b7ade57211d 2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46856
diff changeset
9182 break;
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
9183 #endif
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9184 switch ((er.message >> 24) & 0x000000FF)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9185 {
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9186 case suspendResumeMessage:
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9187 if ((er.message & resumeFlag) == 1)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9188 do_app_resume ();
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9189 else
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9190 do_app_suspend ();
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9191 break;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9192
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9193 case mouseMovedMessage:
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9194 #if !USE_CARBON_EVENTS
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9195 SetRectRgn (mouse_region, er.where.h, er.where.v,
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9196 er.where.h + 1, er.where.v + 1);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9197 #endif
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9198 previous_help_echo_string = help_echo_string;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9199 help_echo_string = help_echo_object = help_echo_window = Qnil;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9200 help_echo_pos = -1;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9201
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9202 if (dpyinfo->grabbed && last_mouse_frame
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9203 && FRAME_LIVE_P (last_mouse_frame))
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9204 f = last_mouse_frame;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9205 else
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9206 f = dpyinfo->x_focus_frame;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9207
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9208 if (dpyinfo->mouse_face_hidden)
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9209 {
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9210 dpyinfo->mouse_face_hidden = 0;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9211 clear_mouse_face (dpyinfo);
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9212 }
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9213
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9214 if (f)
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9215 {
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9216 WindowPtr wp = FRAME_MAC_WINDOW (f);
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9217 Point mouse_pos = er.where;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9218
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9219 SetPortWindowPort (wp);
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9220
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9221 GlobalToLocal (&mouse_pos);
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9222
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9223 if (dpyinfo->grabbed && tracked_scroll_bar)
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9224 #ifdef USE_TOOLKIT_SCROLL_BARS
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9225 x_scroll_bar_handle_drag (wp, tracked_scroll_bar,
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9226 mouse_pos, er.when * (1000 / 60),
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9227 &inev);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9228 #else /* not USE_TOOLKIT_SCROLL_BARS */
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9229 x_scroll_bar_note_movement (tracked_scroll_bar,
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9230 mouse_pos.v
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9231 - XINT (tracked_scroll_bar->top),
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9232 er.when * (1000 / 60));
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9233 #endif /* not USE_TOOLKIT_SCROLL_BARS */
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9234 else
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9235 {
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9236 /* Generate SELECT_WINDOW_EVENTs when needed. */
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9237 if (mouse_autoselect_window)
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9238 {
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9239 Lisp_Object window;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9240
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9241 window = window_from_coordinates (f,
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9242 mouse_pos.h,
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9243 mouse_pos.v,
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9244 0, 0, 0, 0);
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9245
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9246 /* Window will be selected only when it is
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9247 not selected now and last mouse movement
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9248 event was not in it. Minibuffer window
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9249 will be selected iff it is active. */
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9250 if (WINDOWP (window)
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9251 && !EQ (window, last_window)
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9252 && !EQ (window, selected_window))
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9253 {
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9254 inev.kind = SELECT_WINDOW_EVENT;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9255 inev.frame_or_window = window;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9256 }
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9257
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9258 last_window=window;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9259 }
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9260 note_mouse_movement (f, &mouse_pos);
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9261 }
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9262 }
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9263
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9264 /* If the contents of the global variable
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9265 help_echo_string has changed, generate a
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9266 HELP_EVENT. */
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9267 if (!NILP (help_echo_string) || !NILP (previous_help_echo_string))
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9268 do_help = 1;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9269 break;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9270 }
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9271 break;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9272
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9273 case activateEvt:
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9274 {
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9275 WindowPtr window_ptr = (WindowPtr) er.message;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9276
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9277 #if USE_CARBON_EVENTS
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9278 if (SendEventToEventTarget (eventRef, toolbox_dispatcher)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9279 != eventNotHandledErr)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9280 break;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9281 #endif
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9282 if (window_ptr == tip_window)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9283 {
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9284 HideWindow (tip_window);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9285 break;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9286 }
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9287
56278
3d525d0266de macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents: 56277
diff changeset
9288 if (!is_emacs_window (window_ptr))
3d525d0266de macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents: 56277
diff changeset
9289 break;
57373
38e45bf0128a (x_update_window_end): Fix flicker on vertical line between
Kim F. Storm <storm@cua.dk>
parents: 57357
diff changeset
9290
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9291 if ((er.modifiers & activeFlag) != 0)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9292 {
56278
3d525d0266de macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents: 56277
diff changeset
9293 /* A window has been activated */
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9294 Point mouse_loc = er.where;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9295
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9296 x_detect_focus_change (dpyinfo, &er, &inev);
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9297
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9298 SetPortWindowPort (window_ptr);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9299 GlobalToLocal (&mouse_loc);
56278
3d525d0266de macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents: 56277
diff changeset
9300 /* Window-activated event counts as mouse movement,
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9301 so update things that depend on mouse position. */
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9302 note_mouse_movement (mac_window_to_frame (window_ptr),
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9303 &mouse_loc);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9304 }
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9305 else
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9306 {
56278
3d525d0266de macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents: 56277
diff changeset
9307 /* A window has been deactivated */
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9308 #if USE_TOOLKIT_SCROLL_BARS
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9309 if (dpyinfo->grabbed && tracked_scroll_bar)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9310 {
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9311 struct input_event event;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9312
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9313 EVENT_INIT (event);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9314 event.kind = NO_EVENT;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9315 x_scroll_bar_handle_release (tracked_scroll_bar,
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9316 er.when * (1000 / 60),
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9317 &event);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9318 if (event.kind != NO_EVENT)
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9319 {
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9320 kbd_buffer_store_event_hold (&event, hold_quit);
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9321 count++;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9322 }
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9323 }
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
9324 #endif
56278
3d525d0266de macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents: 56277
diff changeset
9325 dpyinfo->grabbed = 0;
3d525d0266de macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents: 56277
diff changeset
9326
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9327 x_detect_focus_change (dpyinfo, &er, &inev);
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9328
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9329 f = mac_window_to_frame (window_ptr);
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9330 if (f == dpyinfo->mouse_face_mouse_frame)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9331 {
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9332 /* If we move outside the frame, then we're
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9333 certainly no longer on any text in the
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9334 frame. */
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9335 clear_mouse_face (dpyinfo);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9336 dpyinfo->mouse_face_mouse_frame = 0;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9337 }
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9338
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9339 /* Generate a nil HELP_EVENT to cancel a help-echo.
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9340 Do it only if there's something to cancel.
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9341 Otherwise, the startup message is cleared when the
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9342 mouse leaves the frame. */
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9343 if (any_help_event_p)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9344 do_help = -1;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9345 }
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9346 }
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9347 break;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9348
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9349 case keyDown:
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9350 case autoKey:
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9351 {
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9352 int keycode = (er.message & keyCodeMask) >> 8;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9353 int xkeysym;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
9354
60364
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
9355 #if USE_CARBON_EVENTS && defined (MAC_OSX)
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9356 /* When using Carbon Events, we need to pass raw keyboard
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9357 events to the TSM ourselves. If TSM handles it, it
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9358 will pass back noErr, otherwise it will pass back
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9359 "eventNotHandledErr" and we can process it
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9360 normally. */
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9361 if ((!NILP (Vmac_pass_command_to_system)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9362 || !(er.modifiers & cmdKey))
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9363 && (!NILP (Vmac_pass_control_to_system)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9364 || !(er.modifiers & controlKey)))
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9365 if (SendEventToEventTarget (eventRef, toolbox_dispatcher)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9366 != eventNotHandledErr)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9367 break;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9368 #endif
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9369
61615
351bda10c1b0 (XTread_socket): Don't beep on keyboard input even if no frame is
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61574
diff changeset
9370 #if 0
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9371 if (dpyinfo->x_focus_frame == NULL)
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9372 {
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9373 /* Beep if keyboard input occurs when all the frames
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9374 are invisible. */
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9375 SysBeep (1);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9376 break;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9377 }
61615
351bda10c1b0 (XTread_socket): Don't beep on keyboard input even if no frame is
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61574
diff changeset
9378 #endif
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9379
61500
441abfeebcb2 (mac_keyboard_text_encoding, current_mac_keyboard_text_encoding):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60635
diff changeset
9380 {
441abfeebcb2 (mac_keyboard_text_encoding, current_mac_keyboard_text_encoding):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60635
diff changeset
9381 static SInt16 last_key_script = -1;
441abfeebcb2 (mac_keyboard_text_encoding, current_mac_keyboard_text_encoding):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60635
diff changeset
9382 SInt16 current_key_script = GetScriptManagerVariable (smKeyScript);
441abfeebcb2 (mac_keyboard_text_encoding, current_mac_keyboard_text_encoding):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60635
diff changeset
9383
441abfeebcb2 (mac_keyboard_text_encoding, current_mac_keyboard_text_encoding):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60635
diff changeset
9384 if (last_key_script != current_key_script)
441abfeebcb2 (mac_keyboard_text_encoding, current_mac_keyboard_text_encoding):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60635
diff changeset
9385 {
441abfeebcb2 (mac_keyboard_text_encoding, current_mac_keyboard_text_encoding):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60635
diff changeset
9386 struct input_event event;
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9387
61500
441abfeebcb2 (mac_keyboard_text_encoding, current_mac_keyboard_text_encoding):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60635
diff changeset
9388 EVENT_INIT (event);
441abfeebcb2 (mac_keyboard_text_encoding, current_mac_keyboard_text_encoding):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60635
diff changeset
9389 event.kind = LANGUAGE_CHANGE_EVENT;
441abfeebcb2 (mac_keyboard_text_encoding, current_mac_keyboard_text_encoding):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60635
diff changeset
9390 event.arg = Qnil;
441abfeebcb2 (mac_keyboard_text_encoding, current_mac_keyboard_text_encoding):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60635
diff changeset
9391 event.code = current_key_script;
441abfeebcb2 (mac_keyboard_text_encoding, current_mac_keyboard_text_encoding):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60635
diff changeset
9392 kbd_buffer_store_event (&event);
441abfeebcb2 (mac_keyboard_text_encoding, current_mac_keyboard_text_encoding):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60635
diff changeset
9393 count++;
441abfeebcb2 (mac_keyboard_text_encoding, current_mac_keyboard_text_encoding):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60635
diff changeset
9394 }
441abfeebcb2 (mac_keyboard_text_encoding, current_mac_keyboard_text_encoding):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60635
diff changeset
9395 last_key_script = current_key_script;
441abfeebcb2 (mac_keyboard_text_encoding, current_mac_keyboard_text_encoding):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60635
diff changeset
9396 }
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9397
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9398 ObscureCursor ();
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9399
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9400 if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight))
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9401 {
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9402 clear_mouse_face (dpyinfo);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9403 dpyinfo->mouse_face_hidden = 1;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9404 }
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9405
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9406 if (keycode_to_xkeysym (keycode, &xkeysym))
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9407 {
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9408 inev.code = 0xff00 | xkeysym;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9409 inev.kind = NON_ASCII_KEYSTROKE_EVENT;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9410 }
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9411 else
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9412 {
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9413 if (er.modifiers & (controlKey |
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9414 (NILP (Vmac_command_key_is_meta) ? optionKey
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9415 : cmdKey)))
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9416 {
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9417 /* This code comes from Keyboard Resource,
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9418 Appendix C of IM - Text. This is necessary
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9419 since shift is ignored in KCHR table
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9420 translation when option or command is pressed.
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9421 It also does not translate correctly
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9422 control-shift chars like C-% so mask off shift
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9423 here also */
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9424 int new_modifiers = er.modifiers & 0xe600;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9425 /* mask off option and command */
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9426 int new_keycode = keycode | new_modifiers;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9427 Ptr kchr_ptr = (Ptr) GetScriptManagerVariable (smKCHRCache);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9428 unsigned long some_state = 0;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9429 inev.code = KeyTranslate (kchr_ptr, new_keycode,
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9430 &some_state) & 0xff;
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9431 }
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9432 else if (!NILP (Vmac_option_modifier)
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9433 && (er.modifiers & optionKey))
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9434 {
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9435 /* When using the option key as an emacs modifier,
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9436 convert the pressed key code back to one
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9437 without the Mac option modifier applied. */
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9438 int new_modifiers = er.modifiers & ~optionKey;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9439 int new_keycode = keycode | new_modifiers;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9440 Ptr kchr_ptr = (Ptr) GetScriptManagerVariable (smKCHRCache);
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9441 unsigned long some_state = 0;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9442 inev.code = KeyTranslate (kchr_ptr, new_keycode,
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9443 &some_state) & 0xff;
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9444 }
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9445 else
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9446 inev.code = er.message & charCodeMask;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9447 inev.kind = ASCII_KEYSTROKE_EVENT;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9448 }
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9449 }
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9450
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9451 #if USE_CARBON_EVENTS
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9452 inev.modifiers = mac_event_to_emacs_modifiers (eventRef);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9453 #else
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9454 inev.modifiers = mac_to_emacs_modifiers (er.modifiers);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9455 #endif
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9456 XSETFRAME (inev.frame_or_window, mac_focus_frame (dpyinfo));
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9457 inev.timestamp = er.when * (1000 / 60); /* ticks to milliseconds */
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9458 break;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9459
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9460 case kHighLevelEvent:
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9461 drag_and_drop_file_list = Qnil;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9462
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9463 AEProcessAppleEvent(&er);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9464
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9465 /* Build a DRAG_N_DROP_EVENT type event as is done in
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9466 constuct_drag_n_drop in w32term.c. */
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9467 if (!NILP (drag_and_drop_file_list))
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9468 {
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9469 struct frame *f = mac_focus_frame (dpyinfo);
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9470 WindowPtr wp;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9471 Lisp_Object frame;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9472
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9473 inev.kind = DRAG_N_DROP_EVENT;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9474 inev.code = 0;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9475 inev.timestamp = er.when * (1000 / 60);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9476 /* ticks to milliseconds */
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
9477 #if USE_CARBON_EVENTS
54165
88d1b7a60637 (XTread_socket): Remove bufp_r and numcharsp args. Add hold_quit arg.
Kim F. Storm <storm@cua.dk>
parents: 54150
diff changeset
9478 inev.modifiers = mac_event_to_emacs_modifiers (eventRef);
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
9479 #else
54165
88d1b7a60637 (XTread_socket): Remove bufp_r and numcharsp args. Add hold_quit arg.
Kim F. Storm <storm@cua.dk>
parents: 54150
diff changeset
9480 inev.modifiers = mac_to_emacs_modifiers (er.modifiers);
88d1b7a60637 (XTread_socket): Remove bufp_r and numcharsp args. Add hold_quit arg.
Kim F. Storm <storm@cua.dk>
parents: 54150
diff changeset
9481 #endif
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9482
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9483 XSETINT (inev.x, 0);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9484 XSETINT (inev.y, 0);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9485
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9486 XSETFRAME (frame, f);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9487 inev.frame_or_window = Fcons (frame, drag_and_drop_file_list);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9488
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9489 #if 0
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9490 /* Regardless of whether Emacs was suspended or in the
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9491 foreground, ask it to redraw its entire screen.
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9492 Otherwise parts of the screen can be left in an
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9493 inconsistent state. */
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9494 wp = FRAME_MAC_WINDOW (f);
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9495 if (wp)
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
9496 #if TARGET_API_MAC_CARBON
52827
7d76fa8c5eda * macterm.c (XTread_socket): Call DragWindow only for mouseDown events.
Andrew Choi <akochoi@shaw.ca>
parents: 52742
diff changeset
9497 {
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9498 Rect r;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9499
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9500 GetWindowPortBounds (wp, &r);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9501 InvalWindowRect (wp, &r);
52827
7d76fa8c5eda * macterm.c (XTread_socket): Call DragWindow only for mouseDown events.
Andrew Choi <akochoi@shaw.ca>
parents: 52742
diff changeset
9502 }
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9503 #else /* not TARGET_API_MAC_CARBON */
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9504 InvalRect (&(wp->portRect));
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9505 #endif /* not TARGET_API_MAC_CARBON */
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9506 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9507 }
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9508 default:
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9509 break;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9510 }
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
9511 #if USE_CARBON_EVENTS
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9512 ReleaseEvent (eventRef);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
9513 #endif
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9514
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9515 if (inev.kind != NO_EVENT)
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9516 {
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9517 kbd_buffer_store_event_hold (&inev, hold_quit);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9518 count++;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9519 }
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9520
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9521 if (do_help
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9522 && !(hold_quit && hold_quit->kind != NO_EVENT))
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9523 {
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9524 Lisp_Object frame;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9525
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9526 if (f)
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9527 XSETFRAME (frame, f);
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9528 else
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9529 frame = Qnil;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9530
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9531 if (do_help > 0)
46860
8b7ade57211d 2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46856
diff changeset
9532 {
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9533 any_help_event_p = 1;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9534 gen_help_event (help_echo_string, frame, help_echo_window,
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9535 help_echo_object, help_echo_pos);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
9536 }
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9537 else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9538 {
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9539 help_echo_string = Qnil;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9540 gen_help_event (Qnil, frame, Qnil, Qnil, 0);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9541 }
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9542 count++;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9543 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
9544
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9545 }
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9546
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9547 /* If the focus was just given to an autoraising frame,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9548 raise it now. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9549 /* ??? This ought to be able to handle more than one such frame. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9550 if (pending_autoraise_frame)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9551 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9552 x_raise_frame (pending_autoraise_frame);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9553 pending_autoraise_frame = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9554 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9555
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9556 UNBLOCK_INPUT;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9557 return count;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9558 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9559
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9560
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9561 /* Need to override CodeWarrior's input function so no conversion is
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9562 done on newlines Otherwise compiled functions in .elc files will be
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9563 read incorrectly. Defined in ...:MSL C:MSL
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9564 Common:Source:buffer_io.c. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9565 #ifdef __MWERKS__
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9566 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9567 __convert_to_newlines (unsigned char * p, size_t * n)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9568 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9569 #pragma unused(p,n)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9570 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9571
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9572 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9573 __convert_from_newlines (unsigned char * p, size_t * n)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9574 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9575 #pragma unused(p,n)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9576 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9577 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9578
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9579 #ifdef MAC_OS8
47634
fb65015ecfce Whitespace changes.
Richard M. Stallman <rms@gnu.org>
parents: 47173
diff changeset
9580 void
fb65015ecfce Whitespace changes.
Richard M. Stallman <rms@gnu.org>
parents: 47173
diff changeset
9581 make_mac_terminal_frame (struct frame *f)
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9582 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9583 Lisp_Object frame;
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9584 Rect r;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9585
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9586 XSETFRAME (frame, f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9587
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9588 f->output_method = output_mac;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9589 f->output_data.mac = (struct mac_output *)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9590 xmalloc (sizeof (struct mac_output));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9591 bzero (f->output_data.mac, sizeof (struct mac_output));
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
9592
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9593 XSETFRAME (FRAME_KBOARD (f)->Vdefault_minibuffer_frame, f);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9594
51198
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
9595 FRAME_COLS (f) = 96;
f8e097cae353 Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51048
diff changeset
9596 FRAME_LINES (f) = 4;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9597
53722
4f64eb1ea148 Move setting of scroll bars from make_mac_frame to
Steven Tamm <steventamm@mac.com>
parents: 53651
diff changeset
9598 FRAME_CAN_HAVE_SCROLL_BARS (f) = 1;
4f64eb1ea148 Move setting of scroll bars from make_mac_frame to
Steven Tamm <steventamm@mac.com>
parents: 53651
diff changeset
9599 FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_right;
4f64eb1ea148 Move setting of scroll bars from make_mac_frame to
Steven Tamm <steventamm@mac.com>
parents: 53651
diff changeset
9600
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9601 FRAME_DESIRED_CURSOR (f) = FILLED_BOX_CURSOR;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9602
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9603 f->output_data.mac->cursor_pixel = 0;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9604 f->output_data.mac->border_pixel = 0x00ff00;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9605 f->output_data.mac->mouse_pixel = 0xff00ff;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9606 f->output_data.mac->cursor_foreground_pixel = 0x0000ff;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9607
60364
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
9608 f->output_data.mac->text_cursor = kThemeIBeamCursor;
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
9609 f->output_data.mac->nontext_cursor = kThemeArrowCursor;
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
9610 f->output_data.mac->modeline_cursor = kThemeArrowCursor;
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
9611 f->output_data.mac->hand_cursor = kThemePointingHandCursor;
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
9612 f->output_data.mac->hourglass_cursor = kThemeWatchCursor;
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
9613 f->output_data.mac->horizontal_drag_cursor = kThemeResizeLeftRightCursor;
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9614
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9615 FRAME_FONTSET (f) = -1;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9616 f->output_data.mac->explicit_parent = 0;
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9617 f->left_pos = 8;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9618 f->top_pos = 32;
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9619 f->border_width = 0;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9620
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9621 f->internal_border_width = 0;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9622
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9623 f->auto_raise = 1;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9624 f->auto_lower = 1;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9625
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9626 f->new_text_cols = 0;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9627 f->new_text_lines = 0;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9628
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9629 SetRect (&r, f->left_pos, f->top_pos,
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9630 f->left_pos + FRAME_PIXEL_WIDTH (f),
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9631 f->top_pos + FRAME_PIXEL_HEIGHT (f));
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9632
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9633 BLOCK_INPUT;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9634
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9635 if (!(FRAME_MAC_WINDOW (f) =
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9636 NewCWindow (NULL, &r, "\p", true, dBoxProc,
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9637 (WindowPtr) -1, 1, (long) f->output_data.mac)))
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9638 abort ();
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9639 /* so that update events can find this mac_output struct */
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9640 f->output_data.mac->mFP = f; /* point back to emacs frame */
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9641
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9642 UNBLOCK_INPUT;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9643
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9644 x_make_gc (f);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
9645
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9646 /* Need to be initialized for unshow_buffer in window.c. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9647 selected_window = f->selected_window;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9648
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9649 Fmodify_frame_parameters (frame,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9650 Fcons (Fcons (Qfont,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9651 build_string ("-*-monaco-medium-r-*--*-90-*-*-*-*-mac-roman")), Qnil));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9652 Fmodify_frame_parameters (frame,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9653 Fcons (Fcons (Qforeground_color,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9654 build_string ("black")), Qnil));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9655 Fmodify_frame_parameters (frame,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9656 Fcons (Fcons (Qbackground_color,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9657 build_string ("white")), Qnil));
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9658 }
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9659 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9660
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9661
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9662 /***********************************************************************
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9663 Initialization
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9664 ***********************************************************************/
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9665
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9666 int mac_initialized = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9667
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9668 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9669 mac_initialize_display_info ()
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9670 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9671 struct mac_display_info *dpyinfo = &one_mac_display_info;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9672 GDHandle main_device_handle;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9673
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9674 bzero (dpyinfo, sizeof (*dpyinfo));
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9675
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9676 #ifdef MAC_OSX
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9677 dpyinfo->mac_id_name
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46169
diff changeset
9678 = (char *) xmalloc (SCHARS (Vinvocation_name)
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46169
diff changeset
9679 + SCHARS (Vsystem_name)
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9680 + 2);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9681 sprintf (dpyinfo->mac_id_name, "%s@%s",
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46169
diff changeset
9682 SDATA (Vinvocation_name), SDATA (Vsystem_name));
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9683 #else
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9684 dpyinfo->mac_id_name = (char *) xmalloc (strlen ("Mac Display") + 1);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9685 strcpy (dpyinfo->mac_id_name, "Mac Display");
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9686 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9687
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9688 main_device_handle = LMGetMainDevice();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9689
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9690 dpyinfo->reference_count = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9691 dpyinfo->resx = 75.0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9692 dpyinfo->resy = 75.0;
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
9693 dpyinfo->color_p = TestDeviceAttribute (main_device_handle, gdDevType);
56146
5e784b2ea638 * macfns.c (Fx_display_color_cells): Do not limit return value to 256.
Jan Djärv <jan.h.d@swipnet.se>
parents: 55851
diff changeset
9694 #ifdef MAC_OSX
5e784b2ea638 * macfns.c (Fx_display_color_cells): Do not limit return value to 256.
Jan Djärv <jan.h.d@swipnet.se>
parents: 55851
diff changeset
9695 /* HasDepth returns true if it is possible to have a 32 bit display,
56348
550df8e67006 * macterm.c (mac_initialize_display_info): Use CGGetActiveDisplayList
Jan Djärv <jan.h.d@swipnet.se>
parents: 56278
diff changeset
9696 but this may not be what is actually used. Mac OSX can do better.
550df8e67006 * macterm.c (mac_initialize_display_info): Use CGGetActiveDisplayList
Jan Djärv <jan.h.d@swipnet.se>
parents: 56278
diff changeset
9697 CGMainDisplayID is only available on OSX 10.2 and higher, but the
550df8e67006 * macterm.c (mac_initialize_display_info): Use CGGetActiveDisplayList
Jan Djärv <jan.h.d@swipnet.se>
parents: 56278
diff changeset
9698 header for CGGetActiveDisplayList says that the first display returned
550df8e67006 * macterm.c (mac_initialize_display_info): Use CGGetActiveDisplayList
Jan Djärv <jan.h.d@swipnet.se>
parents: 56278
diff changeset
9699 is the active one, so we use that. */
550df8e67006 * macterm.c (mac_initialize_display_info): Use CGGetActiveDisplayList
Jan Djärv <jan.h.d@swipnet.se>
parents: 56278
diff changeset
9700 {
550df8e67006 * macterm.c (mac_initialize_display_info): Use CGGetActiveDisplayList
Jan Djärv <jan.h.d@swipnet.se>
parents: 56278
diff changeset
9701 CGDirectDisplayID disp_id[1];
550df8e67006 * macterm.c (mac_initialize_display_info): Use CGGetActiveDisplayList
Jan Djärv <jan.h.d@swipnet.se>
parents: 56278
diff changeset
9702 CGDisplayCount disp_count;
550df8e67006 * macterm.c (mac_initialize_display_info): Use CGGetActiveDisplayList
Jan Djärv <jan.h.d@swipnet.se>
parents: 56278
diff changeset
9703 CGDisplayErr error_code;
550df8e67006 * macterm.c (mac_initialize_display_info): Use CGGetActiveDisplayList
Jan Djärv <jan.h.d@swipnet.se>
parents: 56278
diff changeset
9704
550df8e67006 * macterm.c (mac_initialize_display_info): Use CGGetActiveDisplayList
Jan Djärv <jan.h.d@swipnet.se>
parents: 56278
diff changeset
9705 error_code = CGGetActiveDisplayList (1, disp_id, &disp_count);
550df8e67006 * macterm.c (mac_initialize_display_info): Use CGGetActiveDisplayList
Jan Djärv <jan.h.d@swipnet.se>
parents: 56278
diff changeset
9706 if (error_code != 0)
550df8e67006 * macterm.c (mac_initialize_display_info): Use CGGetActiveDisplayList
Jan Djärv <jan.h.d@swipnet.se>
parents: 56278
diff changeset
9707 error ("No display found, CGGetActiveDisplayList error %d", error_code);
550df8e67006 * macterm.c (mac_initialize_display_info): Use CGGetActiveDisplayList
Jan Djärv <jan.h.d@swipnet.se>
parents: 56278
diff changeset
9708
550df8e67006 * macterm.c (mac_initialize_display_info): Use CGGetActiveDisplayList
Jan Djärv <jan.h.d@swipnet.se>
parents: 56278
diff changeset
9709 dpyinfo->n_planes = CGDisplayBitsPerPixel (disp_id[0]);
550df8e67006 * macterm.c (mac_initialize_display_info): Use CGGetActiveDisplayList
Jan Djärv <jan.h.d@swipnet.se>
parents: 56278
diff changeset
9710 }
56146
5e784b2ea638 * macfns.c (Fx_display_color_cells): Do not limit return value to 256.
Jan Djärv <jan.h.d@swipnet.se>
parents: 55851
diff changeset
9711 #else
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
9712 for (dpyinfo->n_planes = 32; dpyinfo->n_planes > 0; dpyinfo->n_planes >>= 1)
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
9713 if (HasDepth (main_device_handle, dpyinfo->n_planes,
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
9714 gdDevType, dpyinfo->color_p))
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
9715 break;
56146
5e784b2ea638 * macfns.c (Fx_display_color_cells): Do not limit return value to 256.
Jan Djärv <jan.h.d@swipnet.se>
parents: 55851
diff changeset
9716 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9717 dpyinfo->height = (**main_device_handle).gdRect.bottom;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9718 dpyinfo->width = (**main_device_handle).gdRect.right;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9719 dpyinfo->grabbed = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9720 dpyinfo->root_window = NULL;
54150
6c8849d06ab3 Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents: 53956
diff changeset
9721 dpyinfo->image_cache = make_image_cache ();
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9722
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9723 dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9724 dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9725 dpyinfo->mouse_face_face_id = DEFAULT_FACE_ID;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9726 dpyinfo->mouse_face_window = Qnil;
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9727 dpyinfo->mouse_face_overlay = Qnil;
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9728 dpyinfo->mouse_face_hidden = 0;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9729 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9730
60635
e45b939c1d93 (x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60623
diff changeset
9731
e45b939c1d93 (x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60623
diff changeset
9732 static XrmDatabase
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9733 mac_make_rdb (xrm_option)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9734 char *xrm_option;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9735 {
60635
e45b939c1d93 (x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60623
diff changeset
9736 XrmDatabase database;
e45b939c1d93 (x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60623
diff changeset
9737
e45b939c1d93 (x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60623
diff changeset
9738 database = xrm_get_preference_database (NULL);
e45b939c1d93 (x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60623
diff changeset
9739 if (xrm_option)
e45b939c1d93 (x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60623
diff changeset
9740 xrm_merge_string_database (database, xrm_option);
e45b939c1d93 (x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60623
diff changeset
9741
e45b939c1d93 (x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60623
diff changeset
9742 return database;
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9743 }
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9744
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9745 struct mac_display_info *
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9746 mac_term_init (display_name, xrm_option, resource_name)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9747 Lisp_Object display_name;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9748 char *xrm_option;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9749 char *resource_name;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9750 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9751 struct mac_display_info *dpyinfo;
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9752
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9753 BLOCK_INPUT;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9754
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9755 if (!mac_initialized)
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9756 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9757 mac_initialize ();
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9758 mac_initialized = 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9759 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9760
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9761 if (x_display_list)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9762 error ("Sorry, this version can only handle one display");
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9763
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9764 mac_initialize_display_info ();
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9765
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9766 dpyinfo = &one_mac_display_info;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9767
60635
e45b939c1d93 (x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60623
diff changeset
9768 dpyinfo->xrdb = mac_make_rdb (xrm_option);
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9769
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9770 /* Put this display on the chain. */
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9771 dpyinfo->next = x_display_list;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9772 x_display_list = dpyinfo;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9773
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9774 /* Put it on x_display_name_list. */
60635
e45b939c1d93 (x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60623
diff changeset
9775 x_display_name_list = Fcons (Fcons (display_name,
e45b939c1d93 (x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 60623
diff changeset
9776 Fcons (Qnil, dpyinfo->xrdb)),
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9777 x_display_name_list);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9778 dpyinfo->name_list_element = XCAR (x_display_name_list);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9779
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9780 UNBLOCK_INPUT;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9781
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9782 return dpyinfo;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9783 }
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9784 /* Get rid of display DPYINFO, assuming all frames are already gone. */
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9785
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9786 void
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9787 x_delete_display (dpyinfo)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9788 struct mac_display_info *dpyinfo;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9789 {
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9790 int i;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9791
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9792 /* Discard this display from x_display_name_list and x_display_list.
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9793 We can't use Fdelq because that can quit. */
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9794 if (! NILP (x_display_name_list)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9795 && EQ (XCAR (x_display_name_list), dpyinfo->name_list_element))
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9796 x_display_name_list = XCDR (x_display_name_list);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9797 else
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9798 {
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9799 Lisp_Object tail;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9800
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9801 tail = x_display_name_list;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9802 while (CONSP (tail) && CONSP (XCDR (tail)))
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9803 {
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9804 if (EQ (XCAR (XCDR (tail)), dpyinfo->name_list_element))
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9805 {
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9806 XSETCDR (tail, XCDR (XCDR (tail)));
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9807 break;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9808 }
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9809 tail = XCDR (tail);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9810 }
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9811 }
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9812
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9813 if (x_display_list == dpyinfo)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9814 x_display_list = dpyinfo->next;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9815 else
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9816 {
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9817 struct x_display_info *tail;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9818
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9819 for (tail = x_display_list; tail; tail = tail->next)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9820 if (tail->next == dpyinfo)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9821 tail->next = tail->next->next;
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9822 }
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9823
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9824 /* Free the font names in the font table. */
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9825 for (i = 0; i < dpyinfo->n_fonts; i++)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9826 if (dpyinfo->font_table[i].name)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9827 {
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9828 if (dpyinfo->font_table[i].name != dpyinfo->font_table[i].full_name)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9829 xfree (dpyinfo->font_table[i].full_name);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9830 xfree (dpyinfo->font_table[i].name);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9831 }
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9832
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9833 if (dpyinfo->font_table->font_encoder)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9834 xfree (dpyinfo->font_table->font_encoder);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9835
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9836 xfree (dpyinfo->font_table);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9837 xfree (dpyinfo->mac_id_name);
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9838
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9839 if (x_display_list == 0)
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9840 {
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9841 mac_clear_font_name_table ();
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9842 bzero (dpyinfo, sizeof (*dpyinfo));
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9843 }
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9844 }
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
9845
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
9846
46856
eba75fedd593 2002-08-10 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46805
diff changeset
9847 #ifdef MAC_OSX
47634
fb65015ecfce Whitespace changes.
Richard M. Stallman <rms@gnu.org>
parents: 47173
diff changeset
9848 void
48739
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9849 mac_check_bundle()
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9850 {
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9851 extern int inhibit_window_system;
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9852 extern int noninteractive;
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9853 CFBundleRef appsBundle;
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9854 pid_t child;
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9855
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9856 /* No need to test if already -nw*/
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9857 if (inhibit_window_system || noninteractive)
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9858 return;
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9859
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9860 appsBundle = CFBundleGetMainBundle();
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9861 if (appsBundle != NULL)
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9862 {
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9863 CFStringRef cfBI = CFSTR("CFBundleIdentifier");
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9864 CFTypeRef res = CFBundleGetValueForInfoDictionaryKey(appsBundle, cfBI);
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9865 /* We found the bundle identifier, now we know we are valid. */
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9866 if (res != NULL)
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9867 {
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9868 CFRelease(res);
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9869 return;
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9870 }
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9871 }
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9872 /* MAC_TODO: Have this start the bundled executable */
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9873
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9874 /* For now, prevent the fatal error by bringing it up in the terminal */
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9875 inhibit_window_system = 1;
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9876 }
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9877
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9878 void
47634
fb65015ecfce Whitespace changes.
Richard M. Stallman <rms@gnu.org>
parents: 47173
diff changeset
9879 MakeMeTheFrontProcess ()
46856
eba75fedd593 2002-08-10 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46805
diff changeset
9880 {
eba75fedd593 2002-08-10 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46805
diff changeset
9881 ProcessSerialNumber psn;
eba75fedd593 2002-08-10 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46805
diff changeset
9882 OSErr err;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
9883
46856
eba75fedd593 2002-08-10 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46805
diff changeset
9884 err = GetCurrentProcess (&psn);
eba75fedd593 2002-08-10 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46805
diff changeset
9885 if (err == noErr)
eba75fedd593 2002-08-10 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46805
diff changeset
9886 (void) SetFrontProcess (&psn);
eba75fedd593 2002-08-10 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46805
diff changeset
9887 }
48739
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9888
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9889 /***** Code to handle C-g testing *****/
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9890
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9891 /* Contains the Mac modifier formed from quit_char */
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9892 static mac_quit_char_modifiers = 0;
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9893 static mac_quit_char_keycode;
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9894 extern int quit_char;
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9895
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9896 static void
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9897 mac_determine_quit_char_modifiers()
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9898 {
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9899 /* Todo: Determine modifiers from quit_char. */
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9900 UInt32 qc_modifiers = ctrl_modifier;
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9901
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9902 /* Map modifiers */
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9903 mac_quit_char_modifiers = 0;
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9904 if (qc_modifiers & ctrl_modifier) mac_quit_char_modifiers |= macCtrlKey;
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9905 if (qc_modifiers & shift_modifier) mac_quit_char_modifiers |= macShiftKey;
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9906 if (qc_modifiers & meta_modifier) mac_quit_char_modifiers |= macMetaKey;
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9907 if (qc_modifiers & alt_modifier) mac_quit_char_modifiers |= macAltKey;
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9908 }
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9909
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9910 static void
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9911 init_quit_char_handler ()
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9912 {
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9913 /* TODO: Let this support keys other the 'g' */
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9914 mac_quit_char_keycode = 5;
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9915 /* Look at <architecture/adb_kb_map.h> for details */
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9916 /* http://gemma.apple.com/techpubs/mac/Toolbox/Toolbox-40.html#MARKER-9-184*/
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
9917
48739
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9918 mac_determine_quit_char_modifiers();
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9919 }
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9920
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9921 static Boolean
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9922 quit_char_comp (EventRef inEvent, void *inCompData)
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9923 {
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9924 if (GetEventClass(inEvent) != kEventClassKeyboard)
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9925 return false;
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9926 if (GetEventKind(inEvent) != kEventRawKeyDown)
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9927 return false;
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9928 {
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9929 UInt32 keyCode;
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9930 UInt32 keyModifiers;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
9931 GetEventParameter(inEvent, kEventParamKeyCode,
48739
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9932 typeUInt32, NULL, sizeof(UInt32), NULL, &keyCode);
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9933 if (keyCode != mac_quit_char_keycode)
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9934 return false;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
9935 GetEventParameter(inEvent, kEventParamKeyModifiers,
48739
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9936 typeUInt32, NULL, sizeof(UInt32), NULL, &keyModifiers);
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9937 if (keyModifiers != mac_quit_char_modifiers)
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9938 return false;
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9939 }
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9940 return true;
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9941 }
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9942
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9943 void
50591
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
9944 mac_check_for_quit_char ()
48739
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9945 {
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9946 EventRef event;
50591
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
9947 static EMACS_TIME last_check_time = { 0, 0 };
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
9948 static EMACS_TIME one_second = { 1, 0 };
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
9949 EMACS_TIME now, t;
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
9950
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
9951 /* If windows are not initialized, return immediately (keep it bouncin'). */
48739
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9952 if (!mac_quit_char_modifiers)
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9953 return;
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9954
50591
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
9955 /* Don't check if last check is less than a second ago. */
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
9956 EMACS_GET_TIME (now);
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
9957 EMACS_SUB_TIME (t, now, last_check_time);
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
9958 if (EMACS_TIME_LT (t, one_second))
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
9959 return;
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
9960 last_check_time = now;
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
9961
48739
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9962 /* Redetermine modifiers because they are based on lisp variables */
50591
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
9963 mac_determine_quit_char_modifiers ();
48739
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9964
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9965 /* Fill the queue with events */
55412
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
9966 BLOCK_INPUT;
48739
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9967 ReceiveNextEvent (0, NULL, kEventDurationNoWait, false, &event);
50591
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
9968 event = FindSpecificEventInQueue (GetMainEventQueue (), quit_char_comp,
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
9969 NULL);
55412
53a1a79a33f9 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents: 55128
diff changeset
9970 UNBLOCK_INPUT;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
9971 if (event)
48739
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9972 {
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9973 struct input_event e;
55851
f1d6a507dcfd Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents: 55583
diff changeset
9974
48739
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9975 /* Use an input_event to emulate what the interrupt handler does. */
51570
5bc2bb8c1fef (mac_check_for_quit_char): Don't pass uninitialized
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 51464
diff changeset
9976 EVENT_INIT (e);
48739
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9977 e.kind = ASCII_KEYSTROKE_EVENT;
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9978 e.code = quit_char;
55583
21f88361795c Various fixes to support USE_LSB_TAG with carbon emacs. Mostly fixing
Steven Tamm <steventamm@mac.com>
parents: 55539
diff changeset
9979 e.arg = Qnil;
48818
5030a4c296d2 * macterm.c (mac_check_for_quit_char): Correctly set the
Steven Tamm <steventamm@mac.com>
parents: 48739
diff changeset
9980 e.modifiers = NULL;
50591
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
9981 e.timestamp = EventTimeToTicks (GetEventTime (event)) * (1000/60);
61574
d3c53b9d1828 (x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61555
diff changeset
9982 XSETFRAME (e.frame_or_window, mac_focus_frame (&one_mac_display_info));
48739
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9983 /* Remove event from queue to prevent looping. */
50591
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
9984 RemoveEventFromQueue (GetMainEventQueue (), event);
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
9985 ReleaseEvent (event);
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
9986 kbd_buffer_store_event (&e);
48739
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9987 }
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
9988 }
46856
eba75fedd593 2002-08-10 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46805
diff changeset
9989 #endif /* MAC_OSX */
eba75fedd593 2002-08-10 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46805
diff changeset
9990
61786
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
9991 static void
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
9992 init_menu_bar ()
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
9993 {
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
9994 #ifdef MAC_OSX
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
9995 OSErr err;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
9996 MenuRef menu;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
9997 MenuItemIndex menu_index;
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
9998
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
9999 err = GetIndMenuItemWithCommandID (NULL, kHICommandQuit, 1,
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10000 &menu, &menu_index);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10001 if (err == noErr)
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10002 SetMenuItemCommandKey (menu, menu_index, false, 0);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10003 #if USE_CARBON_EVENTS
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10004 EnableMenuCommand (NULL, kHICommandPreferences);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10005 err = GetIndMenuItemWithCommandID (NULL, kHICommandPreferences, 1,
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10006 &menu, &menu_index);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10007 if (err == noErr)
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10008 {
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10009 SetMenuItemCommandKey (menu, menu_index, false, 0);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10010 InsertMenuItemTextWithCFString (menu, NULL,
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10011 0, kMenuItemAttrSeparator, 0);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10012 InsertMenuItemTextWithCFString (menu, CFSTR ("About Emacs"),
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10013 0, 0, kHICommandAbout);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10014 }
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10015 #endif /* USE_CARBON_EVENTS */
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10016 #else /* !MAC_OSX */
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10017 #if USE_CARBON_EVENTS
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10018 SetMenuItemCommandID (GetMenuHandle (M_APPLE), I_ABOUT, kHICommandAbout);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10019 #endif
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10020 #endif
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10021 }
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10022
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10023
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10024 /* Set up use of X before we make the first connection. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10025
50360
0cebe62850bc Remove unnecessary extern declarations.
Kim F. Storm <storm@cua.dk>
parents: 50344
diff changeset
10026 extern frame_parm_handler mac_frame_parm_handlers[];
0cebe62850bc Remove unnecessary extern declarations.
Kim F. Storm <storm@cua.dk>
parents: 50344
diff changeset
10027
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10028 static struct redisplay_interface x_redisplay_interface =
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10029 {
50360
0cebe62850bc Remove unnecessary extern declarations.
Kim F. Storm <storm@cua.dk>
parents: 50344
diff changeset
10030 mac_frame_parm_handlers,
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10031 x_produce_glyphs,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10032 x_write_glyphs,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10033 x_insert_glyphs,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10034 x_clear_end_of_line,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10035 x_scroll_run,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10036 x_after_update_window_line,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10037 x_update_window_begin,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10038 x_update_window_end,
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
10039 x_cursor_to,
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10040 x_flush,
58634
95d38c47c806 * keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents: 58403
diff changeset
10041 0, /* flush_display_optional */
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
10042 x_clear_window_mouse_face,
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10043 x_get_glyph_overhangs,
50097
ee703213acfa Remove generic fringe code.
Kim F. Storm <storm@cua.dk>
parents: 49600
diff changeset
10044 x_fix_overlapping_area,
50157
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
10045 x_draw_fringe_bitmap,
53885
693745d24f76 (x_draw_fringe_bitmap): Copy unadapted code from
Kim F. Storm <storm@cua.dk>
parents: 53722
diff changeset
10046 0, /* define_fringe_bitmap */
693745d24f76 (x_draw_fringe_bitmap): Copy unadapted code from
Kim F. Storm <storm@cua.dk>
parents: 53722
diff changeset
10047 0, /* destroy_fringe_bitmap */
50157
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
10048 mac_per_char_metric,
203d5a0f77a8 The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents: 50097
diff changeset
10049 mac_encode_char,
59718
d4cb255b034d * dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents: 59655
diff changeset
10050 mac_compute_glyph_string_overhangs,
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
10051 x_draw_glyph_string,
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
10052 mac_define_frame_cursor,
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
10053 mac_clear_frame_area,
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
10054 mac_draw_window_cursor,
50344
31cf5b909af7 (x_redisplay_interface): Add missing entry for
Andreas Schwab <schwab@suse.de>
parents: 50247
diff changeset
10055 mac_draw_vertical_window_border,
50222
90e10bfd8bfa * macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents: 50157
diff changeset
10056 mac_shift_glyphs_for_insert
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10057 };
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10058
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10059 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10060 mac_initialize ()
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10061 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10062 rif = &x_redisplay_interface;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10063
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10064 clear_frame_hook = x_clear_frame;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10065 ins_del_lines_hook = x_ins_del_lines;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10066 delete_glyphs_hook = x_delete_glyphs;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10067 ring_bell_hook = XTring_bell;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10068 reset_terminal_modes_hook = XTreset_terminal_modes;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10069 set_terminal_modes_hook = XTset_terminal_modes;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10070 update_begin_hook = x_update_begin;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10071 update_end_hook = x_update_end;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10072 set_terminal_window_hook = XTset_terminal_window;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10073 read_socket_hook = XTread_socket;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10074 frame_up_to_date_hook = XTframe_up_to_date;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10075 mouse_position_hook = XTmouse_position;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10076 frame_rehighlight_hook = XTframe_rehighlight;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10077 frame_raise_lower_hook = XTframe_raise_lower;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10078
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10079 set_vertical_scroll_bar_hook = XTset_vertical_scroll_bar;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10080 condemn_scroll_bars_hook = XTcondemn_scroll_bars;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10081 redeem_scroll_bar_hook = XTredeem_scroll_bar;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10082 judge_scroll_bars_hook = XTjudge_scroll_bars;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10083
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10084 scroll_region_ok = 1; /* we'll scroll partial frames */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10085 char_ins_del_ok = 1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10086 line_ins_del_ok = 1; /* we'll just blt 'em */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10087 fast_clear_end_of_line = 1; /* X does this well */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10088 memory_below_frame = 0; /* we don't remember what scrolls
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10089 off the bottom */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10090 baud_rate = 19200;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10091
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10092 x_noop_count = 0;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10093 last_tool_bar_item = -1;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10094 any_help_event_p = 0;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
10095
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10096 /* Try to use interrupt input; if we can't, then start polling. */
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10097 Fset_input_mode (Qt, Qnil, Qt, Qnil);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10098
57425
0867872551d9 macterm.c (x_raise_frame): Add BLOCK_INPUT around SelectWindow
Steven Tamm <steventamm@mac.com>
parents: 57373
diff changeset
10099 BLOCK_INPUT;
46121
2198a6632b2b In mac:
Andrew Choi <akochoi@shaw.ca>
parents: 45890
diff changeset
10100
2198a6632b2b In mac:
Andrew Choi <akochoi@shaw.ca>
parents: 45890
diff changeset
10101 #if TARGET_API_MAC_CARBON
2198a6632b2b In mac:
Andrew Choi <akochoi@shaw.ca>
parents: 45890
diff changeset
10102 init_required_apple_events ();
2198a6632b2b In mac:
Andrew Choi <akochoi@shaw.ca>
parents: 45890
diff changeset
10103
61786
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10104 #if USE_CARBON_EVENTS
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10105 #ifdef MAC_OSX
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
10106 init_service_handler ();
48739
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
10107
9f54273b7ff1 Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents: 48625
diff changeset
10108 init_quit_char_handler ();
61786
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10109 #endif /* MAC_OSX */
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10110
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10111 init_command_handler ();
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10112
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10113 init_menu_bar ();
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10114 #endif /* USE_CARBON_EVENTS */
46856
eba75fedd593 2002-08-10 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46805
diff changeset
10115
60364
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
10116 #ifdef MAC_OSX
46856
eba75fedd593 2002-08-10 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46805
diff changeset
10117 if (!inhibit_window_system)
eba75fedd593 2002-08-10 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46805
diff changeset
10118 MakeMeTheFrontProcess ();
46121
2198a6632b2b In mac:
Andrew Choi <akochoi@shaw.ca>
parents: 45890
diff changeset
10119 #endif
60364
de784812b4d4 [TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 59899
diff changeset
10120 #endif
57425
0867872551d9 macterm.c (x_raise_frame): Add BLOCK_INPUT around SelectWindow
Steven Tamm <steventamm@mac.com>
parents: 57373
diff changeset
10121 UNBLOCK_INPUT;
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10122 }
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10123
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10124
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10125 void
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10126 syms_of_macterm ()
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10127 {
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10128 #if 0
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10129 staticpro (&x_error_message_string);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10130 x_error_message_string = Qnil;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10131 #endif
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10132
57783
4cb8cebc3255 2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents: 57425
diff changeset
10133 Qmodifier_value = intern ("modifier-value");
4cb8cebc3255 2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents: 57425
diff changeset
10134 Qalt = intern ("alt");
4cb8cebc3255 2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents: 57425
diff changeset
10135 Fput (Qalt, Qmodifier_value, make_number (alt_modifier));
4cb8cebc3255 2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents: 57425
diff changeset
10136 Qhyper = intern ("hyper");
4cb8cebc3255 2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents: 57425
diff changeset
10137 Fput (Qhyper, Qmodifier_value, make_number (hyper_modifier));
4cb8cebc3255 2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents: 57425
diff changeset
10138 Qsuper = intern ("super");
4cb8cebc3255 2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents: 57425
diff changeset
10139 Fput (Qsuper, Qmodifier_value, make_number (super_modifier));
4cb8cebc3255 2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents: 57425
diff changeset
10140
61786
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10141 Qapplication = intern ("application"); staticpro (&Qapplication);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10142 Qabout = intern ("about"); staticpro (&Qabout);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10143
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10144 #if USE_CARBON_EVENTS && defined (MAC_OSX)
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10145 Qpreferences = intern ("preferences"); staticpro (&Qpreferences);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10146 Qservices = intern ("services"); staticpro (&Qservices);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10147 Qpaste = intern ("paste"); staticpro (&Qpaste);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10148 Qperform = intern ("perform"); staticpro (&Qperform);
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10149 #endif
223bdb2c3b9a (handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61658
diff changeset
10150
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
10151 #ifdef MAC_OSX
49015
c49640262de0 * macterm.c (syms_of_macterm): Provide the feature "mac-carbon" to
Steven Tamm <steventamm@mac.com>
parents: 49003
diff changeset
10152 Fprovide (intern ("mac-carbon"), Qnil);
59146
9bde7721ad0f * dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents: 59041
diff changeset
10153 #endif
49015
c49640262de0 * macterm.c (syms_of_macterm): Provide the feature "mac-carbon" to
Steven Tamm <steventamm@mac.com>
parents: 49003
diff changeset
10154
53956
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
10155 staticpro (&Qreverse);
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
10156 Qreverse = intern ("reverse");
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
10157
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10158 staticpro (&x_display_name_list);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10159 x_display_name_list = Qnil;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10160
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10161 staticpro (&last_mouse_scroll_bar);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10162 last_mouse_scroll_bar = Qnil;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10163
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10164 staticpro (&Qvendor_specific_keysyms);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10165 Qvendor_specific_keysyms = intern ("vendor-specific-keysyms");
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10166
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10167 staticpro (&last_mouse_press_frame);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10168 last_mouse_press_frame = Qnil;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10169
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10170 Qmac_ready_for_drag_n_drop = intern ("mac-ready-for-drag-n-drop");
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10171 staticpro (&Qmac_ready_for_drag_n_drop);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10172
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10173 DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10174 doc: /* If not nil, Emacs uses toolkit scroll bars. */);
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
10175 #ifdef USE_TOOLKIT_SCROLL_BARS
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10176 Vx_toolkit_scroll_bars = Qt;
62103
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
10177 #else
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
10178 Vx_toolkit_scroll_bars = Qnil;
2d42fd79f829 (toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61786
diff changeset
10179 #endif
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10180
50591
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
10181 DEFVAR_BOOL ("x-use-underline-position-properties",
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
10182 &x_use_underline_position_properties,
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
10183 doc: /* *Non-nil means make use of UNDERLINE_POSITION font properties.
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
10184 nil means ignore them. If you encounter fonts with bogus
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
10185 UNDERLINE_POSITION font properties, for example 7x13 on XFree prior
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
10186 to 4.1, set this to nil. */);
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
10187 x_use_underline_position_properties = 0;
12b66952af3a * macterm.c (mac_check_for_quit_char): Don't check more often than
Andrew Choi <akochoi@shaw.ca>
parents: 50360
diff changeset
10188
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10189 staticpro (&last_mouse_motion_frame);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10190 last_mouse_motion_frame = Qnil;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49504
diff changeset
10191
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10192 DEFVAR_LISP ("mac-command-key-is-meta", &Vmac_command_key_is_meta,
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10193 doc: /* Non-nil means that the command key is used as the Emacs meta key.
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10194 Otherwise the option key is used. */);
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10195 Vmac_command_key_is_meta = Qt;
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10196
57783
4cb8cebc3255 2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents: 57425
diff changeset
10197 DEFVAR_LISP ("mac-option-modifier", &Vmac_option_modifier,
4cb8cebc3255 2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents: 57425
diff changeset
10198 doc: /* Modifier to use for the Mac alt/option key. The value can
4cb8cebc3255 2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents: 57425
diff changeset
10199 be alt, hyper, or super for the respective modifier. If the value is
4cb8cebc3255 2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents: 57425
diff changeset
10200 nil then the key will act as the normal Mac option modifier. */);
4cb8cebc3255 2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents: 57425
diff changeset
10201 Vmac_option_modifier = Qnil;
4cb8cebc3255 2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents: 57425
diff changeset
10202
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
10203 DEFVAR_LISP ("mac-reverse-ctrl-meta", &Vmac_reverse_ctrl_meta,
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
10204 doc: /* Non-nil means that the control and meta keys are reversed. This is
59804
f47724e7b605 (syms_of_macterm) <mac-reverse-ctrl-meta>: Fix docstring indentation.
Jesper Harder <harder@ifa.au.dk>
parents: 59748
diff changeset
10205 useful for non-standard keyboard layouts. */);
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
10206 Vmac_reverse_ctrl_meta = Qnil;
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
10207
55025
5cbecea4d4ad (x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents: 54366
diff changeset
10208 DEFVAR_LISP ("mac-emulate-three-button-mouse",
53956
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
10209 &Vmac_emulate_three_button_mouse,
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
10210 doc: /* t means that when the option-key is held down while pressing the
59804
f47724e7b605 (syms_of_macterm) <mac-reverse-ctrl-meta>: Fix docstring indentation.
Jesper Harder <harder@ifa.au.dk>
parents: 59748
diff changeset
10211 mouse button, the click will register as mouse-2 and while the
f47724e7b605 (syms_of_macterm) <mac-reverse-ctrl-meta>: Fix docstring indentation.
Jesper Harder <harder@ifa.au.dk>
parents: 59748
diff changeset
10212 command-key is held down, the click will register as mouse-3.
f47724e7b605 (syms_of_macterm) <mac-reverse-ctrl-meta>: Fix docstring indentation.
Jesper Harder <harder@ifa.au.dk>
parents: 59748
diff changeset
10213 'reverse means that the the option-key will register for mouse-3
f47724e7b605 (syms_of_macterm) <mac-reverse-ctrl-meta>: Fix docstring indentation.
Jesper Harder <harder@ifa.au.dk>
parents: 59748
diff changeset
10214 and the command-key will register for mouse-2. nil means that
f47724e7b605 (syms_of_macterm) <mac-reverse-ctrl-meta>: Fix docstring indentation.
Jesper Harder <harder@ifa.au.dk>
parents: 59748
diff changeset
10215 no emulation should be done and the modifiers should be placed
f47724e7b605 (syms_of_macterm) <mac-reverse-ctrl-meta>: Fix docstring indentation.
Jesper Harder <harder@ifa.au.dk>
parents: 59748
diff changeset
10216 on the mouse-1 event. */);
53956
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
10217 Vmac_emulate_three_button_mouse = Qnil;
922b1cbf208b (Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents: 53935
diff changeset
10218
46798
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
10219 #if USE_CARBON_EVENTS
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
10220 DEFVAR_LISP ("mac-wheel-button-is-mouse-2", &Vmac_wheel_button_is_mouse_2,
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
10221 doc: /* Non-nil means that the wheel button will be treated as mouse-2 and
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
10222 the right click will be mouse-3.
a8e027c9c403 In src:
Andrew Choi <akochoi@shaw.ca>
parents: 46370
diff changeset
10223 Otherwise, the right click will be mouse-2 and the wheel button mouse-3.*/);
49003
532fc9301fcd * macterm.c (syms_of_macterm): Set mac-wheel-button-is-mouse-2
Steven Tamm <steventamm@mac.com>
parents: 48926
diff changeset
10224 Vmac_wheel_button_is_mouse_2 = Qt;
46860
8b7ade57211d 2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46856
diff changeset
10225
8b7ade57211d 2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46856
diff changeset
10226 DEFVAR_LISP ("mac-pass-command-to-system", &Vmac_pass_command_to_system,
8b7ade57211d 2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46856
diff changeset
10227 doc: /* If non-nil, the Mac \"Command\" key is passed on to the Mac
8b7ade57211d 2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46856
diff changeset
10228 Toolbox for processing before Emacs sees it. */);
8b7ade57211d 2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46856
diff changeset
10229 Vmac_pass_command_to_system = Qt;
8b7ade57211d 2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46856
diff changeset
10230
8b7ade57211d 2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46856
diff changeset
10231 DEFVAR_LISP ("mac-pass-control-to-system", &Vmac_pass_control_to_system,
8b7ade57211d 2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46856
diff changeset
10232 doc: /* If non-nil, the Mac \"Control\" key is passed on to the Mac
8b7ade57211d 2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46856
diff changeset
10233 Toolbox for processing before Emacs sees it. */);
8b7ade57211d 2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents: 46856
diff changeset
10234 Vmac_pass_control_to_system = Qt;
59577
a4a748516aa7 * macterm.c (Vmac_use_core_graphics): defined
Steven Tamm <steventamm@mac.com>
parents: 59575
diff changeset
10235
a4a748516aa7 * macterm.c (Vmac_use_core_graphics): defined
Steven Tamm <steventamm@mac.com>
parents: 59575
diff changeset
10236 #endif
a4a748516aa7 * macterm.c (Vmac_use_core_graphics): defined
Steven Tamm <steventamm@mac.com>
parents: 59575
diff changeset
10237
59578
10f083976969 Changed name from mac-use-core-graphics to mac-allow-anti-aliasing
Steven Tamm <steventamm@mac.com>
parents: 59577
diff changeset
10238 DEFVAR_LISP ("mac-allow-anti-aliasing", &Vmac_use_core_graphics,
59586
2f6084ef9fec (syms_of_macterm) <mac-allow-anti-aliasing>: Doc fix.
Kim F. Storm <storm@cua.dk>
parents: 59585
diff changeset
10239 doc: /* If non-nil, allow anti-aliasing.
2f6084ef9fec (syms_of_macterm) <mac-allow-anti-aliasing>: Doc fix.
Kim F. Storm <storm@cua.dk>
parents: 59585
diff changeset
10240 The text will be rendered using Core Graphics text rendering which
2f6084ef9fec (syms_of_macterm) <mac-allow-anti-aliasing>: Doc fix.
Kim F. Storm <storm@cua.dk>
parents: 59585
diff changeset
10241 may anti-alias the text. */);
59577
a4a748516aa7 * macterm.c (Vmac_use_core_graphics): defined
Steven Tamm <steventamm@mac.com>
parents: 59575
diff changeset
10242 Vmac_use_core_graphics = Qnil;
61658
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
10243
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
10244 /* Register an entry for `mac-roman' so that it can be used when
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
10245 creating the terminal frame on Mac OS 9 before loading
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
10246 term/mac-win.elc. */
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
10247 DEFVAR_LISP ("mac-charset-info-alist", &Vmac_charset_info_alist,
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
10248 doc: /* Alist linking Emacs character sets to Mac text encoding and Emacs coding system.
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
10249 Each entry should be of the form:
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
10250
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
10251 (CHARSET-NAME TEXT-ENCODING CODING-SYSTEM)
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
10252
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
10253 where CHARSET-NAME is a string used in font names to identify the
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
10254 charset, TEXT-ENCODING is a TextEncodingBase value, and CODING_SYSTEM
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
10255 is a coding system corresponding to TEXT-ENCODING. */);
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
10256 Vmac_charset_info_alist =
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
10257 Fcons (list3 (build_string ("mac-roman"),
38a086380ddc (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 61615
diff changeset
10258 make_number (smRoman), Qnil), Qnil);
44890
01b93e5e53a7 Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff changeset
10259 }
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 51570
diff changeset
10260
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 51570
diff changeset
10261 /* arch-tag: f2259165-4454-4c04-a029-a133c8af7b5b
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 51570
diff changeset
10262 (do not change this comment) */