emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r109836: Merge from cygw32 branch


From: dancol
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109836: Merge from cygw32 branch
Date: Sat, 01 Sep 2012 00:01:36 -0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109836 [merge]
committer: address@hidden
branch nick: realtrunk
timestamp: Sat 2012-09-01 00:01:36 -0800
message:
  Merge from cygw32 branch
modified:
  ChangeLog
  configure.ac
  nt/ChangeLog
  nt/inc/ms-w32.h
  src/ChangeLog
  src/Makefile.in
  src/ccl.h
  src/dispnew.c
  src/emacs.c
  src/font.c
  src/frame.c
  src/frame.h
  src/gtkutil.h
  src/image.c
  src/keyboard.c
  src/keyboard.h
  src/menu.c
  src/nsterm.h
  src/process.c
  src/w32font.h
  src/w32term.h
  src/w32xfns.c
  src/xfaces.c
  src/xterm.h
=== modified file 'ChangeLog'
--- a/ChangeLog 2012-08-28 16:01:59 +0000
+++ b/ChangeLog 2012-09-01 06:38:52 +0000
@@ -1,3 +1,11 @@
+2012-09-01  Daniel Colascione  <address@hidden>
+
+       * configure.ac: Introduce term_header variable, which holds the
+       value which will become TERM_HEADER in code.  We effect our choice
+       of window system by setting term_header and WINDOW_SYSTEM_OBJ
+       instead of using ad-hoc variables and flags for each window
+       system.
+
 2012-08-26  Paul Eggert  <address@hidden>
 
        * configure.ac (CFLAGS): Prefer -g3 to -g if -g3 works

=== modified file 'configure.ac'
--- a/configure.ac      2012-08-28 16:01:59 +0000
+++ b/configure.ac      2012-09-01 06:38:52 +0000
@@ -1386,10 +1386,14 @@
 
 #### Choose a window system.
 
+## We leave window_system equal to none if
+## we end up building without one.  Any new window system should
+## set window_system to an appropriate value and add objects to
+## window-system-specific substs.
+
+window_system=none
 AC_PATH_X
-if test "$no_x" = yes; then
-  window_system=none
-else
+if test "$no_x" != yes; then
   window_system=x11
 fi
 
@@ -1528,7 +1532,6 @@
   fi
 
   window_system=nextstep
-  with_xft=no
   # set up packaging dirs
   if test "${EN_NS_SELF_CONTAINED}" = yes; then
      ns_self_contained=yes
@@ -1548,7 +1551,6 @@
      INSTALL_ARCH_INDEP_EXTRA=
   fi
   ns_frag=$srcdir/src/ns.mk
-  NS_OBJ="fontset.o fringe.o image.o"
   NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o"
 fi
 CFLAGS="$tmp_CFLAGS"
@@ -1560,18 +1562,29 @@
 AC_SUBST(LIB_STANDARD)
 AC_SUBST_FILE(ns_frag)
 
+## $window_system is now set to the window system we will
+## ultimately use.
+
+term_header=
+HAVE_X_WINDOWS=no
+HAVE_X11=no
+USE_X_TOOLKIT=none
+
 case "${window_system}" in
   x11 )
     HAVE_X_WINDOWS=yes
     HAVE_X11=yes
+    term_header=xterm.h
     case "${with_x_toolkit}" in
       athena | lucid ) USE_X_TOOLKIT=LUCID ;;
       motif ) USE_X_TOOLKIT=MOTIF ;;
       gtk ) with_gtk=yes
+            term_header=gtkutil.h
 dnl Don't set this for GTK.  A lot of tests below assumes Xt when
 dnl USE_X_TOOLKIT is set.
             USE_X_TOOLKIT=none ;;
       gtk3 ) with_gtk3=yes
+             term_header=gtkutil.h
              USE_X_TOOLKIT=none ;;
       no ) USE_X_TOOLKIT=none ;;
 dnl If user did not say whether to use a toolkit, make this decision later:
@@ -1579,13 +1592,16 @@
       * ) USE_X_TOOLKIT=maybe ;;
     esac
   ;;
-  nextstep | none )
-    HAVE_X_WINDOWS=no
-    HAVE_X11=no
-    USE_X_TOOLKIT=none
+  nextstep )
+    term_header=nsterm.h
   ;;
 esac
 
+if test -n "${term_header}"; then
+    AC_DEFINE_UNQUOTED(TERM_HEADER, "${term_header}",
+        [Define to the header for the built-in window system.])
+fi
+
 if test "$window_system" = none && test "X$with_x" != "Xno"; then
    AC_CHECK_PROG(HAVE_XSERVER, X, true, false)
    if test "$HAVE_XSERVER" = true ||
