Top |
GimpPreviewGimpPreview — A widget providing a GimpPreviewArea plus framework to update the preview. |
Functions
gboolean | gimp_preview_get_update () |
void | gimp_preview_set_update () |
void | gimp_preview_set_bounds () |
void | gimp_preview_get_size () |
void | gimp_preview_get_position () |
void | gimp_preview_transform () |
void | gimp_preview_untransform () |
GtkWidget * | gimp_preview_get_area () |
void | gimp_preview_draw () |
void | gimp_preview_draw_buffer () |
void | gimp_preview_invalidate () |
void | gimp_preview_set_default_cursor () |
GtkWidget * | gimp_preview_get_controls () |
Object Hierarchy
GObject ╰── GInitiallyUnowned ╰── GtkObject ╰── GtkWidget ╰── GtkContainer ╰── GtkBox ╰── GimpPreview ╰── GimpScrolledPreview
Functions
gimp_preview_set_update ()
void gimp_preview_set_update (GimpPreview *preview
,gboolean update
);
Sets the state of the "Preview" check button.
Parameters
preview |
a GimpPreview widget |
|
update |
|
Since: 2.2
gimp_preview_set_bounds ()
void gimp_preview_set_bounds (GimpPreview *preview
,gint xmin
,gint ymin
,gint xmax
,gint ymax
);
Sets the lower and upper limits for the previewed area. The
difference between the upper and lower value is used to set the
maximum size of the GimpPreviewArea used in the preview
.
Parameters
preview |
a GimpPreview widget |
|
xmin |
the minimum X value |
|
ymin |
the minimum Y value |
|
xmax |
the maximum X value |
|
ymax |
the maximum Y value |
Since: 2.2
gimp_preview_get_size ()
void gimp_preview_get_size (GimpPreview *preview
,gint *width
,gint *height
);
Parameters
preview |
a GimpPreview widget |
|
width |
return location for the preview area width |
|
height |
return location for the preview area height |
Since: 2.2
gimp_preview_get_position ()
void gimp_preview_get_position (GimpPreview *preview
,gint *x
,gint *y
);
Parameters
preview |
a GimpPreview widget |
|
x |
return location for the horizontal offset |
|
y |
return location for the vertical offset |
Since: 2.2
gimp_preview_transform ()
void gimp_preview_transform (GimpPreview *preview
,gint src_x
,gint src_y
,gint *dest_x
,gint *dest_y
);
Transforms from image to widget coordinates.
Parameters
preview |
a GimpPreview widget |
|
src_x |
horizontal position on the previewed image |
|
src_y |
vertical position on the previewed image |
|
dest_x |
returns the transformed horizontal position |
|
dest_y |
returns the transformed vertical position |
Since: 2.4
gimp_preview_untransform ()
void gimp_preview_untransform (GimpPreview *preview
,gint src_x
,gint src_y
,gint *dest_x
,gint *dest_y
);
Transforms from widget to image coordinates.
Parameters
preview |
a GimpPreview widget |
|
src_x |
horizontal position relative to the preview area's origin |
|
src_y |
vertical position relative to preview area's origin |
|
dest_x |
returns the untransformed horizontal position |
|
dest_y |
returns the untransformed vertical position |
Since: 2.4
gimp_preview_get_area ()
GtkWidget *
gimp_preview_get_area (GimpPreview *preview
);
In most cases, you shouldn't need to access the GimpPreviewArea
that is being used in the preview
. Sometimes however, you need to.
For example if you want to receive mouse events from the area. In
such cases, use gimp_preview_get_area()
.
Since: 2.4
gimp_preview_draw ()
void
gimp_preview_draw (GimpPreview *preview
);
Calls the GimpPreview::draw method. GimpPreview itself doesn't implement a default draw method so the behaviour is determined by the derived class implementing this method.
GimpDrawablePreview implements gimp_preview_draw()
by drawing the
original, unmodified drawable to the preview
.
Since: 2.2
gimp_preview_draw_buffer ()
void gimp_preview_draw_buffer (GimpPreview *preview
,const guchar *buffer
,gint rowstride
);
Calls the GimpPreview::draw_buffer method. GimpPreview itself doesn't implement this method so the behaviour is determined by the derived class implementing this method.
Parameters
preview |
a GimpPreview widget |
|
buffer |
a pixel buffer the size of the preview |
|
rowstride |
the |
Since: 2.2
gimp_preview_invalidate ()
void
gimp_preview_invalidate (GimpPreview *preview
);
This function starts or renews a short low-priority timeout. When
the timeout expires, the GimpPreview::invalidated signal is emitted
which will usually cause the preview
to be updated.
This function does nothing unless the "Preview" button is checked.
During the emission of the signal a busy cursor is set on the
toplevel window containing the preview
and on the preview area
itself.
Since: 2.2
gimp_preview_set_default_cursor ()
void gimp_preview_set_default_cursor (GimpPreview *preview
,GdkCursor *cursor
);
Sets the default mouse cursor for the preview. Note that this will
be overridden by a GDK_FLEUR
if the preview has scrollbars, or by a
GDK_WATCH
when the preview is invalidated.
Since: 2.2
gimp_preview_get_controls ()
GtkWidget *
gimp_preview_get_controls (GimpPreview *preview
);
Gives access to the GtkHBox at the bottom of the preview that contains the update toggle. Derived widgets can use this function if they need to add controls to this area.
Since: 2.4
Signal Details
The “invalidated”
signal
void user_function (GimpPreview *gimppreview, gpointer user_data)
Flags: Run First