comparison src/frame-msw.c @ 274:ca9a9ec9c1c1 r21-0b35

Import from CVS: tag r21-0b35
author cvs
date Mon, 13 Aug 2007 10:29:42 +0200
parents c5d627a313b1
children 6330739388db
comparison
equal deleted inserted replaced
273:411aac7253ef 274:ca9a9ec9c1c1
376 } 376 }
377 377
378 static void 378 static void
379 mswindows_set_title_from_bufbyte (struct frame *f, Bufbyte *title) 379 mswindows_set_title_from_bufbyte (struct frame *f, Bufbyte *title)
380 { 380 {
381 SetWindowText (FRAME_MSWINDOWS_HANDLE(f), title); 381 unsigned int new_checksum = hash_string (title, strlen (title));
382 if (new_checksum != FRAME_MSWINDOWS_TITLE_CHECKSUM(f))
383 {
384 FRAME_MSWINDOWS_TITLE_CHECKSUM(f) = new_checksum;
385 SetWindowText (FRAME_MSWINDOWS_HANDLE(f), title);
386 }
387 }
388
389 static Lisp_Object
390 mswindows_frame_property (struct frame *f, Lisp_Object property)
391 {
392 if (EQ (Qleft, property) || EQ (Qtop, property))
393 {
394 RECT rc;
395 GetWindowRect (FRAME_MSWINDOWS_HANDLE(f), &rc);
396 return make_int (EQ (Qtop, property) ? rc.top : rc.left);
397 }
398 return Qunbound;
399 }
400
401 static int
402 mswindows_internal_frame_property_p (struct frame *f, Lisp_Object property)
403 {
404 return EQ (property, Qleft)
405 || EQ (property, Qtop);
406 /* #### frame-x.c has also this. Why?
407 || STRINGP (property);
408 */
409 }
410
411 static Lisp_Object
412 mswindows_frame_properties (struct frame *f)
413 {
414 Lisp_Object props = Qnil;
415 RECT rc;
416 GetWindowRect (FRAME_MSWINDOWS_HANDLE(f), &rc);
417
418 props = cons3 (Qtop, make_int (rc.top), props);
419 props = cons3 (Qleft, make_int (rc.left), props);
420
421 return props;
382 } 422 }
383 423
384 static void 424 static void
385 mswindows_set_frame_properties (struct frame *f, Lisp_Object plist) 425 mswindows_set_frame_properties (struct frame *f, Lisp_Object plist)
386 { 426 {
516 if (1) 556 if (1)
517 { 557 {
518 int new_char_height, new_char_width; 558 int new_char_height, new_char_width;
519 pixel_to_real_char_size (frm, FRAME_PIXWIDTH(frm), FRAME_PIXHEIGHT(frm), 559 pixel_to_real_char_size (frm, FRAME_PIXWIDTH(frm), FRAME_PIXHEIGHT(frm),
520 &new_char_width, &new_char_height); 560 &new_char_width, &new_char_height);
521 if (new_char_width != MSWINDOWS_FRAME_CHARWIDTH (frm) 561 if (new_char_width != FRAME_MSWINDOWS_CHARWIDTH (frm)
522 || new_char_height != MSWINDOWS_FRAME_CHARHEIGHT (frm)) 562 || new_char_height != FRAME_MSWINDOWS_CHARHEIGHT (frm))
523 { 563 {
524 Lisp_Object frame; 564 Lisp_Object frame;
525 XSETFRAME (frame, frm); 565 XSETFRAME (frame, frm);
526 Fset_frame_size (frame, MSWINDOWS_FRAME_CHARWIDTH (frm), 566 Fset_frame_size (frame, FRAME_MSWINDOWS_CHARWIDTH (frm),
527 MSWINDOWS_FRAME_CHARHEIGHT (frm), Qnil); 567 FRAME_MSWINDOWS_CHARHEIGHT (frm), Qnil);
528 } 568 }
529 } 569 }
530 570
531 /* This resizes minibuffer and redraws modeline. */ 571 /* This resizes minibuffer and redraws modeline. */
532 { 572 {
556 CONSOLE_HAS_METHOD (mswindows, make_frame_visible); 596 CONSOLE_HAS_METHOD (mswindows, make_frame_visible);
557 CONSOLE_HAS_METHOD (mswindows, make_frame_invisible); 597 CONSOLE_HAS_METHOD (mswindows, make_frame_invisible);
558 CONSOLE_HAS_METHOD (mswindows, iconify_frame); 598 CONSOLE_HAS_METHOD (mswindows, iconify_frame);
559 CONSOLE_HAS_METHOD (mswindows, set_frame_size); 599 CONSOLE_HAS_METHOD (mswindows, set_frame_size);
560 CONSOLE_HAS_METHOD (mswindows, set_frame_position); 600 CONSOLE_HAS_METHOD (mswindows, set_frame_position);
561 /* CONSOLE_HAS_METHOD (mswindows, frame_property); */ 601 CONSOLE_HAS_METHOD (mswindows, frame_property);
562 /* CONSOLE_HAS_METHOD (mswindows, internal_frame_property_p); */ 602 CONSOLE_HAS_METHOD (mswindows, internal_frame_property_p);
563 /* CONSOLE_HAS_METHOD (mswindows, frame_properties); */ 603 CONSOLE_HAS_METHOD (mswindows, frame_properties);
564 CONSOLE_HAS_METHOD (mswindows, set_frame_properties); 604 CONSOLE_HAS_METHOD (mswindows, set_frame_properties);
565 CONSOLE_HAS_METHOD (mswindows, set_title_from_bufbyte); 605 CONSOLE_HAS_METHOD (mswindows, set_title_from_bufbyte);
566 /* CONSOLE_HAS_METHOD (mswindows, set_icon_name_from_bufbyte); */ 606 /* CONSOLE_HAS_METHOD (mswindows, set_icon_name_from_bufbyte); */
567 CONSOLE_HAS_METHOD (mswindows, frame_visible_p); 607 CONSOLE_HAS_METHOD (mswindows, frame_visible_p);
568 /* CONSOLE_HAS_METHOD (mswindows, frame_totally_visible_p); */ 608 /* CONSOLE_HAS_METHOD (mswindows, frame_totally_visible_p); */