Changeset 4120
- Timestamp:
- 07/25/06 22:21:26 (2 years ago)
- Files:
-
- trunk/src/ChangeLog.Meadow (modified) (1 diff)
- trunk/src/fontset.c (modified) (10 diffs)
- trunk/src/mw32font.c (modified) (2 diffs)
- trunk/src/w32proc.c (modified) (1 diff)
- trunk/src/w32term.h (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/ChangeLog.Meadow
r4119 r4120 1 2006-07-25 MIYOSHI Masanori <miyoshi@meadowy.org> 2 3 * w32term.h: Sync up with Emacs CVS HEAD. 4 5 * w32proc.c: Don't include "w32term.h" 6 7 * mw32font.c (FONTSET_FROM_ID): Use mw32_get_fontset_table(). 8 (FONTSET_REF_VIA_BASE): Use mw32_fontset_ref_via_base(). 9 (FONTSET_SET): Use mw32_fontset_set(). 10 11 * fontset.c: Sync up with Emacs CVS HEAD. 12 (lookup_overriding_fontspec): Validated as a stub. 13 (mw32_get_fontset_table): New function. 14 (mw32_fontset_set): Ditto. 15 (mw32_fontset_ref_via_base): Ditto. 16 1 17 2006-07-22 MIYOSHI Masanori <miyoshi@meadowy.org> 2 18 trunk/src/fontset.c
r4119 r4120 137 137 138 138 /* Vector containing all fontsets. */ 139 #ifdef MEADOW140 Lisp_Object Vfontset_table;141 #else142 139 static Lisp_Object Vfontset_table; 143 #endif144 140 145 141 /* Next possibly free fontset ID. Usually this keeps the minimum … … 200 196 static Lisp_Object fontset_ref P_ ((Lisp_Object, int)); 201 197 static Lisp_Object lookup_overriding_fontspec P_ ((Lisp_Object, int)); 202 #ifdef MEADOW203 void fontset_set P_ ((Lisp_Object, int, Lisp_Object));204 #else205 198 static void fontset_set P_ ((Lisp_Object, int, Lisp_Object)); 206 #endif207 199 static Lisp_Object make_fontset P_ ((Lisp_Object, Lisp_Object, Lisp_Object)); 208 200 static int fontset_id_valid_p P_ ((int)); … … 262 254 263 255 264 #ifndef MEADOW265 256 static Lisp_Object 266 257 lookup_overriding_fontspec (frame, c) … … 268 259 int c; 269 260 { 261 #ifndef MEADOW 270 262 Lisp_Object tail; 271 263 … … 300 292 } 301 293 } 294 #endif /* not MEADOW */ 302 295 return Qnil; 303 296 } 304 #endif /* not MEADOW */305 297 306 298 #define FONTSET_REF_VIA_BASE(fontset, c) fontset_ref_via_base (fontset, &c) 307 299 308 #ifdef MEADOW309 Lisp_Object310 #else311 300 static Lisp_Object 312 #endif313 301 fontset_ref_via_base (fontset, c) 314 302 Lisp_Object fontset; … … 324 312 if (! EQ (FONTSET_BASE (fontset), Vdefault_fontset)) 325 313 elt = FONTSET_REF (FONTSET_BASE (fontset), *c); 326 #ifndef MEADOW327 314 if (NILP (elt)) 328 315 elt = lookup_overriding_fontspec (FONTSET_FRAME (fontset), *c); 329 #endif330 316 if (NILP (elt)) 331 317 elt = FONTSET_REF (Vdefault_fontset, *c); … … 353 339 #define FONTSET_SET(fontset, c, newelt) fontset_set(fontset, c, newelt) 354 340 355 #ifdef MEADOW356 void357 #else358 341 static void 359 #endif360 342 fontset_set (fontset, c, newelt) 361 343 Lisp_Object fontset; … … 632 614 elt = FONTSET_REF (fontset, c); 633 615 } 634 #ifndef MEADOW635 616 if (NILP (elt)) 636 617 { … … 640 621 elt = lookup_overriding_fontspec (frame, c); 641 622 } 642 #endif643 623 if (NILP (elt)) 644 624 elt = FONTSET_REF (Vdefault_fontset, c); … … 1752 1732 } 1753 1733 1734 1735 #ifdef MEADOW 1736 /* export static variables and functions to MEADOW */ 1737 Lisp_Object 1738 mw32_get_fontset_table (void) 1739 { 1740 return Vfontset_table; 1741 } 1742 1743 void 1744 mw32_fontset_set (Lisp_Object fontset, int c, Lisp_Object newelt) 1745 { 1746 fontset_set (fontset, c, newelt); 1747 } 1748 1749 Lisp_Object 1750 mw32_fontset_ref_via_base (Lisp_Object fontset, int *c) 1751 { 1752 return fontset_ref_via_base (fontset, c); 1753 } 1754 #endif 1755 1756 1754 1757 /* arch-tag: ea861585-2f5f-4e5b-9849-d04a9c3a3537 1755 1758 (do not change this comment) */ trunk/src/mw32font.c
r4117 r4120 93 93 /* for fontset.c. */ 94 94 95 extern Lisp_Object Vfontset_table; 96 extern Lisp_Object fontset_ref_via_base (Lisp_Object, int *); 97 extern void fontset_set (Lisp_Object, int, Lisp_Object); 95 extern Lisp_Object mw32_get_fontset_table (void); 96 extern void mw32_fontset_set (Lisp_Object, int, Lisp_Object); 97 extern Lisp_Object mw32_fontset_ref_via_base (Lisp_Object, int *); 98 98 99 #define FONTSET_ID(fontset) XCHAR_TABLE (fontset)->extras[0] 99 100 #define FONTSET_NAME(fontset) XCHAR_TABLE (fontset)->extras[1] … … 102 103 #define FONTSET_BASE(fontset) XCHAR_TABLE (fontset)->parent 103 104 #define BASE_FONTSET_P(fontset) NILP (FONTSET_BASE (fontset)) 104 #define FONTSET_FROM_ID(id) AREF ( Vfontset_table, id)105 #define FONTSET_REF_VIA_BASE(fontset, c) fontset_ref_via_base (fontset, &c)106 #define FONTSET_SET(fontset, c, newelt) fontset_set (fontset, c, newelt)105 #define FONTSET_FROM_ID(id) AREF (mw32_get_fontset_table (), id) 106 #define FONTSET_REF_VIA_BASE(fontset, c) mw32_fontset_ref_via_base (fontset, &c) 107 #define FONTSET_SET(fontset, c, newelt) mw32_fontset_set (fontset, c, newelt) 107 108 108 109 trunk/src/w32proc.c
r4117 r4120 61 61 #include "process.h" 62 62 #include "syssignal.h" 63 #ifndef MEADOW 63 64 #include "w32term.h" 65 #endif 64 66 65 67 #define RVA_TO_PTR(var,section,filedata) \ trunk/src/w32term.h
r4119 r4120 28 28 #define WHITE_PIX_DEFAULT(f) PALETTERGB(255,255,255) 29 29 30 #if !defined (MEADOW)31 30 #define FONT_WIDTH(f) \ 32 31 ((f)->bdf ? (f)->bdf->width : (f)->tm.tmAveCharWidth) … … 39 38 #define FONT_MAX_WIDTH(f) \ 40 39 ((f)->bdf ? (f)->bdf->width : (f)->tm.tmMaxCharWidth) 41 #endif /* MEADOW */42 40 43 41 #define CP_DEFAULT 1004 … … 65 63 extern struct frame *x_window_to_frame (); 66 64 67 enum text_cursor_kinds {68 NO_CURSOR = -1,69 FILLED_BOX_CURSOR,70 HOLLOW_BOX_CURSOR,71 BAR_CURSOR72 };73 74 65 /* Structure recording bitmaps and reference count. 75 66 If REFCOUNT is 0 then this record is free to be reused. */ … … 142 133 /* The cursor to use for vertical scroll bars. */ 143 134 Cursor vertical_scroll_bar_cursor; 135 136 /* Resource data base */ 137 XrmDatabase xrdb; 144 138 145 139 /* color palette information. */ … … 197 191 int mouse_face_defer; 198 192 193 /* Nonzero means that the mouse highlight should not be shown. */ 194 int mouse_face_hidden; 195 199 196 int mouse_face_image_state; 200 197 … … 233 230 frame. It differs from w32_focus_frame when we're using a global 234 231 minibuffer. */ 235 struct frame * w32_highlight_frame;232 struct frame *x_highlight_frame; 236 233 237 234 /* Cache of images. */ … … 253 250 254 251 struct w32_display_info *x_display_info_for_name (); 252 253 Lisp_Object display_x_get_resource P_ ((struct w32_display_info *, 254 Lisp_Object, Lisp_Object, 255 Lisp_Object, Lisp_Object)); 255 256 256 257 extern struct w32_display_info *w32_term_init (); … … 305 306 HPALETTE old_palette; 306 307 307 /* Position of the W32 window (x and y offsets in root window). */308 int left_pos;309 int top_pos;310 311 /* Border width of the W32 window as known by the window system. */312 int border_width;313 314 /* Size of the W32 window in pixels. */315 int pixel_height, pixel_width;316 317 /* Height of a line, in pixels. */318 int line_height;319 320 308 /* Here are the Graphics Contexts for the default font. */ 321 309 XGCValues *cursor_gc; /* cursor drawing */ 322 323 /* Width of the internal border. This is a line of background color324 just inside the window's border. When the frame is selected,325 a highlighting is displayed inside the internal border. */326 int internal_border_width;327 310 328 311 /* The window used for this frame. … … 367 350 Cursor nontext_cursor; 368 351 Cursor modeline_cursor; 369 Cursor cross_cursor;352 Cursor hand_cursor; 370 353 Cursor hourglass_cursor; 371 354 Cursor horizontal_drag_cursor; … … 381 364 int needs_exposure; 382 365 383 /* What kind of text cursor is drawn in this window right now?384 (If there is no cursor (phys_cursor_x < 0), then this means nothing.) */385 enum text_cursor_kinds current_cursor;386 387 /* What kind of text cursor should we draw in the future?388 This should always be filled_box_cursor or bar_cursor. */389 enum text_cursor_kinds desired_cursor;390 391 /* Width of bar cursor (if we are using that). */392 int cursor_width;393 394 366 DWORD dwStyle; 395 396 /* The size of the extra width currently allotted for vertical397 scroll bars, in pixels. */398 int vertical_scroll_bar_extra;399 400 /* The extra width currently allotted for the areas in which401 truncation marks, continuation marks, and overlay arrows are402 displayed. */403 int flags_areas_extra;404 405 /* This is the gravity value for the specified window position. */406 int win_gravity;407 408 /* The geometry flags for this window. */409 int size_hint_flags;410 367 411 368 /* This is the Emacs structure for the display this frame is on. */ … … 421 378 /* Nonzero means menubar is currently active. */ 422 379 char menubar_active; 380 381 /* Nonzero means a menu command is being processed. */ 382 char menu_command_in_progress; 423 383 424 384 /* Nonzero means menubar is about to become active, but should be … … 442 402 extern struct w32_output w32term_display; 443 403 404 /* Return the X output data for frame F. */ 405 #define FRAME_X_OUTPUT(f) ((f)->output_data.w32) 406 444 407 /* Return the window associated with the frame F. */ 445 408 #define FRAME_W32_WINDOW(f) ((f)->output_data.w32->window_desc) 409 #define FRAME_X_WINDOW(f) ((f)->output_data.w32->window_desc) 446 410 447 411 #define FRAME_FOREGROUND_PIXEL(f) ((f)->output_data.x->foreground_pixel) … … 449 413 #define FRAME_FONT(f) ((f)->output_data.w32->font) 450 414 #define FRAME_FONTSET(f) ((f)->output_data.w32->fontset) 451 #define FRAME_INTERNAL_BORDER_WIDTH(f) ((f)->output_data.w32->internal_border_width)452 #define FRAME_LINE_HEIGHT(f) ((f)->output_data.w32->line_height)453 /* Width of the default font of frame F. Must be defined by each454 terminal specific header. */455 #define FRAME_DEFAULT_FONT_WIDTH(F) FONT_WIDTH (FRAME_FONT (F))456 415 #define FRAME_BASELINE_OFFSET(f) ((f)->output_data.w32->baseline_offset) 457 416 … … 460 419 #define FRAME_X_DISPLAY_INFO(f) (&one_w32_display_info) 461 420 421 /* This is the `Display *' which frame F is on. */ 422 #define FRAME_X_DISPLAY(f) (0) 423 462 424 /* This is the 'font_info *' which frame F has. */ 463 425 #define FRAME_W32_FONT_TABLE(f) (FRAME_W32_DISPLAY_INFO (f)->font_table) 464 426 465 /* These two really ought to be called FRAME_PIXEL_{WIDTH,HEIGHT}. */466 #define PIXEL_WIDTH(f) ((f)->output_data.w32->pixel_width)467 #define PIXEL_HEIGHT(f) ((f)->output_data.w32->pixel_height)468 469 #define FRAME_DESIRED_CURSOR(f) ((f)->output_data.w32->desired_cursor)470 471 427 /* Value is the smallest width of any character in any font on frame F. */ 472 428 … … 482 438 483 439 #define FRAME_X_IMAGE_CACHE(F) FRAME_W32_DISPLAY_INFO ((F))->image_cache 484 485 486 /* Pixel width of the bitmaps drawn to indicate truncation,487 continuation etc. */488 489 #define FRAME_FLAGS_BITMAP_WIDTH(f) 8490 #define FRAME_FLAGS_BITMAP_HEIGHT(f) 8491 492 /* Total width of areas reserved for drawing truncation bitmaps,493 continuation bitmaps and alike. The width is in canonical char494 units of the frame. This must currently be the case because window495 sizes aren't pixel values. If it weren't the case, we wouldn't be496 able to split windows horizontally nicely. */497 498 #define FRAME_X_FLAGS_AREA_COLS(F) \499 ((2 * FRAME_FLAGS_BITMAP_WIDTH ((F)) + CANON_X_UNIT ((F)) - 1) \500 / CANON_X_UNIT ((F)))501 502 /* Total width of flags areas in pixels. */503 504 #define FRAME_X_FLAGS_AREA_WIDTH(F) \505 (FRAME_X_FLAGS_AREA_COLS ((F)) * CANON_X_UNIT ((F)))506 507 /* Pixel-width of the left flags area. */508 509 #define FRAME_X_LEFT_FLAGS_AREA_WIDTH(F) \510 (FRAME_X_FLAGS_AREA_WIDTH (F) / 2)511 512 /* Pixel-width of the right flags area. Note that we are doing513 integer arithmetic here, so don't loose a pixel if the total514 width is an odd number. */515 516 #define FRAME_X_RIGHT_FLAGS_AREA_WIDTH(F) \517 (FRAME_X_FLAGS_AREA_WIDTH (F) - FRAME_X_FLAGS_AREA_WIDTH (F) / 2)518 519 440 520 441 … … 653 574 text from glomming up against the scroll bar */ 654 575 #define VERTICAL_SCROLL_BAR_WIDTH_TRIM (0) 655 656 657 /* Manipulating pixel sizes and character sizes.658 Knowledge of which factors affect the overall size of the window should659 be hidden in these macros, if that's possible.660 661 Return the upper/left pixel position of the character cell on frame F662 at ROW/COL. */663 #define CHAR_TO_PIXEL_ROW(f, row) \664 ((f)->output_data.w32->internal_border_width \665 + (row) * (f)->output_data.w32->line_height)666 #define CHAR_TO_PIXEL_COL(f, col) \667 ((f)->output_data.w32->internal_border_width \668 + (col) * FONT_WIDTH ((f)->output_data.w32->font))669 670 /* Return the pixel width/height of frame F if it has671 WIDTH columns/HEIGHT rows. */672 #define CHAR_TO_PIXEL_WIDTH(f, width) \673 (CHAR_TO_PIXEL_COL (f, width) \674 + (f)->output_data.w32->vertical_scroll_bar_extra \675 + (f)->output_data.w32->flags_areas_extra \676 + (f)->output_data.w32->internal_border_width)677 #define CHAR_TO_PIXEL_HEIGHT(f, height) \678 (CHAR_TO_PIXEL_ROW (f, height) \679 + (f)->output_data.w32->internal_border_width)680 681 682 /* Return the row/column (zero-based) of the character cell containing683 the pixel on FRAME at ROW/COL. */684 #define PIXEL_TO_CHAR_ROW(f, row) \685 (((row) - (f)->output_data.w32->internal_border_width) \686 / (f)->output_data.w32->line_height)687 #define PIXEL_TO_CHAR_COL(f, col) \688 (((col) - (f)->output_data.w32->internal_border_width) \689 / FONT_WIDTH ((f)->output_data.w32->font))690 691 /* How many columns/rows of text can we fit in WIDTH/HEIGHT pixels on692 frame F? */693 #define PIXEL_TO_CHAR_WIDTH(f, width) \694 (PIXEL_TO_CHAR_COL (f, ((width) \695 - (f)->output_data.w32->internal_border_width \696 - (f)->output_data.w32->flags_areas_extra \697 - (f)->output_data.w32->vertical_scroll_bar_extra)))698 #define PIXEL_TO_CHAR_HEIGHT(f, height) \699 (PIXEL_TO_CHAR_ROW (f, ((height) \700 - (f)->output_data.w32->internal_border_width)))701 576 702 577 … … 730 605 #define MSH_MOUSEWHEEL "MSWHEEL_ROLLMSG" 731 606 #endif /* MSH_MOUSEWHEEL */ 607 #ifndef WM_XBUTTONDOWN 608 #define WM_XBUTTONDOWN (WM_MOUSEWHEEL + 1) 609 #define WM_XBUTTONUP (WM_MOUSEWHEEL + 2) 610 #endif /* WM_XBUTTONDOWN */ 732 611 733 612 #define WM_EMACS_START (WM_USER + 1) … … 747 626 #define WM_EMACS_UNREGISTER_HOT_KEY (WM_EMACS_START + 13) 748 627 #define WM_EMACS_TOGGLE_LOCK_KEY (WM_EMACS_START + 14) 749 #define WM_EMACS_END (WM_EMACS_START + 15) 628 #define WM_EMACS_TRACK_CARET (WM_EMACS_START + 15) 629 #define WM_EMACS_DESTROY_CARET (WM_EMACS_START + 16) 630 #define WM_EMACS_SHOW_CARET (WM_EMACS_START + 17) 631 #define WM_EMACS_HIDE_CARET (WM_EMACS_START + 18) 632 #define WM_EMACS_SETCURSOR (WM_EMACS_START + 19) 633 #define WM_EMACS_END (WM_EMACS_START + 20) 750 634 751 635 #define WND_FONTWIDTH_INDEX (0) … … 835 719 #define APPS_PRESSED 0x2000 836 720 721 /* When compiling on Windows 9x/ME and NT 3.x, the following are not defined 722 (even though they are supported on 98 and ME. */ 723 #ifndef WM_MOUSELEAVE 724 #define WM_MOUSELEAVE 0x02A3 725 #define TME_LEAVE 0x00000002; 726 727 typedef struct tagTRACKMOUSEEVENT 728 { 729 DWORD cbSize; 730 DWORD dwFlags; 731 HWND hwndTrack; 732 DWORD dwHoverTime; 733 } TRACKMOUSEEVENT; 734 #endif 735 837 736 struct image; 838 737 struct face; … … 840 739 XGCValues *XCreateGC (void *, Window, unsigned long, XGCValues *); 841 740 struct frame * check_x_frame (Lisp_Object); 741 Lisp_Object vga_stdcolor_name (int); 742 842 743 EXFUN (Fx_display_color_p, 1); 843 744 EXFUN (Fx_display_grayscale_p, 1); 844 int image_ascent P_ ((struct image *, struct face *)); 745 746 #define FONT_TYPE_FOR_UNIBYTE(font, ch) \ 747 ((font)->bdf ? BDF_1D_FONT : ANSI_FONT) 748 749 #define FONT_TYPE_FOR_MULTIBYTE(font, ch) \ 750 (!(font)->bdf \ 751 ? UNICODE_FONT \ 752 : ((CHARSET_DIMENSION (CHAR_CHARSET ((ch))) == 1) \ 753 ? BDF_1D_FONT : BDF_2D_FONT)) 754 755 typedef DWORD (WINAPI * ClipboardSequence_Proc) (); 756 typedef BOOL (WINAPI * AppendMenuW_Proc) ( 757 IN HMENU, 758 IN UINT, 759 IN UINT_PTR, 760 IN LPCWSTR); 761 762 /* arch-tag: f201d05a-1240-4fc5-8ea4-ca24d4ee5671 763 (do not change this comment) */
