Changeset 4150

Show
Ignore:
Timestamp:
08/22/06 22:12:03 (2 years ago)
Author:
miyoshi
Message:

* mw32term.c: Use FRAME_FOREGROUND_PIXEL and
FRAME_BACKGROUND_PIXEL to get the frame colors. Refer to
ticket:334.

* mw32fns.c (mw32_set_foreground_color): Ditto.

* image.c (get_image_data_from_icon): Ditto.

* mw32term.h (struct mw32_output): New member `x_compatible'.
(struct mw32_output): Removed members `background_pixel' and
`foreground_pixel'. Refer to ticket:334.

Files:

Legend:

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

    r4149 r4150  
     12006-08-22  MIYOSHI Masanori  <miyoshi@meadowy.org> 
     2 
     3        * mw32term.c: Use FRAME_FOREGROUND_PIXEL and 
     4        FRAME_BACKGROUND_PIXEL to get the frame colors.  Refer to 
     5        ticket:334. 
     6 
     7        * mw32fns.c (mw32_set_foreground_color): Ditto. 
     8 
     9        * image.c (get_image_data_from_icon): Ditto. 
     10 
     11        * mw32term.h (struct mw32_output): New member `x_compatible'. 
     12        (struct mw32_output): Removed members `background_pixel' and 
     13        `foreground_pixel'.  Refer to ticket:334. 
     14 
    1152006-08-22  YAMAZAKI Katsuhiro <yamazaki-k@mwe.biglobe.ne.jp> 
    216 
  • trunk/src/image.c

    r4137 r4150  
    98999899                                     RGBQUAD *prgb) 
    99009900{ 
    9901   unsigned long foreground = f->output_data.mw32->foreground_pixel
    9902   unsigned long background = f->output_data.mw32->background_pixel
     9901  unsigned long foreground = FRAME_FOREGROUND_PIXEL (f)
     9902  unsigned long background = FRAME_BACKGROUND_PIXEL (f)
    99039903  Lisp_Object value; 
    99049904  RGBQUAD *pfg = prgb; 
     
    1030710307  hobj_orig = SelectObject (cdc, hbmp); 
    1030810308 
    10309   brush = CreateSolidBrush (f->output_data.mw32->background_pixel); 
     10309  brush = CreateSolidBrush (FRAME_BACKGROUND_PIXEL (f)); 
    1031010310  rect.right = width; 
    1031110311  rect.bottom = height; 
  • trunk/src/mw32fns.c

    r4149 r4150  
    650650 
    651651  fg = mw32_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); 
    652   old_fg = x->foreground_pixel
    653   x->foreground_pixel = fg; 
     652  old_fg = FRAME_FOREGROUND_PIXEL (f)
     653  FRAME_FOREGROUND_PIXEL (f) = fg; 
    654654 
    655655  if (FRAME_MW32_WINDOW (f) != 0) 
     
    674674  bg = mw32_decode_color (f, arg, WHITE_PIX_DEFAULT (f)); 
    675675#if 0 /* TODO: color */ 
    676   unload_color (f, x->background_pixel); 
     676  unload_color (f,   FRAME_BACKGROUND_PIXEL (f)); 
    677677#endif 
    678   x->background_pixel = bg; 
     678  FRAME_BACKGROUND_PIXEL (f) = bg; 
    679679 
    680680  if (FRAME_MW32_WINDOW (f) != 0) 
     
    696696    f->output_data.mw32->mouse_pixel 
    697697      = mw32_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); 
    698   mask_color = f->output_data.mw32->background_pixel
     698  mask_color = FRAME_BACKGROUND_PIXEL (f)
    699699                                /* No invisible pointers. */ 
    700700  if (mask_color == f->output_data.mw32->mouse_pixel 
    701        && mask_color == f->output_data.mw32->background_pixel
    702     f->output_data.mw32->mouse_pixel = f->output_data.mw32->foreground_pixel
     701      && mask_color == FRAME_BACKGROUND_PIXEL (f)
     702    f->output_data.mw32->mouse_pixel = FRAME_FOREGROUND_PIXEL (f)
    703703 
    704704#else 
     
    708708  int count; 
    709709  unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); 
    710   unsigned long mask_color = x->background_pixel
     710  unsigned long mask_color = FRAME_BACKGROUND_PIXEL (f)
    711711 
    712712  /* Don't let pointers be invisible.  */ 
     
    714714    { 
    715715      x_free_colors (f, &pixel, 1); 
    716       pixel = x_copy_color (f, x->foreground_pixel); 
     716      pixel = x_copy_color (f, FRAME_FOREGROUND_PIXEL (f)) 
    717717    } 
    718718 
     
    869869                                    WHITE_PIX_DEFAULT (f)); 
    870870  else 
    871     fore_pixel = out->background_pixel
     871    fore_pixel = FRAME_BACKGROUND_PIXEL (f)
    872872  out->cursor_pixel = mw32_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); 
    873873 
    874874  /* Make sure that the cursor color differs from the background color.  */ 
    875   if (out->cursor_pixel == out->background_pixel
     875  if (out->cursor_pixel == FRAME_BACKGROUND_PIXEL (f)
    876876    { 
    877877      out->cursor_pixel = out->mouse_pixel; 
    878878      if (out->cursor_pixel == fore_pixel) 
    879         fore_pixel = out->background_pixel
     879        fore_pixel = FRAME_BACKGROUND_PIXEL (f)
    880880    } 
    881881  out->cursor_foreground_pixel = fore_pixel; 
     
    901901    } 
    902902  else 
    903     fore_pixel = x->background_pixel
     903    fore_pixel = FRAME_BACKGROUND_PIXEL (f)
    904904 
    905905  pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); 
     
    907907 
    908908  /* Make sure that the cursor color differs from the background color.  */ 
    909   if (pixel == x->background_pixel
     909  if (pixel == FRAME_BACKGROUND_PIXEL (f)
    910910    { 
    911911      if (pixel_allocated_p) 
     
    923923              fore_pixel_allocated_p = 0; 
    924924            } 
    925           fore_pixel = x->background_pixel
     925          fore_pixel = FRAME_BACKGROUND_PIXEL (f)
    926926        } 
    927927    } 
     
    17171717mw32m_flash_window (struct frame *f) 
    17181718{ 
    1719   PIX_TYPE pixel = f->output_data.mw32->foreground_pixel ^ 
    1720                    f->output_data.mw32->background_pixel; 
     1719  PIX_TYPE pixel = FRAME_FOREGROUND_PIXEL (f) ^ FRAME_BACKGROUND_PIXEL (f); 
    17211720  HDC hdc = GetDC (FRAME_MW32_WINDOW (f)); 
    17221721  HBRUSH hbrush = CreateSolidBrush (pixel); 
  • trunk/src/mw32term.c

    r4149 r4150  
    700700mw32_fill_area (struct frame *f, int x0, int y0, int x1, int y1) 
    701701{ 
    702   mw32_fill_area_pix (f, f->output_data.mw32->foreground_pixel, 
    703                       x0, y0, x1, y1); 
     702  mw32_fill_area_pix (f, FRAME_FOREGROUND_PIXEL (f), x0, y0, x1, y1); 
    704703} 
    705704 
     
    707706mw32_clear_native_frame_area (struct frame *f, int x0, int y0, int x1, int y1) 
    708707{ 
    709   mw32_fill_area_pix (f, f->output_data.mw32->background_pixel, 
    710                       x0, y0, x1, y1); 
     708  mw32_fill_area_pix (f, FRAME_BACKGROUND_PIXEL (f), x0, y0, x1, y1); 
    711709} 
    712710 
     
    714712mw32_clear_frame_area (struct frame *f, int x, int y, int width, int height) 
    715713{ 
    716   mw32_fill_area_pix (f, f->output_data.mw32->background_pixel
     714  mw32_fill_area_pix (f, FRAME_BACKGROUND_PIXEL (f)
    717715                      x, y, x + width, y + height); 
    718716} 
  • trunk/src/mw32term.h

    r4119 r4150  
    361361struct mw32_output 
    362362{ 
     363  /* Placeholder for things accessed through output_data.x.  */ 
     364  struct x_output x_compatible; 
     365 
    363366  /* caret bitmap handle */ 
    364367  HBITMAP caret_bitmap; 
     
    441444  /* Pixel values used for various purposes. 
    442445     border_pixel may be -1 meaning use a gray tile.  */ 
    443   PIX_TYPE background_pixel; 
    444   PIX_TYPE foreground_pixel; 
    445446  PIX_TYPE cursor_pixel; 
    446447  PIX_TYPE border_pixel; 
     
    593594   Refer make_terminal_frame()@frame.c for the detail.  These 
    594595   are only for a terminal frame!  */ 
     596/* Now it's safe to use these macros. Miyoshi */ 
    595597#define FRAME_FOREGROUND_PIXEL(f) ((f)->output_data.x->foreground_pixel) 
    596598#define FRAME_BACKGROUND_PIXEL(f) ((f)->output_data.x->background_pixel)