![]() |
![]() |
![]() |
GIMP Widgets Library Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Style Properties | Signals |
GimpPreviewGimpPreview — A widget providing a GimpPreviewArea plus framework to update the preview. |
GimpPreview; gboolean gimp_preview_get_update (GimpPreview *preview
); void gimp_preview_set_update (GimpPreview *preview
,gboolean update
); void gimp_preview_set_bounds (GimpPreview *preview
,gint xmin
,gint ymin
,gint xmax
,gint ymax
); void gimp_preview_get_size (GimpPreview *preview
,gint *width
,gint *height
); void gimp_preview_get_position (GimpPreview *preview
,gint *x
,gint *y
); void gimp_preview_transform (GimpPreview *preview
,gint src_x
,gint src_y
,gint *dest_x
,gint *dest_y
); void gimp_preview_untransform (GimpPreview *preview
,gint src_x
,gint src_y
,gint *dest_x
,gint *dest_y
); GtkWidget * gimp_preview_get_area (GimpPreview *preview
); void gimp_preview_draw (GimpPreview *preview
); void gimp_preview_draw_buffer (GimpPreview *preview
,const guchar *buffer
,gint rowstride
); void gimp_preview_invalidate (GimpPreview *preview
); void gimp_preview_set_default_cursor (GimpPreview *preview
,GdkCursor *cursor
); GtkWidget * gimp_preview_get_controls (GimpPreview *preview
);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkContainer +----GtkBox +----GimpPreview +----GimpScrolledPreview
gboolean gimp_preview_get_update (GimpPreview *preview
);
|
a GimpPreview widget |
Returns : |
the state of the "Preview" check button. |
Since GIMP 2.2
void gimp_preview_set_update (GimpPreview *preview
,gboolean update
);
Sets the state of the "Preview" check button.
|
a GimpPreview widget |
|
TRUE if the preview should invalidate itself when being
scrolled or when gimp_preview_invalidate() is being called |
Since GIMP 2.2
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
.
|
a GimpPreview widget |
|
the minimum X value |
|
the minimum Y value |
|
the maximum X value |
|
the maximum Y value |
Since GIMP 2.2
void gimp_preview_get_size (GimpPreview *preview
,gint *width
,gint *height
);
|
a GimpPreview widget |
|
return location for the preview area width |
|
return location for the preview area height |
Since GIMP 2.2
void gimp_preview_get_position (GimpPreview *preview
,gint *x
,gint *y
);
|
a GimpPreview widget |
|
return location for the horizontal offset |
|
return location for the vertical offset |
Since GIMP 2.2
void gimp_preview_transform (GimpPreview *preview
,gint src_x
,gint src_y
,gint *dest_x
,gint *dest_y
);
Transforms from image to widget coordinates.
|
a GimpPreview widget |
|
horizontal position on the previewed image |
|
vertical position on the previewed image |
|
returns the transformed horizontal position |
|
returns the transformed vertical position |
Since GIMP 2.4
void gimp_preview_untransform (GimpPreview *preview
,gint src_x
,gint src_y
,gint *dest_x
,gint *dest_y
);
Transforms from widget to image coordinates.
|
a GimpPreview widget |
|
horizontal position relative to the preview area's origin |
|
vertical position relative to preview area's origin |
|
returns the untransformed horizontal position |
|
returns the untransformed vertical position |
Since GIMP 2.4
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()
.
|
a GimpPreview widget |
Returns : |
a pointer to the GimpPreviewArea used in the preview . |
Since GIMP 2.4
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
.
|
a GimpPreview widget |
Since GIMP 2.2
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.
|
a GimpPreview widget |
|
a pixel buffer the size of the preview |
|
the buffer 's rowstride |
Since GIMP 2.2
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.
|
a GimpPreview widget |
Since GIMP 2.2
void gimp_preview_set_default_cursor (GimpPreview *preview
,GdkCursor *cursor
);
Sets the default mouse cursor for the preview. Note that this will
be overriden by a GDK_FLEUR
if the preview has scrollbars, or by a
GDK_WATCH
when the preview is invalidated.
|
a GimpPreview widget |
|
a GdkCursor or NULL
|
Since GIMP 2.2
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.
|
a GimpPreview widget |
Returns : |
the GtkHBox at the bottom of the preview. |
Since GIMP 2.4
"invalidated"
signalvoid user_function (GimpPreview *gimppreview,
gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |