summaryrefslogtreecommitdiff
path: root/src/frame.h
diff options
context:
space:
mode:
authorGerd Möllmann <gerd@gnu.org>2024-10-21 18:32:04 +0200
committerGerd Möllmann <gerd@gnu.org>2024-10-22 06:40:19 +0200
commit414de92a562e8912ffdc8ed2995e7ea10d05f13b (patch)
tree9058dd00922ed14319e0e49eb216fcad7ea5fdd6 /src/frame.h
parent1854f2751e3f73e1e5f12f6de993b6357de1766b (diff)
downloademacs-414de92a562e8912ffdc8ed2995e7ea10d05f13b.tar.gz
emacs-414de92a562e8912ffdc8ed2995e7ea10d05f13b.tar.bz2
emacs-414de92a562e8912ffdc8ed2995e7ea10d05f13b.zip
Initial child frames based on master
This is based on a diff from 2024-10-15 which still applied. Since then, I've inadvertantly modified the igc branch so that it is no longer possible to get a clean diff of what has changed since I created the branch.
Diffstat (limited to 'src/frame.h')
-rw-r--r--src/frame.h84
1 files changed, 39 insertions, 45 deletions
diff --git a/src/frame.h b/src/frame.h
index 1d920d1a6bc..0b7368fb29b 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -161,10 +161,8 @@ struct frame
Usually it is nil. */
Lisp_Object title;
-#if defined (HAVE_WINDOW_SYSTEM)
/* This frame's parent frame, if it has one. */
Lisp_Object parent_frame;
-#endif /* HAVE_WINDOW_SYSTEM */
/* Last device to move over this frame. Any value that isn't a
string means the "Virtual core pointer". */
@@ -385,15 +383,8 @@ struct frame
zero if the frame has been made invisible without an icon. */
/* Nonzero if the frame is currently displayed; we check
- it to see if we should bother updating the frame's contents.
-
- On ttys and on Windows NT/9X, to avoid wasting effort updating
- visible frames that are actually completely obscured by other
- windows on the display, we bend the meaning of visible slightly:
- if equal to 2, then the frame is obscured - we still consider
- it to be "visible" as seen from lisp, but we don't bother
- updating it. */
- unsigned visible : 2;
+ it to see if we should bother updating the frame's contents. */
+ unsigned visible : 1;
/* True if the frame is currently iconified. Do not
set this directly, use SET_FRAME_ICONIFIED instead. */
@@ -451,7 +442,15 @@ struct frame
This must be the same as the terminal->type. */
ENUM_BF (output_method) output_method : 4;
+ /* True if this is an undecorated frame. */
+ bool_bf undecorated : 1;
+
+ /* Nonzero if this frame's window does not want to receive input focus
+ via mouse clicks or by moving the mouse into it. */
+ bool_bf no_accept_focus : 1;
+
#ifdef HAVE_WINDOW_SYSTEM
+# ifndef HAVE_NTGUI
/* True if this frame is a tooltip frame. */
bool_bf tooltip : 1;
@@ -465,10 +464,7 @@ struct frame
/* Nonzero if we should actually display horizontal scroll bars on this frame. */
bool_bf horizontal_scroll_bars : 1;
- /* True if this is an undecorated frame. */
- bool_bf undecorated : 1;
-#ifndef HAVE_NTGUI
/* True if this is an override_redirect frame. */
bool_bf override_redirect : 1;
#endif
@@ -480,17 +476,13 @@ struct frame
receive input focus when it is mapped. */
bool_bf no_focus_on_map : 1;
- /* Nonzero if this frame's window does not want to receive input focus
- via mouse clicks or by moving the mouse into it. */
- bool_bf no_accept_focus : 1;
-
/* The z-group this frame's window belongs to. */
ENUM_BF (z_group) z_group : 2;
+#endif /* HAVE_WINDOW_SYSTEM */
/* Non-zero if display of truncation and continuation glyphs outside
the fringes is suppressed. */
bool_bf no_special_glyphs : 1;
-#endif /* HAVE_WINDOW_SYSTEM */
/* True means set_window_size_hook requests can be processed for
this frame. */
@@ -740,7 +732,10 @@ struct frame
#ifdef HAVE_TEXT_CONVERSION
/* Text conversion state used by certain input methods. */
struct text_conversion_state conversion;
-#endif
+# endif
+
+ /* Z-order of child frames. */
+ int z_order;
} GCALIGNED_STRUCT;
/* Most code should use these functions to set Lisp fields in struct frame. */
@@ -1021,9 +1016,11 @@ default_pixels_per_inch_y (void)
does not have FRAME_DISPLAY_INFO. */
#ifdef HAVE_WINDOW_SYSTEM
#ifndef HAVE_ANDROID
-# define MOUSE_HL_INFO(F) \
+# define MOUSE_HL_INFO(F) \
(FRAME_WINDOW_P (F) \
- ? &FRAME_DISPLAY_INFO(F)->mouse_highlight \
+ ? (FRAME_OUTPUT_DATA (F) \
+ ? &FRAME_DISPLAY_INFO (F)->mouse_highlight \
+ : NULL) \
: &(F)->output_data.tty->display_info->mouse_highlight)
#else
/* There is no "struct tty_output" on Android at all. */
@@ -1176,9 +1173,6 @@ default_pixels_per_inch_y (void)
&& FRAME_X_VISIBLE (f)))
#endif
-/* True if frame F is currently visible but hidden. */
-#define FRAME_OBSCURED_P(f) ((f)->visible > 1)
-
/* True if frame F is currently iconified. */
#define FRAME_ICONIFIED_P(f) (f)->iconified
@@ -1243,21 +1237,23 @@ default_pixels_per_inch_y (void)
#define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT(f) ((void) (f), 0)
#endif /* HAVE_WINDOW_SYSTEM */
-#if defined (HAVE_WINDOW_SYSTEM)
+INLINE struct frame *
+FRAME_PARENT_FRAME (struct frame *f)
+{
+ return NILP (f->parent_frame) ? NULL : XFRAME (f->parent_frame);
+}
+
#define FRAME_UNDECORATED(f) ((f)->undecorated)
+
+#if defined (HAVE_WINDOW_SYSTEM)
#ifdef HAVE_NTGUI
#define FRAME_OVERRIDE_REDIRECT(f) ((void) (f), 0)
#else
#define FRAME_OVERRIDE_REDIRECT(f) ((f)->override_redirect)
#endif
-#define FRAME_PARENT_FRAME(f) \
- (NILP ((f)->parent_frame) \
- ? NULL \
- : XFRAME ((f)->parent_frame))
#define FRAME_SKIP_TASKBAR(f) ((f)->skip_taskbar)
#define FRAME_NO_FOCUS_ON_MAP(f) ((f)->no_focus_on_map)
#define FRAME_NO_ACCEPT_FOCUS(f) ((f)->no_accept_focus)
-#define FRAME_NO_SPECIAL_GLYPHS(f) ((f)->no_special_glyphs)
#define FRAME_Z_GROUP(f) ((f)->z_group)
#define FRAME_Z_GROUP_NONE(f) ((f)->z_group == z_group_none)
#define FRAME_Z_GROUP_ABOVE(f) ((f)->z_group == z_group_above)
@@ -1270,13 +1266,10 @@ default_pixels_per_inch_y (void)
#define FRAME_NS_TRANSPARENT_TITLEBAR(f) ((f)->ns_transparent_titlebar)
#endif
#else /* not HAVE_WINDOW_SYSTEM */
-#define FRAME_UNDECORATED(f) ((void) (f), 0)
#define FRAME_OVERRIDE_REDIRECT(f) ((void) (f), 0)
-#define FRAME_PARENT_FRAME(f) ((void) (f), NULL)
#define FRAME_SKIP_TASKBAR(f) ((void) (f), 0)
#define FRAME_NO_FOCUS_ON_MAP(f) ((void) (f), 0)
#define FRAME_NO_ACCEPT_FOCUS(f) ((void) (f), 0)
-#define FRAME_NO_SPECIAL_GLYPHS(f) ((void) (f), 0)
#define FRAME_Z_GROUP(f) ((void) (f), z_group_none)
#define FRAME_Z_GROUP_NONE(f) ((void) (f), true)
#define FRAME_Z_GROUP_ABOVE(f) ((void) (f), false)
@@ -1284,6 +1277,8 @@ default_pixels_per_inch_y (void)
#define FRAME_TOOLTIP_P(f) ((void) f, false)
#endif /* HAVE_WINDOW_SYSTEM */
+#define FRAME_NO_SPECIAL_GLYPHS(f) ((f)->no_special_glyphs)
+
/* Whether horizontal scroll bars are currently enabled for frame F. */
#if USE_HORIZONTAL_SCROLL_BARS
#define FRAME_HAS_HORIZONTAL_SCROLL_BARS(f) \
@@ -1445,9 +1440,8 @@ extern bool frame_garbaged;
if some changes were applied to it while it wasn't visible (and hence
wasn't redisplayed). */
INLINE void
-SET_FRAME_VISIBLE (struct frame *f, int v)
+SET_FRAME_VISIBLE (struct frame *f, bool v)
{
- eassert (0 <= v && v <= 2);
if (v)
{
if (v == 1 && f->visible != 1)
@@ -1504,13 +1498,14 @@ extern struct frame *decode_any_frame (Lisp_Object);
extern struct frame *make_initial_frame (void);
extern struct frame *make_frame (bool);
#ifdef HAVE_WINDOW_SYSTEM
-extern struct frame *make_minibuffer_frame (void);
-extern struct frame *make_frame_without_minibuffer (Lisp_Object,
- struct kboard *,
- Lisp_Object);
extern bool display_available (void);
#endif
+struct frame *make_minibuffer_frame (void);
+struct frame *
+make_frame_without_minibuffer (Lisp_Object mini_window,
+ KBOARD *kb, Lisp_Object display);
+
INLINE bool
window_system_available (struct frame *f)
{
@@ -1522,6 +1517,8 @@ window_system_available (struct frame *f)
}
extern WINDOW_SYSTEM_RETURN void check_window_system (struct frame *);
+void check_tty (struct frame *f);
+struct frame *decode_tty_frame (Lisp_Object frame);
extern void frame_make_pointer_invisible (struct frame *);
extern void frame_make_pointer_visible (struct frame *);
extern Lisp_Object delete_frame (Lisp_Object, Lisp_Object);
@@ -1617,15 +1614,11 @@ FRAME_CHILD_FRAME_BORDER_WIDTH (struct frame *f)
INLINE int
FRAME_INTERNAL_BORDER_WIDTH (struct frame *f)
{
-#ifdef HAVE_WINDOW_SYSTEM
return (FRAME_PARENT_FRAME(f)
? (FRAME_CHILD_FRAME_BORDER_WIDTH(f) >= 0
? FRAME_CHILD_FRAME_BORDER_WIDTH(f)
: frame_dimension (f->internal_border_width))
: frame_dimension (f->internal_border_width));
-#else
- return frame_dimension (f->internal_border_width);
-#endif
}
/* Pixel-size of window divider lines. */
@@ -1880,7 +1873,6 @@ extern Lisp_Object gui_display_get_resource (Display_Info *,
extern void set_frame_menubar (struct frame *f, bool deep_p);
extern void frame_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y);
extern void free_frame_menubar (struct frame *);
-extern bool frame_ancestor_p (struct frame *af, struct frame *df);
extern enum internal_border_part frame_internal_border_part (struct frame *f, int x, int y);
#if defined HAVE_X_WINDOWS
@@ -1907,6 +1899,8 @@ gui_set_bitmap_icon (struct frame *f)
#endif /* !HAVE_NS */
#endif /* HAVE_WINDOW_SYSTEM */
+extern bool frame_ancestor_p (struct frame *af, struct frame *df);
+
INLINE void
flush_frame (struct frame *f)
{