1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 A widget to display RGB or grayscale data
7 <!-- ##### SECTION Long_Description ##### -->
9 The #GtkPreview widget provides a simple interface
10 used to display images as RGB or grayscale data.
11 It's deprecated; just use a #GdkPixbuf displayed by a #GtkImage, or
12 perhaps a #GtkDrawingArea. #GtkPreview has no advantage over those
16 <!-- ##### SECTION See_Also ##### -->
22 <listitem><para>the backend used by #GtkPreview.</para></listitem>
28 <!-- ##### SECTION Stability_Level ##### -->
31 <!-- ##### STRUCT GtkPreview ##### -->
33 The #GtkPreview-struct struct contains private data only, and
34 should be accessed using the functions below.
38 <!-- ##### ARG GtkPreview:expand ##### -->
43 <!-- ##### STRUCT GtkPreviewInfo ##### -->
45 Contains information about global properties
48 The #GtkPreviewInfo struct contains the following fields.
49 (These fields should be considered read-only. They should never be set by
52 <informaltable pgwide="1" frame="none" role="struct">
53 <tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/>
57 <entry>#GdkVisual *visual;</entry>
58 <entry>the visual used by all previews.</entry>
62 <entry>#GdkColormap *cmap;</entry>
63 <entry>the colormap used by all previews.</entry>
67 <entry>gdouble gamma;</entry>
68 <entry>the gamma correction value used by all previews (See gtk_preview_set_gamma()).</entry>
80 <!-- ##### UNION GtkDitherInfo ##### -->
82 This union not used in GTK+.
86 <!-- ##### FUNCTION gtk_preview_uninit ##### -->
88 This function is deprecated and does nothing.
93 <!-- ##### FUNCTION gtk_preview_new ##### -->
95 Create a new preview widget.
98 @type: the type data contained by the widget.
100 @Returns: a new #GtkPreview
103 <!-- ##### FUNCTION gtk_preview_size ##### -->
105 Set the size that the preview widget will request
106 in response to a "size_request" signal. The
107 drawing area may actually be allocated a size
108 larger than this depending on how it is packed
109 within the enclosing containers. The effect
110 of this is determined by whether the preview
111 is set to expand or not (see gtk_preview_expand())
114 @preview: a #GtkPreview.
115 @width: the new width.
116 @height: the new height.
119 <!-- ##### FUNCTION gtk_preview_put ##### -->
121 Takes a portion of the contents of a preview widget
122 and draws it onto the given drawable, @window.
125 @preview: a #GtkPreview.
126 @window: a window or pixmap.
127 @gc: The graphics context for the operation. Only the
128 clip mask for this GC matters.
129 @srcx: the x coordinate of the upper left corner in the source image.
130 @srcy: the y coordinate of the upper left corner in the source image.
131 @destx: the x coordinate of the upper left corner in the destination image.
132 @desty: the y coordinate of the upper left corner in the destination image.
133 @width: the width of the rectangular portion to draw.
134 @height: the height of the rectangular portion to draw.
137 <!-- ##### FUNCTION gtk_preview_draw_row ##### -->
139 Sets the data for a portion of a row.
142 @preview: a #GtkPreview.
143 @data: the new data for the portion. It should contain
144 @w bytes of data if the preview is of type
145 GTK_TYPE_GRAYSCALE, and 3*@w bytes of data
146 if the preview is of type GTK_TYPE_COLOR.
147 @x: the starting value on the row to set.
148 @y: the row to change.
149 @w: the number of pixels in the row to change.
152 <!-- ##### FUNCTION gtk_preview_set_expand ##### -->
154 Determines the way that the the preview widget behaves
155 when the size it is allocated is larger than the requested
156 size. If @expand is %FALSE, then the preview's window
157 and buffer will be no larger than the size set with
158 gtk_preview_size(), and the data set will be centered
159 in the allocation if it is larger. If @expand is %TRUE
160 then the window and buffer will expand with the allocation;
161 the application is responsible for catching
162 the "size_allocate" signal and providing the data
163 appropriate for this size.
166 @preview: a #GtkPreview.
167 @expand: whether the preview's window should expand or not.
170 <!-- ##### FUNCTION gtk_preview_set_gamma ##### -->
172 Set the gamma-correction value for all preview widgets.
173 (This function will eventually be replaced with a
174 function that sets a per-preview-widget gamma value).
175 The resulting intensity is given by:
176 <literal>destination_value * pow (source_value/255, 1/gamma)</literal>.
177 The gamma value is applied when the data is
178 set with gtk_preview_draw_row() so changing this
179 value will not affect existing data in preview
183 @gamma_: the new gamma value.
186 <!-- ##### FUNCTION gtk_preview_set_color_cube ##### -->
188 This function is deprecated and does nothing. GdkRGB
189 automatically picks an optimium color cube for the
193 @nred_shades: ignored
194 @ngreen_shades: ignored
195 @nblue_shades: ignored
196 @ngray_shades: ignored
199 <!-- ##### FUNCTION gtk_preview_set_install_cmap ##### -->
201 This function is deprecated
202 and does nothing. GdkRGB will automatically pick
203 a private colormap if it cannot allocate sufficient
207 @install_cmap: ignored.
210 <!-- ##### FUNCTION gtk_preview_set_reserved ##### -->
212 This function is deprecated and does nothing.
218 <!-- ##### FUNCTION gtk_preview_set_dither ##### -->
220 Set the dithering mode for the display.
223 @preview: a #GtkPreview.
224 @dither: the dithering mode.
227 <!-- ##### FUNCTION gtk_preview_get_visual ##### -->
229 Returns the visual used by preview widgets. This
230 function is deprecated, and you should use
231 gdk_rgb_get_visual() instead.
234 @Returns: the visual for previews.
237 <!-- ##### FUNCTION gtk_preview_get_cmap ##### -->
239 Returns the colormap used by preview widgets. This
240 function is deprecated, and you should use
241 gdk_rgb_get_cmap() instead.
244 @Returns: the colormap for previews.
247 <!-- ##### FUNCTION gtk_preview_get_info ##### -->
249 Return a #GtkPreviewInfo structure containing
250 global information about preview widgets.
253 @Returns: a #GtkPreviewInfo structure. The return
254 value belongs to GTK+ and must not be modified
258 <!-- ##### FUNCTION gtk_preview_reset ##### -->
260 This function is deprecated and does nothing. It was
261 once used for changing the colormap and visual on the fly.