@@ -1901,6 +1917,7 @@
   fi
   AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.])
   GTK_OBJ=emacsgtkfixed.o
+  term_header=gtkutil.h
 fi
 
 if test "$pkg_check_gtk" != "yes"; then
@@ -1979,6 +1996,8 @@
                  gtk_widget_get_mapped gtk_adjustment_get_page_size \
                  gtk_orientable_set_orientation \
                 gtk_window_set_has_resize_grip)
+
+ term_header=gtkutil.h
 fi
 
 dnl D-Bus has been tested under GNU/Linux only.  Must be adapted for
@@ -3973,6 +3992,11 @@
 AC_SUBST(GNU_OBJC_CFLAGS)
 AC_SUBST(OTHER_FILES)
 
+if test -n "${term_header}"; then
+    AC_DEFINE_UNQUOTED(TERM_HEADER, "${term_header}",
+        [Define to the header for the built-in window system.])
+fi
+
 AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION,  "${canonical}",
                   [Define to the canonical Emacs configuration name.])
 AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${ac_configure_args}",
@@ -3987,7 +4011,7 @@
   AC_DEFINE(HAVE_X_WINDOWS, 1,
            [Define to 1 if you want to use the X window system.])
   XMENU_OBJ=xmenu.o
-  XOBJ="xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o 
xsettings.o xgselect.o"
+  XOBJ="xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o xgselect.o"
   FONT_OBJ=xfont.o
   if test "$HAVE_XFT" = "yes"; then
     FONT_OBJ="$FONT_OBJ ftfont.o xftfont.o ftxfont.o"
@@ -4277,13 +4301,14 @@
 fi                              dnl if $GCC
 AC_SUBST(LIB_GCC)
 
-
-## If we're using X11/GNUstep, define some consequences.
-if test "$HAVE_X_WINDOWS" = "yes" || test "$HAVE_NS" = "yes"; then
+## Common for all window systems
+if test "$window_system" != "none"; then
   AC_DEFINE(HAVE_WINDOW_SYSTEM, 1, [Define if you have a window system.])
   AC_DEFINE(HAVE_MOUSE, 1, [Define if you have mouse support.])
+  WINDOW_SYSTEM_OBJ="fontset.o fringe.o image.o"
 fi
 
