@@ -536,10 +536,13 @@ otherwise for the first of 'inotify', 'kqueue' or 'gfile' that is usable.])
536
536
OPTION_DEFAULT_OFF([ xwidgets] ,
537
537
[ enable use of xwidgets in Emacs buffers (requires gtk3 or macOS Cocoa)] )
538
538
539
- OPTION_DEFAULT_OFF([ webrender ] ,
540
- [ enable use of webrender (written in Rust) as GUI backend on
539
+ OPTION_DEFAULT_OFF([ winit ] ,
540
+ [ enable use of winit (written in Rust) as GUI backend on
541
541
multiple platforms(Linux, Windows and MacOS) (experimental)] )
542
542
543
+ OPTION_DEFAULT_OFF([ webrender] ,
544
+ [ enable use of webrender(written in Rust) as rendering engine] )
545
+
543
546
# # Based on Deno 1.9.1
544
547
# # Update the above when upgrading Deno
545
548
OPTION_DEFAULT_OFF([ javascript] ,
@@ -1315,8 +1318,8 @@ AC_ARG_ENABLE(rust-debug,
1315
1318
Useful for debugging rust component of emacs-ng.] ) ] ,
1316
1319
[ ac_enable_rust_debug="${enableval}"] ,[ ] )
1317
1320
1318
- AC_ARG_ENABLE ( webrender -self-contained ,
1319
- [ AS_HELP_STRING ( [ --disable-webrender -self-contained] ,
1321
+ AC_ARG_ENABLE ( winit -self-contained ,
1322
+ [ AS_HELP_STRING ( [ --disable-winit -self-contained] ,
1320
1323
[ disable self contained Webrender build under NeXTstep] ) ] ,
1321
1324
EN_NS_SELF_CONTAINED=$enableval ,
1322
1325
EN_NS_SELF_CONTAINED=yes )
@@ -1326,10 +1329,10 @@ AC_ARG_ENABLE(webrender-capture,
1326
1329
[ enable WebRender capture infrastructure.] ) ] ,
1327
1330
[ ac_enable_webrender_capture="${enableval}"] ,[ ] )
1328
1331
1329
- AC_ARG_ENABLE ( webrender -x11 ,
1330
- [ AS_HELP_STRING ( [ --disable-webrender -x11] ,
1331
- [ disable WebRender X11 support.] ) ] ,
1332
- [ ac_enable_webrender_x11 ="${enableval}"] ,[ ] )
1332
+ AC_ARG_ENABLE ( winit -x11 ,
1333
+ [ AS_HELP_STRING ( [ --enable-winit -x11] ,
1334
+ [ enable Winit X11 support.] ) ] ,
1335
+ [ ac_enable_winit_x11 ="${enableval}"] ,[ ] )
1333
1336
1334
1337
AC_SUBST ( [ AM_DEFAULT_VERBOSITY] )
1335
1338
AC_CONFIG_FILES ( [ src/verbose.mk] )
@@ -2012,10 +2015,15 @@ AC_SUBST([AUTO_DEPEND])
2012
2015
2013
2016
window_system=none
2014
2017
2015
- if test "${with_webrender }" = "yes"; then
2018
+ if test "${with_winit }" = "yes"; then
2016
2019
no_x=yes
2017
2020
with_ns=no
2018
- window_system=webrender
2021
+ window_system=winit
2022
+ with_webrender=yes
2023
+ fi
2024
+
2025
+ if test "${with_webrender}" = "yes"; then
2026
+ with_cairo=no
2019
2027
fi
2020
2028
2021
2029
if test "${with_pgtk}" = "yes"; then
@@ -2506,7 +2514,7 @@ dnl use the toolkit if we have gtk, or X11R5 or newer.
2506
2514
w32 )
2507
2515
term_header=w32term.h
2508
2516
;;
2509
- webrender )
2517
+ winit )
2510
2518
term_header=wrterm.h
2511
2519
;;
2512
2520
pgtk )
@@ -6282,39 +6290,30 @@ AC_SUBST([XMENU_OBJ])
6282
6290
AC_SUBST ( [ XOBJ] )
6283
6291
AC_SUBST ( [ FONT_OBJ] )
6284
6292
6285
- WEBRENDER_LIBS =
6286
- WEBRENDER_IMPL_COCOA =no
6287
- if test "${window_system}" = "webrender " ; then
6293
+ WINIT_LIBS =
6294
+ WINIT_IMPL_COCOA =no
6295
+ if test "${window_system}" = "winit " ; then
6288
6296
6289
- AC_DEFINE ( USE_WEBRENDER , 1 ,
6290
- [ Define to 1 if you want to use the webrender.] )
6291
-
6292
- AC_DEFINE ( HAVE_NATIVE_IMAGE_API , 1 , [ Define to use native OS APIs for images.] )
6293
- NATIVE_IMAGE_API="yes (webrender)"
6297
+ AC_DEFINE ( HAVE_WINIT , 1 ,
6298
+ [ Define to 1 if you want to use the Winit.] )
6294
6299
6295
6300
if test "${opsys}" = gnu-linux; then
6296
- EMACS_CHECK_MODULES([ FREETYPE] , [ freetype2] )
6297
- test "$HAVE_FREETYPE" = "no" && AC_MSG_ERROR ( webrender requires libfreetype )
6298
-
6299
- EMACS_CHECK_MODULES([ FONTCONFIG] , [ fontconfig >= 2.2.0] )
6300
- test "$HAVE_FONTCONFIG" = "no" && AC_MSG_ERROR ( webrender requires libfontconfig )
6301
-
6302
6301
EMACS_CHECK_MODULES([ XCB] , [ xcb >= 1.0.0] )
6303
- test "$HAVE_XCB" = "no" && AC_MSG_ERROR ( WebRender Unix build requires libxcb )
6302
+ test "$HAVE_XCB" = "no" && AC_MSG_ERROR ( Winit Unix build requires libxcb )
6304
6303
6305
- WEBRENDER_LIBS ="$WEBRENDER_LIBS -lxcb -lxcb-xfixes -lxcb-shape -lxcb-render"
6304
+ WINIT_LIBS ="$WINIT_LIBS -lxcb -lxcb-xfixes -lxcb-shape -lxcb-render"
6306
6305
6307
6306
if test X$ac_enable_webrender_x11 != Xno; then
6308
- WEBRENDER_LIBS ="-lX11 -lX11-xcb $WEBRENDER_LIBS "
6307
+ WINIT_LIBS ="-lX11 -lX11-xcb $WINIT_LIBS "
6309
6308
fi
6310
6309
fi
6311
6310
6312
6311
if test "${opsys}" = darwin; then
6313
- WEBRENDER_IMPL_COCOA =yes
6312
+ WINIT_IMPL_COCOA =yes
6314
6313
fi
6315
6314
6316
6315
if test "${EN_NS_SELF_CONTAINED}" = yes && test "${opsys}" = darwin; then
6317
- AC_DEFINE ( NS_SELF_CONTAINED , 1 , [ Build an Webrender NS bundled app] )
6316
+ AC_DEFINE ( NS_SELF_CONTAINED , 1 , [ Build an Winit NS bundled app] )
6318
6317
ns_self_contained=yes
6319
6318
ns_appdir=`pwd`/nextstep/Emacs.app
6320
6319
ns_appbindir=${ns_appdir}/Contents/MacOS
@@ -6341,8 +6340,28 @@ if test "${window_system}" = "webrender" ; then
6341
6340
fi
6342
6341
6343
6342
fi
6343
+ AC_SUBST ( WINIT_OBJ )
6344
+ AC_SUBST ( WINIT_LIBS )
6345
+ AC_SUBST ( WINIT_IMPL_COCOA )
6346
+
6347
+ WEBRENDER_LIBS=
6348
+ if test "${with_webrender}" = "yes" ; then
6349
+ RUSTFLAGS_CFG="\"--cfg=use_webrender\", ${RUSTFLAGS_CFG}"
6350
+ AC_DEFINE ( USE_WEBRENDER , 1 ,
6351
+ [ Define to 1 if you want to use the webrender.] )
6352
+
6353
+ AC_DEFINE ( HAVE_NATIVE_IMAGE_API , 1 , [ Define to use native OS APIs for images.] )
6354
+ NATIVE_IMAGE_API="yes (webrender)"
6355
+
6356
+ if test "${opsys}" = gnu-linux; then
6357
+ EMACS_CHECK_MODULES([ FREETYPE] , [ freetype2] )
6358
+ test "$HAVE_FREETYPE" = "no" && AC_MSG_ERROR ( webrender requires libfreetype )
6359
+
6360
+ EMACS_CHECK_MODULES([ FONTCONFIG] , [ fontconfig >= 2.2.0] )
6361
+ test "$HAVE_FONTCONFIG" = "no" && AC_MSG_ERROR ( webrender requires libfontconfig )
6362
+ fi
6363
+ fi
6344
6364
AC_SUBST ( WEBRENDER_LIBS )
6345
- AC_SUBST ( WEBRENDER_IMPL_COCOA )
6346
6365
6347
6366
WIDGET_OBJ=
6348
6367
MOTIF_LIBW=
@@ -7017,33 +7036,29 @@ fi || AC_MSG_ERROR(['src/epaths.h' could not be made.])
7017
7036
window_system="$window_system" EN_NS_SELF_CONTAINED="$EN_NS_SELF_CONTAINED"] )
7018
7037
7019
7038
CARGO_DEFAULT_FEATURES=""
7039
+ WINIT_DEFAULT_FEATURES=""
7020
7040
WEBRENDER_DEFAULT_FEATURES=""
7021
7041
if test "$HAVE_LIBXML2" = "yes"; then
7022
7042
CARGO_DEFAULT_FEATURES="${CARGO_DEFAULT_FEATURES}\"use-xml2\", "
7023
7043
fi
7024
- if test "$window_system" != "none"; then
7025
- CARGO_DEFAULT_FEATURES="${CARGO_DEFAULT_FEATURES}\"window-system\", "
7026
- fi
7044
+ dnl if test "$window_system" != "none"; then
7045
+ RUSTFLAGS_CFG="\"--cfg=have_window_system\", ${RUSTFLAGS_CFG}"
7046
+ dnl fi
7047
+ RUSTFLAGS_CFG="\"--cfg=window_system=\\\"$window_system\\\"\", ${RUSTFLAGS_CFG}"
7027
7048
case "$window_system" in
7028
- x11)
7029
- CARGO_DEFAULT_FEATURES="${CARGO_DEFAULT_FEATURES}\"window-system-x11\", "
7030
- ;;
7031
- nextstep)
7032
- CARGO_DEFAULT_FEATURES="${CARGO_DEFAULT_FEATURES}\"window-system-nextstep\", "
7033
- ;;
7034
- w32)
7035
- CARGO_DEFAULT_FEATURES="${CARGO_DEFAULT_FEATURES}\"window-system-w32\", "
7036
- ;;
7037
- webrender)
7038
- CARGO_DEFAULT_FEATURES="${CARGO_DEFAULT_FEATURES}\"window-system-webrender\", "
7039
- if test x$ac_enable_webrender_capture != x ; then
7040
- WEBRENDER_DEFAULT_FEATURES="\"capture\", ${WEBRENDER_DEFAULT_FEATURES}"
7041
- fi
7049
+ winit)
7050
+ CARGO_DEFAULT_FEATURES="${CARGO_DEFAULT_FEATURES}\"window-system-winit\", "
7042
7051
if test X$ac_enable_webrender_x11 != Xno ; then
7043
- WEBRENDER_DEFAULT_FEATURES ="\"x11\", ${WEBRENDER_DEFAULT_FEATURES }"
7052
+ WINIT_DEFAULT_FEATURES ="\"x11\", ${WINIT_DEFAULT_FEATURES }"
7044
7053
fi
7045
7054
;;
7046
7055
esac
7056
+ if test "${with_webrender}" = "yes" ; then
7057
+ if test x$ac_enable_webrender_capture != x ; then
7058
+ WEBRENDER_DEFAULT_FEATURES="\"wr_capture\", ${WINIT_DEFAULT_FEATURES}"
7059
+ fi
7060
+ CARGO_DEFAULT_FEATURES="${CARGO_DEFAULT_FEATURES}\"webrender\", "
7061
+ fi
7047
7062
if test "$HAVE_LIBGIT" = "yes"; then
7048
7063
CARGO_DEFAULT_FEATURES="${CARGO_DEFAULT_FEATURES}\"libgit\", "
7049
7064
fi
@@ -7054,11 +7069,17 @@ fi
7054
7069
if test "${HAVE_MODULES}" = "yes"; then
7055
7070
CARGO_DEFAULT_FEATURES="${CARGO_DEFAULT_FEATURES}\"ng-module\", "
7056
7071
fi
7072
+
7073
+ AC_SUBST ( RUSTFLAGS_CFG )
7057
7074
AC_SUBST ( CARGO_DEFAULT_FEATURES )
7075
+ AC_SUBST ( WINIT_DEFAULT_FEATURES )
7058
7076
AC_SUBST ( WEBRENDER_DEFAULT_FEATURES )
7059
7077
AC_CONFIG_FILES ( [ Cargo.toml:Cargo.in] )
7060
7078
webrender_src=$srcdir/rust_src/crates/webrender
7061
7079
AC_CONFIG_FILES ( [ $webrender_src/Cargo.toml:$webrender_src/Cargo.in] )
7080
+ winit_term_src=$srcdir/rust_src/crates/winit-term
7081
+ AC_CONFIG_FILES ( [ $winit_term_src/Cargo.toml:$winit_term_src/Cargo.in] )
7082
+ AC_CONFIG_FILES ( [ $srcdir/.cargo/config.toml:$srcdir/.cargo/config.in] )
7062
7083
AC_CONFIG_FILES ( [ $srcdir/rust_src/crates/emacs/build.rs] )
7063
7084
7064
7085
dnl NB we have to cheat and use the ac_... version because abs_top_srcdir
0 commit comments