comparison src/frame-msw.c @ 231:557eaa0339bf r20-5b14

Import from CVS: tag r20-5b14
author cvs
date Mon, 13 Aug 2007 10:13:48 +0200
parents 12579d965149
children 51092a27c943
comparison
equal deleted inserted replaced
230:39ed1d2bdd9d 231:557eaa0339bf
33 33
34 #include "console-msw.h" 34 #include "console-msw.h"
35 #include "event-msw.h" 35 #include "event-msw.h"
36 36
37 #include "buffer.h" 37 #include "buffer.h"
38 #include "faces.h"
38 #include "frame.h" 39 #include "frame.h"
39 #include "events.h" 40 #include "events.h"
40 41
41 #define MSWINDOWS_FRAME_STYLE WS_CLIPCHILDREN|WS_CLIPSIBLINGS|WS_OVERLAPPEDWINDOW 42 #define MSWINDOWS_FRAME_STYLE WS_CLIPCHILDREN|WS_CLIPSIBLINGS|WS_OVERLAPPEDWINDOW
42 #define MSWINDOWS_POPUP_STYLE WS_CLIPCHILDREN|WS_CLIPSIBLINGS|WS_CAPTION|WS_POPUP 43 #define MSWINDOWS_POPUP_STYLE WS_CLIPCHILDREN|WS_CLIPSIBLINGS|WS_CAPTION|WS_POPUP
58 static void 59 static void
59 mswindows_init_frame_1 (struct frame *f, Lisp_Object props) 60 mswindows_init_frame_1 (struct frame *f, Lisp_Object props)
60 { 61 {
61 Lisp_Object device = FRAME_DEVICE (f); 62 Lisp_Object device = FRAME_DEVICE (f);
62 struct device *d = XDEVICE (device); 63 struct device *d = XDEVICE (device);
63 Lisp_Object lisp_window_id, initially_unmapped; 64 Lisp_Object initially_unmapped;
64 Lisp_Object name, height, width, popup, top, left; 65 Lisp_Object name, height, width, popup, top, left;
65 Lisp_Object frame_obj; 66 Lisp_Object frame_obj;
66 int pixel_width, pixel_height;
67 RECT rect; 67 RECT rect;
68 DWORD style, exstyle; 68 DWORD style, exstyle;
69 HWND hwnd;
70 69
71 initially_unmapped = Fplist_get (props, Qinitially_unmapped, Qnil); 70 initially_unmapped = Fplist_get (props, Qinitially_unmapped, Qnil);
72 name = Fplist_get (props, Qname, Qnil); 71 name = Fplist_get (props, Qname, Qnil);
73 height = Fplist_get (props, Qheight, Qnil); 72 height = Fplist_get (props, Qheight, Qnil);
74 width = Fplist_get (props, Qwidth, Qnil); 73 width = Fplist_get (props, Qwidth, Qnil);
98 FRAME_MSWINDOWS_DATA(f)->button2_need_rbutton = 0; 97 FRAME_MSWINDOWS_DATA(f)->button2_need_rbutton = 0;
99 FRAME_MSWINDOWS_DATA(f)->button2_is_down = 0; 98 FRAME_MSWINDOWS_DATA(f)->button2_is_down = 0;
100 FRAME_MSWINDOWS_DATA(f)->ignore_next_lbutton_up = 0; 99 FRAME_MSWINDOWS_DATA(f)->ignore_next_lbutton_up = 0;
101 FRAME_MSWINDOWS_DATA(f)->ignore_next_rbutton_up = 0; 100 FRAME_MSWINDOWS_DATA(f)->ignore_next_rbutton_up = 0;
102 FRAME_MSWINDOWS_DATA(f)->sizing = 0; 101 FRAME_MSWINDOWS_DATA(f)->sizing = 0;
102
103 FRAME_MSWINDOWS_MENU_HASHTABLE(f) = Qnil;
103 104
104 AdjustWindowRectEx(&rect, style, ADJR_MENUFLAG, exstyle); 105 AdjustWindowRectEx(&rect, style, ADJR_MENUFLAG, exstyle);
105 106
106 FRAME_MSWINDOWS_HANDLE(f) = 107 FRAME_MSWINDOWS_HANDLE(f) =
107 CreateWindowEx (exstyle, 108 CreateWindowEx (exstyle,
130 mswindows_init_frame_3 (struct frame *f) 131 mswindows_init_frame_3 (struct frame *f)
131 { 132 {
132 /* Don't do this earlier or we get a WM_PAINT before the frame is ready*/ 133 /* Don't do this earlier or we get a WM_PAINT before the frame is ready*/
133 ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_SHOWNORMAL); 134 ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_SHOWNORMAL);
134 SetForegroundWindow (FRAME_MSWINDOWS_HANDLE(f)); 135 SetForegroundWindow (FRAME_MSWINDOWS_HANDLE(f));
136 }
137
138 static void
139 mswindows_mark_frame (struct frame *f, void (*markobj) (Lisp_Object))
140 {
141 ((markobj) (FRAME_MSWINDOWS_MENU_HASHTABLE (f)));
135 } 142 }
136 143
137 static void 144 static void
138 mswindows_focus_on_frame (struct frame *f) 145 mswindows_focus_on_frame (struct frame *f)
139 { 146 {
338 { 345 {
339 /* frame methods */ 346 /* frame methods */
340 CONSOLE_HAS_METHOD (mswindows, init_frame_1); 347 CONSOLE_HAS_METHOD (mswindows, init_frame_1);
341 CONSOLE_HAS_METHOD (mswindows, init_frame_2); 348 CONSOLE_HAS_METHOD (mswindows, init_frame_2);
342 CONSOLE_HAS_METHOD (mswindows, init_frame_3); 349 CONSOLE_HAS_METHOD (mswindows, init_frame_3);
343 /* CONSOLE_HAS_METHOD (mswindows, mark_frame); */ 350 CONSOLE_HAS_METHOD (mswindows, mark_frame);
344 CONSOLE_HAS_METHOD (mswindows, focus_on_frame); 351 CONSOLE_HAS_METHOD (mswindows, focus_on_frame);
345 CONSOLE_HAS_METHOD (mswindows, delete_frame); 352 CONSOLE_HAS_METHOD (mswindows, delete_frame);
346 /* CONSOLE_HAS_METHOD (mswindows, get_mouse_position); */ 353 /* CONSOLE_HAS_METHOD (mswindows, get_mouse_position); */
347 /* CONSOLE_HAS_METHOD (mswindows, set_mouse_position); */ 354 /* CONSOLE_HAS_METHOD (mswindows, set_mouse_position); */
348 CONSOLE_HAS_METHOD (mswindows, raise_frame); 355 CONSOLE_HAS_METHOD (mswindows, raise_frame);