+AC_SUBST(WINDOW_SYSTEM_OBJ)
 
 AH_TOP([/* GNU Emacs site configuration template file.
 

=== modified file 'nt/ChangeLog'
--- a/nt/ChangeLog      2012-08-28 16:01:59 +0000
+++ b/nt/ChangeLog      2012-09-01 06:38:52 +0000
@@ -1,3 +1,7 @@
+2012-09-01  Daniel Colascione  <address@hidden>
+
+       * inc/ms-w32.h (TERM_HEADER): Add for refactoring
+
 2012-08-22  Juanma Barranquero  <address@hidden>
 
        * config.nt: Sync with autogen/config.in.

=== modified file 'nt/inc/ms-w32.h'
--- a/nt/inc/ms-w32.h   2012-08-07 11:03:48 +0000
+++ b/nt/inc/ms-w32.h   2012-09-01 06:38:52 +0000
@@ -424,4 +424,7 @@
 #define DebPrint(stuff)
 #endif
 
+#define TERM_HEADER "w32term.h"
+
+
 /* ============================================================ */

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-09-01 01:04:26 +0000
+++ b/src/ChangeLog     2012-09-01 08:01:36 +0000
@@ -7,6 +7,78 @@
        * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
        (init_random): New function.
 
+2012-09-01  Daniel Colascione  <address@hidden>
+
+       * xterm.h: Add header guards.  Declare x_menubar_window_to_frame.
+       Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
+       x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
+       x_wm_set_size_hint, x_query_colors, x_real_positions,
+       x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
+       x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
+       all of which have been moved to common code.
+
+       * xfaces.c: Include TERM_HEADER instead of listing all possible
+       window-system headers.
+
+       * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
+       to match header.
+
+       * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
+       directly accessing frame internals.
+
+       * w32font.h (w): Include font.h.  Define syms_of_w32font and
+       globals_of_w32font.
+
+       * process.c: Include TERM_HEADER instead of listing all possible
+       window-system headers.
+
+       * nsterm.h: Remove declarations now in frame.h.  Define
+       FRAME_X_SCREEN, FRAME_X_VISUAL.
+
+       * menu.c: Include TERM_HEADER instead of listing all possible
+       window-system headers.
+
+       * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
+       window system.
+
+       * keyboard.c: Include TERM_HEADER instead of listing all possible
+       window-system headers.
+
+       * image.c: Include TERM_HEADER instead of listing all possible
+       window-system headers.  Declare Vlibrary_cache when compiling for
+       Windows.
+
+       * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
+       window system declarations.
+
+       * frame.h: Move common functions here: set_frame_menubar,
+       x_set_window_size, x_sync, x_get_focus_frame,
+       x_set_mouse_position, x_set_mouse_pixel_position,
+       x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
+       x_char_width, x_char_height, x_pixel_width, x_pixel_height,
+       x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
+       x_activate_menubar, x_real_positions, x_bitmap_icon,
+       x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
+       and x_query_colors.
+
+       * frame.c: Include TERM_HEADER instead of listing all possible
+       window-system headers.
+
+       * font.c: Include TERM_HEADER instead of listing all possible
+       window-system headers.
+
+       * emacs.c: Include TERM_HEADER.
+
+       * dispnew.c (d): Include TERM_HEADER instead of listing all
+       possible window-system headers.
+
+       * ccl.h (c): Include character.h.
+
+       * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
+       the current window system; include in list of objects to link into
+       Emacs.
+>>>>>>> MERGE-SOURCE
+
 2012-08-31  Dmitry Antipov  <address@hidden>
 
        Remove mark_ttys function and fix tty_display_info initialization.

=== modified file 'src/Makefile.in'
--- a/src/Makefile.in   2012-08-26 10:29:37 +0000
+++ b/src/Makefile.in   2012-09-01 06:38:52 +0000
@@ -211,8 +211,8 @@
 
 ## xmenu.o if HAVE_X_WINDOWS, else empty.
 address@hidden@
-## xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o
-## xsettings.o xgselect.o if HAVE_X_WINDOWS, else empty.
+## xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o xgselect.o if
+## HAVE_X_WINDOWS, else empty.
 address@hidden@
 
 address@hidden@
@@ -247,6 +247,9 @@
 ## sheap.o if CYGWIN, otherwise empty.
 address@hidden@
 
+## fontset.o fringe.o image.o if we have any window system
address@hidden@
+
 ## dosfns.o msdos.o w16select.o if MSDOS.
 MSDOS_OBJ =
 ## w16select.o termcap.o if MSDOS && HAVE_X_WINDOWS.
@@ -255,7 +258,6 @@
 address@hidden@
 address@hidden@
 address@hidden@
-## fontset.o fringe.o image.o if HAVE_NS, else empty.
 address@hidden@
 ## nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o if HAVE_NS.
 address@hidden@
@@ -340,7 +342,8 @@
        process.o gnutls.o callproc.o \
        region-cache.o sound.o atimer.o \
        doprnt.o intervals.o textprop.o composite.o xml.o \
-       $(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ)
+       $(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ) \
+       $(WINDOW_SYSTEM_OBJ)
 obj = $(base_obj) $(NS_OBJC_OBJ)
 
 ## Object files used on some machine or other.

=== modified file 'src/ccl.h'
--- a/src/ccl.h 2012-07-03 18:24:42 +0000
+++ b/src/ccl.h 2012-09-01 06:38:52 +0000
@@ -26,6 +26,8 @@
 #ifndef EMACS_CCL_H
 #define EMACS_CCL_H
 
+#include "character.h" /* For MAX_MULTIBYTE_LENGTH */
+
 /* Macros for exit status of CCL program.  */
 #define CCL_STAT_SUCCESS       0 /* Terminated successfully.  */
 #define CCL_STAT_SUSPEND_BY_SRC        1 /* Terminated by empty input.  */

=== modified file 'src/dispnew.c'
--- a/src/dispnew.c     2012-08-30 15:07:00 +0000
+++ b/src/dispnew.c     2012-09-01 06:38:52 +0000
@@ -47,17 +47,9 @@
 
 #include "syssignal.h"
 
-#ifdef HAVE_X_WINDOWS
-#include "xterm.h"
-#endif /* HAVE_X_WINDOWS */
-
-#ifdef HAVE_NTGUI
-#include "w32term.h"
-#endif /* HAVE_NTGUI */
-
-#ifdef HAVE_NS
-#include "nsterm.h"
-#endif
+#ifdef HAVE_WINDOW_SYSTEM
+#include TERM_HEADER
+#endif /* HAVE_WINDOW_SYSTEM */
 
 /* Include systime.h after xterm.h to avoid double inclusion of time.h.  */
 

=== modified file 'src/emacs.c'
--- a/src/emacs.c       2012-09-01 01:04:26 +0000
+++ b/src/emacs.c       2012-09-01 08:01:36 +0000
@@ -31,6 +31,10 @@
 
 #include "lisp.h"
 
+#ifdef HAVE_WINDOW_SYSTEM
+#include TERM_HEADER
+#endif /* HAVE_WINDOW_SYSTEM */
+
 #ifdef WINDOWSNT
 #include <fcntl.h>
 #include <windows.h> /* just for w32.h */
@@ -62,20 +66,12 @@
 #include "gnutls.h"
 #endif
 
-#ifdef HAVE_NS
-#include "nsterm.h"
-#endif
-
 #if (defined PROFILING \
      && (defined __FreeBSD__ || defined GNU_LINUX || defined __MINGW32__))
 # include <sys/gmon.h>
 extern void moncontrol (int mode);
 #endif
 
-#ifdef HAVE_X_WINDOWS
-#include "xterm.h"
-#endif
-
 #ifdef HAVE_SETLOCALE
 #include <locale.h>
 #endif

=== modified file 'src/font.c'
--- a/src/font.c        2012-08-16 21:58:44 +0000
+++ b/src/font.c        2012-09-01 06:38:52 +0000
@@ -38,17 +38,9 @@
 #include "fontset.h"
 #include "font.h"
 
-#ifdef HAVE_X_WINDOWS
-#include "xterm.h"
-#endif /* HAVE_X_WINDOWS */
-
-#ifdef HAVE_NTGUI
-#include "w32term.h"
-#endif /* HAVE_NTGUI */
-
-#ifdef HAVE_NS
-#include "nsterm.h"
-#endif /* HAVE_NS */
+#ifdef HAVE_WINDOW_SYSTEM
+#include TERM_HEADER
+#endif /* HAVE_WINDOW_SYSTEM */
 
 Lisp_Object Qopentype;
 

=== modified file 'src/frame.c'
--- a/src/frame.c       2012-08-22 16:05:04 +0000
+++ b/src/frame.c       2012-09-01 06:38:52 +0000
@@ -30,15 +30,11 @@
 
 #include "lisp.h"
 #include "character.h"
-#ifdef HAVE_X_WINDOWS
-#include "xterm.h"
-#endif
-#ifdef WINDOWSNT
-#include "w32term.h"
-#endif
-#ifdef HAVE_NS
-#include "nsterm.h"
-#endif
+
+#ifdef HAVE_WINDOW_SYSTEM
+#include TERM_HEADER
+#endif /* HAVE_WINDOW_SYSTEM */
+
 #include "buffer.h"
 /* These help us bind and responding to switch-frame events.  */
 #include "commands.h"
@@ -58,11 +54,6 @@
 #include "dosfns.h"
 #endif
 
-
-#ifdef HAVE_WINDOW_SYSTEM
-
-#endif
-
 #ifdef HAVE_NS
 Lisp_Object Qns_parse_geometry;
 #endif

=== modified file 'src/frame.h'
--- a/src/frame.h       2012-08-31 04:40:52 +0000
+++ b/src/frame.h       2012-09-01 06:38:52 +0000
@@ -1251,10 +1251,40 @@
                                           Lisp_Object component,
                                           Lisp_Object subclass);
 
