Changeset 4120

Show
Ignore:
Timestamp:
07/25/06 22:21:26 (2 years ago)
Author:
miyoshi
Message:

* w32term.h: Sync up with Emacs CVS HEAD.

* w32proc.c: Don't include "w32term.h"

* mw32font.c (FONTSET_FROM_ID): Use mw32_get_fontset_table().
(FONTSET_REF_VIA_BASE): Use mw32_fontset_ref_via_base().
(FONTSET_SET): Use mw32_fontset_set().

* fontset.c: Sync up with Emacs CVS HEAD.
(lookup_overriding_fontspec): Validated as a stub.
(mw32_get_fontset_table): New function.
(mw32_fontset_set): Ditto.
(mw32_fontset_ref_via_base): Ditto.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/ChangeLog.Meadow

    r4119 r4120  
     12006-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 
    1172006-07-22  MIYOSHI Masanori  <miyoshi@meadowy.org> 
    218 
  • trunk/src/fontset.c

    r4119 r4120  
    137137 
    138138/* Vector containing all fontsets.  */ 
    139 #ifdef MEADOW 
    140 Lisp_Object Vfontset_table; 
    141 #else 
    142139static Lisp_Object Vfontset_table; 
    143 #endif 
    144140 
    145141/* Next possibly free fontset ID.  Usually this keeps the minimum 
     
    200196static Lisp_Object fontset_ref P_ ((Lisp_Object, int)); 
    201197static Lisp_Object lookup_overriding_fontspec P_ ((Lisp_Object, int)); 
    202 #ifdef MEADOW 
    203 void fontset_set P_ ((Lisp_Object, int, Lisp_Object)); 
    204 #else 
    205198static void fontset_set P_ ((Lisp_Object, int, Lisp_Object)); 
    206 #endif 
    207199static Lisp_Object make_fontset P_ ((Lisp_Object, Lisp_Object, Lisp_Object)); 
    208200static int fontset_id_valid_p P_ ((int)); 
     
    262254 
    263255 
    264 #ifndef MEADOW 
    265256static Lisp_Object 
    266257lookup_overriding_fontspec (frame, c) 
     
    268259     int c; 
    269260{ 
     261#ifndef MEADOW 
    270262  Lisp_Object tail; 
    271263 
     
    300292        } 
    301293    } 
     294#endif /* not MEADOW */ 
    302295  return Qnil; 
    303296} 
    304 #endif /* not MEADOW */ 
    305297 
    306298#define FONTSET_REF_VIA_BASE(fontset, c) fontset_ref_via_base (fontset, &c) 
    307299 
    308 #ifdef MEADOW 
    309 Lisp_Object 
    310 #else 
    311300static Lisp_Object 
    312 #endif 
    313301fontset_ref_via_base (fontset, c) 
    314302     Lisp_Object fontset; 
     
    324312  if (! EQ (FONTSET_BASE (fontset), Vdefault_fontset)) 
    325313    elt = FONTSET_REF (FONTSET_BASE (fontset), *c); 
    326 #ifndef MEADOW 
    327314  if (NILP (elt)) 
    328315    elt = lookup_overriding_fontspec (FONTSET_FRAME (fontset), *c); 
    329 #endif 
    330316  if (NILP (elt)) 
    331317    elt = FONTSET_REF (Vdefault_fontset, *c); 
     
    353339#define FONTSET_SET(fontset, c, newelt) fontset_set(fontset, c, newelt) 
    354340 
    355 #ifdef MEADOW 
    356 void 
    357 #else 
    358341static void 
    359 #endif 
    360342fontset_set (fontset, c, newelt) 
    361343     Lisp_Object fontset; 
     
    632614        elt = FONTSET_REF (fontset, c); 
    633615    } 
    634 #ifndef MEADOW 
    635616  if (NILP (elt)) 
    636617    { 
     
    640621      elt = lookup_overriding_fontspec (frame, c); 
    641622    } 
    642 #endif 
    643623  if (NILP (elt)) 
    644624    elt = FONTSET_REF (Vdefault_fontset, c); 
     
    17521732} 
    17531733 
     1734 
     1735#ifdef MEADOW 
     1736/* export static variables and functions to MEADOW */ 
     1737Lisp_Object 
     1738mw32_get_fontset_table (void) 
     1739{ 
     1740  return Vfontset_table; 
     1741} 
     1742 
     1743void 
     1744mw32_fontset_set (Lisp_Object fontset, int c, Lisp_Object newelt) 
     1745{ 
     1746  fontset_set (fontset, c, newelt); 
     1747} 
     1748 
     1749Lisp_Object 
     1750mw32_fontset_ref_via_base (Lisp_Object fontset, int *c) 
     1751{ 
     1752  return fontset_ref_via_base (fontset, c); 
     1753} 
     1754#endif 
     1755 
     1756 
    17541757/* arch-tag: ea861585-2f5f-4e5b-9849-d04a9c3a3537 
    17551758   (do not change this comment) */ 
  • trunk/src/mw32font.c

    r4117 r4120  
    9393/* for fontset.c. */ 
    9494 
    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); 
     95extern Lisp_Object mw32_get_fontset_table (void); 
     96extern void mw32_fontset_set (Lisp_Object, int, Lisp_Object); 
     97extern Lisp_Object mw32_fontset_ref_via_base (Lisp_Object, int *); 
     98 
    9899#define FONTSET_ID(fontset)             XCHAR_TABLE (fontset)->extras[0] 
    99100#define FONTSET_NAME(fontset)           XCHAR_TABLE (fontset)->extras[1] 
     
    102103#define FONTSET_BASE(fontset)           XCHAR_TABLE (fontset)->parent 
    103104#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) 
    107108 
    108109  
  • trunk/src/w32proc.c

    r4117 r4120  
    6161#include "process.h" 
    6262#include "syssignal.h" 
     63#ifndef MEADOW 
    6364#include "w32term.h" 
     65#endif 
    6466 
    6567#define RVA_TO_PTR(var,section,filedata) \ 
  • trunk/src/w32term.h

    r4119 r4120  
    2828#define WHITE_PIX_DEFAULT(f) PALETTERGB(255,255,255) 
    2929 
    30 #if !defined (MEADOW) 
    3130#define FONT_WIDTH(f)       \ 
    3231  ((f)->bdf ? (f)->bdf->width : (f)->tm.tmAveCharWidth) 
     
    3938#define FONT_MAX_WIDTH(f)   \ 
    4039  ((f)->bdf ? (f)->bdf->width : (f)->tm.tmMaxCharWidth) 
    41 #endif /* MEADOW */ 
    4240 
    4341#define CP_DEFAULT 1004 
     
    6563extern struct frame *x_window_to_frame (); 
    6664 
    67 enum text_cursor_kinds { 
    68   NO_CURSOR = -1, 
    69   FILLED_BOX_CURSOR, 
    70   HOLLOW_BOX_CURSOR, 
    71   BAR_CURSOR 
    72 }; 
    73  
    7465/* Structure recording bitmaps and reference count. 
    7566   If REFCOUNT is 0 then this record is free to be reused.  */ 
     
    142133  /* The cursor to use for vertical scroll bars.  */ 
    143134  Cursor vertical_scroll_bar_cursor; 
     135 
     136  /* Resource data base */ 
     137  XrmDatabase xrdb; 
    144138 
    145139  /* color palette information.  */ 
     
    197191  int mouse_face_defer; 
    198192 
     193  /* Nonzero means that the mouse highlight should not be shown.  */ 
     194  int mouse_face_hidden; 
     195 
    199196  int mouse_face_image_state; 
    200197 
     
    233230     frame.  It differs from w32_focus_frame when we're using a global 
    234231     minibuffer.  */ 
    235   struct frame *w32_highlight_frame; 
     232  struct frame *x_highlight_frame; 
    236233 
    237234  /* Cache of images.  */ 
     
    253250 
    254251struct w32_display_info *x_display_info_for_name (); 
     252 
     253Lisp_Object display_x_get_resource P_ ((struct w32_display_info *, 
     254                                        Lisp_Object, Lisp_Object, 
     255                                        Lisp_Object, Lisp_Object)); 
    255256 
    256257extern struct w32_display_info *w32_term_init (); 
     
    305306  HPALETTE old_palette; 
    306307 
    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  
    320308  /* Here are the Graphics Contexts for the default font.  */ 
    321309  XGCValues *cursor_gc;                         /* cursor drawing */ 
    322  
    323   /* Width of the internal border.  This is a line of background color 
    324      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; 
    327310 
    328311  /* The window used for this frame. 
     
    367350  Cursor nontext_cursor; 
    368351  Cursor modeline_cursor; 
    369   Cursor cross_cursor; 
     352  Cursor hand_cursor; 
    370353  Cursor hourglass_cursor; 
    371354  Cursor horizontal_drag_cursor; 
     
    381364  int needs_exposure; 
    382365 
    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  
    394366  DWORD dwStyle; 
    395  
    396   /* The size of the extra width currently allotted for vertical 
    397      scroll bars, in pixels.  */ 
    398   int vertical_scroll_bar_extra; 
    399  
    400   /* The extra width currently allotted for the areas in which 
    401      truncation marks, continuation marks, and overlay arrows are 
    402      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; 
    410367 
    411368  /* This is the Emacs structure for the display this frame is on.  */ 
     
    421378  /* Nonzero means menubar is currently active.  */ 
    422379  char menubar_active; 
     380 
     381  /* Nonzero means a menu command is being processed.  */ 
     382  char menu_command_in_progress; 
    423383 
    424384  /* Nonzero means menubar is about to become active, but should be 
     
    442402extern struct w32_output w32term_display; 
    443403 
     404/* Return the X output data for frame F.  */ 
     405#define FRAME_X_OUTPUT(f) ((f)->output_data.w32) 
     406 
    444407/* Return the window associated with the frame F.  */ 
    445408#define FRAME_W32_WINDOW(f) ((f)->output_data.w32->window_desc) 
     409#define FRAME_X_WINDOW(f) ((f)->output_data.w32->window_desc) 
    446410 
    447411#define FRAME_FOREGROUND_PIXEL(f) ((f)->output_data.x->foreground_pixel) 
     
    449413#define FRAME_FONT(f) ((f)->output_data.w32->font) 
    450414#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 each 
    454    terminal specific header.  */ 
    455 #define FRAME_DEFAULT_FONT_WIDTH(F)     FONT_WIDTH (FRAME_FONT (F)) 
    456415#define FRAME_BASELINE_OFFSET(f) ((f)->output_data.w32->baseline_offset) 
    457416 
     
    460419#define FRAME_X_DISPLAY_INFO(f) (&one_w32_display_info) 
    461420 
     421/* This is the `Display *' which frame F is on.  */ 
     422#define FRAME_X_DISPLAY(f) (0) 
     423 
    462424/* This is the 'font_info *' which frame F has.  */ 
    463425#define FRAME_W32_FONT_TABLE(f) (FRAME_W32_DISPLAY_INFO (f)->font_table) 
    464426 
    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  
    471427/* Value is the smallest width of any character in any font on frame F.  */ 
    472428 
     
    482438 
    483439#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)     8 
    490 #define FRAME_FLAGS_BITMAP_HEIGHT(f)    8 
    491  
    492 /* Total width of areas reserved for drawing truncation bitmaps, 
    493    continuation bitmaps and alike.  The width is in canonical char 
    494    units of the frame.  This must currently be the case because window 
    495    sizes aren't pixel values.  If it weren't the case, we wouldn't be 
    496    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 doing 
    513    integer arithmetic here, so don't loose a pixel if the total 
    514    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  
    519440 
    520441  
     
    653574   text from glomming up against the scroll bar */ 
    654575#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 should 
    659    be hidden in these macros, if that's possible. 
    660  
    661    Return the upper/left pixel position of the character cell on frame F 
    662    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 has 
    671    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 containing 
    683    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 on 
    692    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))) 
    701576 
    702577  
     
    730605#define MSH_MOUSEWHEEL                 "MSWHEEL_ROLLMSG" 
    731606#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 */ 
    732611 
    733612#define WM_EMACS_START                 (WM_USER + 1) 
     
    747626#define WM_EMACS_UNREGISTER_HOT_KEY    (WM_EMACS_START + 13) 
    748627#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) 
    750634 
    751635#define WND_FONTWIDTH_INDEX    (0) 
     
    835719#define APPS_PRESSED           0x2000 
    836720 
     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 
     727typedef struct tagTRACKMOUSEEVENT 
     728{ 
     729  DWORD cbSize; 
     730  DWORD dwFlags; 
     731  HWND hwndTrack; 
     732  DWORD dwHoverTime; 
     733} TRACKMOUSEEVENT; 
     734#endif 
     735 
    837736struct image; 
    838737struct face; 
     
    840739XGCValues *XCreateGC (void *, Window, unsigned long, XGCValues *); 
    841740struct frame * check_x_frame (Lisp_Object); 
     741Lisp_Object vga_stdcolor_name (int); 
     742 
    842743EXFUN (Fx_display_color_p, 1); 
    843744EXFUN (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 
     755typedef DWORD (WINAPI * ClipboardSequence_Proc) (); 
     756typedef 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) */