diff options
| author | Martin Rudalics | 2014-02-04 08:36:58 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2014-02-04 08:36:58 +0100 |
| commit | 764ec9e5f0adaff96b52252eea71eb30ef7cefa1 (patch) | |
| tree | 1aaf762a76e795be19e9a2279db36b496b0d1e15 /src/w32term.c | |
| parent | 6da8227cfa5bc7f428346e78d028a83a385f908f (diff) | |
| download | emacs-764ec9e5f0adaff96b52252eea71eb30ef7cefa1.tar.gz emacs-764ec9e5f0adaff96b52252eea71eb30ef7cefa1.zip | |
Improve window dividers code.
* faces.el (window-divider): New default value. Rewrite
doc-string.
(window-divider-first-pixel, window-divider-last-pixel): New
faces.
* dispextern.h (face_id): Add WINDOW_DIVIDER_FIRST_PIXEL_FACE_ID
and WINDOW_DIVIDER_LAST_PIXEL_FACE_ID.
* w32term.c (w32_draw_window_divider): Handle first and last
pixels specially.
* w32term.h (w32_fill_area_abs): New function.
* xdisp.c (x_draw_right_divider): Don't draw over bottom
divider.
* xfaces.c (realize_basic_faces): Handle new face ids.
* xfns.c (Fx_create_frame): Call x_default_parameter for right
and bottom divider width.
* xterm.c (x_draw_window_divider): Handle first and last pixels
specially.
Diffstat (limited to 'src/w32term.c')
| -rw-r--r-- | src/w32term.c | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/src/w32term.c b/src/w32term.c index 03d5a0047bc..b77d01796d7 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -628,26 +628,38 @@ static void | |||
| 628 | w32_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1) | 628 | w32_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1) |
| 629 | { | 629 | { |
| 630 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 630 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 631 | RECT r; | 631 | HDC hdc = get_frame_dc (f); |
| 632 | HDC hdc; | 632 | struct face *face = FACE_FROM_ID (f, WINDOW_DIVIDER_FACE_ID); |
| 633 | struct face *face; | 633 | struct face *face_first = FACE_FROM_ID (f, WINDOW_DIVIDER_FIRST_PIXEL_FACE_ID); |
| 634 | 634 | struct face *face_last = FACE_FROM_ID (f, WINDOW_DIVIDER_LAST_PIXEL_FACE_ID); | |
| 635 | r.left = x0; | 635 | unsigned long color = face ? face->foreground : FRAME_FOREGROUND_PIXEL (f); |
| 636 | r.right = x1; | 636 | unsigned long color_first = (face_first |
| 637 | r.top = y0; | 637 | ? face_first->foreground |
| 638 | r.bottom = y1; | 638 | : FRAME_FOREGROUND_PIXEL (f)); |
| 639 | 639 | unsigned long color_last = (face_last | |
| 640 | hdc = get_frame_dc (f); | 640 | ? face_last->foreground |
| 641 | face = FACE_FROM_ID (f, WINDOW_DIVIDER_FACE_ID); | 641 | : FRAME_FOREGROUND_PIXEL (f)); |
| 642 | if (face) | 642 | |
| 643 | w32_fill_rect (f, hdc, face->foreground, &r); | 643 | if (y1 - y0 > x1 - x0 && x1 - x0 > 2) |
| 644 | /* Vertical. */ | ||
| 645 | { | ||
| 646 | w32_fill_area_abs (f, hdc, color_first, x0, y0, x0 + 1, y1); | ||
| 647 | w32_fill_area_abs (f, hdc, color, x0 + 1, y0, x1 - 1, y1); | ||
| 648 | w32_fill_area_abs (f, hdc, color_last, x1 - 1, y0, x1, y1); | ||
| 649 | } | ||
| 650 | else if (x1 - x0 > y1 - y0 && y1 - y0 > 3) | ||
| 651 | /* Horizontal. */ | ||
| 652 | { | ||
| 653 | w32_fill_area_abs (f, hdc, color_first, x0, y0, x1, y0 + 1); | ||
| 654 | w32_fill_area_abs (f, hdc, color, x0, y0 + 1, x1, y1 - 1); | ||
| 655 | w32_fill_area_abs (f, hdc, color_last, x0, y1 - 1, x1, y1); | ||
| 656 | } | ||
| 644 | else | 657 | else |
| 645 | w32_fill_rect (f, hdc, FRAME_FOREGROUND_PIXEL (f), &r); | 658 | w32_fill_area_abs (f, hdc, color, x0, y0, x1, y1); |
| 646 | 659 | ||
| 647 | release_frame_dc (f, hdc); | 660 | release_frame_dc (f, hdc); |
| 648 | } | 661 | } |
| 649 | 662 | ||
| 650 | |||
| 651 | /* End update of window W. | 663 | /* End update of window W. |
| 652 | 664 | ||
| 653 | Draw vertical borders between horizontally adjacent windows, and | 665 | Draw vertical borders between horizontally adjacent windows, and |