+extern void set_frame_menubar (struct frame *f, int first_time, int deep_p);
+extern void x_set_window_size (struct frame *f, int change_grav,
+                              int cols, int rows);
+extern void x_sync (struct frame *);
+extern Lisp_Object x_get_focus_frame (struct frame *);
+extern void x_set_mouse_position (struct frame *f, int h, int v);
+extern void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y);
+extern void x_make_frame_visible (struct frame *f);
+extern void x_make_frame_invisible (struct frame *f);
+extern void x_iconify_frame (struct frame *f);
+extern int x_char_width (struct frame *f);
+extern int x_char_height (struct frame *f);
+extern int x_pixel_width (struct frame *f);
+extern int x_pixel_height (struct frame *f);
+extern void x_set_frame_alpha (struct frame *f);
+extern void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
+extern void x_set_tool_bar_lines (struct frame *f,
+                                  Lisp_Object value,
+                                  Lisp_Object oldval);
+extern void x_activate_menubar (struct frame *);
+extern void x_real_positions (struct frame *, int *, int *);
+extern int x_bitmap_icon (struct frame *, Lisp_Object);
+extern void x_set_menu_bar_lines (struct frame *,
+                                  Lisp_Object,
+                                  Lisp_Object);
+extern void free_frame_menubar (struct frame *);
+extern void x_free_frame_resources (struct frame *);
+
 #if defined HAVE_X_WINDOWS && !defined USE_X_TOOLKIT
 extern char *x_get_resource_string (const char *, const char *);
 #endif
 
+extern void x_query_colors (struct frame *f, XColor *, int);
+
 /* In xmenu.c */
 extern void set_frame_menubar (FRAME_PTR, int, int);
 

