aboutsummaryrefslogtreecommitdiffstats
path: root/src/xfaces.c
diff options
context:
space:
mode:
authorDaniel Colascione2012-08-31 22:38:52 -0800
committerDaniel Colascione2012-08-31 22:38:52 -0800
commit17a2cbbd76385d0be8a4b28974e64f4debf459c1 (patch)
treec9d9f61e8580269679c9583ee94ccd812cca5790 /src/xfaces.c
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.
Diffstat (limited to 'src/xfaces.c')
-rw-r--r--src/xfaces.c20
1 files changed, 8 insertions, 12 deletions
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 {