aboutsummaryrefslogtreecommitdiffstats
path: root/src/frame.h
diff options
context:
space:
mode:
authorAlan Third2017-08-20 21:14:47 +0100
committerAlan Third2017-08-23 19:57:00 +0100
commit7baa50eca28ff21497b058fa22656bbb4a447d87 (patch)
tree248e7eae805b65b76f368f70928cdcfb1a54cb84 /src/frame.h
parent4309d1574ae86244751600171b605b2b2eca4697 (diff)
downloademacs-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/frame.h')
-rw-r--r--src/frame.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/frame.h b/src/frame.h
index 154dc9a3bb4..4b7e448b543 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -65,6 +65,14 @@ enum internal_border_part
65 INTERNAL_BORDER_BOTTOM_EDGE, 65 INTERNAL_BORDER_BOTTOM_EDGE,
66 INTERNAL_BORDER_BOTTOM_LEFT_CORNER, 66 INTERNAL_BORDER_BOTTOM_LEFT_CORNER,
67 }; 67 };
68
69#ifdef NS_IMPL_COCOA
70enum ns_appearance_type
71 {
72 ns_appearance_aqua,
73 ns_appearance_vibrant_dark
74 };
75#endif
68#endif /* HAVE_WINDOW_SYSTEM */ 76#endif /* HAVE_WINDOW_SYSTEM */
69 77
70/* The structure representing a frame. */ 78/* The structure representing a frame. */
@@ -563,6 +571,12 @@ struct frame
563 /* All display backends seem to need these two pixel values. */ 571 /* All display backends seem to need these two pixel values. */
564 unsigned long background_pixel; 572 unsigned long background_pixel;
565 unsigned long foreground_pixel; 573 unsigned long foreground_pixel;
574
575#ifdef NS_IMPL_COCOA
576 /* NSAppearance theme used on this frame. */
577 enum ns_appearance_type ns_appearance;
578 bool_bf ns_transparent_titlebar;
579#endif
566}; 580};
567 581
568/* Most code should use these functions to set Lisp fields in struct frame. */ 582/* Most code should use these functions to set Lisp fields in struct frame. */
@@ -953,6 +967,10 @@ default_pixels_per_inch_y (void)
953#define FRAME_Z_GROUP_ABOVE_SUSPENDED(f) \ 967#define FRAME_Z_GROUP_ABOVE_SUSPENDED(f) \
954 ((f)->z_group == z_group_above_suspended) 968 ((f)->z_group == z_group_above_suspended)
955#define FRAME_Z_GROUP_BELOW(f) ((f)->z_group == z_group_below) 969#define FRAME_Z_GROUP_BELOW(f) ((f)->z_group == z_group_below)
970#ifdef NS_IMPL_COCOA
971#define FRAME_NS_APPEARANCE(f) ((f)->ns_appearance)
972#define FRAME_NS_TRANSPARENT_TITLEBAR(f) ((f)->ns_transparent_titlebar)
973#endif
956#else /* not HAVE_WINDOW_SYSTEM */ 974#else /* not HAVE_WINDOW_SYSTEM */
957#define FRAME_UNDECORATED(f) ((void) (f), 0) 975#define FRAME_UNDECORATED(f) ((void) (f), 0)
958#define FRAME_OVERRIDE_REDIRECT(f) ((void) (f), 0) 976#define FRAME_OVERRIDE_REDIRECT(f) ((void) (f), 0)