=== modified file 'src/gtkutil.h'
--- a/src/gtkutil.h     2012-08-15 07:58:34 +0000
+++ b/src/gtkutil.h     2012-09-01 06:38:52 +0000
@@ -25,6 +25,7 @@
 
 #include <gtk/gtk.h>
 #include "frame.h"
+#include "xterm.h"
 
 /* Minimum and maximum values used for GTK scroll bars  */
 

=== modified file 'src/image.c'
--- a/src/image.c       2012-08-16 21:58:44 +0000
+++ b/src/image.c       2012-09-01 06:38:52 +0000
@@ -50,11 +50,19 @@
 #include "termhooks.h"
 #include "font.h"
 
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif /* HAVE_SYS_STAT_H */
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif /* HAVE_SYS_TYPES_H */
+
+#ifdef HAVE_WINDOW_SYSTEM
+#include TERM_HEADER
+#endif /* HAVE_WINDOW_SYSTEM */
+
 #ifdef HAVE_X_WINDOWS
-#include "xterm.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-
 #define COLOR_TABLE_SUPPORT 1
 
 typedef struct x_bitmap_record Bitmap_Record;
@@ -67,11 +75,7 @@
 #define PIX_MASK_DRAW  1
 #endif /* HAVE_X_WINDOWS */
 
-
 #ifdef HAVE_NTGUI
-#include "w32.h"
-#include "w32term.h"
-
 /* W32_TODO : Color tables on W32.  */
 #undef COLOR_TABLE_SUPPORT
 
@@ -84,15 +88,9 @@
 #define PIX_MASK_RETAIN        0
 #define PIX_MASK_DRAW  1
 
-#define FRAME_X_VISUAL(f) FRAME_X_DISPLAY_INFO (f)->visual
 #define x_defined_color w32_defined_color
 #define DefaultDepthOfScreen(screen) (one_w32_display_info.n_cbits)
 
-/* Functions from w32term.c that depend on XColor (so can't go in w32term.h
-   without modifying lots of files).  */
-extern void x_query_colors (struct frame *f, XColor *colors, int ncolors);
-extern void x_query_color (struct frame *f, XColor *color);
-
 /* Version of libpng that we were compiled with, or -1 if no PNG
    support was compiled in.  This is tested by w32-win.el to correctly
    set up the alist used to search for PNG libraries.  */
@@ -100,10 +98,6 @@
 #endif /* HAVE_NTGUI */
 
 #ifdef HAVE_NS
-#include "nsterm.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-
 #undef COLOR_TABLE_SUPPORT
 
 typedef struct ns_bitmap_record Bitmap_Record;
@@ -117,10 +111,8 @@
 #define PIX_MASK_RETAIN        0
 #define PIX_MASK_DRAW  1
 
-#define FRAME_X_VISUAL FRAME_NS_DISPLAY_INFO (f)->visual
 #define x_defined_color(f, name, color_def, alloc) \
   ns_defined_color (f, name, color_def, alloc, 0)
-#define FRAME_X_SCREEN(f) 0
 #define DefaultDepthOfScreen(screen) x_display_list->n_planes
 #endif /* HAVE_NS */
 
@@ -577,6 +569,7 @@
 static int x_build_heuristic_mask (struct frame *, struct image *,
                                    Lisp_Object);
 #ifdef HAVE_NTGUI
+extern Lisp_Object Vlibrary_cache, QCloaded_from;
 #define CACHE_IMAGE_TYPE(type, status) \
   do { Vlibrary_cache = Fcons (Fcons (type, status), Vlibrary_cache); } while 
(0)
 #else

=== modified file 'src/keyboard.c'
--- a/src/keyboard.c    2012-08-28 06:20:08 +0000
+++ b/src/keyboard.c    2012-09-01 06:38:52 +0000
@@ -63,20 +63,11 @@
 #include <unistd.h>
 #include <fcntl.h>
 
-/* This is to get the definitions of the XK_ symbols.  */
-#ifdef HAVE_X_WINDOWS
-#include "xterm.h"
-#endif
-
-#ifdef HAVE_NTGUI
-#include "w32term.h"
-#endif /* HAVE_NTGUI */
-
-#ifdef HAVE_NS
-#include "nsterm.h"
-#endif
-
-/* Variables for blockinput.h:  */
+#ifdef HAVE_WINDOW_SYSTEM
+#include TERM_HEADER
+#endif /* HAVE_WINDOW_SYSTEM */
+
+/* Variables for blockinput.h: */
 
 /* Non-zero if interrupt input is blocked right now.  */
 volatile int interrupt_input_blocked;
@@ -1324,7 +1315,7 @@
    If ignore_mouse_drag_p is non-zero, ignore (implicit) mouse movement
    after resizing the tool-bar window.  */
 
