Mercurial > hg > xemacs-beta
changeset 3022:dd34bc8e9423
[xemacs-hg @ 2005-10-25 03:54:01 by ben]
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.
author | ben |
---|---|
date | Tue, 25 Oct 2005 03:54:03 +0000 |
parents | 285d258fdeb6 |
children | d305f4207861 |
files | src/ChangeLog src/frame-msw.c |
diffstat | 2 files changed, 43 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog Mon Oct 24 22:40:21 2005 +0000 +++ b/src/ChangeLog Tue Oct 25 03:54:03 2005 +0000 @@ -1,3 +1,16 @@ +2005-10-24 Ben Wing <ben@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@xemacs.org> * alloc.c:
--- a/src/frame-msw.c Mon Oct 24 22:40:21 2005 +0000 +++ b/src/frame-msw.c Tue Oct 25 03:54:03 2005 +0000 @@ -102,6 +102,18 @@ /*----- 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 @@ } 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 @@ 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 @@ 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 @@ 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 @@ 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.