diff options
| author | Kim F. Storm | 2003-05-24 22:07:03 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2003-05-24 22:07:03 +0000 |
| commit | 90022f5a3e142d08696bd4d73ac26c308aa762fd (patch) | |
| tree | 9fabbb30a80273beb5fa8c0ebb1cd5325faa2dd9 /src/widget.c | |
| parent | 03e4639645519fba65b1413339f741705bb79078 (diff) | |
| download | emacs-90022f5a3e142d08696bd4d73ac26c308aa762fd.tar.gz emacs-90022f5a3e142d08696bd4d73ac26c308aa762fd.zip | |
Make (few) trivial substitutions for renamed and
new macros in dispextern.h, frame.h and window.h.
Diffstat (limited to 'src/widget.c')
| -rw-r--r-- | src/widget.c | 60 |
1 files changed, 28 insertions, 32 deletions
diff --git a/src/widget.c b/src/widget.c index afb8b700837..eaf8e66e9a9 100644 --- a/src/widget.c +++ b/src/widget.c | |||
| @@ -183,8 +183,8 @@ get_default_char_pixel_size (ew, pixel_width, pixel_height) | |||
| 183 | int* pixel_height; | 183 | int* pixel_height; |
| 184 | { | 184 | { |
| 185 | struct frame* f = ew->emacs_frame.frame; | 185 | struct frame* f = ew->emacs_frame.frame; |
| 186 | *pixel_width = FONT_WIDTH (f->output_data.x->font); | 186 | *pixel_width = FRAME_COLUMN_WIDTH (f); |
| 187 | *pixel_height = f->output_data.x->line_height; | 187 | *pixel_height = FRAME_LINE_HEIGHT (f); |
| 188 | } | 188 | } |
| 189 | 189 | ||
| 190 | static void | 190 | static void |
| @@ -196,8 +196,8 @@ pixel_to_char_size (ew, pixel_width, pixel_height, char_width, char_height) | |||
| 196 | int* char_height; | 196 | int* char_height; |
| 197 | { | 197 | { |
| 198 | struct frame* f = ew->emacs_frame.frame; | 198 | struct frame* f = ew->emacs_frame.frame; |
| 199 | *char_width = PIXEL_TO_CHAR_WIDTH (f, (int) pixel_width); | 199 | *char_width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, (int) pixel_width); |
| 200 | *char_height = PIXEL_TO_CHAR_HEIGHT (f, (int) pixel_height); | 200 | *char_height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, (int) pixel_height); |
| 201 | } | 201 | } |
| 202 | 202 | ||
| 203 | static void | 203 | static void |
| @@ -209,8 +209,8 @@ char_to_pixel_size (ew, char_width, char_height, pixel_width, pixel_height) | |||
| 209 | Dimension* pixel_height; | 209 | Dimension* pixel_height; |
| 210 | { | 210 | { |
| 211 | struct frame* f = ew->emacs_frame.frame; | 211 | struct frame* f = ew->emacs_frame.frame; |
| 212 | *pixel_width = CHAR_TO_PIXEL_WIDTH (f, char_width); | 212 | *pixel_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, char_width); |
| 213 | *pixel_height = CHAR_TO_PIXEL_HEIGHT (f, char_height); | 213 | *pixel_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, char_height); |
| 214 | } | 214 | } |
| 215 | 215 | ||
| 216 | static void | 216 | static void |
| @@ -305,8 +305,8 @@ set_frame_size (ew) | |||
| 305 | */ | 305 | */ |
| 306 | 306 | ||
| 307 | /* Hairily merged geometry */ | 307 | /* Hairily merged geometry */ |
| 308 | unsigned int w = ew->emacs_frame.frame->width; | 308 | unsigned int w = FRAME_COLS (ew->emacs_frame.frame); |
| 309 | unsigned int h = ew->emacs_frame.frame->height; | 309 | unsigned int h = FRAME_LINES (ew->emacs_frame.frame); |
| 310 | 310 | ||
| 311 | Widget wmshell = get_wm_shell ((Widget) ew); | 311 | Widget wmshell = get_wm_shell ((Widget) ew); |
| 312 | /* Each Emacs shell is now independent and top-level. */ | 312 | /* Each Emacs shell is now independent and top-level. */ |
| @@ -420,7 +420,7 @@ set_frame_size (ew) | |||
| 420 | } | 420 | } |
| 421 | #endif /* 0 */ | 421 | #endif /* 0 */ |
| 422 | { | 422 | { |
| 423 | struct frame* frame = ew->emacs_frame.frame; | 423 | struct frame *f = ew->emacs_frame.frame; |
| 424 | Dimension pixel_width, pixel_height; | 424 | Dimension pixel_width, pixel_height; |
| 425 | 425 | ||
| 426 | /* Take into account the size of the scrollbar. Always use the | 426 | /* Take into account the size of the scrollbar. Always use the |
| @@ -428,18 +428,15 @@ set_frame_size (ew) | |||
| 428 | might end up with a frame width that is not a multiple of the | 428 | might end up with a frame width that is not a multiple of the |
| 429 | frame's character width which is bad for vertically split | 429 | frame's character width which is bad for vertically split |
| 430 | windows. */ | 430 | windows. */ |
| 431 | frame->output_data.x->vertical_scroll_bar_extra | 431 | f->scroll_bar_actual_width |
| 432 | = (!FRAME_HAS_VERTICAL_SCROLL_BARS (frame) | 432 | = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f); |
| 433 | ? 0 | ||
| 434 | : (FRAME_SCROLL_BAR_COLS (frame) | ||
| 435 | * FONT_WIDTH (frame->output_data.x->font))); | ||
| 436 | 433 | ||
| 437 | compute_fringe_widths (frame, 0); | 434 | compute_fringe_widths (f, 0); |
| 438 | 435 | ||
| 439 | #if 0 /* This can run Lisp code, and it is dangerous to give | 436 | #if 0 /* This can run Lisp code, and it is dangerous to give |
| 440 | out the frame to Lisp code before it officially exists. | 437 | out the frame to Lisp code before it officially exists. |
| 441 | This is handled in Fx_create_frame so not needed here. */ | 438 | This is handled in Fx_create_frame so not needed here. */ |
| 442 | change_frame_size (frame, h, w, 1, 0, 0); | 439 | change_frame_size (f, h, w, 1, 0, 0); |
| 443 | #endif | 440 | #endif |
| 444 | char_to_pixel_size (ew, w, h, &pixel_width, &pixel_height); | 441 | char_to_pixel_size (ew, w, h, &pixel_width, &pixel_height); |
| 445 | ew->core.width = pixel_width; | 442 | ew->core.width = pixel_width; |
| @@ -645,10 +642,11 @@ static void | |||
| 645 | update_various_frame_slots (ew) | 642 | update_various_frame_slots (ew) |
| 646 | EmacsFrame ew; | 643 | EmacsFrame ew; |
| 647 | { | 644 | { |
| 648 | struct x_output *x = ew->emacs_frame.frame->output_data.x; | 645 | struct frame *f = ew->emacs_frame.frame; |
| 649 | x->pixel_height = ew->core.height + x->menubar_height; | 646 | struct x_output *x = f->output_data.x; |
| 650 | x->pixel_width = ew->core.width; | 647 | FRAME_PIXEL_HEIGHT (f) = ew->core.height + x->menubar_height; |
| 651 | x->internal_border_width = ew->emacs_frame.internal_border_width; | 648 | FRAME_PIXEL_WIDTH (f) = ew->core.width; |
| 649 | f->internal_border_width = ew->emacs_frame.internal_border_width; | ||
| 652 | 650 | ||
| 653 | } | 651 | } |
| 654 | 652 | ||
| @@ -656,11 +654,12 @@ static void | |||
| 656 | update_from_various_frame_slots (ew) | 654 | update_from_various_frame_slots (ew) |
| 657 | EmacsFrame ew; | 655 | EmacsFrame ew; |
| 658 | { | 656 | { |
| 659 | struct x_output *x = ew->emacs_frame.frame->output_data.x; | 657 | struct frame *f = ew->emacs_frame.frame; |
| 660 | ew->core.height = x->pixel_height - x->menubar_height; | 658 | struct x_output *x = f->output_data.x; |
| 661 | ew->core.width = x->pixel_width; | 659 | ew->core.height = FRAME_PIXEL_HEIGHT (f) - x->menubar_height; |
| 660 | ew->core.width = FRAME_PIXEL_WIDTH (f); | ||
| 662 | ew->core.background_pixel = x->background_pixel; | 661 | ew->core.background_pixel = x->background_pixel; |
| 663 | ew->emacs_frame.internal_border_width = x->internal_border_width; | 662 | ew->emacs_frame.internal_border_width = f->internal_border_width; |
| 664 | ew->emacs_frame.font = x->font; | 663 | ew->emacs_frame.font = x->font; |
| 665 | ew->emacs_frame.foreground_pixel = x->foreground_pixel; | 664 | ew->emacs_frame.foreground_pixel = x->foreground_pixel; |
| 666 | ew->emacs_frame.cursor_color = x->cursor_pixel; | 665 | ew->emacs_frame.cursor_color = x->cursor_pixel; |
| @@ -717,7 +716,7 @@ EmacsFrameInitialize (request, new, dum1, dum2) | |||
| 717 | } | 716 | } |
| 718 | 717 | ||
| 719 | /* Update the font field in frame */ | 718 | /* Update the font field in frame */ |
| 720 | ew->emacs_frame.frame->output_data.x->font = ew->emacs_frame.font; | 719 | FRAME_FONT (ew->emacs_frame.frame) = ew->emacs_frame.font; |
| 721 | #endif | 720 | #endif |
| 722 | 721 | ||
| 723 | update_from_various_frame_slots (ew); | 722 | update_from_various_frame_slots (ew); |
| @@ -910,10 +909,8 @@ EmacsFrameSetCharSize (widget, columns, rows) | |||
| 910 | if (columns < 3) columns = 3; /* no way buddy */ | 909 | if (columns < 3) columns = 3; /* no way buddy */ |
| 911 | 910 | ||
| 912 | check_frame_size (f, &rows, &columns); | 911 | check_frame_size (f, &rows, &columns); |
| 913 | f->output_data.x->vertical_scroll_bar_extra | 912 | f->scroll_bar_actual_width |
| 914 | = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f) | 913 | = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f); |
| 915 | ? 0 | ||
| 916 | : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.x->font))); | ||
| 917 | 914 | ||
| 918 | compute_fringe_widths (f, 0); | 915 | compute_fringe_widths (f, 0); |
| 919 | 916 | ||
| @@ -923,7 +920,7 @@ EmacsFrameSetCharSize (widget, columns, rows) | |||
| 923 | /* Something is really strange here wrt to the border width: | 920 | /* Something is really strange here wrt to the border width: |
| 924 | Apparently, XtNwidth and XtNheight include the border, so we have | 921 | Apparently, XtNwidth and XtNheight include the border, so we have |
| 925 | to add it here. But the XtNborderWidth set for the widgets has | 922 | to add it here. But the XtNborderWidth set for the widgets has |
| 926 | no similarity to what f->output_data.x->border_width is set to. */ | 923 | no similarity to what f->border_width is set to. */ |
| 927 | XtVaGetValues (widget, XtNborderWidth, &border_width, NULL); | 924 | XtVaGetValues (widget, XtNborderWidth, &border_width, NULL); |
| 928 | pixel_height += 2 * border_width; | 925 | pixel_height += 2 * border_width; |
| 929 | pixel_width += 2 * border_width; | 926 | pixel_width += 2 * border_width; |
| @@ -1017,6 +1014,5 @@ widget_store_internal_border (widget) | |||
| 1017 | EmacsFrame ew = (EmacsFrame) widget; | 1014 | EmacsFrame ew = (EmacsFrame) widget; |
| 1018 | FRAME_PTR f = ew->emacs_frame.frame; | 1015 | FRAME_PTR f = ew->emacs_frame.frame; |
| 1019 | 1016 | ||
| 1020 | ew->emacs_frame.internal_border_width | 1017 | ew->emacs_frame.internal_border_width = f->internal_border_width; |
| 1021 | = f->output_data.x->internal_border_width; | ||
| 1022 | } | 1018 | } |