-#if !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS
+#if !defined HAVE_WINDOW_SYSTEM
 static
 #endif
 int ignore_mouse_drag_p;

=== modified file 'src/keyboard.h'
--- a/src/keyboard.h    2012-08-17 23:38:43 +0000
+++ b/src/keyboard.h    2012-09-01 06:38:52 +0000
@@ -469,7 +469,7 @@
    happens.  */
 extern EMACS_TIME *input_available_clear_time;
 
-#if defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS
+#if defined HAVE_WINDOW_SYSTEM
 extern int ignore_mouse_drag_p;
 #endif
 

=== modified file 'src/menu.c'
--- a/src/menu.c        2012-08-05 15:47:28 +0000
+++ b/src/menu.c        2012-09-01 06:38:52 +0000
@@ -36,24 +36,13 @@
 #include "../lwlib/lwlib.h"
 #endif
 
-#ifdef HAVE_X_WINDOWS
-#include "xterm.h"
-#endif
-
-#ifdef HAVE_NS
-#include "nsterm.h"
-#endif
-
-#ifdef USE_GTK
-#include "gtkutil.h"
-#endif
+#ifdef HAVE_WINDOW_SYSTEM
+#include TERM_HEADER
+#endif /* HAVE_WINDOW_SYSTEM */
 
 #ifdef HAVE_NTGUI
-#include "w32term.h"
-
 extern AppendMenuW_Proc unicode_append_menu;
 extern HMENU current_popup_menu;
-
 #endif /* HAVE_NTGUI  */
 
 #include "menu.h"

=== modified file 'src/nsterm.h'
--- a/src/nsterm.h      2012-08-28 16:05:17 +0000
+++ b/src/nsterm.h      2012-09-01 06:38:52 +0000
@@ -631,6 +631,8 @@
 /* This is the `Display *' which frame F is on.  */
 #define FRAME_NS_DISPLAY(f) (0)
 #define FRAME_X_DISPLAY(f) (0)
+#define FRAME_X_SCREEN(f) (0)
+#define FRAME_X_VISUAL(f) FRAME_NS_DISPLAY_INFO(f)->visual
 
 #define FRAME_FOREGROUND_COLOR(f) ((f)->output_data.ns->foreground_color)
 #define FRAME_BACKGROUND_COLOR(f) ((f)->output_data.ns->background_color)
@@ -780,31 +782,6 @@
 extern Lisp_Object ns_popup_dialog (Lisp_Object position, Lisp_Object contents,
                                     Lisp_Object header);
 
-/* More prototypes that should be moved to a more general include file */
-extern void set_frame_menubar (struct frame *f, int first_time, int deep_p);
-extern void x_set_window_size (struct frame *f, int change_grav,
-                              int cols, int rows);
-extern void x_sync (struct frame *);
-extern Lisp_Object x_get_focus_frame (struct frame *);
-extern void x_set_mouse_position (struct frame *f, int h, int v);
-extern void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y);
-extern void x_make_frame_visible (struct frame *f);
-extern void x_make_frame_invisible (struct frame *f);
-extern void x_iconify_frame (struct frame *f);
-extern int x_char_width (struct frame *f);
-extern int x_char_height (struct frame *f);
-extern int x_pixel_width (struct frame *f);
-extern int x_pixel_height (struct frame *f);
-extern void x_set_frame_alpha (struct frame *f);
-extern void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
-extern void x_set_tool_bar_lines (struct frame *f,
-                                  Lisp_Object value,
-                                  Lisp_Object oldval);
-extern void x_activate_menubar (struct frame *);
-extern void free_frame_menubar (struct frame *);
-extern void x_free_frame_resources (struct frame *);
-extern void x_destroy_window (struct frame *);
-
 #define NSAPP_DATA2_RUNASSCRIPT 10
 extern void ns_run_ascript (void);
 

=== modified file 'src/process.c'
--- a/src/process.c     2012-08-28 06:20:08 +0000
+++ b/src/process.c     2012-09-01 06:38:52 +0000
@@ -116,12 +116,13 @@
 #include "gnutls.h"
 #endif
 
+#ifdef HAVE_WINDOW_SYSTEM
+#include TERM_HEADER
+#endif /* HAVE_WINDOW_SYSTEM */
+
 #if defined (USE_GTK) || defined (HAVE_GCONF) || defined (HAVE_GSETTINGS)
 #include "xgselect.h"
 #endif
