[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/gtkutil.c
From: |
Kim F. Storm |
Subject: |
[Emacs-diffs] Changes to emacs/src/gtkutil.c |
Date: |
Sat, 24 May 2003 17:58:42 -0400 |
Index: emacs/src/gtkutil.c
diff -c emacs/src/gtkutil.c:1.28 emacs/src/gtkutil.c:1.29
*** emacs/src/gtkutil.c:1.28 Fri May 2 08:20:16 2003
--- emacs/src/gtkutil.c Sat May 24 17:58:42 2003
***************
*** 34,40 ****
#include <gdk/gdkkeysyms.h>
#define FRAME_TOTAL_PIXEL_HEIGHT(f) \
! (PIXEL_HEIGHT (f) + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f))
--- 34,40 ----
#include <gdk/gdkkeysyms.h>
#define FRAME_TOTAL_PIXEL_HEIGHT(f) \
! (FRAME_PIXEL_HEIGHT (f) + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT
(f))
***************
*** 237,248 ****
xg_set_geometry (f)
FRAME_PTR f;
{
! if (f->output_data.x->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;
char geom_str[32];
if (xneg)
--- 237,248 ----
xg_set_geometry (f)
FRAME_PTR f;
{
! if (f->size_hint_flags & USPosition)
{
! 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,257 ****
top = -top;
sprintf (geom_str, "=%dx%d%c%d%c%d",
! PIXEL_WIDTH (f),
FRAME_TOTAL_PIXEL_HEIGHT (f),
(xneg ? '-' : '+'), left,
(yneg ? '-' : '+'), top);
--- 251,257 ----
top = -top;
sprintf (geom_str, "=%dx%d%c%d%c%d",
! FRAME_PIXEL_WIDTH (f),
FRAME_TOTAL_PIXEL_HEIGHT (f),
(xneg ? '-' : '+'), left,
(yneg ? '-' : '+'), top);
***************
*** 273,279 ****
int rows;
{
gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
! PIXEL_WIDTH (f), FRAME_TOTAL_PIXEL_HEIGHT (f));
/* base_height is now changed. */
x_wm_set_size_hint (f, 0, 0);
--- 273,279 ----
int rows;
{
gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
! FRAME_PIXEL_WIDTH (f), FRAME_TOTAL_PIXEL_HEIGHT (f));
/* base_height is now changed. */
x_wm_set_size_hint (f, 0, 0);
***************
*** 317,328 ****
{
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);
if (FRAME_GTK_WIDGET (f)
! && (columns != FRAME_WIDTH (f) || rows != FRAME_HEIGHT (f)
! || pixelwidth != PIXEL_WIDTH (f) || pixelheight != PIXEL_HEIGHT
(f)))
{
struct x_output *x = f->output_data.x;
GtkAllocation all;
--- 317,329 ----
{
int mbheight = FRAME_MENUBAR_HEIGHT (f);
int tbheight = FRAME_TOOLBAR_HEIGHT (f);
! 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_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,355 ****
int cols;
int rows;
{
! int pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows)
+ FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f);
int pixelwidth;
--- 350,356 ----
int cols;
int rows;
{
! int pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows)
+ FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f);
int pixelwidth;
***************
*** 358,374 ****
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)));
compute_fringe_widths (f, 0);
! /* CHAR_TO_PIXEL_WIDTH uses vertical_scroll_bar_extra, so call it
after calculating that value. */
! pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols);
/* Must resize our top level widget. Font size may have changed,
but not rows/cols. */
--- 359,372 ----
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->scroll_bar_actual_width
! = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f);
compute_fringe_widths (f, 0);
! /* FRAME_TEXT_COLS_TO_PIXEL_WIDTH uses scroll_bar_actual_width, so call it
after calculating that value. */
! 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,519 ****
gtk_fixed_set_has_window (GTK_FIXED (wfixed), TRUE);
! gtk_widget_set_size_request (wfixed,
! PIXEL_WIDTH (f),
! PIXEL_HEIGHT (f));
gtk_container_add (GTK_CONTAINER (wtop), wvbox);
gtk_box_pack_end (GTK_BOX (wvbox), wfixed, TRUE, TRUE, 0);
--- 509,515 ----
gtk_fixed_set_has_window (GTK_FIXED (wfixed), TRUE);
! 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,601 ****
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;
UNBLOCK_INPUT;
--- 590,597 ----
gtk_widget_modify_style (wfixed, style);
/* GTK does not set any border, and they look bad with GTK. */
! f->border_width = 0;
! f->internal_border_width = 0;
UNBLOCK_INPUT;
***************
*** 621,627 ****
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;
if (flags)
{
--- 617,623 ----
gint hint_flags = 0;
int base_width, base_height;
int min_rows = 0, min_cols = 0;
! int win_gravity = f->win_gravity;
if (flags)
{
***************
*** 630,647 ****
f->output_data.x->hint_flags = hint_flags;
}
else
! flags = f->output_data.x->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;
hint_flags |= GDK_HINT_BASE_SIZE;
! base_width = CHAR_TO_PIXEL_WIDTH (f, 0);
! base_height = CHAR_TO_PIXEL_HEIGHT (f, 0)
+ FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f);
check_frame_size (f, &min_rows, &min_cols);
--- 626,643 ----
f->output_data.x->hint_flags = hint_flags;
}
else
! 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 = FRAME_COLUMN_WIDTH (f);
! size_hints.height_inc = FRAME_LINE_HEIGHT (f);
hint_flags |= GDK_HINT_BASE_SIZE;
! 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,2304 ****
/* 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));
SET_FRAME_GARBAGED (f);
UNBLOCK_INPUT;
--- 2294,2300 ----
/* 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_COLS (f), FRAME_LINES (f));
SET_FRAME_GARBAGED (f);
UNBLOCK_INPUT;
***************
*** 2327,2333 ****
/* 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));
SET_FRAME_GARBAGED (f);
UNBLOCK_INPUT;
--- 2323,2329 ----
/* 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_COLS (f), FRAME_LINES (f));
SET_FRAME_GARBAGED (f);
UNBLOCK_INPUT;
***************
*** 2735,2741 ****
/* 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;
/* When the thumb is at the bottom, position == whole.
So we need to increase `whole' to make space for the thumb. */
whole += portion;
--- 2731,2737 ----
/* 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 = 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,2763 ****
value = max (value, XG_SB_MIN);
/* Assume all lines are of equal size. */
! new_step = size / max (1, FRAME_HEIGHT (f));
if ((int) adj->page_size != size
|| (int) adj->step_increment != new_step)
--- 2753,2759 ----
value = max (value, XG_SB_MIN);
/* Assume all lines are of equal size. */
! new_step = size / max (1, FRAME_LINES (f));
if ((int) adj->page_size != size
|| (int) adj->step_increment != new_step)
***************
*** 2857,2863 ****
/* 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));
}
}
--- 2853,2859 ----
/* 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_COLS (f), FRAME_LINES (f));
}
}
***************
*** 2884,2890 ****
/* 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));
}
}
--- 2880,2886 ----
/* 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_COLS (f), FRAME_LINES (f));
}
}
***************
*** 3029,3035 ****
/* 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));
SET_FRAME_GARBAGED (f);
}
--- 3025,3031 ----
/* 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_COLS (f), FRAME_LINES (f));
SET_FRAME_GARBAGED (f);
}
***************
*** 3202,3208 ****
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));
}
if (icon_list) g_list_free (icon_list);
--- 3198,3204 ----
if (old_req.height != new_req.height)
{
FRAME_TOOLBAR_HEIGHT (f) = new_req.height;
! xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f));
}
if (icon_list) g_list_free (icon_list);
***************
*** 3227,3233 ****
/* 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));
SET_FRAME_GARBAGED (f);
UNBLOCK_INPUT;
--- 3223,3229 ----
/* 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_COLS (f), FRAME_LINES (f));
SET_FRAME_GARBAGED (f);
UNBLOCK_INPUT;