diff options
| author | Alan Third | 2017-08-20 21:14:47 +0100 |
|---|---|---|
| committer | Alan Third | 2017-08-23 19:57:00 +0100 |
| commit | 7baa50eca28ff21497b058fa22656bbb4a447d87 (patch) | |
| tree | 248e7eae805b65b76f368f70928cdcfb1a54cb84 /src/nsfns.m | |
| parent | 4309d1574ae86244751600171b605b2b2eca4697 (diff) | |
| download | emacs-7baa50eca28ff21497b058fa22656bbb4a447d87.tar.gz emacs-7baa50eca28ff21497b058fa22656bbb4a447d87.zip | |
Add ability to change macOS WM theme (bug#27973)
* src/frame.c (make_frame, frame_parms, syms_of_frame)
[NS_IMPL_COCOA]: Add ns-appearance and ns-transparent-titlebar
options.
* src/frame.h (ns_appearance_type) [NS_IMPL_COCOA]: Add enum to
represent NSAppearance options.
(struct frame) [NS_IMPL_COCOA]: Add ns_appearance and
ns_transparent_titlebar frame parameters.
* src/nsfns.m (ns_frame_parm_handlers) [NS_IMPL_COCOA]: Add
ns_set_appearance and ns_set_transparent_titlebar handlers.
(Sx_create_frame): Handle ns-appearance and ns-transparent-titlebar
frame parameters.
(Qdark): Add new symbol for use with ns-appearance.
* src/nsterm.h (ns_set_appearance, ns_set_transparent_titlebar)
[NS_IMPL_COCOA]: Add prototypes.
* src/nsterm.m (ns_set_appearance, ns_set_transparent_titlebar)
[NS_IMPL_COCOA]: New functions.
(initFrameFromEmacs) [NS_IMPL_COCOA]: Handle ns-appearance and
ns-transparent-titlebar frame parameters.
* doc/lispref/frames.texi (Window Management Parameters): Document
ns-apperance and ns-transparent-titlebar.
Diffstat (limited to 'src/nsfns.m')
| -rw-r--r-- | src/nsfns.m | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/nsfns.m b/src/nsfns.m index e19e4e2641a..b00441eb79f 100644 --- a/src/nsfns.m +++ b/src/nsfns.m | |||
| @@ -985,6 +985,10 @@ frame_parm_handler ns_frame_parm_handlers[] = | |||
| 985 | x_set_z_group, /* x_set_z_group */ | 985 | x_set_z_group, /* x_set_z_group */ |
| 986 | 0, /* x_set_override_redirect */ | 986 | 0, /* x_set_override_redirect */ |
| 987 | x_set_no_special_glyphs, | 987 | x_set_no_special_glyphs, |
| 988 | #ifdef NS_IMPL_COCOA | ||
| 989 | ns_set_appearance, | ||
| 990 | ns_set_transparent_titlebar, | ||
| 991 | #endif | ||
| 988 | }; | 992 | }; |
| 989 | 993 | ||
| 990 | 994 | ||
| @@ -1277,6 +1281,18 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 1277 | FRAME_UNDECORATED (f) = !NILP (tem) && !EQ (tem, Qunbound); | 1281 | FRAME_UNDECORATED (f) = !NILP (tem) && !EQ (tem, Qunbound); |
| 1278 | store_frame_param (f, Qundecorated, FRAME_UNDECORATED (f) ? Qt : Qnil); | 1282 | store_frame_param (f, Qundecorated, FRAME_UNDECORATED (f) ? Qt : Qnil); |
| 1279 | 1283 | ||
| 1284 | #ifdef NS_IMPL_COCOA | ||
| 1285 | tem = x_get_arg (dpyinfo, parms, Qns_appearance, NULL, NULL, RES_TYPE_SYMBOL); | ||
| 1286 | FRAME_NS_APPEARANCE (f) = EQ (tem, Qdark) | ||
| 1287 | ? ns_appearance_vibrant_dark : ns_appearance_aqua; | ||
| 1288 | store_frame_param (f, Qns_appearance, tem); | ||
| 1289 | |||
| 1290 | tem = x_get_arg (dpyinfo, parms, Qns_transparent_titlebar, | ||
| 1291 | NULL, NULL, RES_TYPE_BOOLEAN); | ||
| 1292 | FRAME_NS_TRANSPARENT_TITLEBAR (f) = !NILP (tem) && !EQ (tem, Qunbound); | ||
| 1293 | store_frame_param (f, Qns_transparent_titlebar, tem); | ||
| 1294 | #endif | ||
| 1295 | |||
| 1280 | parent_frame = x_get_arg (dpyinfo, parms, Qparent_frame, NULL, NULL, | 1296 | parent_frame = x_get_arg (dpyinfo, parms, Qparent_frame, NULL, NULL, |
| 1281 | RES_TYPE_SYMBOL); | 1297 | RES_TYPE_SYMBOL); |
| 1282 | /* Accept parent-frame iff parent-id was not specified. */ | 1298 | /* Accept parent-frame iff parent-id was not specified. */ |
| @@ -3248,6 +3264,7 @@ syms_of_nsfns (void) | |||
| 3248 | DEFSYM (Qfontsize, "fontsize"); | 3264 | DEFSYM (Qfontsize, "fontsize"); |
| 3249 | DEFSYM (Qframe_title_format, "frame-title-format"); | 3265 | DEFSYM (Qframe_title_format, "frame-title-format"); |
| 3250 | DEFSYM (Qicon_title_format, "icon-title-format"); | 3266 | DEFSYM (Qicon_title_format, "icon-title-format"); |
| 3267 | DEFSYM (Qdark, "dark"); | ||
| 3251 | 3268 | ||
| 3252 | DEFVAR_LISP ("ns-icon-type-alist", Vns_icon_type_alist, | 3269 | DEFVAR_LISP ("ns-icon-type-alist", Vns_icon_type_alist, |
| 3253 | doc: /* Alist of elements (REGEXP . IMAGE) for images of icons associated to frames. | 3270 | doc: /* Alist of elements (REGEXP . IMAGE) for images of icons associated to frames. |