Commit 08add3cd authored by Havoc Pennington's avatar Havoc Pennington Committed by Havoc Pennington

convert the X coordinates so they're with respect to the line, rather than

2001-02-15  Havoc Pennington  <hp@redhat.com>

	* gdk/gdkpango.c (gdk_pango_layout_line_get_clip_region): convert
	the X coordinates so they're with respect to the line, rather than
	with respect to the layout.

	* gtk/gtkalignment.c: Convert to new property API, patch from Lee
	Mallabone

	* gtk/testgtk.c (create_range_controls): add vscale tests,
	and inverted test

	* gtk/gtkrange.c (gtk_range_set_inverted): new function to fix
	#50806

	* gtk/gtkentry.c (gtk_entry_get_text): add G_CONST_RETURN

	* gtk/gtktextiter.h (gtk_text_iter_is_last): rename
	gtk_text_iter_is_end

	* gtk/gtktextbuffer.h (gtk_text_buffer_get_last_iter):
	rename gtk_text_buffer_get_end_iter

	* gtk/testgtk.c (create_labels): Add test for selectable

	* gtk/gtkentry.c (gtk_entry_draw_text): Use new GDK API to draw
	the selection stuff. This code is kind of broken since it doesn't
	use the theme engine.

	* gdk/gdkpango.c (gdk_pango_layout_line_get_clip_region):
	fix infinite loop and y offset problem
	(gdk_draw_layout_line_with_colors): fix foreground color handling

        * gtk/gtklabel.h, gtk/gtklabel.c: Implement a "selectable" flag
	that makes the label selectable.

	* gtk/gtklabel.c (gtk_label_style_set): recreate the label's
	layout when the style is set, since fonts etc. could have changed.
