aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Colascione2012-08-31 22:38:52 -0800
committerDaniel Colascione2012-08-31 22:38:52 -0800
commit17a2cbbd76385d0be8a4b28974e64f4debf459c1 (patch)
treec9d9f61e8580269679c9583ee94ccd812cca5790
parentc650a5dec69902c684c5333befd35da6c518c5e0 (diff)
downloademacs-17a2cbbd76385d0be8a4b28974e64f4debf459c1.tar.gz
emacs-17a2cbbd76385d0be8a4b28974e64f4debf459c1.zip
Refactor window-system configuration
This change streamlines the window system selection code in configure.in and moves many common function declarations from window-specific headers to frame.h. It introduces a new TERM_HEADER macro in config.h: we set this macro to the right header to use for the window system for which we're compiling Emacs and have source files include it indirectly. This way, we don't have to teach every file about every window system.
-rw-r--r--ChangeLog8
-rw-r--r--configure.ac51
-rw-r--r--nt/ChangeLog4
-rw-r--r--nt/inc/ms-w32.h3
-rw-r--r--src/ChangeLog71
-rw-r--r--src/Makefile.in11
-rw-r--r--src/ccl.h2
-rw-r--r--src/dispnew.c14
-rw-r--r--src/emacs.c12
-rw-r--r--src/font.c14
-rw-r--r--src/frame.c19
-rw-r--r--src/frame.h30
-rw-r--r--src/gtkutil.h1
-rw-r--r--src/image.c31
-rw-r--r--src/keyboard.c19
-rw-r--r--src/keyboard.h2
-rw-r--r--src/menu.c17
-rw-r--r--src/nsterm.h27
-rw-r--r--src/process.c7
-rw-r--r--src/w32font.h4
-rw-r--r--src/w32term.h2
-rw-r--r--src/w32xfns.c2
-rw-r--r--src/xfaces.c20
-rw-r--r--src/xterm.h26
24 files changed, 228 insertions, 169 deletions
diff --git a/ChangeLog b/ChangeLog
index 228cf1d74d7..6e93b8313e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
12012-09-01 Daniel Colascione <dan.colascione@gmail.com>
2
3 * configure.ac: Introduce term_header variable, which holds the
4 value which will become TERM_HEADER in code. We effect our choice
5 of window system by setting term_header and WINDOW_SYSTEM_OBJ
6 instead of using ad-hoc variables and flags for each window
7 system.
8
12012-08-26 Paul Eggert <eggert@cs.ucla.edu> 92012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2 10
3 * configure.ac (CFLAGS): Prefer -g3 to -g if -g3 works 11 * configure.ac (CFLAGS): Prefer -g3 to -g if -g3 works
diff --git a/configure.ac b/configure.ac
index 71ec98390aa..d16113bf919 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1386,10 +1386,14 @@ AC_SYS_LONG_FILE_NAMES
1386 1386
1387#### Choose a window system. 1387#### Choose a window system.
1388 1388
1389## We leave window_system equal to none if
1390## we end up building without one. Any new window system should
1391## set window_system to an appropriate value and add objects to
1392## window-system-specific substs.
1393
1394window_system=none
1389AC_PATH_X 1395AC_PATH_X
1390if test "$no_x" = yes; then 1396if test "$no_x" != yes; then
1391 window_system=none
1392else
1393 window_system=x11 1397 window_system=x11
1394fi 1398fi
1395 1399
@@ -1528,7 +1532,6 @@ if test "${HAVE_NS}" = yes; then
1528 fi 1532 fi
1529 1533
1530 window_system=nextstep 1534 window_system=nextstep
1531 with_xft=no
1532 # set up packaging dirs 1535 # set up packaging dirs
1533 if test "${EN_NS_SELF_CONTAINED}" = yes; then 1536 if test "${EN_NS_SELF_CONTAINED}" = yes; then
1534 ns_self_contained=yes 1537 ns_self_contained=yes
@@ -1548,7 +1551,6 @@ if test "${HAVE_NS}" = yes; then
1548 INSTALL_ARCH_INDEP_EXTRA= 1551 INSTALL_ARCH_INDEP_EXTRA=
1549 fi 1552 fi
1550 ns_frag=$srcdir/src/ns.mk 1553 ns_frag=$srcdir/src/ns.mk
1551 NS_OBJ="fontset.o fringe.o image.o"
1552 NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o" 1554 NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o"
1553fi 1555fi
1554CFLAGS="$tmp_CFLAGS" 1556CFLAGS="$tmp_CFLAGS"
@@ -1560,18 +1562,29 @@ AC_SUBST(NS_OBJC_OBJ)
1560AC_SUBST(LIB_STANDARD) 1562AC_SUBST(LIB_STANDARD)
1561AC_SUBST_FILE(ns_frag) 1563AC_SUBST_FILE(ns_frag)
1562 1564
1565## $window_system is now set to the window system we will
1566## ultimately use.
1567
1568term_header=
1569HAVE_X_WINDOWS=no
1570HAVE_X11=no
1571USE_X_TOOLKIT=none
1572
1563case "${window_system}" in 1573case "${window_system}" in
1564 x11 ) 1574 x11 )
1565 HAVE_X_WINDOWS=yes 1575 HAVE_X_WINDOWS=yes
1566 HAVE_X11=yes 1576 HAVE_X11=yes
1577 term_header=xterm.h
1567 case "${with_x_toolkit}" in 1578 case "${with_x_toolkit}" in
1568 athena | lucid ) USE_X_TOOLKIT=LUCID ;; 1579 athena | lucid ) USE_X_TOOLKIT=LUCID ;;
1569 motif ) USE_X_TOOLKIT=MOTIF ;; 1580 motif ) USE_X_TOOLKIT=MOTIF ;;
1570 gtk ) with_gtk=yes 1581 gtk ) with_gtk=yes
1582 term_header=gtkutil.h
1571dnl Don't set this for GTK. A lot of tests below assumes Xt when 1583dnl Don't set this for GTK. A lot of tests below assumes Xt when
1572dnl USE_X_TOOLKIT is set. 1584dnl USE_X_TOOLKIT is set.
1573 USE_X_TOOLKIT=none ;; 1585 USE_X_TOOLKIT=none ;;
1574 gtk3 ) with_gtk3=yes 1586 gtk3 ) with_gtk3=yes
1587 term_header=gtkutil.h
1575 USE_X_TOOLKIT=none ;; 1588 USE_X_TOOLKIT=none ;;
1576 no ) USE_X_TOOLKIT=none ;; 1589 no ) USE_X_TOOLKIT=none ;;
1577dnl If user did not say whether to use a toolkit, make this decision later: 1590dnl If user did not say whether to use a toolkit, make this decision later:
@@ -1579,13 +1592,16 @@ dnl use the toolkit if we have gtk, or X11R5 or newer.
1579 * ) USE_X_TOOLKIT=maybe ;; 1592 * ) USE_X_TOOLKIT=maybe ;;
1580 esac 1593 esac
1581 ;; 1594 ;;
1582 nextstep | none ) 1595 nextstep )
1583 HAVE_X_WINDOWS=no 1596 term_header=nsterm.h
1584 HAVE_X11=no
1585 USE_X_TOOLKIT=none
1586 ;; 1597 ;;
1587esac 1598esac
1588 1599
1600if test -n "${term_header}"; then
1601 AC_DEFINE_UNQUOTED(TERM_HEADER, "${term_header}",
1602 [Define to the header for the built-in window system.])
1603fi
1604
1589if test "$window_system" = none && test "X$with_x" != "Xno"; then 1605if test "$window_system" = none && test "X$with_x" != "Xno"; then
1590 AC_CHECK_PROG(HAVE_XSERVER, X, true, false) 1606 AC_CHECK_PROG(HAVE_XSERVER, X, true, false)
1591 if test "$HAVE_XSERVER" = true || 1607 if test "$HAVE_XSERVER" = true ||
@@ -1901,6 +1917,7 @@ if test "${with_gtk3}" = "yes"; then
1901 fi 1917 fi
1902 AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.]) 1918 AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.])
1903 GTK_OBJ=emacsgtkfixed.o 1919 GTK_OBJ=emacsgtkfixed.o
1920 term_header=gtkutil.h
1904fi 1921fi
1905 1922
1906if test "$pkg_check_gtk" != "yes"; then 1923if test "$pkg_check_gtk" != "yes"; then
@@ -1979,6 +1996,8 @@ if test "${HAVE_GTK}" = "yes"; then
1979 gtk_widget_get_mapped gtk_adjustment_get_page_size \ 1996 gtk_widget_get_mapped gtk_adjustment_get_page_size \
1980 gtk_orientable_set_orientation \ 1997 gtk_orientable_set_orientation \
1981 gtk_window_set_has_resize_grip) 1998 gtk_window_set_has_resize_grip)
1999
2000 term_header=gtkutil.h
1982fi 2001fi
1983 2002
1984dnl D-Bus has been tested under GNU/Linux only. Must be adapted for 2003dnl D-Bus has been tested under GNU/Linux only. Must be adapted for
@@ -3973,6 +3992,11 @@ AC_SUBST(ns_appsrc)
3973AC_SUBST(GNU_OBJC_CFLAGS) 3992AC_SUBST(GNU_OBJC_CFLAGS)
3974AC_SUBST(OTHER_FILES) 3993AC_SUBST(OTHER_FILES)
3975 3994
3995if test -n "${term_header}"; then
3996 AC_DEFINE_UNQUOTED(TERM_HEADER, "${term_header}",
3997 [Define to the header for the built-in window system.])
3998fi
3999
3976AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "${canonical}", 4000AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "${canonical}",
3977 [Define to the canonical Emacs configuration name.]) 4001 [Define to the canonical Emacs configuration name.])
3978AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${ac_configure_args}", 4002AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${ac_configure_args}",
@@ -3987,7 +4011,7 @@ if test "${HAVE_X_WINDOWS}" = "yes" ; then
3987 AC_DEFINE(HAVE_X_WINDOWS, 1, 4011 AC_DEFINE(HAVE_X_WINDOWS, 1,
3988 [Define to 1 if you want to use the X window system.]) 4012 [Define to 1 if you want to use the X window system.])
3989 XMENU_OBJ=xmenu.o 4013 XMENU_OBJ=xmenu.o
3990 XOBJ="xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o xsettings.o xgselect.o" 4014 XOBJ="xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o xgselect.o"
3991 FONT_OBJ=xfont.o 4015 FONT_OBJ=xfont.o
3992 if test "$HAVE_XFT" = "yes"; then 4016 if test "$HAVE_XFT" = "yes"; then
3993 FONT_OBJ="$FONT_OBJ ftfont.o xftfont.o ftxfont.o" 4017 FONT_OBJ="$FONT_OBJ ftfont.o xftfont.o ftxfont.o"
@@ -4277,13 +4301,14 @@ if test "x$GCC" = "xyes" && test "x$ORDINARY_LINK" != "xyes"; then
4277fi dnl if $GCC 4301fi dnl if $GCC
4278AC_SUBST(LIB_GCC) 4302AC_SUBST(LIB_GCC)
4279 4303
4280 4304## Common for all window systems
4281## If we're using X11/GNUstep, define some consequences. 4305if test "$window_system" != "none"; then
4282if test "$HAVE_X_WINDOWS" = "yes" || test "$HAVE_NS" = "yes"; then
4283 AC_DEFINE(HAVE_WINDOW_SYSTEM, 1, [Define if you have a window system.]) 4306 AC_DEFINE(HAVE_WINDOW_SYSTEM, 1, [Define if you have a window system.])
4284 AC_DEFINE(HAVE_MOUSE, 1, [Define if you have mouse support.]) 4307 AC_DEFINE(HAVE_MOUSE, 1, [Define if you have mouse support.])
4308 WINDOW_SYSTEM_OBJ="fontset.o fringe.o image.o"
4285fi 4309fi
4286 4310
4311AC_SUBST(WINDOW_SYSTEM_OBJ)
4287 4312
4288AH_TOP([/* GNU Emacs site configuration template file. 4313AH_TOP([/* GNU Emacs site configuration template file.
4289 4314
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 7729f09d00f..1085138e3f6 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,7 @@
12012-09-01 Daniel Colascione <dancol@dancol.org>
2
3 * inc/ms-w32.h (TERM_HEADER): Add for refactoring
4
12012-08-22 Juanma Barranquero <lekktu@gmail.com> 52012-08-22 Juanma Barranquero <lekktu@gmail.com>
2 6
3 * config.nt: Sync with autogen/config.in. 7 * config.nt: Sync with autogen/config.in.
diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h
index 022b168c0b8..8945fb7be4d 100644
--- a/nt/inc/ms-w32.h
+++ b/nt/inc/ms-w32.h
@@ -424,4 +424,7 @@ extern void _DebPrint (const char *fmt, ...);
424#define DebPrint(stuff) 424#define DebPrint(stuff)
425#endif 425#endif
426 426
427#define TERM_HEADER "w32term.h"
428
429
427/* ============================================================ */ 430/* ============================================================ */
diff --git a/src/ChangeLog b/src/ChangeLog
index 4db48bbb969..0bd1d6c98a9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,74 @@
12012-09-01 Daniel Colascione <dancol@dancol.org>
2
3 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
4 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
5 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
6 x_wm_set_size_hint, x_query_colors, x_real_positions,
7 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
8 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
9 all of which have been moved to common code.
10
11 * xfaces.c: Include TERM_HEADER instead of listing all possible
12 window-system headers.
13
14 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
15 to match header.
16
17 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
18 directly accessing frame internals.
19
20 * w32font.h (w): Include font.h. Define syms_of_w32font and
21 globals_of_w32font.
22
23 * process.c: Include TERM_HEADER instead of listing all possible
24 window-system headers.
25
26 * nsterm.h: Remove declarations now in frame.h. Define
27 FRAME_X_SCREEN, FRAME_X_VISUAL.
28
29 * menu.c: Include TERM_HEADER instead of listing all possible
30 window-system headers.
31
32 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
33 window system.
34
35 * keyboard.c: Include TERM_HEADER instead of listing all possible
36 window-system headers.
37
38 * image.c: Include TERM_HEADER instead of listing all possible
39 window-system headers. Declare Vlibrary_cache when compiling for
40 Windows.
41
42 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
43 window system declarations.
44
45 * frame.h: Move common functions here: set_frame_menubar,
46 x_set_window_size, x_sync, x_get_focus_frame,
47 x_set_mouse_position, x_set_mouse_pixel_position,
48 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
49 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
50 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
51 x_activate_menubar, x_real_positions, x_bitmap_icon,
52 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
53 and x_query_colors.
54
55 * frame.c: Include TERM_HEADER instead of listing all possible
56 window-system headers.
57
58 * font.c: Include TERM_HEADER instead of listing all possible
59 window-system headers.
60
61 * emacs.c: Include TERM_HEADER.
62
63 * dispnew.c (d): Include TERM_HEADER instead of listing all
64 possible window-system headers.
65
66 * ccl.h (c): Include character.h.
67
68 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
69 the current window system; include in list of objects to link into
70 Emacs.
71
12012-08-31 Dmitry Antipov <dmantipov@yandex.ru> 722012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2 73
3 Remove mark_ttys function and fix tty_display_info initialization. 74 Remove mark_ttys function and fix tty_display_info initialization.
diff --git a/src/Makefile.in b/src/Makefile.in
index 60df1f1c677..a809216f095 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -211,8 +211,8 @@ LIBXMENU=@LIBXMENU@
211 211
212## xmenu.o if HAVE_X_WINDOWS, else empty. 212## xmenu.o if HAVE_X_WINDOWS, else empty.
213XMENU_OBJ=@XMENU_OBJ@ 213XMENU_OBJ=@XMENU_OBJ@
214## xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o 214## xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o xgselect.o if
215## xsettings.o xgselect.o if HAVE_X_WINDOWS, else empty. 215## HAVE_X_WINDOWS, else empty.
216XOBJ=@XOBJ@ 216XOBJ=@XOBJ@
217 217
218TOOLKIT_LIBW=@TOOLKIT_LIBW@ 218TOOLKIT_LIBW=@TOOLKIT_LIBW@
@@ -247,6 +247,9 @@ WIDGET_OBJ=@WIDGET_OBJ@
247## sheap.o if CYGWIN, otherwise empty. 247## sheap.o if CYGWIN, otherwise empty.
248CYGWIN_OBJ=@CYGWIN_OBJ@ 248CYGWIN_OBJ=@CYGWIN_OBJ@
249 249
250## fontset.o fringe.o image.o if we have any window system
251WINDOW_SYSTEM_OBJ=@WINDOW_SYSTEM_OBJ@
252
250## dosfns.o msdos.o w16select.o if MSDOS. 253## dosfns.o msdos.o w16select.o if MSDOS.
251MSDOS_OBJ = 254MSDOS_OBJ =
252## w16select.o termcap.o if MSDOS && HAVE_X_WINDOWS. 255## w16select.o termcap.o if MSDOS && HAVE_X_WINDOWS.
@@ -255,7 +258,6 @@ MSDOS_X_OBJ =
255ns_appdir=@ns_appdir@ 258ns_appdir=@ns_appdir@
256ns_appbindir=@ns_appbindir@ 259ns_appbindir=@ns_appbindir@
257ns_appsrc=@ns_appsrc@ 260ns_appsrc=@ns_appsrc@
258## fontset.o fringe.o image.o if HAVE_NS, else empty.
259NS_OBJ=@NS_OBJ@ 261NS_OBJ=@NS_OBJ@
260## nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o if HAVE_NS. 262## nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o if HAVE_NS.
261NS_OBJC_OBJ=@NS_OBJC_OBJ@ 263NS_OBJC_OBJ=@NS_OBJC_OBJ@
@@ -340,7 +342,8 @@ base_obj = dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \
340 process.o gnutls.o callproc.o \ 342 process.o gnutls.o callproc.o \
341 region-cache.o sound.o atimer.o \ 343 region-cache.o sound.o atimer.o \
342 doprnt.o intervals.o textprop.o composite.o xml.o \ 344 doprnt.o intervals.o textprop.o composite.o xml.o \
343 $(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ) 345 $(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ) \
346 $(WINDOW_SYSTEM_OBJ)
344obj = $(base_obj) $(NS_OBJC_OBJ) 347obj = $(base_obj) $(NS_OBJC_OBJ)
345 348
346## Object files used on some machine or other. 349## Object files used on some machine or other.
diff --git a/src/ccl.h b/src/ccl.h
index 71139175be5..cc5daf11e1c 100644
--- a/src/ccl.h
+++ b/src/ccl.h
@@ -26,6 +26,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
26#ifndef EMACS_CCL_H 26#ifndef EMACS_CCL_H
27#define EMACS_CCL_H 27#define EMACS_CCL_H
28 28
29#include "character.h" /* For MAX_MULTIBYTE_LENGTH */
30
29/* Macros for exit status of CCL program. */ 31/* Macros for exit status of CCL program. */
30#define CCL_STAT_SUCCESS 0 /* Terminated successfully. */ 32#define CCL_STAT_SUCCESS 0 /* Terminated successfully. */
31#define CCL_STAT_SUSPEND_BY_SRC 1 /* Terminated by empty input. */ 33#define CCL_STAT_SUSPEND_BY_SRC 1 /* Terminated by empty input. */
diff --git a/src/dispnew.c b/src/dispnew.c
index 2d232d49c53..cac4c2da4c4 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -47,17 +47,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
47 47
48#include "syssignal.h" 48#include "syssignal.h"
49 49
50#ifdef HAVE_X_WINDOWS 50#ifdef HAVE_WINDOW_SYSTEM
51#include "xterm.h" 51#include TERM_HEADER
52#endif /* HAVE_X_WINDOWS */ 52#endif /* HAVE_WINDOW_SYSTEM */
53
54#ifdef HAVE_NTGUI
55#include "w32term.h"
56#endif /* HAVE_NTGUI */
57
58#ifdef HAVE_NS
59#include "nsterm.h"
60#endif
61 53
62/* Include systime.h after xterm.h to avoid double inclusion of time.h. */ 54/* Include systime.h after xterm.h to avoid double inclusion of time.h. */
63 55
diff --git a/src/emacs.c b/src/emacs.c
index 7ff5c43dbea..d6e4887292e 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -31,6 +31,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
31 31
32#include "lisp.h" 32#include "lisp.h"
33 33
34#ifdef HAVE_WINDOW_SYSTEM
35#include TERM_HEADER
36#endif /* HAVE_WINDOW_SYSTEM */
37
34#ifdef WINDOWSNT 38#ifdef WINDOWSNT
35#include <fcntl.h> 39#include <fcntl.h>
36#include <windows.h> /* just for w32.h */ 40#include <windows.h> /* just for w32.h */
@@ -62,20 +66,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
62#include "gnutls.h" 66#include "gnutls.h"
63#endif 67#endif
64 68
65#ifdef HAVE_NS
66#include "nsterm.h"
67#endif
68
69#if (defined PROFILING \ 69#if (defined PROFILING \
70 && (defined __FreeBSD__ || defined GNU_LINUX || defined __MINGW32__)) 70 && (defined __FreeBSD__ || defined GNU_LINUX || defined __MINGW32__))
71# include <sys/gmon.h> 71# include <sys/gmon.h>
72extern void moncontrol (int mode); 72extern void moncontrol (int mode);
73#endif 73#endif
74 74
75#ifdef HAVE_X_WINDOWS
76#include "xterm.h"
77#endif
78
79#ifdef HAVE_SETLOCALE 75#ifdef HAVE_SETLOCALE
80#include <locale.h> 76#include <locale.h>
81#endif 77#endif
diff --git a/src/font.c b/src/font.c
index 5b9e4f1cfcf..cf9964f08f3 100644
--- a/src/font.c
+++ b/src/font.c
@@ -38,17 +38,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
38#include "fontset.h" 38#include "fontset.h"
39#include "font.h" 39#include "font.h"
40 40
41#ifdef HAVE_X_WINDOWS 41#ifdef HAVE_WINDOW_SYSTEM
42#include "xterm.h" 42#include TERM_HEADER
43#endif /* HAVE_X_WINDOWS */ 43#endif /* HAVE_WINDOW_SYSTEM */
44
45#ifdef HAVE_NTGUI
46#include "w32term.h"
47#endif /* HAVE_NTGUI */
48
49#ifdef HAVE_NS
50#include "nsterm.h"
51#endif /* HAVE_NS */
52 44
53Lisp_Object Qopentype; 45Lisp_Object Qopentype;
54 46
diff --git a/src/frame.c b/src/frame.c
index 4785840a95f..968cb4905a2 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -30,15 +30,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
30 30
31#include "lisp.h" 31#include "lisp.h"
32#include "character.h" 32#include "character.h"
33#ifdef HAVE_X_WINDOWS 33
34#include "xterm.h" 34#ifdef HAVE_WINDOW_SYSTEM
35#endif 35#include TERM_HEADER
36#ifdef WINDOWSNT 36#endif /* HAVE_WINDOW_SYSTEM */
37#include "w32term.h" 37
38#endif
39#ifdef HAVE_NS
40#include "nsterm.h"
41#endif
42#include "buffer.h" 38#include "buffer.h"
43/* These help us bind and responding to switch-frame events. */ 39/* These help us bind and responding to switch-frame events. */
44#include "commands.h" 40#include "commands.h"
@@ -58,11 +54,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
58#include "dosfns.h" 54#include "dosfns.h"
59#endif 55#endif
60 56
61
62#ifdef HAVE_WINDOW_SYSTEM
63
64#endif
65
66#ifdef HAVE_NS 57#ifdef HAVE_NS
67Lisp_Object Qns_parse_geometry; 58Lisp_Object Qns_parse_geometry;
68#endif 59#endif
diff --git a/src/frame.h b/src/frame.h
index 8587f094a95..76fde8ec96b 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -1251,10 +1251,40 @@ extern Lisp_Object display_x_get_resource (Display_Info *,
1251 Lisp_Object component, 1251 Lisp_Object component,
1252 Lisp_Object subclass); 1252 Lisp_Object subclass);
1253 1253
1254extern void set_frame_menubar (struct frame *f, int first_time, int deep_p);
1255extern void x_set_window_size (struct frame *f, int change_grav,
1256 int cols, int rows);
1257extern void x_sync (struct frame *);
1258extern Lisp_Object x_get_focus_frame (struct frame *);
1259extern void x_set_mouse_position (struct frame *f, int h, int v);
1260extern void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y);
1261extern void x_make_frame_visible (struct frame *f);
1262extern void x_make_frame_invisible (struct frame *f);
1263extern void x_iconify_frame (struct frame *f);
1264extern int x_char_width (struct frame *f);
1265extern int x_char_height (struct frame *f);
1266extern int x_pixel_width (struct frame *f);
1267extern int x_pixel_height (struct frame *f);
1268extern void x_set_frame_alpha (struct frame *f);
1269extern void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
1270extern void x_set_tool_bar_lines (struct frame *f,
1271 Lisp_Object value,
1272 Lisp_Object oldval);
1273extern void x_activate_menubar (struct frame *);
1274extern void x_real_positions (struct frame *, int *, int *);
1275extern int x_bitmap_icon (struct frame *, Lisp_Object);
1276extern void x_set_menu_bar_lines (struct frame *,
1277 Lisp_Object,
1278 Lisp_Object);
1279extern void free_frame_menubar (struct frame *);
1280extern void x_free_frame_resources (struct frame *);
1281
1254#if defined HAVE_X_WINDOWS && !defined USE_X_TOOLKIT 1282#if defined HAVE_X_WINDOWS && !defined USE_X_TOOLKIT
1255extern char *x_get_resource_string (const char *, const char *); 1283extern char *x_get_resource_string (const char *, const char *);
1256#endif 1284#endif
1257 1285
1286extern void x_query_colors (struct frame *f, XColor *, int);
1287
1258/* In xmenu.c */ 1288/* In xmenu.c */
1259extern void set_frame_menubar (FRAME_PTR, int, int); 1289extern void set_frame_menubar (FRAME_PTR, int, int);
1260 1290
diff --git a/src/gtkutil.h b/src/gtkutil.h
index 462e879d3e7..c1b6634999f 100644
--- a/src/gtkutil.h
+++ b/src/gtkutil.h
@@ -25,6 +25,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
25 25
26#include <gtk/gtk.h> 26#include <gtk/gtk.h>
27#include "frame.h" 27#include "frame.h"
28#include "xterm.h"
28 29
29/* Minimum and maximum values used for GTK scroll bars */ 30/* Minimum and maximum values used for GTK scroll bars */
30 31
diff --git a/src/image.c b/src/image.c
index f2778165ece..c444c986a76 100644
--- a/src/image.c
+++ b/src/image.c
@@ -50,11 +50,19 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
50#include "termhooks.h" 50#include "termhooks.h"
51#include "font.h" 51#include "font.h"
52 52
53#ifdef HAVE_X_WINDOWS 53#ifdef HAVE_SYS_STAT_H
54#include "xterm.h"
55#include <sys/types.h>
56#include <sys/stat.h> 54#include <sys/stat.h>
55#endif /* HAVE_SYS_STAT_H */
56
57#ifdef HAVE_SYS_TYPES_H
58#include <sys/types.h>
59#endif /* HAVE_SYS_TYPES_H */
60
61#ifdef HAVE_WINDOW_SYSTEM
62#include TERM_HEADER
63#endif /* HAVE_WINDOW_SYSTEM */
57 64
65#ifdef HAVE_X_WINDOWS
58#define COLOR_TABLE_SUPPORT 1 66#define COLOR_TABLE_SUPPORT 1
59 67
60typedef struct x_bitmap_record Bitmap_Record; 68typedef struct x_bitmap_record Bitmap_Record;
@@ -67,11 +75,7 @@ typedef struct x_bitmap_record Bitmap_Record;
67#define PIX_MASK_DRAW 1 75#define PIX_MASK_DRAW 1
68#endif /* HAVE_X_WINDOWS */ 76#endif /* HAVE_X_WINDOWS */
69 77
70
71#ifdef HAVE_NTGUI 78#ifdef HAVE_NTGUI
72#include "w32.h"
73#include "w32term.h"
74
75/* W32_TODO : Color tables on W32. */ 79/* W32_TODO : Color tables on W32. */
76#undef COLOR_TABLE_SUPPORT 80#undef COLOR_TABLE_SUPPORT
77 81
@@ -84,15 +88,9 @@ typedef struct w32_bitmap_record Bitmap_Record;
84#define PIX_MASK_RETAIN 0 88#define PIX_MASK_RETAIN 0
85#define PIX_MASK_DRAW 1 89#define PIX_MASK_DRAW 1
86 90
87#define FRAME_X_VISUAL(f) FRAME_X_DISPLAY_INFO (f)->visual
88#define x_defined_color w32_defined_color 91#define x_defined_color w32_defined_color
89#define DefaultDepthOfScreen(screen) (one_w32_display_info.n_cbits) 92#define DefaultDepthOfScreen(screen) (one_w32_display_info.n_cbits)
90 93
91/* Functions from w32term.c that depend on XColor (so can't go in w32term.h
92 without modifying lots of files). */
93extern void x_query_colors (struct frame *f, XColor *colors, int ncolors);
94extern void x_query_color (struct frame *f, XColor *color);
95
96/* Version of libpng that we were compiled with, or -1 if no PNG 94/* Version of libpng that we were compiled with, or -1 if no PNG
97 support was compiled in. This is tested by w32-win.el to correctly 95 support was compiled in. This is tested by w32-win.el to correctly
98 set up the alist used to search for PNG libraries. */ 96 set up the alist used to search for PNG libraries. */
@@ -100,10 +98,6 @@ Lisp_Object Qlibpng_version;
100#endif /* HAVE_NTGUI */ 98#endif /* HAVE_NTGUI */
101 99
102#ifdef HAVE_NS 100#ifdef HAVE_NS
103#include "nsterm.h"
104#include <sys/types.h>
105#include <sys/stat.h>
106
107#undef COLOR_TABLE_SUPPORT 101#undef COLOR_TABLE_SUPPORT
108 102
109typedef struct ns_bitmap_record Bitmap_Record; 103typedef struct ns_bitmap_record Bitmap_Record;
@@ -117,10 +111,8 @@ typedef struct ns_bitmap_record Bitmap_Record;
117#define PIX_MASK_RETAIN 0 111#define PIX_MASK_RETAIN 0
118#define PIX_MASK_DRAW 1 112#define PIX_MASK_DRAW 1
119 113
120#define FRAME_X_VISUAL FRAME_NS_DISPLAY_INFO (f)->visual
121#define x_defined_color(f, name, color_def, alloc) \ 114#define x_defined_color(f, name, color_def, alloc) \
122 ns_defined_color (f, name, color_def, alloc, 0) 115 ns_defined_color (f, name, color_def, alloc, 0)
123#define FRAME_X_SCREEN(f) 0
124#define DefaultDepthOfScreen(screen) x_display_list->n_planes 116#define DefaultDepthOfScreen(screen) x_display_list->n_planes
125#endif /* HAVE_NS */ 117#endif /* HAVE_NS */
126 118
@@ -577,6 +569,7 @@ static void x_emboss (struct frame *, struct image *);
577static int x_build_heuristic_mask (struct frame *, struct image *, 569static int x_build_heuristic_mask (struct frame *, struct image *,
578 Lisp_Object); 570 Lisp_Object);
579#ifdef HAVE_NTGUI 571#ifdef HAVE_NTGUI
572extern Lisp_Object Vlibrary_cache, QCloaded_from;
580#define CACHE_IMAGE_TYPE(type, status) \ 573#define CACHE_IMAGE_TYPE(type, status) \
581 do { Vlibrary_cache = Fcons (Fcons (type, status), Vlibrary_cache); } while (0) 574 do { Vlibrary_cache = Fcons (Fcons (type, status), Vlibrary_cache); } while (0)
582#else 575#else
diff --git a/src/keyboard.c b/src/keyboard.c
index d9b88a8a911..7b1ea341e7f 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -63,20 +63,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
63#include <unistd.h> 63#include <unistd.h>
64#include <fcntl.h> 64#include <fcntl.h>
65 65
66/* This is to get the definitions of the XK_ symbols. */ 66#ifdef HAVE_WINDOW_SYSTEM
67#ifdef HAVE_X_WINDOWS 67#include TERM_HEADER
68#include "xterm.h" 68#endif /* HAVE_WINDOW_SYSTEM */
69#endif
70
71#ifdef HAVE_NTGUI
72#include "w32term.h"
73#endif /* HAVE_NTGUI */
74
75#ifdef HAVE_NS
76#include "nsterm.h"
77#endif
78 69
79/* Variables for blockinput.h: */ 70/* Variables for blockinput.h: */
80 71
81/* Non-zero if interrupt input is blocked right now. */ 72/* Non-zero if interrupt input is blocked right now. */
82volatile int interrupt_input_blocked; 73volatile int interrupt_input_blocked;
@@ -1324,7 +1315,7 @@ usage: (track-mouse BODY...) */)
1324 If ignore_mouse_drag_p is non-zero, ignore (implicit) mouse movement 1315 If ignore_mouse_drag_p is non-zero, ignore (implicit) mouse movement
1325 after resizing the tool-bar window. */ 1316 after resizing the tool-bar window. */
1326 1317
1327#if !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS 1318#if !defined HAVE_WINDOW_SYSTEM
1328static 1319static
1329#endif 1320#endif
1330int ignore_mouse_drag_p; 1321int ignore_mouse_drag_p;
diff --git a/src/keyboard.h b/src/keyboard.h
index 91484b3649b..98b1933f3f9 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -469,7 +469,7 @@ extern int waiting_for_input;
469 happens. */ 469 happens. */
470extern EMACS_TIME *input_available_clear_time; 470extern EMACS_TIME *input_available_clear_time;
471 471
472#if defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS 472#if defined HAVE_WINDOW_SYSTEM
473extern int ignore_mouse_drag_p; 473extern int ignore_mouse_drag_p;
474#endif 474#endif
475 475
diff --git a/src/menu.c b/src/menu.c
index 3e466b46aa3..20770537326 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -36,24 +36,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
36#include "../lwlib/lwlib.h" 36#include "../lwlib/lwlib.h"
37#endif 37#endif
38 38
39#ifdef HAVE_X_WINDOWS 39#ifdef HAVE_WINDOW_SYSTEM
40#include "xterm.h" 40#include TERM_HEADER
41#endif 41#endif /* HAVE_WINDOW_SYSTEM */
42
43#ifdef HAVE_NS
44#include "nsterm.h"
45#endif
46
47#ifdef USE_GTK
48#include "gtkutil.h"
49#endif
50 42
51#ifdef HAVE_NTGUI 43#ifdef HAVE_NTGUI
52#include "w32term.h"
53
54extern AppendMenuW_Proc unicode_append_menu; 44extern AppendMenuW_Proc unicode_append_menu;
55extern HMENU current_popup_menu; 45extern HMENU current_popup_menu;
56
57#endif /* HAVE_NTGUI */ 46#endif /* HAVE_NTGUI */
58 47
59#include "menu.h" 48#include "menu.h"
diff --git a/src/nsterm.h b/src/nsterm.h
index f9149d97571..f0cae193005 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -631,6 +631,8 @@ struct x_output
631/* This is the `Display *' which frame F is on. */ 631/* This is the `Display *' which frame F is on. */
632#define FRAME_NS_DISPLAY(f) (0) 632#define FRAME_NS_DISPLAY(f) (0)
633#define FRAME_X_DISPLAY(f) (0) 633#define FRAME_X_DISPLAY(f) (0)
634#define FRAME_X_SCREEN(f) (0)
635#define FRAME_X_VISUAL(f) FRAME_NS_DISPLAY_INFO(f)->visual
634 636
635#define FRAME_FOREGROUND_COLOR(f) ((f)->output_data.ns->foreground_color) 637#define FRAME_FOREGROUND_COLOR(f) ((f)->output_data.ns->foreground_color)
636#define FRAME_BACKGROUND_COLOR(f) ((f)->output_data.ns->background_color) 638#define FRAME_BACKGROUND_COLOR(f) ((f)->output_data.ns->background_color)
@@ -780,31 +782,6 @@ extern Lisp_Object find_and_return_menu_selection (FRAME_PTR f,
780extern Lisp_Object ns_popup_dialog (Lisp_Object position, Lisp_Object contents, 782extern Lisp_Object ns_popup_dialog (Lisp_Object position, Lisp_Object contents,
781 Lisp_Object header); 783 Lisp_Object header);
782 784
783/* More prototypes that should be moved to a more general include file */
784extern void set_frame_menubar (struct frame *f, int first_time, int deep_p);
785extern void x_set_window_size (struct frame *f, int change_grav,
786 int cols, int rows);
787extern void x_sync (struct frame *);
788extern Lisp_Object x_get_focus_frame (struct frame *);
789extern void x_set_mouse_position (struct frame *f, int h, int v);
790extern void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y);
791extern void x_make_frame_visible (struct frame *f);
792extern void x_make_frame_invisible (struct frame *f);
793extern void x_iconify_frame (struct frame *f);
794extern int x_char_width (struct frame *f);
795extern int x_char_height (struct frame *f);
796extern int x_pixel_width (struct frame *f);
797extern int x_pixel_height (struct frame *f);
798extern void x_set_frame_alpha (struct frame *f);
799extern void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
800extern void x_set_tool_bar_lines (struct frame *f,
801 Lisp_Object value,
802 Lisp_Object oldval);
803extern void x_activate_menubar (struct frame *);
804extern void free_frame_menubar (struct frame *);
805extern void x_free_frame_resources (struct frame *);
806extern void x_destroy_window (struct frame *);
807
808#define NSAPP_DATA2_RUNASSCRIPT 10 785#define NSAPP_DATA2_RUNASSCRIPT 10
809extern void ns_run_ascript (void); 786extern void ns_run_ascript (void);
810 787
diff --git a/src/process.c b/src/process.c
index fbe56ebcb54..bfac054c3c2 100644
--- a/src/process.c
+++ b/src/process.c
@@ -116,12 +116,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
116#include "gnutls.h" 116#include "gnutls.h"
117#endif 117#endif
118 118
119#ifdef HAVE_WINDOW_SYSTEM
120#include TERM_HEADER
121#endif /* HAVE_WINDOW_SYSTEM */
122
119#if defined (USE_GTK) || defined (HAVE_GCONF) || defined (HAVE_GSETTINGS) 123#if defined (USE_GTK) || defined (HAVE_GCONF) || defined (HAVE_GSETTINGS)
120#include "xgselect.h" 124#include "xgselect.h"
121#endif 125#endif
122#ifdef HAVE_NS
123#include "nsterm.h"
124#endif
125 126
126/* Work around GCC 4.7.0 bug with strict overflow checking; see 127/* Work around GCC 4.7.0 bug with strict overflow checking; see
127 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52904>. 128 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52904>.
diff --git a/src/w32font.h b/src/w32font.h
index b08d48a3d36..a29ddbe778c 100644
--- a/src/w32font.h
+++ b/src/w32font.h
@@ -19,6 +19,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19#ifndef EMACS_W32FONT_H 19#ifndef EMACS_W32FONT_H
20#define EMACS_W32FONT_H 20#define EMACS_W32FONT_H
21 21
22#include "font.h"
22 23
23/* Bit 17 of ntmFlags in NEWTEXTMETRIC is set for PostScript OpenType fonts, 24/* Bit 17 of ntmFlags in NEWTEXTMETRIC is set for PostScript OpenType fonts,
24 bit 18 for TrueType OpenType fonts, bit 20 for Type1 fonts. */ 25 bit 18 for TrueType OpenType fonts, bit 20 for Type1 fonts. */
@@ -83,4 +84,7 @@ int uniscribe_check_otf (LOGFONT *font, Lisp_Object otf_spec);
83 84
84Lisp_Object intern_font_name (char *); 85Lisp_Object intern_font_name (char *);
85 86
87extern void syms_of_w32font (void);
88extern void globals_of_w32font (void);
89
86#endif 90#endif
diff --git a/src/w32term.h b/src/w32term.h
index 6fc2beeb18c..5d756f435e4 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -342,7 +342,7 @@ extern struct w32_output w32term_display;
342 342
343/* Return the window associated with the frame F. */ 343/* Return the window associated with the frame F. */
344#define FRAME_W32_WINDOW(f) ((f)->output_data.w32->window_desc) 344#define FRAME_W32_WINDOW(f) ((f)->output_data.w32->window_desc)
345#define FRAME_X_WINDOW(f) ((f)->output_data.w32->window_desc) 345#define FRAME_X_WINDOW(f) FRAME_W32_WINDOW (f)
346 346
347#define FRAME_FONT(f) ((f)->output_data.w32->font) 347#define FRAME_FONT(f) ((f)->output_data.w32->font)
348#define FRAME_FONTSET(f) ((f)->output_data.w32->fontset) 348#define FRAME_FONTSET(f) ((f)->output_data.w32->fontset)
diff --git a/src/w32xfns.c b/src/w32xfns.c
index 745a5cfe3e7..62e45dd987b 100644
--- a/src/w32xfns.c
+++ b/src/w32xfns.c
@@ -438,6 +438,6 @@ XParseGeometry (char *string,
438 438
439/* x_sync is a no-op on W32. */ 439/* x_sync is a no-op on W32. */
440void 440void
441x_sync (void *f) 441x_sync (struct frame *f)
442{ 442{
443} 443}
diff --git a/src/xfaces.c b/src/xfaces.c
index 820d764d0a8..5554c4aa705 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -225,11 +225,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
225#include "dosfns.h" 225#include "dosfns.h"
226#endif 226#endif
227 227
228#ifdef WINDOWSNT 228#ifdef HAVE_WINDOW_SYSTEM
229#include "w32term.h" 229#include TERM_HEADER
230#include "fontset.h" 230#include "fontset.h"
231/* Redefine X specifics to W32 equivalents to avoid cluttering the 231#ifdef WINDOWSNT
232 code with #ifdef blocks. */
233#undef FRAME_X_DISPLAY_INFO 232#undef FRAME_X_DISPLAY_INFO
234#define FRAME_X_DISPLAY_INFO FRAME_W32_DISPLAY_INFO 233#define FRAME_X_DISPLAY_INFO FRAME_W32_DISPLAY_INFO
235#define x_display_info w32_display_info 234#define x_display_info w32_display_info
@@ -238,13 +237,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
238#endif /* WINDOWSNT */ 237#endif /* WINDOWSNT */
239 238
240#ifdef HAVE_NS 239#ifdef HAVE_NS
241#include "nsterm.h"
242#undef FRAME_X_DISPLAY_INFO 240#undef FRAME_X_DISPLAY_INFO
243#define FRAME_X_DISPLAY_INFO FRAME_NS_DISPLAY_INFO 241#define FRAME_X_DISPLAY_INFO FRAME_NS_DISPLAY_INFO
244#define x_display_info ns_display_info 242#define x_display_info ns_display_info
245#define check_x check_ns 243#define check_x check_ns
246#define GCGraphicsExposures 0 244#define GCGraphicsExposures 0
247#endif /* HAVE_NS */ 245#endif /* HAVE_NS */
246#endif /* HAVE_WINDOW_SYSTEM */
248 247
249#include "buffer.h" 248#include "buffer.h"
250#include "dispextern.h" 249#include "dispextern.h"
@@ -254,9 +253,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
254#include "termchar.h" 253#include "termchar.h"
255 254
256#include "font.h" 255#include "font.h"
257#ifdef HAVE_WINDOW_SYSTEM
258#include "fontset.h"
259#endif /* HAVE_WINDOW_SYSTEM */
260 256
261#ifdef HAVE_X_WINDOWS 257#ifdef HAVE_X_WINDOWS
262 258
@@ -2565,13 +2561,13 @@ merge_face_ref (struct frame *f, Lisp_Object face_ref, Lisp_Object *to,
2565 } 2561 }
2566 else if (EQ (keyword, QCstipple)) 2562 else if (EQ (keyword, QCstipple))
2567 { 2563 {
2568#if defined (HAVE_X_WINDOWS) || defined (HAVE_NS) 2564#if defined (HAVE_WINDOW_SYSTEM)
2569 Lisp_Object pixmap_p = Fbitmap_spec_p (value); 2565 Lisp_Object pixmap_p = Fbitmap_spec_p (value);
2570 if (!NILP (pixmap_p)) 2566 if (!NILP (pixmap_p))
2571 to[LFACE_STIPPLE_INDEX] = value; 2567 to[LFACE_STIPPLE_INDEX] = value;
2572 else 2568 else
2573 err = 1; 2569 err = 1;
2574#endif 2570#endif /* HAVE_WINDOW_SYSTEM */
2575 } 2571 }
2576 else if (EQ (keyword, QCwidth)) 2572 else if (EQ (keyword, QCwidth))
2577 { 2573 {
@@ -3125,14 +3121,14 @@ FRAME 0 means change the face on all frames, and change the default
3125 } 3121 }
3126 else if (EQ (attr, QCstipple)) 3122 else if (EQ (attr, QCstipple))
3127 { 3123 {
3128#if defined (HAVE_X_WINDOWS) || defined (HAVE_NS) 3124#if defined (HAVE_WINDOW_SYSTEM)
3129 if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value) 3125 if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value)
3130 && !NILP (value) 3126 && !NILP (value)
3131 && NILP (Fbitmap_spec_p (value))) 3127 && NILP (Fbitmap_spec_p (value)))
3132 signal_error ("Invalid stipple attribute", value); 3128 signal_error ("Invalid stipple attribute", value);
3133 old_value = LFACE_STIPPLE (lface); 3129 old_value = LFACE_STIPPLE (lface);
3134 ASET (lface, LFACE_STIPPLE_INDEX, value); 3130 ASET (lface, LFACE_STIPPLE_INDEX, value);
3135#endif /* HAVE_X_WINDOWS || HAVE_NS */ 3131#endif /* HAVE_WINDOW_SYSTEM */
3136 } 3132 }
3137 else if (EQ (attr, QCwidth)) 3133 else if (EQ (attr, QCwidth))
3138 { 3134 {
diff --git a/src/xterm.h b/src/xterm.h
index 007c92b929c..2d718f49118 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -16,6 +16,9 @@ GNU General Public License for more details.
16You should have received a copy of the GNU General Public License 16You should have received a copy of the GNU General Public License
17along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ 17along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
18 18
19#ifndef XTERM_H
20#define XTERM_H
21
19#include <X11/Xlib.h> 22#include <X11/Xlib.h>
20#include <X11/cursorfont.h> 23#include <X11/cursorfont.h>
21 24
@@ -367,13 +370,14 @@ extern int use_xim;
367extern void check_x (void); 370extern void check_x (void);
368 371
369extern struct frame *x_window_to_frame (struct x_display_info *, int); 372extern struct frame *x_window_to_frame (struct x_display_info *, int);
370
371extern struct frame *x_any_window_to_frame (struct x_display_info *, int); 373extern struct frame *x_any_window_to_frame (struct x_display_info *, int);
372extern struct frame *x_menubar_window_to_frame (struct x_display_info *, 374extern struct frame *x_menubar_window_to_frame (struct x_display_info *,
373 XEvent *); 375 XEvent *);
374
375extern struct frame *x_top_window_to_frame (struct x_display_info *, int); 376extern struct frame *x_top_window_to_frame (struct x_display_info *, int);
376 377
378extern struct frame *x_menubar_window_to_frame (struct x_display_info *,
379 XEvent *);
380
377#if ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK) 381#if ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
378#define x_any_window_to_frame x_window_to_frame 382#define x_any_window_to_frame x_window_to_frame
379#define x_top_window_to_frame x_window_to_frame 383#define x_top_window_to_frame x_window_to_frame
@@ -389,7 +393,6 @@ extern struct x_display_info *x_display_list;
389extern Lisp_Object x_display_name_list; 393extern Lisp_Object x_display_name_list;
390 394
391extern struct x_display_info *x_display_info_for_display (Display *); 395extern struct x_display_info *x_display_info_for_display (Display *);
392extern void x_set_frame_alpha (struct frame *);
393 396
394extern struct x_display_info *x_term_init (Lisp_Object, char *, char *); 397extern struct x_display_info *x_term_init (Lisp_Object, char *, char *);
395extern int x_display_ok (const char *); 398extern int x_display_ok (const char *);
@@ -941,7 +944,6 @@ XrmDatabase x_load_resources (Display *, const char *, const char *,
941/* Defined in xterm.c */ 944/* Defined in xterm.c */
942 945
943extern int x_text_icon (struct frame *, const char *); 946extern int x_text_icon (struct frame *, const char *);
944extern int x_bitmap_icon (struct frame *, Lisp_Object);
945extern void x_catch_errors (Display *); 947extern void x_catch_errors (Display *);
946extern void x_check_errors (Display *, const char *) 948extern void x_check_errors (Display *, const char *)
947 ATTRIBUTE_FORMAT_PRINTF (2, 0); 949 ATTRIBUTE_FORMAT_PRINTF (2, 0);
@@ -953,11 +955,6 @@ extern void x_set_mouse_position (struct frame *, int, int);
953extern void x_set_mouse_pixel_position (struct frame *, int, int); 955extern void x_set_mouse_pixel_position (struct frame *, int, int);
954extern void xembed_request_focus (struct frame *); 956extern void xembed_request_focus (struct frame *);
955extern void x_ewmh_activate_frame (struct frame *); 957extern void x_ewmh_activate_frame (struct frame *);
956extern void x_make_frame_visible (struct frame *);
957extern void x_make_frame_invisible (struct frame *);
958extern void x_iconify_frame (struct frame *);
959extern void x_free_frame_resources (struct frame *);
960extern void x_wm_set_size_hint (struct frame *, long, int);
961extern void x_delete_terminal (struct terminal *terminal); 958extern void x_delete_terminal (struct terminal *terminal);
962extern unsigned long x_copy_color (struct frame *, unsigned long); 959extern unsigned long x_copy_color (struct frame *, unsigned long);
963#ifdef USE_X_TOOLKIT 960#ifdef USE_X_TOOLKIT
@@ -970,7 +967,6 @@ extern int x_alloc_lighter_color_for_widget (Widget, Display *, Colormap,
970 double, int); 967 double, int);
971#endif 968#endif
972extern int x_alloc_nearest_color (struct frame *, Colormap, XColor *); 969extern int x_alloc_nearest_color (struct frame *, Colormap, XColor *);
973extern void x_query_colors (struct frame *f, XColor *, int);
974extern void x_query_color (struct frame *f, XColor *); 970extern void x_query_color (struct frame *f, XColor *);
975extern void x_clear_area (Display *, Window, int, int, int, int, int); 971extern void x_clear_area (Display *, Window, int, int, int, int, int);
976#if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK 972#if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK
@@ -1029,8 +1025,6 @@ extern int xg_set_icon (struct frame *, Lisp_Object);
1029extern int xg_set_icon_from_xpm_data (struct frame *, const char**); 1025extern int xg_set_icon_from_xpm_data (struct frame *, const char**);
1030#endif /* USE_GTK */ 1026#endif /* USE_GTK */
1031 1027
1032extern void x_real_positions (struct frame *, int *, int *);
1033extern void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
1034extern void x_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object); 1028extern void x_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
1035extern void xic_free_xfontset (struct frame *); 1029extern void xic_free_xfontset (struct frame *);
1036extern void create_frame_xic (struct frame *); 1030extern void create_frame_xic (struct frame *);
@@ -1040,9 +1034,6 @@ extern void xic_set_statusarea (struct frame *);
1040extern void xic_set_xfontset (struct frame *, const char *); 1034extern void xic_set_xfontset (struct frame *, const char *);
1041extern int x_pixel_width (struct frame *); 1035extern int x_pixel_width (struct frame *);
1042extern int x_pixel_height (struct frame *); 1036extern int x_pixel_height (struct frame *);
1043extern int x_char_width (struct frame *);
1044extern int x_char_height (struct frame *);
1045extern void x_sync (struct frame *);
1046extern int x_defined_color (struct frame *, const char *, XColor *, int); 1037extern int x_defined_color (struct frame *, const char *, XColor *, int);
1047#ifdef HAVE_X_I18N 1038#ifdef HAVE_X_I18N
1048extern void free_frame_xic (struct frame *); 1039extern void free_frame_xic (struct frame *);
@@ -1050,7 +1041,6 @@ extern void free_frame_xic (struct frame *);
1050extern char * xic_create_fontsetname (const char *base_fontname, int motif); 1041extern char * xic_create_fontsetname (const char *base_fontname, int motif);
1051# endif 1042# endif
1052#endif 1043#endif
1053extern void x_set_tool_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
1054 1044
1055/* Defined in xfaces.c */ 1045/* Defined in xfaces.c */
1056 1046
@@ -1067,10 +1057,8 @@ extern void x_menu_set_in_use (int);
1067#ifdef USE_MOTIF 1057#ifdef USE_MOTIF
1068extern void x_menu_wait_for_event (void *data); 1058extern void x_menu_wait_for_event (void *data);
1069#endif 1059#endif
1070extern void x_activate_menubar (struct frame *);
1071extern int popup_activated (void); 1060extern int popup_activated (void);
1072extern void initialize_frame_menubar (struct frame *); 1061extern void initialize_frame_menubar (struct frame *);
1073extern void free_frame_menubar (struct frame *);
1074 1062
1075/* Defined in widget.c */ 1063/* Defined in widget.c */
1076 1064
@@ -1112,3 +1100,5 @@ extern Lisp_Object Qx_gtk_map_stock;
1112 (nr).y = (ry), \ 1100 (nr).y = (ry), \
1113 (nr).width = (rwidth), \ 1101 (nr).width = (rwidth), \
1114 (nr).height = (rheight)) 1102 (nr).height = (rheight))
1103
1104#endif /* XTERM_H */