Commit 0c3be554 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

ue Sep 25 12:41:17 2001 Owen Taylor <otaylor@redhat.com>

	* configure.in: Version 1.3.9, interface age 0, binary age 0.

	* configure.in: Require GLib-1.39, Pango 0.20, Atk 0.5.

	* NEWS: Updates.

Mon Sep 24 11:59:09 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkstyle.[ch] (_gtk_draw_insertion_cursor): Shared
	function for drawing cursors between gtkentry/gtklabel/gtktextview.
	Should this be public? It has a bit of an odd interface, but
	custom editing widgets probably should be using it.
	Function will draw with wider width for taller cursors, and
	draws a little indicator arrow to indicate directoin for split
	cursors.

	* gtk/gtktextview.c: Add a "cursor_color" property.

	* gtk/gtktextdisplay.[ch]: Add a cursor_gc parameter to
	gtk_text_layout_draw().

	* gtk/gtkentry.c gtk/gtklabel.c gtk/gtktextdisplay.c: Use
	_gtk_draw_insertion_cursor().

Tue Sep 25 11:22:23 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkcellrenderertext.c gtk/gtktexttag.c: Restore
	the behavior where you could turn family_set (etc) back on
	and get back the values you had before.

	* demos/gtk-demo/stock_browser.c (id_to_macro): Use
	g_string_ascii_up() rather than looping through the
	string ourself.
