forked from AuroraMiddleware/gtk
Removed the x_set and y_set arguments. Now they are always on and start
2000-01-22 Federico Mena Quintero <federico@helixcode.com> * gdk-pixbuf/gnome-canvas-pixbuf.c (PixbufPrivate): Removed the x_set and y_set arguments. Now they are always on and start with defaults of 0.0 in units. (gnome_canvas_pixbuf_class_init): Likewise. (gnome_canvas_pixbuf_set_arg): Likewise. (gnome_canvas_pixbuf_get_arg): Likewise. (compute_viewport_affine): Likewise; always use the priv->x and priv->y fields. * doc/tmpl/gnome-canvas-pixbuf.sgml: Modified to reflect the removal of the x_set/y_set arguments.
This commit is contained in:
parent
bb8a563730
commit
72ee1f0c50
@ -46,12 +46,6 @@
|
||||
<FLAGS>rw</FLAGS>
|
||||
</ARG>
|
||||
|
||||
<ARG>
|
||||
<NAME>GnomeCanvasPixbuf::x_set</NAME>
|
||||
<TYPE>gboolean</TYPE>
|
||||
<FLAGS>rw</FLAGS>
|
||||
</ARG>
|
||||
|
||||
<ARG>
|
||||
<NAME>GnomeCanvasPixbuf::x_in_pixels</NAME>
|
||||
<TYPE>gboolean</TYPE>
|
||||
@ -64,12 +58,6 @@
|
||||
<FLAGS>rw</FLAGS>
|
||||
</ARG>
|
||||
|
||||
<ARG>
|
||||
<NAME>GnomeCanvasPixbuf::y_set</NAME>
|
||||
<TYPE>gboolean</TYPE>
|
||||
<FLAGS>rw</FLAGS>
|
||||
</ARG>
|
||||
|
||||
<ARG>
|
||||
<NAME>GnomeCanvasPixbuf::y_in_pixels</NAME>
|
||||
<TYPE>gboolean</TYPE>
|
||||
|
@ -63,6 +63,26 @@
|
||||
gdk-pixbuf-io
|
||||
|
||||
|
||||
<!-- ##### ARG GnomeCanvasPixbuf:x_set ##### -->
|
||||
<para>
|
||||
Determines whether the <link
|
||||
linkend="GnomeCanvasPixbuf--x">x</link> argument is used to
|
||||
translate the pixbuf from its logical origin in item-relative
|
||||
coordinates.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GnomeCanvasPixbuf:y_set ##### -->
|
||||
<para>
|
||||
Determines whether the <link
|
||||
linkend="GnomeCanvasPixbuf--y">y</link> argument is used to
|
||||
translate the pixbuf from its logical origin in item-relative
|
||||
coordinates. Works in the same way as the <link
|
||||
linkend="GnomeCanvasPixbuf--x-set">x_set</link> argument. The
|
||||
default is %FALSE.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### USER_FUNCTION ModulePreparedNotifyFunc ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -56,15 +56,9 @@ Canvas item to display #GdkPixbuf images.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The custom translation values are analogously controlled by the
|
||||
<link linkend="GnomeCanvasPixbuf--x-set">x_set</link>, <link
|
||||
linkend="GnomeCanvasPixbuf--y-set">y_set</link>, <link
|
||||
linkend="GnomeCanvasPixbuf--x">x</link>, and <link
|
||||
linkend="GnomeCanvasPixbuf--y">y</link> arguments. The former
|
||||
two control whether the custom translation offsets are used and
|
||||
they are %FALSE by default, and the latter two control the
|
||||
offsets themselves. If a custom translation offset is not used,
|
||||
it is taken to be 0.0 by default. Otherwise, the logical
|
||||
The custom translation offsets are controlled by the <link
|
||||
linkend="GnomeCanvasPixbuf--x">x</link> and <link
|
||||
linkend="GnomeCanvasPixbuf--y">y</link> arguments. The logical
|
||||
upper-left vertex of the image will be translated by the
|
||||
specified distance, aligned with the item's local coordinate
|
||||
system.
|
||||
@ -115,14 +109,7 @@ Canvas item to display #GdkPixbuf images.
|
||||
Likewise, consider a pixbuf item whose (<link
|
||||
linkend="GnomeCanvasPixbuf--x">x</link>, <link
|
||||
linkend="GnomeCanvasPixbuf--y">y</link>) arguments are set to
|
||||
(30, 40)<footnote>
|
||||
<para>
|
||||
This of course assumes that the <link
|
||||
linkend="GnomeCanvasPixbuf--x-set">x_set</link> and <link
|
||||
linkend="GnomeCanvasPixbuf--y-set">y_set</link> arguments
|
||||
are set to %TRUE for the translation offsets to take effect.
|
||||
</para>
|
||||
</footnote>. If the item is then modified by the same scaling
|
||||
(30, 40). If the item is then modified by the same scaling
|
||||
transformation of (0.5, 2.0) but the <link
|
||||
linkend="GnomeCanvasPixbuf--y-in-pixels">y_in_pixels</link>
|
||||
argument is set to %TRUE, then the image's upper-left corner
|
||||
@ -273,18 +260,9 @@ Canvas item to display #GdkPixbuf images.
|
||||
<!-- ##### ARG GnomeCanvasPixbuf:x ##### -->
|
||||
<para>
|
||||
Indicates the horizontal translation offset of the pixbuf item's
|
||||
image. This argument will only be used if the <link
|
||||
linkend="GnomeCanvasPixbuf--x-set">x_set</link> argument is %TRUE.
|
||||
This offset may not actually appear horizontal, since it will be
|
||||
affected by the item's affine transformation.
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GnomeCanvasPixbuf:x_set ##### -->
|
||||
<para>
|
||||
Determines whether the <link
|
||||
linkend="GnomeCanvasPixbuf--x">x</link> argument is used to
|
||||
translate the pixbuf from its logical origin in item-relative
|
||||
coordinates.
|
||||
image. This offset may not actually appear horizontal, since it
|
||||
will be affected by the item's affine transformation. The default
|
||||
is 0.0.
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GnomeCanvasPixbuf:x_in_pixels ##### -->
|
||||
@ -294,31 +272,25 @@ Canvas item to display #GdkPixbuf images.
|
||||
pixels, that is, the visible offset will not change even if the
|
||||
item's affine transformation changes. If it is %FALSE, the
|
||||
pixbuf's translation will be taken to be in canvas units, and thus
|
||||
will change along with the item's affine transformation.
|
||||
will change along with the item's affine transformation. The
|
||||
default is %FALSE.
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GnomeCanvasPixbuf:y ##### -->
|
||||
<para>
|
||||
Indicates the vertical translation offset of the pixbuf item's
|
||||
image. Works in the same way as the <link
|
||||
linkend="GnomeCanvasPixbuf--x">x</link> argument.
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GnomeCanvasPixbuf:y_set ##### -->
|
||||
<para>
|
||||
Determines whether the <link
|
||||
linkend="GnomeCanvasPixbuf--y">y</link> argument is used to
|
||||
translate the pixbuf from its logical origin in item-relative
|
||||
coordinates. Works in the same way as the <link
|
||||
linkend="GnomeCanvasPixbuf--x-set">x_set</link> argument. The
|
||||
default is %FALSE.
|
||||
linkend="GnomeCanvasPixbuf--x">x</link> argument. The default is
|
||||
0.0.
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GnomeCanvasPixbuf:y_in_pixels ##### -->
|
||||
<para>
|
||||
Works in the same way as the <link
|
||||
linkend="GnomeCanvasPixbuf--x-in-pixels">x_in_pixels</link>
|
||||
argument. The default is %FALSE.
|
||||
argument, but controls whether the <link
|
||||
linkend="GnomeCanvasPixbuf--y">y</link> translation offset is
|
||||
scaled or not. The default is %FALSE.
|
||||
</para>
|
||||
|
||||
<!--
|
||||
|
@ -1,3 +1,17 @@
|
||||
2000-01-22 Federico Mena Quintero <federico@helixcode.com>
|
||||
|
||||
* gdk-pixbuf/gnome-canvas-pixbuf.c (PixbufPrivate): Removed the
|
||||
x_set and y_set arguments. Now they are always on and start with
|
||||
defaults of 0.0 in units.
|
||||
(gnome_canvas_pixbuf_class_init): Likewise.
|
||||
(gnome_canvas_pixbuf_set_arg): Likewise.
|
||||
(gnome_canvas_pixbuf_get_arg): Likewise.
|
||||
(compute_viewport_affine): Likewise; always use the priv->x and
|
||||
priv->y fields.
|
||||
|
||||
* doc/tmpl/gnome-canvas-pixbuf.sgml: Modified to reflect the
|
||||
removal of the x_set/y_set arguments.
|
||||
|
||||
2000-01-21 Federico Mena Quintero <federico@helixcode.com>
|
||||
|
||||
* gdk-pixbuf/gdk-pixbuf.c (gdk_pixbuf_ref): Return the same pixbuf
|
||||
|
@ -52,9 +52,7 @@ typedef struct {
|
||||
guint width_in_pixels : 1;
|
||||
guint height_set : 1;
|
||||
guint height_in_pixels : 1;
|
||||
guint x_set : 1;
|
||||
guint x_in_pixels : 1;
|
||||
guint y_set : 1;
|
||||
guint y_in_pixels : 1;
|
||||
|
||||
/* Whether the pixbuf has changed */
|
||||
@ -77,10 +75,8 @@ enum {
|
||||
ARG_HEIGHT_SET,
|
||||
ARG_HEIGHT_IN_PIXELS,
|
||||
ARG_X,
|
||||
ARG_X_SET,
|
||||
ARG_X_IN_PIXELS,
|
||||
ARG_Y,
|
||||
ARG_Y_SET,
|
||||
ARG_Y_IN_PIXELS
|
||||
};
|
||||
|
||||
@ -165,14 +161,10 @@ gnome_canvas_pixbuf_class_init (GnomeCanvasPixbufClass *class)
|
||||
GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_HEIGHT_IN_PIXELS);
|
||||
gtk_object_add_arg_type ("GnomeCanvasPixbuf::x",
|
||||
GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, ARG_X);
|
||||
gtk_object_add_arg_type ("GnomeCanvasPixbuf::x_set",
|
||||
GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_X_SET);
|
||||
gtk_object_add_arg_type ("GnomeCanvasPixbuf::x_in_pixels",
|
||||
GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_X_IN_PIXELS);
|
||||
gtk_object_add_arg_type ("GnomeCanvasPixbuf::y",
|
||||
GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, ARG_Y);
|
||||
gtk_object_add_arg_type ("GnomeCanvasPixbuf::y_set",
|
||||
GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_Y_SET);
|
||||
gtk_object_add_arg_type ("GnomeCanvasPixbuf::y_in_pixels",
|
||||
GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_Y_IN_PIXELS);
|
||||
|
||||
@ -314,12 +306,6 @@ gnome_canvas_pixbuf_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
|
||||
gnome_canvas_item_request_update (item);
|
||||
break;
|
||||
|
||||
case ARG_X_SET:
|
||||
priv->x_set = GTK_VALUE_BOOL (*arg) ? TRUE : FALSE;
|
||||
priv->need_xform_update = TRUE;
|
||||
gnome_canvas_item_request_update (item);
|
||||
break;
|
||||
|
||||
case ARG_X_IN_PIXELS:
|
||||
priv->x_in_pixels = GTK_VALUE_BOOL (*arg) ? TRUE : FALSE;
|
||||
priv->need_xform_update = TRUE;
|
||||
@ -332,12 +318,6 @@ gnome_canvas_pixbuf_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
|
||||
gnome_canvas_item_request_update (item);
|
||||
break;
|
||||
|
||||
case ARG_Y_SET:
|
||||
priv->y_set = GTK_VALUE_BOOL (*arg) ? TRUE : FALSE;
|
||||
priv->need_xform_update = TRUE;
|
||||
gnome_canvas_item_request_update (item);
|
||||
break;
|
||||
|
||||
case ARG_Y_IN_PIXELS:
|
||||
priv->y_in_pixels = GTK_VALUE_BOOL (*arg) ? TRUE : FALSE;
|
||||
priv->need_xform_update = TRUE;
|
||||
@ -392,10 +372,6 @@ gnome_canvas_pixbuf_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
|
||||
GTK_VALUE_DOUBLE (*arg) = priv->x;
|
||||
break;
|
||||
|
||||
case ARG_X_SET:
|
||||
GTK_VALUE_BOOL (*arg) = priv->x_set;
|
||||
break;
|
||||
|
||||
case ARG_X_IN_PIXELS:
|
||||
GTK_VALUE_BOOL (*arg) = priv->x_in_pixels;
|
||||
break;
|
||||
@ -404,10 +380,6 @@ gnome_canvas_pixbuf_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
|
||||
GTK_VALUE_DOUBLE (*arg) = priv->y;
|
||||
break;
|
||||
|
||||
case ARG_Y_SET:
|
||||
GTK_VALUE_BOOL (*arg) = priv->y_set;
|
||||
break;
|
||||
|
||||
case ARG_Y_IN_PIXELS:
|
||||
GTK_VALUE_BOOL (*arg) = priv->y_in_pixels;
|
||||
break;
|
||||
@ -466,7 +438,6 @@ compute_viewport_affine (GnomeCanvasPixbuf *gcp, double *viewport_affine, double
|
||||
double ti_len, tj_len;
|
||||
double scale[6], translate[6];
|
||||
double w, h;
|
||||
double x, y;
|
||||
|
||||
priv = gcp->priv;
|
||||
|
||||
@ -487,16 +458,6 @@ compute_viewport_affine (GnomeCanvasPixbuf *gcp, double *viewport_affine, double
|
||||
else
|
||||
h = priv->pixbuf->art_pixbuf->height;
|
||||
|
||||
if (priv->x_set)
|
||||
x = priv->x;
|
||||
else
|
||||
x = 0.0;
|
||||
|
||||
if (priv->y_set)
|
||||
y = priv->y;
|
||||
else
|
||||
y = 0.0;
|
||||
|
||||
/* Convert i_len and j_len into scaling factors */
|
||||
|
||||
if (priv->width_in_pixels) {
|
||||
@ -529,7 +490,7 @@ compute_viewport_affine (GnomeCanvasPixbuf *gcp, double *viewport_affine, double
|
||||
} else
|
||||
ti_len = 1.0;
|
||||
|
||||
ti_len *= x;
|
||||
ti_len *= priv->x;
|
||||
|
||||
if (priv->y_in_pixels) {
|
||||
if (j_len > GNOME_CANVAS_EPSILON)
|
||||
@ -539,7 +500,7 @@ compute_viewport_affine (GnomeCanvasPixbuf *gcp, double *viewport_affine, double
|
||||
} else
|
||||
tj_len = 1.0;
|
||||
|
||||
tj_len *= y;
|
||||
tj_len *= priv->y;
|
||||
|
||||
/* Compute the final affine */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user