User: ben
Date: 05/10/25 05:54:06
Modified: xemacs/src ChangeLog frame-msw.c
Log:
add support for `window-id' property in mswindows
frame-msw.c: New function, like decode_x_frame.
frame-msw.c: Add `window-id' property for MS Windows frames.
Revision Changes Path
1.872 +13 -0 XEmacs/xemacs/src/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.871
retrieving revision 1.872
diff -u -p -r1.871 -r1.872
--- ChangeLog 2005/10/24 10:07:32 1.871
+++ ChangeLog 2005/10/25 03:54:01 1.872
@@ -1,5 +1,18 @@
2005-10-24 Ben Wing <ben(a)xemacs.org>
+ * frame-msw.c:
+ * frame-msw.c (decode_mswindows_frame):
+ New function, like decode_x_frame.
+
+ * frame-msw.c (mswindows_window_id):
+ * frame-msw.c (mswindows_frame_property):
+ * frame-msw.c (mswindows_internal_frame_property_p):
+ * frame-msw.c (mswindows_frame_properties):
+ * frame-msw.c (vars_of_frame_mswindows):
+ Add `window-id' property for MS Windows frames.
+
+2005-10-24 Ben Wing <ben(a)xemacs.org>
+
* alloc.c:
* alloc.c (Lisp_Free):
* alloc.c (Fcons):
1.57 +30 -1 XEmacs/xemacs/src/frame-msw.c
Index: frame-msw.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/frame-msw.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -p -r1.56 -r1.57
--- frame-msw.c 2005/07/24 17:53:23 1.56
+++ frame-msw.c 2005/10/25 03:54:03 1.57
@@ -102,6 +102,18 @@ const struct sized_memory_description ms
/*----- DISPLAY FRAME -----*/
/*---------------------------------------------------------------------*/
+static struct frame *
+decode_mswindows_frame (Lisp_Object frame)
+{
+ if (NILP (frame))
+ frame = wrap_frame (selected_frame ());
+ CHECK_LIVE_FRAME (frame);
+ /* this will also catch dead frames, but putting in the above check
+ results in a more useful error */
+ CHECK_MSWINDOWS_FRAME (frame);
+ return XFRAME (frame);
+}
+
HWND
mswindows_get_selected_frame_hwnd (void)
{
@@ -564,6 +576,16 @@ mswindows_set_title_from_ibyte (struct f
}
static Lisp_Object
+mswindows_window_id (Lisp_Object frame)
+{
+ Ibyte str[255];
+ struct frame *f = decode_mswindows_frame (frame);
+
+ qxesprintf (str, "%lu", FRAME_MSWINDOWS_HANDLE (f));
+ return build_intstring (str);
+}
+
+static Lisp_Object
mswindows_frame_property (struct frame *f, Lisp_Object property)
{
if (EQ (Qleft, property) || EQ (Qtop, property))
@@ -572,6 +594,9 @@ mswindows_frame_property (struct frame *
GetWindowRect (FRAME_MSWINDOWS_HANDLE (f), &rc);
return make_int (EQ (Qtop, property) ? rc.top : rc.left);
}
+ if (EQ (Qwindow_id, property))
+ return mswindows_window_id (wrap_frame (f));
+
return Qunbound;
}
@@ -580,7 +605,8 @@ mswindows_internal_frame_property_p (str
Lisp_Object property)
{
return EQ (property, Qleft)
- || EQ (property, Qtop);
+ || EQ (property, Qtop)
+ || EQ (property, Qwindow_id);
/* #### frame-x.c has also this. Why?
|| STRINGP (property);
*/
@@ -595,6 +621,7 @@ mswindows_frame_properties (struct frame
props = cons3 (Qtop, make_int (rc.top), props);
props = cons3 (Qleft, make_int (rc.left), props);
+ props = cons3 (Qwindow_id, mswindows_window_id (wrap_frame (f)), props);
return props;
}
@@ -1209,6 +1236,8 @@ set at any time, except as otherwise not
outermost corner of the frame (i.e. the
upper-left of the window-manager
decorations).
+ window-id Window handle (HWND) of the frame.
+ Cannot be set.
See also `default-frame-plist', which specifies properties which apply
to all frames, not just mswindows frames.
Show replies by date