parent efae27a3
Tue Sep 25 12:41:17 2001 Owen Taylor <otaylor@redhat.com>
* configure.in: Version 1.3.9, interface age 0, binary age 0.
* configure.in: Require GLib-1.39, Pango 0.20, Atk 0.5.
* NEWS: Updates.
Mon Sep 24 11:59:09 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.[ch] (_gtk_draw_insertion_cursor): Shared
function for drawing cursors between gtkentry/gtklabel/gtktextview.
Should this be public? It has a bit of an odd interface, but
custom editing widgets probably should be using it.
Function will draw with wider width for taller cursors, and
draws a little indicator arrow to indicate directoin for split
cursors.
* gtk/gtktextview.c: Add a "cursor_color" property.
* gtk/gtktextdisplay.[ch]: Add a cursor_gc parameter to
gtk_text_layout_draw().
* gtk/gtkentry.c gtk/gtklabel.c gtk/gtktextdisplay.c: Use
_gtk_draw_insertion_cursor().
Tue Sep 25 11:22:23 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcellrenderertext.c gtk/gtktexttag.c: Restore
the behavior where you could turn family_set (etc) back on
and get back the values you had before.
* demos/gtk-demo/stock_browser.c (id_to_macro): Use
g_string_ascii_up() rather than looping through the
string ourself.
Tue Sep 25 15:32:44 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeviewcolumn.c
......@@ -198,12 +234,14 @@ Thu Sep 20 17:45:54 2001 Joshua N Pritikin <vishnu@pobox.com>
Thu Sep 20 16:20:47 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c (gdk_rgb_allocate_images): Remove unnecessary
call to gdk_image_new_bitmap().
call to gdk_image_new_bitmap(). (#59094, reported by
by Sven Neumann)
Thu Sep 20 15:31:35 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalendar.c (gtk_calendar_init): Use the current
day, as well as the current month and year.
(#59047, reported by Vitaly Tishkov)
Thu Sep 20 15:10:30 2001 Owen Taylor <otaylor@redhat.com>
......
Tue Sep 25 12:41:17 2001 Owen Taylor <otaylor@redhat.com>
* configure.in: Version 1.3.9, interface age 0, binary age 0.
* configure.in: Require GLib-1.39, Pango 0.20, Atk 0.5.
* NEWS: Updates.
Mon Sep 24 11:59:09 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.[ch] (_gtk_draw_insertion_cursor): Shared
function for drawing cursors between gtkentry/gtklabel/gtktextview.
Should this be public? It has a bit of an odd interface, but
custom editing widgets probably should be using it.
Function will draw with wider width for taller cursors, and
draws a little indicator arrow to indicate directoin for split
cursors.
* gtk/gtktextview.c: Add a "cursor_color" property.
* gtk/gtktextdisplay.[ch]: Add a cursor_gc parameter to
gtk_text_layout_draw().
* gtk/gtkentry.c gtk/gtklabel.c gtk/gtktextdisplay.c: Use
_gtk_draw_insertion_cursor().
Tue Sep 25 11:22:23 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcellrenderertext.c gtk/gtktexttag.c: Restore
the behavior where you could turn family_set (etc) back on
and get back the values you had before.
* demos/gtk-demo/stock_browser.c (id_to_macro): Use
g_string_ascii_up() rather than looping through the
string ourself.
Tue Sep 25 15:32:44 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeviewcolumn.c
......@@ -198,12 +234,14 @@ Thu Sep 20 17:45:54 2001 Joshua N Pritikin <vishnu@pobox.com>
Thu Sep 20 16:20:47 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c (gdk_rgb_allocate_images): Remove unnecessary
call to gdk_image_new_bitmap().
call to gdk_image_new_bitmap(). (#59094, reported by
by Sven Neumann)
Thu Sep 20 15:31:35 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalendar.c (gtk_calendar_init): Use the current
day, as well as the current month and year.
(#59047, reported by Vitaly Tishkov)
Thu Sep 20 15:10:30 2001 Owen Taylor <otaylor@redhat.com>
......
Tue Sep 25 12:41:17 2001 Owen Taylor <otaylor@redhat.com>
* configure.in: Version 1.3.9, interface age 0, binary age 0.
* configure.in: Require GLib-1.39, Pango 0.20, Atk 0.5.
* NEWS: Updates.
Mon Sep 24 11:59:09 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.[ch] (_gtk_draw_insertion_cursor): Shared
function for drawing cursors between gtkentry/gtklabel/gtktextview.
Should this be public? It has a bit of an odd interface, but
custom editing widgets probably should be using it.
Function will draw with wider width for taller cursors, and
draws a little indicator arrow to indicate directoin for split
cursors.
* gtk/gtktextview.c: Add a "cursor_color" property.
* gtk/gtktextdisplay.[ch]: Add a cursor_gc parameter to
gtk_text_layout_draw().
* gtk/gtkentry.c gtk/gtklabel.c gtk/gtktextdisplay.c: Use
_gtk_draw_insertion_cursor().
Tue Sep 25 11:22:23 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcellrenderertext.c gtk/gtktexttag.c: Restore
the behavior where you could turn family_set (etc) back on
and get back the values you had before.
* demos/gtk-demo/stock_browser.c (id_to_macro): Use
g_string_ascii_up() rather than looping through the
string ourself.
Tue Sep 25 15:32:44 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeviewcolumn.c
......@@ -198,12 +234,14 @@ Thu Sep 20 17:45:54 2001 Joshua N Pritikin <vishnu@pobox.com>
Thu Sep 20 16:20:47 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c (gdk_rgb_allocate_images): Remove unnecessary
call to gdk_image_new_bitmap().
call to gdk_image_new_bitmap(). (#59094, reported by
by Sven Neumann)
Thu Sep 20 15:31:35 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalendar.c (gtk_calendar_init): Use the current
day, as well as the current month and year.
(#59047, reported by Vitaly Tishkov)
Thu Sep 20 15:10:30 2001 Owen Taylor <otaylor@redhat.com>
......
Tue Sep 25 12:41:17 2001 Owen Taylor <otaylor@redhat.com>
* configure.in: Version 1.3.9, interface age 0, binary age 0.
* configure.in: Require GLib-1.39, Pango 0.20, Atk 0.5.
* NEWS: Updates.
Mon Sep 24 11:59:09 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.[ch] (_gtk_draw_insertion_cursor): Shared
function for drawing cursors between gtkentry/gtklabel/gtktextview.
Should this be public? It has a bit of an odd interface, but
custom editing widgets probably should be using it.
Function will draw with wider width for taller cursors, and
draws a little indicator arrow to indicate directoin for split
cursors.
* gtk/gtktextview.c: Add a "cursor_color" property.
* gtk/gtktextdisplay.[ch]: Add a cursor_gc parameter to
gtk_text_layout_draw().
* gtk/gtkentry.c gtk/gtklabel.c gtk/gtktextdisplay.c: Use
_gtk_draw_insertion_cursor().
Tue Sep 25 11:22:23 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcellrenderertext.c gtk/gtktexttag.c: Restore
the behavior where you could turn family_set (etc) back on
and get back the values you had before.
* demos/gtk-demo/stock_browser.c (id_to_macro): Use
g_string_ascii_up() rather than looping through the
string ourself.
Tue Sep 25 15:32:44 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeviewcolumn.c
......@@ -198,12 +234,14 @@ Thu Sep 20 17:45:54 2001 Joshua N Pritikin <vishnu@pobox.com>
Thu Sep 20 16:20:47 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c (gdk_rgb_allocate_images): Remove unnecessary
call to gdk_image_new_bitmap().
call to gdk_image_new_bitmap(). (#59094, reported by
by Sven Neumann)
Thu Sep 20 15:31:35 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalendar.c (gtk_calendar_init): Use the current
day, as well as the current month and year.
(#59047, reported by Vitaly Tishkov)
Thu Sep 20 15:10:30 2001 Owen Taylor <otaylor@redhat.com>
......
Tue Sep 25 12:41:17 2001 Owen Taylor <otaylor@redhat.com>
* configure.in: Version 1.3.9, interface age 0, binary age 0.
* configure.in: Require GLib-1.39, Pango 0.20, Atk 0.5.
* NEWS: Updates.
Mon Sep 24 11:59:09 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.[ch] (_gtk_draw_insertion_cursor): Shared
function for drawing cursors between gtkentry/gtklabel/gtktextview.
Should this be public? It has a bit of an odd interface, but
custom editing widgets probably should be using it.
Function will draw with wider width for taller cursors, and
draws a little indicator arrow to indicate directoin for split
cursors.
* gtk/gtktextview.c: Add a "cursor_color" property.
* gtk/gtktextdisplay.[ch]: Add a cursor_gc parameter to
gtk_text_layout_draw().
* gtk/gtkentry.c gtk/gtklabel.c gtk/gtktextdisplay.c: Use
_gtk_draw_insertion_cursor().
Tue Sep 25 11:22:23 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcellrenderertext.c gtk/gtktexttag.c: Restore
the behavior where you could turn family_set (etc) back on
and get back the values you had before.
* demos/gtk-demo/stock_browser.c (id_to_macro): Use
g_string_ascii_up() rather than looping through the
string ourself.
Tue Sep 25 15:32:44 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeviewcolumn.c
......@@ -198,12 +234,14 @@ Thu Sep 20 17:45:54 2001 Joshua N Pritikin <vishnu@pobox.com>
Thu Sep 20 16:20:47 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c (gdk_rgb_allocate_images): Remove unnecessary
call to gdk_image_new_bitmap().
call to gdk_image_new_bitmap(). (#59094, reported by
by Sven Neumann)
Thu Sep 20 15:31:35 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalendar.c (gtk_calendar_init): Use the current
day, as well as the current month and year.
(#59047, reported by Vitaly Tishkov)
Thu Sep 20 15:10:30 2001 Owen Taylor <otaylor@redhat.com>
......
Tue Sep 25 12:41:17 2001 Owen Taylor <otaylor@redhat.com>
* configure.in: Version 1.3.9, interface age 0, binary age 0.
* configure.in: Require GLib-1.39, Pango 0.20, Atk 0.5.
* NEWS: Updates.
Mon Sep 24 11:59:09 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.[ch] (_gtk_draw_insertion_cursor): Shared
function for drawing cursors between gtkentry/gtklabel/gtktextview.
Should this be public? It has a bit of an odd interface, but
custom editing widgets probably should be using it.
Function will draw with wider width for taller cursors, and
draws a little indicator arrow to indicate directoin for split
cursors.
* gtk/gtktextview.c: Add a "cursor_color" property.
* gtk/gtktextdisplay.[ch]: Add a cursor_gc parameter to
gtk_text_layout_draw().
* gtk/gtkentry.c gtk/gtklabel.c gtk/gtktextdisplay.c: Use
_gtk_draw_insertion_cursor().
Tue Sep 25 11:22:23 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcellrenderertext.c gtk/gtktexttag.c: Restore
the behavior where you could turn family_set (etc) back on
and get back the values you had before.
* demos/gtk-demo/stock_browser.c (id_to_macro): Use
g_string_ascii_up() rather than looping through the
string ourself.
Tue Sep 25 15:32:44 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeviewcolumn.c
......@@ -198,12 +234,14 @@ Thu Sep 20 17:45:54 2001 Joshua N Pritikin <vishnu@pobox.com>
Thu Sep 20 16:20:47 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c (gdk_rgb_allocate_images): Remove unnecessary
call to gdk_image_new_bitmap().
call to gdk_image_new_bitmap(). (#59094, reported by
by Sven Neumann)
Thu Sep 20 15:31:35 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalendar.c (gtk_calendar_init): Use the current
day, as well as the current month and year.
(#59047, reported by Vitaly Tishkov)
Thu Sep 20 15:10:30 2001 Owen Taylor <otaylor@redhat.com>
......
Tue Sep 25 12:41:17 2001 Owen Taylor <otaylor@redhat.com>
* configure.in: Version 1.3.9, interface age 0, binary age 0.
* configure.in: Require GLib-1.39, Pango 0.20, Atk 0.5.
* NEWS: Updates.
Mon Sep 24 11:59:09 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.[ch] (_gtk_draw_insertion_cursor): Shared
function for drawing cursors between gtkentry/gtklabel/gtktextview.
Should this be public? It has a bit of an odd interface, but
custom editing widgets probably should be using it.
Function will draw with wider width for taller cursors, and
draws a little indicator arrow to indicate directoin for split
cursors.
* gtk/gtktextview.c: Add a "cursor_color" property.
* gtk/gtktextdisplay.[ch]: Add a cursor_gc parameter to
gtk_text_layout_draw().
* gtk/gtkentry.c gtk/gtklabel.c gtk/gtktextdisplay.c: Use
_gtk_draw_insertion_cursor().
Tue Sep 25 11:22:23 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcellrenderertext.c gtk/gtktexttag.c: Restore
the behavior where you could turn family_set (etc) back on
and get back the values you had before.
* demos/gtk-demo/stock_browser.c (id_to_macro): Use
g_string_ascii_up() rather than looping through the
string ourself.
Tue Sep 25 15:32:44 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeviewcolumn.c
......@@ -198,12 +234,14 @@ Thu Sep 20 17:45:54 2001 Joshua N Pritikin <vishnu@pobox.com>
Thu Sep 20 16:20:47 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c (gdk_rgb_allocate_images): Remove unnecessary
call to gdk_image_new_bitmap().
call to gdk_image_new_bitmap(). (#59094, reported by
by Sven Neumann)
Thu Sep 20 15:31:35 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalendar.c (gtk_calendar_init): Use the current
day, as well as the current month and year.
(#59047, reported by Vitaly Tishkov)
Thu Sep 20 15:10:30 2001 Owen Taylor <otaylor@redhat.com>
......
......@@ -20,8 +20,8 @@ GTK+ requires the following packages:
Simple install procedure
========================
% gzip -cd gtk+-1.3.8.tar.gz | tar xvf - # unpack the sources
% cd gtk+-1.3.8 # change to the toplevel directory
% gzip -cd gtk+-1.3.9.tar.gz | tar xvf - # unpack the sources
% cd gtk+-1.3.9 # change to the toplevel directory
% ./configure # run the `configure' script
% make # build GTK
[ Become root if necessary ]
......
Overview of Changes in GTK+ 1.3.9
=================================
* Add editable text cells to GtkTreeView.
Keynav, drawing fixes in GtkTreeView [Jonathan Blandford]
* Text widget no longer always has a \n in it. [Havoc Pennington]
* Text widget bug fixes [Havoc, Dov Grobgeld, Hidetoshi Tajima]
* Allow -1 for width/height in gdk_pixbuf_render_*(). [Matthias Clasen]
* Minor fix for major resizing problems in recent releases [Owen Taylor]
* Restore ability to set _set properties to TRUE for
GtkCellRendererText, GtkTextTag [Owen]
* Cursor drawing improvements [Owen]
* Win32 fixes [Hans Breuer]
* Mark various functions as deprecated or private.
* Misc bug fixes, portability fixes, and cleanups.
Other Contributors:
Vitaly Tishkov, Christian Rose, Frank Belew, Jeff Franks, Sven Neumann,
Kristian Rietveld, Vitaly Tishkov, Joshua N. Pritikin, Matt Wilson,
James Henstridge, Detlef Reichl
Overview of Changes in GTK+ 1.3.8
=================================
......
General Information
===================
This is GTK+ version 1.3.8. GTK+, which stands for the Gimp ToolKit,
This is GTK+ version 1.3.9. GTK+, which stands for the Gimp ToolKit,
is a library for creating graphical user interfaces for the X Window
System. It is designed to be small, efficient, and flexible. GTK+ is
written in C with a very object-oriented approach.
......
......@@ -34,7 +34,7 @@ GLIB_AC_DIVERT_BEFORE_HELP([
#
GTK_MAJOR_VERSION=1
GTK_MINOR_VERSION=3
GTK_MICRO_VERSION=8
GTK_MICRO_VERSION=9
GTK_INTERFACE_AGE=0
GTK_BINARY_AGE=0
GTK_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$GTK_MICRO_VERSION
......@@ -78,9 +78,9 @@ AC_SUBST(GDK_PIXBUF_MICRO)
AC_SUBST(GDK_PIXBUF_VERSION)
## Versions of dependencies
GLIB_REQUIRED_VERSION=1.3.8
PANGO_REQUIRED_VERSION=0.19
ATK_REQUIRED_VERSION=0.4
GLIB_REQUIRED_VERSION=1.3.9
PANGO_REQUIRED_VERSION=0.20
ATK_REQUIRED_VERSION=0.5
# For automake.
VERSION=$GTK_VERSION
......
......@@ -112,14 +112,7 @@ id_to_macro (const gchar *id)
g_string_append (macro, "_STOCK");
g_string_append (macro, cp);
p = macro->str;
while (*p)
{
*p = g_ascii_toupper (*p);
if (*p == '-')
*p = '_';
++p;
}
g_string_ascii_up (macro);
return g_string_free (macro, FALSE);
}
......
......@@ -96,9 +96,9 @@ Creates a new #GtkMenu.
Adds a new #GtkMenuItem to the end of the menu's item list.
</para>
<!-- # Unused Parameters # -->
@menu: a #GtkMenu.
@child: The #GtkMenuItem to add.
<!-- # Unused Parameters # -->
@m:
@c:
......@@ -108,9 +108,9 @@ Adds a new #GtkMenuItem to the end of the menu's item list.
Adds a new #GtkMenuItem to the beginning of the menu's item list.
</para>
<!-- # Unused Parameters # -->
@menu: a #GtkMenu.
@child: The #GtkMenuItem to add.
<!-- # Unused Parameters # -->
@menu_child:
@m:
@c:
......@@ -122,10 +122,10 @@ Adds a new #GtkMenuItem to the menu's item list at the position
indicated by @position.
</para>
<!-- # Unused Parameters # -->
@menu: a #GtkMenu.
@child: The #GtkMenuItem to add.
@pos:
<!-- # Unused Parameters # -->
@position: The position in the item list where @child is added.
Positions are numbered from 0 to n-1.
......
......@@ -668,6 +668,46 @@ set_fg_color (GtkCellRendererText *celltext,
}
}
static PangoFontMask
set_font_desc_fields (PangoFontDescription *desc,
PangoFontMask to_set)
{
PangoFontMask changed_mask = 0;
if (to_set & PANGO_FONT_MASK_FAMILY)
{
const char *family = pango_font_description_get_family (desc);
if (!family)
{
family = "sans";
changed_mask |= PANGO_FONT_MASK_FAMILY;
}
pango_font_description_set_family (desc, family);
}
if (to_set & PANGO_FONT_MASK_STYLE)
pango_font_description_set_style (desc, pango_font_description_get_style (desc));
if (to_set & PANGO_FONT_MASK_VARIANT)
pango_font_description_set_variant (desc, pango_font_description_get_variant (desc));
if (to_set & PANGO_FONT_MASK_WEIGHT)
pango_font_description_set_weight (desc, pango_font_description_get_weight (desc));
if (to_set & PANGO_FONT_MASK_STRETCH)
pango_font_description_set_stretch (desc, pango_font_description_get_stretch (desc));
if (to_set & PANGO_FONT_MASK_SIZE)
{
gint size = pango_font_description_get_size (desc);
if (size <= 0)
{
size = 10 * PANGO_SCALE;
changed_mask |= PANGO_FONT_MASK_SIZE;
}
pango_font_description_set_size (desc, size);
}
return changed_mask;
}
static void
notify_set_changed (GObject *object,
PangoFontMask changed_mask)
......@@ -686,6 +726,24 @@ notify_set_changed (GObject *object,
g_object_notify (object, "size_set");
}
static void
notify_fields_changed (GObject *object,
PangoFontMask changed_mask)
{
if (changed_mask & PANGO_FONT_MASK_FAMILY)
g_object_notify (object, "family");
if (changed_mask & PANGO_FONT_MASK_STYLE)
g_object_notify (object, "style");
if (changed_mask & PANGO_FONT_MASK_VARIANT)
g_object_notify (object, "variant");
if (changed_mask & PANGO_FONT_MASK_WEIGHT)
g_object_notify (object, "weight");
if (changed_mask & PANGO_FONT_MASK_STRETCH)
g_object_notify (object, "stretch");
if (changed_mask & PANGO_FONT_MASK_SIZE)
g_object_notify (object, "size");
}
static void
set_font_description (GtkCellRendererText *celltext,
PangoFontDescription *font_desc)
......@@ -960,8 +1018,18 @@ gtk_cell_renderer_text_set_property (GObject *object,
case PROP_STRETCH_SET:
case PROP_SIZE_SET:
if (!g_value_get_boolean (value))
pango_font_description_unset_fields (celltext->font,
get_property_font_set_mask (param_id));
{
pango_font_description_unset_fields (celltext->font,
get_property_font_set_mask (param_id));
}
else
{
PangoFontMask changed_mask;
changed_mask = set_font_desc_fields (celltext->font,
get_property_font_set_mask (param_id));
notify_fields_changed (G_OBJECT (celltext), changed_mask);
}
break;
case PROP_SCALE_SET:
......
......@@ -2653,6 +2653,7 @@ gtk_entry_draw_cursor (GtkEntry *entry,
if (GTK_WIDGET_DRAWABLE (entry))
{
GtkWidget *widget = GTK_WIDGET (entry);
GdkRectangle cursor_location;
gboolean split_cursor;
gint xoffset = INNER_BORDER - entry->scroll_offset;
......@@ -2660,6 +2661,8 @@ gtk_entry_draw_cursor (GtkEntry *entry,
gint text_area_height;
GdkGC *gc1 = NULL;
GdkGC *gc2 = NULL;
GtkTextDirection dir1 = GTK_TEXT_DIR_NONE;
GtkTextDirection dir2 = GTK_TEXT_DIR_NONE;
gint x1 = 0;
gint x2 = 0;
......@@ -2678,6 +2681,9 @@ gtk_entry_draw_cursor (GtkEntry *entry,
if (weak_x != strong_x)
{
dir1 = widget_direction;
dir2 = (widget_direction == GTK_TEXT_DIR_LTR) ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR;
gc2 = widget->style->text_gc[GTK_STATE_NORMAL];
x2 = weak_x;
}
......@@ -2691,15 +2697,21 @@ gtk_entry_draw_cursor (GtkEntry *entry,
else
x1 = weak_x;
}
cursor_location.x = xoffset + x1;
cursor_location.y = INNER_BORDER;
cursor_location.width = 0;
cursor_location.height = text_area_height - 2 * INNER_BORDER ;
gdk_draw_line (entry->text_area, gc1,
xoffset + x1, INNER_BORDER,
xoffset + x1, text_area_height - INNER_BORDER);
_gtk_draw_insertion_cursor (entry->text_area, gc1,
&cursor_location, dir1);
if (gc2)
gdk_draw_line (entry->text_area, gc2,
xoffset + x2, INNER_BORDER,
xoffset + x2, text_area_height - INNER_BORDER);
{
cursor_location.x = xoffset + x2;
_gtk_draw_insertion_cursor (entry->text_area, gc2,
&cursor_location, dir2);
}
}
}
......
......@@ -1595,13 +1595,16 @@ gtk_label_draw_cursor (GtkLabel *label, gint xoffset, gint yoffset)
if (GTK_WIDGET_DRAWABLE (label))
{
GtkWidget *widget = GTK_WIDGET (label);
GtkTextDirection keymap_direction;
GtkTextDirection widget_direction;
PangoRectangle strong_pos, weak_pos;
gboolean split_cursor;
PangoRectangle *cursor1 = NULL;
PangoRectangle *cursor2 = NULL;
GdkRectangle cursor_location;
GtkTextDirection dir1 = GTK_TEXT_DIR_NONE;
GtkTextDirection dir2 = GTK_TEXT_DIR_NONE;
GdkGC *gc1 = NULL;
GdkGC *gc2 = NULL;
......@@ -1628,6 +1631,9 @@ gtk_label_draw_cursor (GtkLabel *label, gint xoffset, gint yoffset)
if (strong_pos.x != weak_pos.x ||
strong_pos.y != weak_pos.y)
{
dir1 = widget_direction;
dir2 = (widget_direction == GTK_TEXT_DIR_LTR) ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR;
gc2 = widget->style->black_gc;
cursor2 = &weak_pos;
}
......@@ -1642,14 +1648,24 @@ gtk_label_draw_cursor (GtkLabel *label, gint xoffset, gint yoffset)
cursor1 = &weak_pos;
}
gdk_draw_line (widget->window, gc1,
xoffset + PANGO_PIXELS (cursor1->x), yoffset + PANGO_PIXELS (cursor1->y),
xoffset + PANGO_PIXELS (cursor1->x), yoffset + PANGO_PIXELS (cursor1->y + cursor1->height));
cursor_location.x = xoffset + PANGO_PIXELS (cursor1->x);
cursor_location.y = yoffset + PANGO_PIXELS (cursor1->y);
cursor_location.width = 0;
cursor_location.height = PANGO_PIXELS (cursor1->height);
_gtk_draw_insertion_cursor (widget->window, gc1,
&cursor_location, dir1);
if (gc2)
gdk_draw_line (widget->window, gc2,
xoffset + PANGO_PIXELS (cursor2->x), yoffset + PANGO_PIXELS (cursor2->y),
xoffset + PANGO_PIXELS (cursor2->x), yoffset + PANGO_PIXELS (cursor2->y + cursor2->height));
{
cursor_location.x = xoffset + PANGO_PIXELS (cursor2->x);
cursor_location.y = yoffset + PANGO_PIXELS (cursor2->y);
cursor_location.width = 0;
cursor_location.height = PANGO_PIXELS (cursor2->height);
_gtk_draw_insertion_cursor (widget->window, gc2,
&cursor_location, dir2);
}
}
}
......
......@@ -5043,3 +5043,60 @@ gtk_style_set_font (GtkStyle *style,
style->private_font_desc = NULL;
}
}
/**
* _gtk_draw_insertion_cursor:
* @drawable: a #GdkDrawable
* @gc: a #GdkGC
* @location: location where to draw the cursor (@location->width is ignored)
* @dir: text direction for the cursor, used to decide whether to draw a
* directional arrow on the cursor and in what direction. Unless both
* strong and weak cursors are displayed, this should be %GTK_TEXT_DIR_NONE.
*
* Draws a text caret on @drawable at @location. This is not a style function
* but merely a convenience function for drawing the standard cursor shape.
**/
void
_gtk_draw_insertion_cursor (GdkDrawable *drawable,
GdkGC *gc,
GdkRectangle *location,
GtkTextDirection dir)
{
gint stem_width = location->height / 30 + 1;
gint arrow_width = stem_width + 1;
gint x, y;
gint i;
for (i = 0; i < stem_width; i++)
gdk_draw_line (drawable, gc,
location->x + i - stem_width / 2, location->y,
location->x + i - stem_width / 2, location->y + location->height);
if (dir == GTK_TEXT_DIR_RTL)
{
x = location->x - stem_width / 2 - 1;