Commit be786000 authored by Kim F. Storm's avatar Kim F. Storm

Make (many) trivial substitutions for renamed and

new macros in dispextern.h, frame.h and window.h.
parent c623bbd3
......@@ -34,7 +34,7 @@ Boston, MA 02111-1307, USA. */
#include <gdk/gdkkeysyms.h>
#define FRAME_TOTAL_PIXEL_HEIGHT(f) \
(PIXEL_HEIGHT (f) + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f))
(FRAME_PIXEL_HEIGHT (f) + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f))
......@@ -237,12 +237,12 @@ static void
xg_set_geometry (f)
FRAME_PTR f;
{
if (f->output_data.x->size_hint_flags & USPosition)
if (f->size_hint_flags & USPosition)
{
int left = f->output_data.x->left_pos;
int xneg = f->output_data.x->size_hint_flags & XNegative;
int top = f->output_data.x->top_pos;
int yneg = f->output_data.x->size_hint_flags & YNegative;
int left = f->left_pos;
int xneg = f->size_hint_flags & XNegative;
int top = f->top_pos;
int yneg = f->size_hint_flags & YNegative;
char geom_str[32];
if (xneg)
......@@ -251,7 +251,7 @@ xg_set_geometry (f)
top = -top;
sprintf (geom_str, "=%dx%d%c%d%c%d",
PIXEL_WIDTH (f),
FRAME_PIXEL_WIDTH (f),
FRAME_TOTAL_PIXEL_HEIGHT (f),
(xneg ? '-' : '+'), left,
(yneg ? '-' : '+'), top);
......@@ -273,7 +273,7 @@ xg_resize_outer_widget (f, columns, rows)
int rows;
{
gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
PIXEL_WIDTH (f), FRAME_TOTAL_PIXEL_HEIGHT (f));
FRAME_PIXEL_WIDTH (f), FRAME_TOTAL_PIXEL_HEIGHT (f));
/* base_height is now changed. */
x_wm_set_size_hint (f, 0, 0);
......@@ -317,12 +317,13 @@ xg_resize_widgets (f, pixelwidth, pixelheight)
{
int mbheight = FRAME_MENUBAR_HEIGHT (f);
int tbheight = FRAME_TOOLBAR_HEIGHT (f);
int rows = PIXEL_TO_CHAR_HEIGHT (f, pixelheight - mbheight - tbheight);
int columns = PIXEL_TO_CHAR_WIDTH (f, pixelwidth);
int rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, (pixelheight
- mbheight - tbheight));
int columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixelwidth);
if (FRAME_GTK_WIDGET (f)
&& (columns != FRAME_WIDTH (f) || rows != FRAME_HEIGHT (f)
|| pixelwidth != PIXEL_WIDTH (f) || pixelheight != PIXEL_HEIGHT (f)))
&& (columns != FRAME_COLS (f) || rows != FRAME_LINES (f)
|| pixelwidth != FRAME_PIXEL_WIDTH (f) || pixelheight != FRAME_PIXEL_HEIGHT (f)))
{
struct x_output *x = f->output_data.x;
GtkAllocation all;
......@@ -349,7 +350,7 @@ xg_frame_set_char_size (f, cols, rows)
int cols;
int rows;
{
int pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows)
int pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows)
+ FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f);
int pixelwidth;
......@@ -358,17 +359,14 @@ xg_frame_set_char_size (f, cols, rows)
might end up with a frame width that is not a multiple of the
frame's character width which is bad for vertically split
windows. */
f->output_data.x->vertical_scroll_bar_extra
= (!FRAME_HAS_VERTICAL_SCROLL_BARS (f)
? 0
: (FRAME_SCROLL_BAR_COLS (f)
* FONT_WIDTH (f->output_data.x->font)));
f->scroll_bar_actual_width
= FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f);
compute_fringe_widths (f, 0);
/* CHAR_TO_PIXEL_WIDTH uses vertical_scroll_bar_extra, so call it
/* FRAME_TEXT_COLS_TO_PIXEL_WIDTH uses scroll_bar_actual_width, so call it
after calculating that value. */
pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols);
pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols);
/* Must resize our top level widget. Font size may have changed,
but not rows/cols. */
......@@ -511,9 +509,7 @@ xg_create_frame_widgets (f)
gtk_fixed_set_has_window (GTK_FIXED (wfixed), TRUE);
gtk_widget_set_size_request (wfixed,
PIXEL_WIDTH (f),
PIXEL_HEIGHT (f));
gtk_widget_set_size_request (wfixed, FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f));
gtk_container_add (GTK_CONTAINER (wtop), wvbox);
gtk_box_pack_end (GTK_BOX (wvbox), wfixed, TRUE, TRUE, 0);
......@@ -594,8 +590,8 @@ xg_create_frame_widgets (f)
gtk_widget_modify_style (wfixed, style);
/* GTK does not set any border, and they look bad with GTK. */
f->output_data.x->border_width = 0;
f->output_data.x->internal_border_width = 0;
f->border_width = 0;
f->internal_border_width = 0;
UNBLOCK_INPUT;
......@@ -621,7 +617,7 @@ x_wm_set_size_hint (f, flags, user_position)
gint hint_flags = 0;
int base_width, base_height;
int min_rows = 0, min_cols = 0;
int win_gravity = f->output_data.x->win_gravity;
int win_gravity = f->win_gravity;
if (flags)
{
......@@ -630,18 +626,18 @@ x_wm_set_size_hint (f, flags, user_position)
f->output_data.x->hint_flags = hint_flags;
}
else
flags = f->output_data.x->size_hint_flags;
flags = f->size_hint_flags;
size_hints = f->output_data.x->size_hints;
hint_flags = f->output_data.x->hint_flags;
hint_flags |= GDK_HINT_RESIZE_INC | GDK_HINT_MIN_SIZE;
size_hints.width_inc = FONT_WIDTH (f->output_data.x->font);
size_hints.height_inc = f->output_data.x->line_height;
size_hints.width_inc = FRAME_COLUMN_WIDTH (f);
size_hints.height_inc = FRAME_LINE_HEIGHT (f);
hint_flags |= GDK_HINT_BASE_SIZE;
base_width = CHAR_TO_PIXEL_WIDTH (f, 0);
base_height = CHAR_TO_PIXEL_HEIGHT (f, 0)
base_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 0);
base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 0)
+ FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f);
check_frame_size (f, &min_rows, &min_cols);
......@@ -2298,7 +2294,7 @@ xg_update_frame_menubar (f)
/* The height has changed, resize outer widget and set columns
rows to what we had before adding the menu bar. */
xg_resize_outer_widget (f, FRAME_WIDTH (f), FRAME_HEIGHT (f));
xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f));
SET_FRAME_GARBAGED (f);
UNBLOCK_INPUT;
......@@ -2327,7 +2323,7 @@ free_frame_menubar (f)
/* The height has changed, resize outer widget and set columns
rows to what we had before removing the menu bar. */
xg_resize_outer_widget (f, FRAME_WIDTH (f), FRAME_HEIGHT (f));
xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f));
SET_FRAME_GARBAGED (f);
UNBLOCK_INPUT;
......@@ -2735,7 +2731,7 @@ xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
/* We do the same as for MOTIF in xterm.c, assume 30 chars per line
rather than the real portion value. This makes the thumb less likely
to resize and that looks better. */
portion = XFASTINT (XWINDOW (bar->window)->height) * 30;
portion = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30;
/* When the thumb is at the bottom, position == whole.
So we need to increase `whole' to make space for the thumb. */
whole += portion;
......@@ -2757,7 +2753,7 @@ xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
value = max (value, XG_SB_MIN);
/* Assume all lines are of equal size. */
new_step = size / max (1, FRAME_HEIGHT (f));
new_step = size / max (1, FRAME_LINES (f));
if ((int) adj->page_size != size
|| (int) adj->step_increment != new_step)
......@@ -2857,7 +2853,7 @@ xg_tool_bar_detach_callback (wbox, w, client_data)
/* The height has changed, resize outer widget and set columns
rows to what we had before detaching the tool bar. */
xg_resize_outer_widget (f, FRAME_WIDTH (f), FRAME_HEIGHT (f));
xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f));
}
}
......@@ -2884,7 +2880,7 @@ xg_tool_bar_attach_callback (wbox, w, client_data)
/* The height has changed, resize outer widget and set columns
rows to what we had before detaching the tool bar. */
xg_resize_outer_widget (f, FRAME_WIDTH (f), FRAME_HEIGHT (f));
xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f));
}
}
......@@ -3029,7 +3025,7 @@ xg_create_tool_bar (f)
/* The height has changed, resize outer widget and set columns
rows to what we had before adding the tool bar. */
xg_resize_outer_widget (f, FRAME_WIDTH (f), FRAME_HEIGHT (f));
xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f));
SET_FRAME_GARBAGED (f);
}
......@@ -3202,7 +3198,7 @@ update_frame_tool_bar (f)
if (old_req.height != new_req.height)
{
FRAME_TOOLBAR_HEIGHT (f) = new_req.height;
xg_resize_outer_widget (f, FRAME_WIDTH (f), FRAME_HEIGHT (f));
xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f));
}
if (icon_list) g_list_free (icon_list);
......@@ -3227,7 +3223,7 @@ free_frame_tool_bar (f)
/* The height has changed, resize outer widget and set columns
rows to what we had before removing the tool bar. */
xg_resize_outer_widget (f, FRAME_WIDTH (f), FRAME_HEIGHT (f));
xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f));
SET_FRAME_GARBAGED (f);
UNBLOCK_INPUT;
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment