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

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> Fri Feb 16 14:22:05 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/Makefile.am: Removed gtktreemodelsimple.[ch] * gtk/Makefile.am: Removed gtktreemodelsimple.[ch]
* gtk/gtktreemodelsimple.[ch]: removes * gtk/gtktreemodelsimple.[ch]: removes
2001-02-16 Alexander Larsson <alexl@redhat.com> 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> Fri Feb 16 14:22:05 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/Makefile.am: Removed gtktreemodelsimple.[ch] * gtk/Makefile.am: Removed gtktreemodelsimple.[ch]
* gtk/gtktreemodelsimple.[ch]: removes * gtk/gtktreemodelsimple.[ch]: removes
2001-02-16 Alexander Larsson <alexl@redhat.com> 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> Fri Feb 16 14:22:05 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/Makefile.am: Removed gtktreemodelsimple.[ch] * gtk/Makefile.am: Removed gtktreemodelsimple.[ch]
* gtk/gtktreemodelsimple.[ch]: removes * gtk/gtktreemodelsimple.[ch]: removes
2001-02-16 Alexander Larsson <alexl@redhat.com> 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> Fri Feb 16 14:22:05 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/Makefile.am: Removed gtktreemodelsimple.[ch] * gtk/Makefile.am: Removed gtktreemodelsimple.[ch]
* gtk/gtktreemodelsimple.[ch]: removes * gtk/gtktreemodelsimple.[ch]: removes
2001-02-16 Alexander Larsson <alexl@redhat.com> 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> Fri Feb 16 14:22:05 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/Makefile.am: Removed gtktreemodelsimple.[ch] * gtk/Makefile.am: Removed gtktreemodelsimple.[ch]
* gtk/gtktreemodelsimple.[ch]: removes * gtk/gtktreemodelsimple.[ch]: removes
2001-02-16 Alexander Larsson <alexl@redhat.com> 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> Fri Feb 16 14:22:05 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/Makefile.am: Removed gtktreemodelsimple.[ch] * gtk/Makefile.am: Removed gtktreemodelsimple.[ch]
* gtk/gtktreemodelsimple.[ch]: removes * gtk/gtktreemodelsimple.[ch]: removes
2001-02-16 Alexander Larsson <alexl@redhat.com> 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> Fri Feb 16 14:22:05 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/Makefile.am: Removed gtktreemodelsimple.[ch] * gtk/Makefile.am: Removed gtktreemodelsimple.[ch]
* gtk/gtktreemodelsimple.[ch]: removes * gtk/gtktreemodelsimple.[ch]: removes
2001-02-16 Alexander Larsson <alexl@redhat.com> 2001-02-16 Alexander Larsson <alexl@redhat.com>
......
...@@ -259,7 +259,7 @@ gdk_draw_layout_line_with_colors (GdkDrawable *drawable, ...@@ -259,7 +259,7 @@ gdk_draw_layout_line_with_colors (GdkDrawable *drawable,
tmp.green = foreground->green; 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); stipple, gc);
} }
else else
...@@ -656,10 +656,15 @@ gdk_pango_attr_embossed_new (gboolean embossed) ...@@ -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 * @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 * @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 * Obtains a clip region which contains the areas where the given
* of text would be drawn. @x_origin and @y_origin are the same position * ranges of text would be drawn. @x_origin and @y_origin are the same
* you would pass to gdk_draw_layout_line(). @index_ranges should contain * position you would pass to gdk_draw_layout_line(). @index_ranges
* ranges of bytes in the layout's text. * 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 * Return value: a clip region containing the given ranges
**/ **/
...@@ -673,13 +678,20 @@ gdk_pango_layout_line_get_clip_region (PangoLayoutLine *line, ...@@ -673,13 +678,20 @@ gdk_pango_layout_line_get_clip_region (PangoLayoutLine *line,
GdkRegion *clip_region; GdkRegion *clip_region;
gint i; gint i;
PangoRectangle logical_rect; PangoRectangle logical_rect;
PangoLayoutIter *iter;
gint baseline;
g_return_val_if_fail (line != NULL, NULL); g_return_val_if_fail (line != NULL, NULL);
g_return_val_if_fail (index_ranges != NULL, NULL); g_return_val_if_fail (index_ranges != NULL, NULL);
clip_region = gdk_region_new (); 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; i = 0;
while (i < n_ranges) while (i < n_ranges)
...@@ -688,6 +700,8 @@ gdk_pango_layout_line_get_clip_region (PangoLayoutLine *line, ...@@ -688,6 +700,8 @@ gdk_pango_layout_line_get_clip_region (PangoLayoutLine *line,
gint n_pixel_ranges = 0; gint n_pixel_ranges = 0;
gint j; gint j;
/* Note that get_x_ranges returns layout coordinates
*/
pango_layout_line_get_x_ranges (line, pango_layout_line_get_x_ranges (line,
index_ranges[i*2], index_ranges[i*2],
index_ranges[i*2+1], index_ranges[i*2+1],
...@@ -697,8 +711,8 @@ gdk_pango_layout_line_get_clip_region (PangoLayoutLine *line, ...@@ -697,8 +711,8 @@ gdk_pango_layout_line_get_clip_region (PangoLayoutLine *line,
{ {
GdkRectangle rect; GdkRectangle rect;
rect.x = x_origin + pixel_ranges[2*j] / PANGO_SCALE; rect.x = x_origin + pixel_ranges[2*j] / PANGO_SCALE - logical_rect.x / PANGO_SCALE;
rect.y = y_origin - logical_rect.y / 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.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;
...@@ -706,6 +720,7 @@ gdk_pango_layout_line_get_clip_region (PangoLayoutLine *line, ...@@ -706,6 +720,7 @@ gdk_pango_layout_line_get_clip_region (PangoLayoutLine *line,
} }
g_free (pixel_ranges); g_free (pixel_ranges);
++i;
} }
return clip_region; return clip_region;
......
...@@ -25,14 +25,17 @@ ...@@ -25,14 +25,17 @@
*/ */
#include "gtkalignment.h" #include "gtkalignment.h"
#include "gtkintl.h"
enum { enum {
ARG_0, PROP_0,
ARG_XALIGN,
ARG_YALIGN, PROP_XALIGN,
ARG_XSCALE, PROP_YALIGN,
ARG_YSCALE PROP_XSCALE,
PROP_YSCALE,
PROP_LAST
}; };
...@@ -42,14 +45,16 @@ static void gtk_alignment_size_request (GtkWidget *widget, ...@@ -42,14 +45,16 @@ static void gtk_alignment_size_request (GtkWidget *widget,
GtkRequisition *requisition); GtkRequisition *requisition);
static void gtk_alignment_size_allocate (GtkWidget *widget, static void gtk_alignment_size_allocate (GtkWidget *widget,
GtkAllocation *allocation); GtkAllocation *allocation);
static void gtk_alignment_set_arg (GtkObject *object, static void gtk_alignment_set_property (GObject *object,
GtkArg *arg, guint prop_id,
guint arg_id); const GValue *value,
static void gtk_alignment_get_arg (GtkObject *object, GParamSpec *pspec,
GtkArg *arg, const gchar *trailer);
guint arg_id); static void gtk_alignment_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec,
const gchar *trailer);
GtkType GtkType
gtk_alignment_get_type (void) gtk_alignment_get_type (void)
...@@ -85,13 +90,46 @@ gtk_alignment_class_init (GtkAlignmentClass *class) ...@@ -85,13 +90,46 @@ gtk_alignment_class_init (GtkAlignmentClass *class)
object_class = (GtkObjectClass*) class; object_class = (GtkObjectClass*) class;
widget_class = (GtkWidgetClass*) class; widget_class = (GtkWidgetClass*) class;
gtk_object_add_arg_type ("GtkAlignment::xalign", GTK_TYPE_FLOAT, GTK_ARG_READWRITE, ARG_XALIGN); g_object_class_install_property(G_OBJECT_CLASS(object_class),
gtk_object_add_arg_type ("GtkAlignment::yalign", GTK_TYPE_FLOAT, GTK_ARG_READWRITE, ARG_YALIGN); PROP_XALIGN,
gtk_object_add_arg_type ("GtkAlignment::xscale", GTK_TYPE_FLOAT, GTK_ARG_READWRITE, ARG_XSCALE); g_param_spec_float("xalign",
gtk_object_add_arg_type ("GtkAlignment::yscale", GTK_TYPE_FLOAT, GTK_ARG_READWRITE, ARG_YSCALE); _("Horizontal alignment"),
_("Value between 0.0 and 1.0 to indicate X alignment"),
object_class->set_arg = gtk_alignment_set_arg; 0.0,
object_class->get_arg = gtk_alignment_get_arg; 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_request = gtk_alignment_size_request;
widget_class->size_allocate = gtk_alignment_size_allocate; widget_class->size_allocate = gtk_alignment_size_allocate;
...@@ -126,75 +164,79 @@ gtk_alignment_new (gfloat xalign, ...@@ -126,75 +164,79 @@ gtk_alignment_new (gfloat xalign,
return GTK_WIDGET (alignment); return GTK_WIDGET (alignment);
} }
static void static void gtk_alignment_set_property (GObject *object,
gtk_alignment_set_arg (GtkObject *object, guint prop_id,
GtkArg *arg, const GValue *value,
guint arg_id) GParamSpec *pspec,
const gchar *trailer)
{ {
GtkAlignment *alignment; GtkAlignment *alignment;
alignment = GTK_ALIGNMENT (object); alignment = GTK_ALIGNMENT (object);
switch (arg_id) switch (prop_id)
{ {
case ARG_XALIGN: case PROP_XALIGN:
gtk_alignment_set (alignment, gtk_alignment_set (alignment,
GTK_VALUE_FLOAT (*arg), g_value_get_float(value),
alignment->yalign, alignment->yalign,
alignment->xscale, alignment->xscale,
alignment->yscale); alignment->yscale);
break; break;
case ARG_YALIGN: case PROP_YALIGN:
gtk_alignment_set (alignment, gtk_alignment_set (alignment,
alignment->xalign, alignment->xalign,
GTK_VALUE_FLOAT (*arg), g_value_get_float(value),
alignment->xscale, alignment->xscale,
alignment->yscale); alignment->yscale);
break; break;
case ARG_XSCALE: case PROP_XSCALE:
gtk_alignment_set (alignment, gtk_alignment_set (alignment