parent f139b1c9
2001-02-15 Havoc Pennington <hp@redhat.com>
* gdk/gdkpango.c (gdk_pango_layout_line_get_clip_region): convert
the X coordinates so they're with respect to the line, rather than
with respect to the layout.
* gtk/gtkalignment.c: Convert to new property API, patch from Lee
Mallabone
* gtk/testgtk.c (create_range_controls): add vscale tests,
and inverted test
* gtk/gtkrange.c (gtk_range_set_inverted): new function to fix
#50806
* gtk/gtkentry.c (gtk_entry_get_text): add G_CONST_RETURN
* gtk/gtktextiter.h (gtk_text_iter_is_last): rename
gtk_text_iter_is_end
* gtk/gtktextbuffer.h (gtk_text_buffer_get_last_iter):
rename gtk_text_buffer_get_end_iter
* gtk/testgtk.c (create_labels): Add test for selectable
* gtk/gtkentry.c (gtk_entry_draw_text): Use new GDK API to draw
the selection stuff. This code is kind of broken since it doesn't
use the theme engine.
* gdk/gdkpango.c (gdk_pango_layout_line_get_clip_region):
fix infinite loop and y offset problem
(gdk_draw_layout_line_with_colors): fix foreground color handling
* gtk/gtklabel.h, gtk/gtklabel.c: Implement a "selectable" flag
that makes the label selectable.
* gtk/gtklabel.c (gtk_label_style_set): recreate the label's
layout when the style is set, since fonts etc. could have changed.
Fri Feb 16 14:22:05 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/Makefile.am: Removed gtktreemodelsimple.[ch]
* gtk/gtktreemodelsimple.[ch]: removes
2001-02-16 Alexander Larsson <alexl@redhat.com>
......
2001-02-15 Havoc Pennington <hp@redhat.com>
* gdk/gdkpango.c (gdk_pango_layout_line_get_clip_region): convert
the X coordinates so they're with respect to the line, rather than
with respect to the layout.
* gtk/gtkalignment.c: Convert to new property API, patch from Lee
Mallabone
* gtk/testgtk.c (create_range_controls): add vscale tests,
and inverted test
* gtk/gtkrange.c (gtk_range_set_inverted): new function to fix
#50806
* gtk/gtkentry.c (gtk_entry_get_text): add G_CONST_RETURN
* gtk/gtktextiter.h (gtk_text_iter_is_last): rename
gtk_text_iter_is_end
* gtk/gtktextbuffer.h (gtk_text_buffer_get_last_iter):
rename gtk_text_buffer_get_end_iter
* gtk/testgtk.c (create_labels): Add test for selectable
* gtk/gtkentry.c (gtk_entry_draw_text): Use new GDK API to draw
the selection stuff. This code is kind of broken since it doesn't
use the theme engine.
* gdk/gdkpango.c (gdk_pango_layout_line_get_clip_region):
fix infinite loop and y offset problem
(gdk_draw_layout_line_with_colors): fix foreground color handling
* gtk/gtklabel.h, gtk/gtklabel.c: Implement a "selectable" flag
that makes the label selectable.
* gtk/gtklabel.c (gtk_label_style_set): recreate the label's
layout when the style is set, since fonts etc. could have changed.
Fri Feb 16 14:22:05 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/Makefile.am: Removed gtktreemodelsimple.[ch]
* gtk/gtktreemodelsimple.[ch]: removes
2001-02-16 Alexander Larsson <alexl@redhat.com>
......
2001-02-15 Havoc Pennington <hp@redhat.com>
* gdk/gdkpango.c (gdk_pango_layout_line_get_clip_region): convert
the X coordinates so they're with respect to the line, rather than
with respect to the layout.
* gtk/gtkalignment.c: Convert to new property API, patch from Lee
Mallabone
* gtk/testgtk.c (create_range_controls): add vscale tests,
and inverted test
* gtk/gtkrange.c (gtk_range_set_inverted): new function to fix
#50806
* gtk/gtkentry.c (gtk_entry_get_text): add G_CONST_RETURN
* gtk/gtktextiter.h (gtk_text_iter_is_last): rename
gtk_text_iter_is_end
* gtk/gtktextbuffer.h (gtk_text_buffer_get_last_iter):
rename gtk_text_buffer_get_end_iter
* gtk/testgtk.c (create_labels): Add test for selectable
* gtk/gtkentry.c (gtk_entry_draw_text): Use new GDK API to draw
the selection stuff. This code is kind of broken since it doesn't
use the theme engine.
* gdk/gdkpango.c (gdk_pango_layout_line_get_clip_region):
fix infinite loop and y offset problem
(gdk_draw_layout_line_with_colors): fix foreground color handling
* gtk/gtklabel.h, gtk/gtklabel.c: Implement a "selectable" flag
that makes the label selectable.
* gtk/gtklabel.c (gtk_label_style_set): recreate the label's
layout when the style is set, since fonts etc. could have changed.
Fri Feb 16 14:22:05 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/Makefile.am: Removed gtktreemodelsimple.[ch]
* gtk/gtktreemodelsimple.[ch]: removes
2001-02-16 Alexander Larsson <alexl@redhat.com>
......
2001-02-15 Havoc Pennington <hp@redhat.com>
* gdk/gdkpango.c (gdk_pango_layout_line_get_clip_region): convert
the X coordinates so they're with respect to the line, rather than
with respect to the layout.
* gtk/gtkalignment.c: Convert to new property API, patch from Lee
Mallabone
* gtk/testgtk.c (create_range_controls): add vscale tests,
and inverted test
* gtk/gtkrange.c (gtk_range_set_inverted): new function to fix
#50806
* gtk/gtkentry.c (gtk_entry_get_text): add G_CONST_RETURN
* gtk/gtktextiter.h (gtk_text_iter_is_last): rename
gtk_text_iter_is_end
* gtk/gtktextbuffer.h (gtk_text_buffer_get_last_iter):
rename gtk_text_buffer_get_end_iter
* gtk/testgtk.c (create_labels): Add test for selectable
* gtk/gtkentry.c (gtk_entry_draw_text): Use new GDK API to draw
the selection stuff. This code is kind of broken since it doesn't
use the theme engine.
* gdk/gdkpango.c (gdk_pango_layout_line_get_clip_region):
fix infinite loop and y offset problem
(gdk_draw_layout_line_with_colors): fix foreground color handling
* gtk/gtklabel.h, gtk/gtklabel.c: Implement a "selectable" flag
that makes the label selectable.
* gtk/gtklabel.c (gtk_label_style_set): recreate the label's
layout when the style is set, since fonts etc. could have changed.
Fri Feb 16 14:22:05 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/Makefile.am: Removed gtktreemodelsimple.[ch]
* gtk/gtktreemodelsimple.[ch]: removes
2001-02-16 Alexander Larsson <alexl@redhat.com>
......
2001-02-15 Havoc Pennington <hp@redhat.com>
* gdk/gdkpango.c (gdk_pango_layout_line_get_clip_region): convert
the X coordinates so they're with respect to the line, rather than
with respect to the layout.
* gtk/gtkalignment.c: Convert to new property API, patch from Lee
Mallabone
* gtk/testgtk.c (create_range_controls): add vscale tests,
and inverted test
* gtk/gtkrange.c (gtk_range_set_inverted): new function to fix
#50806
* gtk/gtkentry.c (gtk_entry_get_text): add G_CONST_RETURN
* gtk/gtktextiter.h (gtk_text_iter_is_last): rename
gtk_text_iter_is_end
* gtk/gtktextbuffer.h (gtk_text_buffer_get_last_iter):
rename gtk_text_buffer_get_end_iter
* gtk/testgtk.c (create_labels): Add test for selectable
* gtk/gtkentry.c (gtk_entry_draw_text): Use new GDK API to draw
the selection stuff. This code is kind of broken since it doesn't
use the theme engine.
* gdk/gdkpango.c (gdk_pango_layout_line_get_clip_region):
fix infinite loop and y offset problem
(gdk_draw_layout_line_with_colors): fix foreground color handling
* gtk/gtklabel.h, gtk/gtklabel.c: Implement a "selectable" flag
that makes the label selectable.
* gtk/gtklabel.c (gtk_label_style_set): recreate the label's
layout when the style is set, since fonts etc. could have changed.
Fri Feb 16 14:22:05 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/Makefile.am: Removed gtktreemodelsimple.[ch]
* gtk/gtktreemodelsimple.[ch]: removes
2001-02-16 Alexander Larsson <alexl@redhat.com>
......
2001-02-15 Havoc Pennington <hp@redhat.com>
* gdk/gdkpango.c (gdk_pango_layout_line_get_clip_region): convert
the X coordinates so they're with respect to the line, rather than
with respect to the layout.
* gtk/gtkalignment.c: Convert to new property API, patch from Lee
Mallabone
* gtk/testgtk.c (create_range_controls): add vscale tests,
and inverted test
* gtk/gtkrange.c (gtk_range_set_inverted): new function to fix
#50806
* gtk/gtkentry.c (gtk_entry_get_text): add G_CONST_RETURN
* gtk/gtktextiter.h (gtk_text_iter_is_last): rename
gtk_text_iter_is_end
* gtk/gtktextbuffer.h (gtk_text_buffer_get_last_iter):
rename gtk_text_buffer_get_end_iter
* gtk/testgtk.c (create_labels): Add test for selectable
* gtk/gtkentry.c (gtk_entry_draw_text): Use new GDK API to draw
the selection stuff. This code is kind of broken since it doesn't
use the theme engine.
* gdk/gdkpango.c (gdk_pango_layout_line_get_clip_region):
fix infinite loop and y offset problem
(gdk_draw_layout_line_with_colors): fix foreground color handling
* gtk/gtklabel.h, gtk/gtklabel.c: Implement a "selectable" flag
that makes the label selectable.
* gtk/gtklabel.c (gtk_label_style_set): recreate the label's
layout when the style is set, since fonts etc. could have changed.
Fri Feb 16 14:22:05 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/Makefile.am: Removed gtktreemodelsimple.[ch]
* gtk/gtktreemodelsimple.[ch]: removes
2001-02-16 Alexander Larsson <alexl@redhat.com>
......
2001-02-15 Havoc Pennington <hp@redhat.com>
* gdk/gdkpango.c (gdk_pango_layout_line_get_clip_region): convert
the X coordinates so they're with respect to the line, rather than
with respect to the layout.
* gtk/gtkalignment.c: Convert to new property API, patch from Lee
Mallabone
* gtk/testgtk.c (create_range_controls): add vscale tests,
and inverted test
* gtk/gtkrange.c (gtk_range_set_inverted): new function to fix
#50806
* gtk/gtkentry.c (gtk_entry_get_text): add G_CONST_RETURN
* gtk/gtktextiter.h (gtk_text_iter_is_last): rename
gtk_text_iter_is_end
* gtk/gtktextbuffer.h (gtk_text_buffer_get_last_iter):
rename gtk_text_buffer_get_end_iter
* gtk/testgtk.c (create_labels): Add test for selectable
* gtk/gtkentry.c (gtk_entry_draw_text): Use new GDK API to draw
the selection stuff. This code is kind of broken since it doesn't
use the theme engine.
* gdk/gdkpango.c (gdk_pango_layout_line_get_clip_region):
fix infinite loop and y offset problem
(gdk_draw_layout_line_with_colors): fix foreground color handling
* gtk/gtklabel.h, gtk/gtklabel.c: Implement a "selectable" flag
that makes the label selectable.
* gtk/gtklabel.c (gtk_label_style_set): recreate the label's
layout when the style is set, since fonts etc. could have changed.
Fri Feb 16 14:22:05 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/Makefile.am: Removed gtktreemodelsimple.[ch]
* gtk/gtktreemodelsimple.[ch]: removes
2001-02-16 Alexander Larsson <alexl@redhat.com>
......
......@@ -259,7 +259,7 @@ gdk_draw_layout_line_with_colors (GdkDrawable *drawable,
tmp.green = foreground->green;
}
fg_gc = gdk_pango_get_gc (context, fg_set ? &fg_color : NULL,
fg_gc = gdk_pango_get_gc (context, fg_set ? &tmp : NULL,
stipple, gc);
}
else
......@@ -656,10 +656,15 @@ gdk_pango_attr_embossed_new (gboolean embossed)
* @index_ranges: array of byte indexes into the layout, where even members of array are start indexes and odd elements are end indexes
* @n_ranges: number of ranges in @index_ranges, i.e. half the size of @index_ranges
*
* Obtains a clip region which contains the areas where the given ranges
* of text would be drawn. @x_origin and @y_origin are the same position
* you would pass to gdk_draw_layout_line(). @index_ranges should contain
* ranges of bytes in the layout's text.
* Obtains a clip region which contains the areas where the given
* ranges of text would be drawn. @x_origin and @y_origin are the same
* position you would pass to gdk_draw_layout_line(). @index_ranges
* should contain ranges of bytes in the layout's text. The clip
* region will include space to the left or right of the line (to the
* layout bounding box) if you have indexes above or below the indexes
* contained inside the line. This is to draw the selection all the way
* to the side of the layout. However, the clip region is in line coordinates,
* not layout coordinates.
*
* Return value: a clip region containing the given ranges
**/
......@@ -673,13 +678,20 @@ gdk_pango_layout_line_get_clip_region (PangoLayoutLine *line,
GdkRegion *clip_region;
gint i;
PangoRectangle logical_rect;
PangoLayoutIter *iter;
gint baseline;
g_return_val_if_fail (line != NULL, NULL);
g_return_val_if_fail (index_ranges != NULL, NULL);
clip_region = gdk_region_new ();
pango_layout_line_get_extents (line, NULL, &logical_rect);
iter = pango_layout_get_iter (line->layout);
while (pango_layout_iter_get_line (iter) != line)
pango_layout_iter_next_line (iter);
pango_layout_iter_get_line_extents (iter, NULL, &logical_rect);
baseline = pango_layout_iter_get_baseline (iter);
i = 0;
while (i < n_ranges)
......@@ -687,7 +699,9 @@ gdk_pango_layout_line_get_clip_region (PangoLayoutLine *line,
gint *pixel_ranges = NULL;
gint n_pixel_ranges = 0;
gint j;
/* Note that get_x_ranges returns layout coordinates
*/
pango_layout_line_get_x_ranges (line,
index_ranges[i*2],
index_ranges[i*2+1],
......@@ -696,16 +710,17 @@ gdk_pango_layout_line_get_clip_region (PangoLayoutLine *line,
for (j=0; j < n_pixel_ranges; j++)
{
GdkRectangle rect;
rect.x = x_origin + pixel_ranges[2*j] / PANGO_SCALE;
rect.y = y_origin - logical_rect.y / PANGO_SCALE;
rect.x = x_origin + pixel_ranges[2*j] / PANGO_SCALE - logical_rect.x / PANGO_SCALE;
rect.y = y_origin - (baseline / PANGO_SCALE - logical_rect.y / PANGO_SCALE);
rect.width = (pixel_ranges[2*j + 1] - pixel_ranges[2*j]) / PANGO_SCALE;
rect.height = logical_rect.height / PANGO_SCALE;
rect.height = logical_rect.height / PANGO_SCALE;
gdk_region_union_with_rect (clip_region, &rect);
}
g_free (pixel_ranges);
++i;
}
return clip_region;
......@@ -750,8 +765,8 @@ gdk_pango_layout_get_clip_region (PangoLayout *layout,
GdkRegion *line_region;
gint baseline;
line = pango_layout_iter_get_line (iter);
line = pango_layout_iter_get_line (iter);
pango_layout_iter_get_line_extents (iter, NULL, &logical_rect);
baseline = pango_layout_iter_get_baseline (iter);
......
......@@ -25,14 +25,17 @@
*/
#include "gtkalignment.h"
#include "gtkintl.h"
enum {
ARG_0,
ARG_XALIGN,
ARG_YALIGN,
ARG_XSCALE,
ARG_YSCALE
PROP_0,
PROP_XALIGN,
PROP_YALIGN,
PROP_XSCALE,
PROP_YSCALE,
PROP_LAST
};
......@@ -42,14 +45,16 @@ static void gtk_alignment_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void gtk_alignment_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void gtk_alignment_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_alignment_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_alignment_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec,
const gchar *trailer);
static void gtk_alignment_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec,
const gchar *trailer);
GtkType
gtk_alignment_get_type (void)
......@@ -85,13 +90,46 @@ gtk_alignment_class_init (GtkAlignmentClass *class)
object_class = (GtkObjectClass*) class;
widget_class = (GtkWidgetClass*) class;
gtk_object_add_arg_type ("GtkAlignment::xalign", GTK_TYPE_FLOAT, GTK_ARG_READWRITE, ARG_XALIGN);
gtk_object_add_arg_type ("GtkAlignment::yalign", GTK_TYPE_FLOAT, GTK_ARG_READWRITE, ARG_YALIGN);
gtk_object_add_arg_type ("GtkAlignment::xscale", GTK_TYPE_FLOAT, GTK_ARG_READWRITE, ARG_XSCALE);
gtk_object_add_arg_type ("GtkAlignment::yscale", GTK_TYPE_FLOAT, GTK_ARG_READWRITE, ARG_YSCALE);
object_class->set_arg = gtk_alignment_set_arg;
object_class->get_arg = gtk_alignment_get_arg;
g_object_class_install_property(G_OBJECT_CLASS(object_class),
PROP_XALIGN,
g_param_spec_float("xalign",
_("Horizontal alignment"),
_("Value between 0.0 and 1.0 to indicate X alignment"),
0.0,
1.0,
0.5,
G_PARAM_READABLE | G_PARAM_WRITABLE));
g_object_class_install_property(G_OBJECT_CLASS(object_class),
PROP_YALIGN,
g_param_spec_float("yalign",
_("Vertical alignment"),
_("Value between 0.0 and 1.0 to indicate Y alignment"),
0.0,
1.0,
0.5,
G_PARAM_READABLE | G_PARAM_WRITABLE));
g_object_class_install_property(G_OBJECT_CLASS(object_class),
PROP_XSCALE,
g_param_spec_float("xscale",
_("Horizontal scale"),
_("Value between 0.0 and 1.0 to indicate X scale"),
0.0,
1.0,
0.5,
G_PARAM_READABLE | G_PARAM_WRITABLE));
g_object_class_install_property(G_OBJECT_CLASS(object_class),
PROP_YSCALE,
g_param_spec_float("yscale",
_("Vertical scale"),
_("Value between 0.0 and 1.0 to indicate Y scale"),
0.0,
1.0,
0.5,
G_PARAM_READABLE | G_PARAM_WRITABLE));
G_OBJECT_CLASS(object_class)->set_property = gtk_alignment_set_property;
G_OBJECT_CLASS(object_class)->get_property = gtk_alignment_get_property;
widget_class->size_request = gtk_alignment_size_request;
widget_class->size_allocate = gtk_alignment_size_allocate;
......@@ -126,75 +164,79 @@ gtk_alignment_new (gfloat xalign,
return GTK_WIDGET (alignment);
}
static void
gtk_alignment_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id)
static void gtk_alignment_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec,
const gchar *trailer)
{
GtkAlignment *alignment;
alignment = GTK_ALIGNMENT (object);
switch (arg_id)
switch (prop_id)
{
case ARG_XALIGN:
case PROP_XALIGN:
gtk_alignment_set (alignment,
GTK_VALUE_FLOAT (*arg),
g_value_get_float(value),
alignment->yalign,
alignment->xscale,
alignment->yscale);
break;
case ARG_YALIGN:
case PROP_YALIGN:
gtk_alignment_set (alignment,
alignment->xalign,
GTK_VALUE_FLOAT (*arg),
g_value_get_float(value),
alignment->xscale,
alignment->yscale);
break;
case ARG_XSCALE:
case PROP_XSCALE:
gtk_alignment_set (alignment,
alignment->xalign,
alignment->yalign,
GTK_VALUE_FLOAT (*arg),
g_value_get_float(value),
alignment->yscale);
break;
case ARG_YSCALE:
case PROP_YSCALE:
gtk_alignment_set (alignment,
alignment->xalign,
alignment->yalign,
alignment->xscale,
GTK_VALUE_FLOAT (*arg));
g_value_get_float(value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gtk_alignment_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id)
static void gtk_alignment_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec,
const gchar *trailer)
{
GtkAlignment *alignment;
alignment = GTK_ALIGNMENT (object);
switch (arg_id)
g_assert (GTK_IS_ALIGNMENT(object));
switch (prop_id)
{
case ARG_XALIGN:
GTK_VALUE_FLOAT (*arg) = alignment->xalign;
case PROP_XALIGN:
g_value_set_float(value, alignment->xalign);
break;
case ARG_YALIGN:
GTK_VALUE_FLOAT (*arg) = alignment->yalign;
case PROP_YALIGN:
g_value_set_float(value, alignment->yalign);
break;
case ARG_XSCALE:
GTK_VALUE_FLOAT (*arg) = alignment->xscale;
case PROP_XSCALE:
g_value_set_float(value, alignment->xscale);
break;
case ARG_YSCALE:
GTK_VALUE_FLOAT (*arg) = alignment->yscale;
case PROP_YSCALE:
g_value_set_float(value, alignment->yscale);
break;
default:
arg->type = GTK_TYPE_INVALID;
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
......@@ -206,6 +248,8 @@ gtk_alignment_set (GtkAlignment *alignment,
gfloat xscale,
gfloat yscale)
{
gboolean values_changed = FALSE;
g_return_if_fail (alignment != NULL);
g_return_if_fail (GTK_IS_ALIGNMENT (alignment));
......@@ -214,16 +258,33 @@ gtk_alignment_set (GtkAlignment *alignment,
xscale = CLAMP (xscale, 0.0, 1.0);
yscale = CLAMP (yscale, 0.0, 1.0);
if ((alignment->xalign != xalign) ||
(alignment->yalign != yalign) ||
(alignment->xscale != xscale) ||
(alignment->yscale != yscale))
if (alignment->xalign != xalign)
{
values_changed = TRUE;
alignment->xalign = xalign;
g_object_notify(G_OBJECT(alignment), "xalign");
}
if (alignment->yalign != yalign)
{
values_changed = TRUE;
alignment->yalign = yalign;
g_object_notify(G_OBJECT(alignment), "yalign");
}
if (alignment->xscale != xscale)
{
alignment->xalign = xalign;
alignment->yalign = yalign;
alignment->xscale = xscale;
alignment->yscale = yscale;
values_changed = TRUE;
alignment->xscale = xscale;
g_object_notify(G_OBJECT(alignment), "xscale");
}
if (alignment->yscale != yscale)
{
values_changed = TRUE;
alignment->yscale = yscale;
g_object_notify(G_OBJECT(alignment), "yscale");
}
if (values_changed == TRUE)
{
gtk_widget_size_allocate (GTK_WIDGET (alignment), &(GTK_WIDGET (alignment)->allocation));
gtk_widget_queue_draw (GTK_WIDGET (alignment));
}
......
......@@ -2619,7 +2619,7 @@ gtk_entry_set_editable(GtkEntry *entry,
gtk_editable_set_editable (GTK_EDITABLE (entry), editable);
}
gchar*
G_CONST_RETURN gchar*
gtk_entry_get_text (GtkEntry *entry)
{
g_return_val_if_fail (entry != NULL, NULL);
......
......@@ -149,10 +149,10 @@ void gtk_entry_set_max_length (GtkEntry *entry,
/* Somewhat more convenient than the GtkEditable generic functions
*/
void gtk_entry_set_text (GtkEntry *entry,
const gchar *text);
void gtk_entry_set_text (GtkEntry *entry,
const gchar *text);
/* returns a reference to the text */
gchar* gtk_entry_get_text (GtkEntry *entry);
G_CONST_RETURN gchar* gtk_entry_get_text (GtkEntry *entry);
/* Deprecated compatibility functions
*/
......
This diff is collapsed.
......@@ -47,19 +47,24 @@ extern "C" {
typedef struct _GtkLabel GtkLabel;
typedef struct _GtkLabelClass GtkLabelClass;
typedef struct _GtkLabelSelectionInfo GtkLabelSelectionInfo;
struct _GtkLabel
{
GtkMisc misc;
/*< private >*/
gchar *label;
gchar *pattern;
guint jtype : 2;
guint wrap : 1;
/*< private >*/
PangoLayout *layout;
PangoAttrList *attrs;
GtkLabelSelectionInfo *select_info;
};
struct _GtkLabelClass
......@@ -95,6 +100,14 @@ void gtk_label_set_line_wrap (GtkLabel *label,
guint gtk_label_parse_uline (GtkLabel *label,
const gchar *string);
void gtk_label_set_selectable (GtkLabel *label,
gboolean setting);
gboolean gtk_label_get_selectable (GtkLabel *label);
void gtk_label_select_region (GtkLabel *label,
gint start_offset,
gint end_offset);
#ifndef GTK_DISABLE_COMPAT_H
# define gtk_label_set gtk_label_set_text
#endif /* GTK_DISABLE_COMPAT_H */
......
......@@ -305,6 +305,29 @@ gtk_range_set_adjustment (GtkRange *range,
}
}
void
gtk_range_set_inverted (