-#ifdef HAVE_NS
-#include "nsterm.h"
-#endif
 
 /* Work around GCC 4.7.0 bug with strict overflow checking; see
    <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52904>.

=== modified file 'src/w32font.h'
--- a/src/w32font.h     2012-07-29 08:18:29 +0000
+++ b/src/w32font.h     2012-09-01 06:38:52 +0000
@@ -19,6 +19,7 @@
 #ifndef EMACS_W32FONT_H
 #define EMACS_W32FONT_H
 
+#include "font.h"
 
 /* Bit 17 of ntmFlags in NEWTEXTMETRIC is set for PostScript OpenType fonts,
    bit 18 for TrueType OpenType fonts, bit 20 for Type1 fonts.  */
@@ -83,4 +84,7 @@
 
 Lisp_Object intern_font_name (char *);
 
+extern void syms_of_w32font (void);
+extern void globals_of_w32font (void);
+
 #endif

=== modified file 'src/w32term.h'
--- a/src/w32term.h     2012-08-31 04:14:59 +0000
+++ b/src/w32term.h     2012-09-01 06:38:52 +0000
@@ -342,7 +342,7 @@
 
 /* Return the window associated with the frame F.  */
 #define FRAME_W32_WINDOW(f) ((f)->output_data.w32->window_desc)
-#define FRAME_X_WINDOW(f) ((f)->output_data.w32->window_desc)
+#define FRAME_X_WINDOW(f) FRAME_W32_WINDOW (f)
 
 #define FRAME_FONT(f) ((f)->output_data.w32->font)
 #define FRAME_FONTSET(f) ((f)->output_data.w32->fontset)

=== modified file 'src/w32xfns.c'
--- a/src/w32xfns.c     2012-07-29 08:18:29 +0000
+++ b/src/w32xfns.c     2012-09-01 06:38:52 +0000
@@ -438,6 +438,6 @@
 
 /* x_sync is a no-op on W32.  */
 void
-x_sync (void *f)
+x_sync (struct frame *f)
 {
 }

=== modified file 'src/xfaces.c'
--- a/src/xfaces.c      2012-08-21 10:21:04 +0000
+++ b/src/xfaces.c      2012-09-01 06:38:52 +0000
@@ -225,11 +225,10 @@
 #include "dosfns.h"
 #endif
 
+#ifdef HAVE_WINDOW_SYSTEM
+#include TERM_HEADER
+#include "fontset.h"
 #ifdef WINDOWSNT
-#include "w32term.h"
-#include "fontset.h"
-/* Redefine X specifics to W32 equivalents to avoid cluttering the
-   code with #ifdef blocks. */
 #undef FRAME_X_DISPLAY_INFO
 #define FRAME_X_DISPLAY_INFO FRAME_W32_DISPLAY_INFO
 #define x_display_info w32_display_info
@@ -238,13 +237,13 @@
 #endif /* WINDOWSNT */
 
 #ifdef HAVE_NS
-#include "nsterm.h"
 #undef FRAME_X_DISPLAY_INFO
 #define FRAME_X_DISPLAY_INFO FRAME_NS_DISPLAY_INFO
 #define x_display_info ns_display_info
 #define check_x check_ns
 #define GCGraphicsExposures 0
 #endif /* HAVE_NS */
+#endif /* HAVE_WINDOW_SYSTEM */
 
 #include "buffer.h"
 #include "dispextern.h"
@@ -254,9 +253,6 @@
 #include "termchar.h"
 
 #include "font.h"
-#ifdef HAVE_WINDOW_SYSTEM
-#include "fontset.h"
-#endif /* HAVE_WINDOW_SYSTEM */
 
 #ifdef HAVE_X_WINDOWS
 
@@ -2565,13 +2561,13 @@
                }
              else if (EQ (keyword, QCstipple))
                {
-#if defined (HAVE_X_WINDOWS) || defined (HAVE_NS)
+#if defined (HAVE_WINDOW_SYSTEM)
                  Lisp_Object pixmap_p = Fbitmap_spec_p (value);
                  if (!NILP (pixmap_p))
                    to[LFACE_STIPPLE_INDEX] = value;
                  else
                    err = 1;
-#endif
+#endif /* HAVE_WINDOW_SYSTEM */
                }
              else if (EQ (keyword, QCwidth))
                {
@@ -3125,14 +3121,14 @@
     }
   else if (EQ (attr, QCstipple))
     {
-#if defined (HAVE_X_WINDOWS) || defined (HAVE_NS)
+#if defined (HAVE_WINDOW_SYSTEM)
       if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value)
          && !NILP (value)
          && NILP (Fbitmap_spec_p (value)))
        signal_error ("Invalid stipple attribute", value);
       old_value = LFACE_STIPPLE (lface);
       ASET (lface, LFACE_STIPPLE_INDEX, value);
