[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/xdisp.c
From: |
Kim F . Storm |
Subject: |
[Emacs-diffs] Changes to emacs/src/xdisp.c |
Date: |
Thu, 30 Dec 2004 13:30:28 -0500 |
Index: emacs/src/xdisp.c
diff -c emacs/src/xdisp.c:1.950 emacs/src/xdisp.c:1.951
*** emacs/src/xdisp.c:1.950 Thu Dec 30 12:25:28 2004
--- emacs/src/xdisp.c Thu Dec 30 18:01:59 2004
***************
*** 308,314 ****
Lisp_Object Qslice;
Lisp_Object Qcenter;
Lisp_Object Qmargin, Qpointer;
! Lisp_Object Qline_height, Qtotal;
extern Lisp_Object Qheight;
extern Lisp_Object QCwidth, QCheight, QCascent;
extern Lisp_Object Qscroll_bar;
--- 308,314 ----
Lisp_Object Qslice;
Lisp_Object Qcenter;
Lisp_Object Qmargin, Qpointer;
! Lisp_Object Qline_height;
extern Lisp_Object Qheight;
extern Lisp_Object QCwidth, QCheight, QCascent;
extern Lisp_Object Qscroll_bar;
***************
*** 3290,3296 ****
{
Lisp_Object prop, object;
struct text_pos *position;
! /* Nonzero if some property replaces the display of the text itself. */
int display_replaced_p = 0;
if (STRINGP (it->string))
--- 3290,3296 ----
{
Lisp_Object prop, object;
struct text_pos *position;
! /* Nonzero if some property replaces the display of the text itself. */
int display_replaced_p = 0;
if (STRINGP (it->string))
***************
*** 3455,3461 ****
{
if (FRAME_TERMCAP_P (it->f) || FRAME_MSDOS_P (it->f))
return 0;
!
it->font_height = XCAR (XCDR (spec));
if (!NILP (it->font_height))
{
--- 3455,3461 ----
{
if (FRAME_TERMCAP_P (it->f) || FRAME_MSDOS_P (it->f))
return 0;
!
it->font_height = XCAR (XCDR (spec));
if (!NILP (it->font_height))
{
***************
*** 18791,18814 ****
take_vertical_position_into_account (it);
}
! /* Calculate line-height and line-spacing properties.
! An integer value specifies explicit pixel value.
! A float value specifies relative value to current face height.
! A cons (float . face-name) specifies relative value to
! height of specified face font.
!
! Returns height in pixels, or nil. */
static Lisp_Object
! calc_line_height_property (it, prop, font, boff, total)
struct it *it;
Lisp_Object prop;
- XFontStruct *font;
- int boff, *total;
{
Lisp_Object position, val;
- Lisp_Object face_name = Qnil;
- int ascent, descent, height, override;
if (STRINGP (it->object))
position = make_number (IT_STRING_CHARPOS (*it));
--- 18791,18806 ----
take_vertical_position_into_account (it);
}
! /* Get line-height and line-spacing property at point.
! If line-height has format (HEIGHT TOTAL), return TOTAL
! in TOTAL_HEIGHT. */
static Lisp_Object
! get_line_height_property (it, prop)
struct it *it;
Lisp_Object prop;
{
Lisp_Object position, val;
if (STRINGP (it->object))
position = make_number (IT_STRING_CHARPOS (*it));
***************
*** 18817,18849 ****
else
return Qnil;
! val = Fget_char_property (position, prop, it->object);
! if (NILP (val))
! return val;
! if (total && CONSP (val) && EQ (XCAR (val), Qtotal))
! {
! *total = 1;
! val = XCDR (val);
! }
! if (INTEGERP (val))
return val;
if (CONSP (val))
{
! face_name = XCDR (val);
! val = XCAR (val);
! }
! else if (SYMBOLP (val))
! {
! face_name = val;
! val = Qnil;
}
- override = EQ (prop, Qline_height);
-
if (NILP (face_name))
{
font = FRAME_FONT (it->f);
--- 18809,18852 ----
else
return Qnil;
! return Fget_char_property (position, prop, it->object);
! }
! /* Calculate line-height and line-spacing properties.
! An integer value specifies explicit pixel value.
! A float value specifies relative value to current face height.
! A cons (float . face-name) specifies relative value to
! height of specified face font.
! Returns height in pixels, or nil. */
!
! static Lisp_Object
! calc_line_height_property (it, val, font, boff, override)
! struct it *it;
! Lisp_Object val;
! XFontStruct *font;
! int boff, override;
! {
! Lisp_Object face_name = Qnil;
! int ascent, descent, height;
!
! if (NILP (val) || INTEGERP (val) || (override && EQ (val, Qt)))
return val;
if (CONSP (val))
{
! face_name = XCAR (val);
! val = XCDR (val);
! if (!NUMBERP (val))
! val = make_number (1);
! if (NILP (face_name))
! {
! height = it->ascent + it->descent;
! goto scale;
! }
}
if (NILP (face_name))
{
font = FRAME_FONT (it->f);
***************
*** 18885,18890 ****
--- 18888,18895 ----
}
height = ascent + descent;
+
+ scale:
if (FLOATP (val))
height = (int)(XFLOAT_DATA (val) * height);
else if (INTEGERP (val))
***************
*** 19097,19108 ****
increase that height */
Lisp_Object height;
it->override_ascent = -1;
it->pixel_width = 0;
it->nglyphs = 0;
! height = calc_line_height_property(it, Qline_height, font, boff, 0);
if (it->override_ascent >= 0)
{
--- 19102,19121 ----
increase that height */
Lisp_Object height;
+ Lisp_Object total_height = Qnil;
it->override_ascent = -1;
it->pixel_width = 0;
it->nglyphs = 0;
! height = get_line_height_property(it, Qline_height);
! /* Split (line-height total-height) list */
! if (CONSP (height) && CONSP (XCDR (height)))
! {
! total_height = XCAR (XCDR (height));
! height = XCAR (height);
! }
! height = calc_line_height_property(it, height, font, boff, 1);
if (it->override_ascent >= 0)
{
***************
*** 19116,19122 ****
it->descent = FONT_DESCENT (font) - boff;
}
! if (EQ (height, make_number(0)))
{
if (it->descent > it->max_descent)
{
--- 19129,19135 ----
it->descent = FONT_DESCENT (font) - boff;
}
! if (EQ (height, Qt))
{
if (it->descent > it->max_descent)
{
***************
*** 19152,19162 ****
&& XINT (height) > it->ascent + it->descent)
it->ascent = XINT (height) - it->descent;
! spacing = calc_line_height_property(it, Qline_spacing, font,
boff, &total);
if (INTEGERP (spacing))
{
extra_line_spacing = XINT (spacing);
! if (total)
extra_line_spacing -= (it->phys_ascent + it->phys_descent);
}
}
--- 19165,19181 ----
&& XINT (height) > it->ascent + it->descent)
it->ascent = XINT (height) - it->descent;
! if (!NILP (total_height))
! spacing = calc_line_height_property(it, total_height, font,
boff, 0);
! else
! {
! spacing = get_line_height_property(it, Qline_spacing);
! spacing = calc_line_height_property(it, spacing, font, boff,
0);
! }
if (INTEGERP (spacing))
{
extra_line_spacing = XINT (spacing);
! if (!NILP (total_height))
extra_line_spacing -= (it->phys_ascent + it->phys_descent);
}
}
***************
*** 22174,22181 ****
staticpro (&Qcenter);
Qline_height = intern ("line-height");
staticpro (&Qline_height);
- Qtotal = intern ("total");
- staticpro (&Qtotal);
QCalign_to = intern (":align-to");
staticpro (&QCalign_to);
QCrelative_width = intern (":relative-width");
--- 22193,22198 ----
- [Emacs-diffs] Changes to emacs/src/xdisp.c, Richard M . Stallman, 2004/12/08
- [Emacs-diffs] Changes to emacs/src/xdisp.c, Kim F . Storm, 2004/12/13
- [Emacs-diffs] Changes to emacs/src/xdisp.c, Richard M . Stallman, 2004/12/21
- [Emacs-diffs] Changes to emacs/src/xdisp.c, Richard M . Stallman, 2004/12/27
- [Emacs-diffs] Changes to emacs/src/xdisp.c, Steven Tamm, 2004/12/27
- [Emacs-diffs] Changes to emacs/src/xdisp.c, Richard M . Stallman, 2004/12/28
- [Emacs-diffs] Changes to emacs/src/xdisp.c, Kenichi Handa, 2004/12/30
- [Emacs-diffs] Changes to emacs/src/xdisp.c, Kim F . Storm, 2004/12/30
- [Emacs-diffs] Changes to emacs/src/xdisp.c,
Kim F . Storm <=
- [Emacs-diffs] Changes to emacs/src/xdisp.c, Richard M . Stallman, 2004/12/31