comparison src/frame-msw.c @ 282:c42ec1d1cded r21-0b39

Import from CVS: tag r21-0b39
author cvs
date Mon, 13 Aug 2007 10:33:18 +0200
parents 7df0dd720c89
children c9fe270a4101
comparison
equal deleted inserted replaced
281:090b52736db2 282:c42ec1d1cded
112 112
113 mswindows_frame_target_rect.left = NILP (left) ? -1 : abs (XINT (left)); 113 mswindows_frame_target_rect.left = NILP (left) ? -1 : abs (XINT (left));
114 mswindows_frame_target_rect.top = NILP (top) ? -1 : abs (XINT (top)); 114 mswindows_frame_target_rect.top = NILP (top) ? -1 : abs (XINT (top));
115 mswindows_frame_target_rect.width = NILP (width) ? -1 : abs (XINT (width)); 115 mswindows_frame_target_rect.width = NILP (width) ? -1 : abs (XINT (width));
116 mswindows_frame_target_rect.height = NILP (height) ? -1 : abs (XINT (height)); 116 mswindows_frame_target_rect.height = NILP (height) ? -1 : abs (XINT (height));
117
118 /* These shouldn't be here, but the window is created too early.
119 The initialization of scrollbar resources is done between
120 init_frame_1 and init_frame_2 in make_frame. jsparkes */
121 f->scrollbar_width = make_int (15);
122 f->scrollbar_height = make_int (15);
123 117
124 f->frame_data = xnew_and_zero (struct mswindows_frame); 118 f->frame_data = xnew_and_zero (struct mswindows_frame);
125 119
126 /* Misc frame stuff */ 120 /* Misc frame stuff */
127 FRAME_MSWINDOWS_DATA(f)->button2_need_lbutton = 0; 121 FRAME_MSWINDOWS_DATA(f)->button2_need_lbutton = 0;
367 if (IMAGE_INSTANCEP (f->icon) 361 if (IMAGE_INSTANCEP (f->icon)
368 && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (f->icon))) 362 && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (f->icon)))
369 { 363 {
370 if (!XIMAGE_INSTANCE_MSWINDOWS_ICON (f->icon)) 364 if (!XIMAGE_INSTANCE_MSWINDOWS_ICON (f->icon))
371 { 365 {
372 mswindows_create_icon_from_image(f->icon, f, 16); 366 mswindows_initialize_image_instance_icon (XIMAGE_INSTANCE (f->icon),
367 FALSE);
373 } 368 }
374 369
375 SetClassLong (FRAME_MSWINDOWS_HANDLE (f), GCL_HICON, 370 SetClassLong (FRAME_MSWINDOWS_HANDLE (f), GCL_HICON,
376 (LONG) XIMAGE_INSTANCE_MSWINDOWS_ICON (f->icon)); 371 (LONG) XIMAGE_INSTANCE_MSWINDOWS_ICON (f->icon));
377 } 372 }
378 } 373 }
379 374
380 static void 375 static void
381 mswindows_set_frame_pointer (struct frame *f) 376 mswindows_set_frame_pointer (struct frame *f)
382 { 377 {
383 #if 0 378 if (IMAGE_INSTANCEP (f->pointer)
384 XDefineCursor (XtDisplay (FRAME_X_TEXT_WIDGET (f)), 379 && IMAGE_INSTANCE_TYPE (XIMAGE_INSTANCE (f->pointer)) == IMAGE_POINTER)
385 XtWindow (FRAME_X_TEXT_WIDGET (f)), 380 {
386 XIMAGE_INSTANCE_X_CURSOR (f->pointer)); 381 SetClassLong (FRAME_MSWINDOWS_HANDLE (f), GCL_HCURSOR,
387 XSync (XtDisplay (FRAME_X_TEXT_WIDGET (f)), 0); 382 (LONG) XIMAGE_INSTANCE_MSWINDOWS_ICON (f->pointer));
388 #endif 383 }
389 } 384 }
390
391 385
392 static void 386 static void
393 mswindows_set_mouse_position (struct window *w, int x, int y) 387 mswindows_set_mouse_position (struct window *w, int x, int y)
394 { 388 {
395 struct frame *f = XFRAME (w->frame); 389 struct frame *f = XFRAME (w->frame);
624 } 618 }
625 619
626 static void 620 static void
627 mswindows_update_frame_external_traits (struct frame* frm, Lisp_Object name) 621 mswindows_update_frame_external_traits (struct frame* frm, Lisp_Object name)
628 { 622 {
629 if (EQ (name, Qfont)) 623 }
630 { 624
631 /* We resize the frame along with the font if user preference 625 static int
632 of MS style compliance is turned off, and if font size has 626 mswindows_frame_size_fixed_p (struct frame *f)
633 really changed 627 {
634 */ 628 /* Frame size cannot change if the frame is maximized */
635 /* #### Frame gets resized after font here */ 629 return IsZoomed (FRAME_MSWINDOWS_HANDLE (f));
636 if (1)
637 {
638 int new_char_height, new_char_width;
639 pixel_to_real_char_size (frm, FRAME_PIXWIDTH(frm), FRAME_PIXHEIGHT(frm),
640 &new_char_width, &new_char_height);
641 if (new_char_width != FRAME_MSWINDOWS_CHARWIDTH (frm)
642 || new_char_height != FRAME_MSWINDOWS_CHARHEIGHT (frm))
643 {
644 Lisp_Object frame;
645 XSETFRAME (frame, frm);
646 Fset_frame_size (frame,
647 make_int(FRAME_MSWINDOWS_CHARWIDTH (frm)),
648 make_int(FRAME_MSWINDOWS_CHARHEIGHT (frm)),
649 Qnil);
650 }
651 }
652
653 /* This resizes minibuffer and redraws modeline. */
654 {
655 int width, height;
656 pixel_to_char_size (frm, FRAME_PIXWIDTH(frm), FRAME_PIXHEIGHT(frm),
657 &width, &height);
658 change_frame_size (frm, height, width, 1);
659 }
660 }
661 } 630 }
662 631
663 void 632 void
664 console_type_create_frame_mswindows (void) 633 console_type_create_frame_mswindows (void)
665 { 634 {
691 CONSOLE_HAS_METHOD (mswindows, frame_iconified_p); 660 CONSOLE_HAS_METHOD (mswindows, frame_iconified_p);
692 CONSOLE_HAS_METHOD (mswindows, set_frame_pointer); 661 CONSOLE_HAS_METHOD (mswindows, set_frame_pointer);
693 CONSOLE_HAS_METHOD (mswindows, set_frame_icon); 662 CONSOLE_HAS_METHOD (mswindows, set_frame_icon);
694 CONSOLE_HAS_METHOD (mswindows, get_frame_parent); 663 CONSOLE_HAS_METHOD (mswindows, get_frame_parent);
695 CONSOLE_HAS_METHOD (mswindows, update_frame_external_traits); 664 CONSOLE_HAS_METHOD (mswindows, update_frame_external_traits);
665 CONSOLE_HAS_METHOD (mswindows, frame_size_fixed_p);
696 } 666 }
697 667
698 void 668 void
699 syms_of_frame_mswindows (void) 669 syms_of_frame_mswindows (void)
700 { 670 {