-#endif /* HAVE_X_WINDOWS || HAVE_NS */
+#endif /* HAVE_WINDOW_SYSTEM */
     }
   else if (EQ (attr, QCwidth))
     {

=== modified file 'src/xterm.h'
--- a/src/xterm.h       2012-08-31 04:14:59 +0000
+++ b/src/xterm.h       2012-09-01 06:38:52 +0000
@@ -16,6 +16,9 @@
 You should have received a copy of the GNU General Public License
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#ifndef XTERM_H
+#define XTERM_H
+
 #include <X11/Xlib.h>
 #include <X11/cursorfont.h>
 
@@ -367,13 +370,14 @@
 extern void check_x (void);
 
 extern struct frame *x_window_to_frame (struct x_display_info *, int);
-
 extern struct frame *x_any_window_to_frame (struct x_display_info *, int);
 extern struct frame *x_menubar_window_to_frame (struct x_display_info *,
                                                XEvent *);
-
 extern struct frame *x_top_window_to_frame (struct x_display_info *, int);
 
+extern struct frame *x_menubar_window_to_frame (struct x_display_info *,
+                                               XEvent *);
+
 #if ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
 #define x_any_window_to_frame x_window_to_frame
 #define x_top_window_to_frame x_window_to_frame
@@ -389,7 +393,6 @@
 extern Lisp_Object x_display_name_list;
 
 extern struct x_display_info *x_display_info_for_display (Display *);
-extern void x_set_frame_alpha (struct frame *);
 
 extern struct x_display_info *x_term_init (Lisp_Object, char *, char *);
 extern int x_display_ok  (const char *);
@@ -941,7 +944,6 @@
 /* Defined in xterm.c */
 
 extern int x_text_icon (struct frame *, const char *);
-extern int x_bitmap_icon (struct frame *, Lisp_Object);
 extern void x_catch_errors (Display *);
 extern void x_check_errors (Display *, const char *)
   ATTRIBUTE_FORMAT_PRINTF (2, 0);
@@ -953,11 +955,6 @@
 extern void x_set_mouse_pixel_position (struct frame *, int, int);
 extern void xembed_request_focus (struct frame *);
 extern void x_ewmh_activate_frame (struct frame *);
-extern void x_make_frame_visible (struct frame *);
-extern void x_make_frame_invisible (struct frame *);
-extern void x_iconify_frame (struct frame *);
-extern void x_free_frame_resources (struct frame *);
-extern void x_wm_set_size_hint (struct frame *, long, int);
 extern void x_delete_terminal (struct terminal *terminal);
 extern unsigned long x_copy_color (struct frame *, unsigned long);
 #ifdef USE_X_TOOLKIT
@@ -970,7 +967,6 @@
                                              double, int);
 #endif
 extern int x_alloc_nearest_color (struct frame *, Colormap, XColor *);
-extern void x_query_colors (struct frame *f, XColor *, int);
 extern void x_query_color (struct frame *f, XColor *);
 extern void x_clear_area (Display *, Window, int, int, int, int, int);
 #if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK
@@ -1029,8 +1025,6 @@
 extern int xg_set_icon_from_xpm_data (struct frame *, const char**);
 #endif /* USE_GTK */
 
-extern void x_real_positions (struct frame *, int *, int *);
-extern void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
 extern void x_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
 extern void xic_free_xfontset (struct frame *);
 extern void create_frame_xic (struct frame *);
@@ -1040,9 +1034,6 @@
 extern void xic_set_xfontset (struct frame *, const char *);
 extern int x_pixel_width (struct frame *);
 extern int x_pixel_height (struct frame *);
-extern int x_char_width (struct frame *);
-extern int x_char_height (struct frame *);
-extern void x_sync (struct frame *);
 extern int x_defined_color (struct frame *, const char *, XColor *, int);
 #ifdef HAVE_X_I18N
 extern void free_frame_xic (struct frame *);
@@ -1050,7 +1041,6 @@
 extern char * xic_create_fontsetname (const char *base_fontname, int motif);
 # endif
 #endif
-extern void x_set_tool_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
 
 /* Defined in xfaces.c */
 
@@ -1067,10 +1057,8 @@
 #ifdef USE_MOTIF
 extern void x_menu_wait_for_event (void *data);
 #endif
-extern void x_activate_menubar (struct frame *);
 extern int popup_activated (void);
 extern void initialize_frame_menubar (struct frame *);
-extern void free_frame_menubar (struct frame *);
 
 /* Defined in widget.c */
 
@@ -1112,3 +1100,5 @@
    (nr).y = (ry),                                      \
    (nr).width = (rwidth),                              \
    (nr).height = (rheight))
+
+#endif /* XTERM_H */


reply via email to

[Prev in Thread] Current Thread [Next in Thread]