]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/tmpl/gtkpreview.sgml
2.9.0
[~andy/gtk] / docs / reference / gtk / tmpl / gtkpreview.sgml
1 <!-- ##### SECTION Title ##### -->
2 GtkPreview
3
4 <!-- ##### SECTION Short_Description ##### -->
5 A widget to display RGB or grayscale data
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para>
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 
13 approaches.
14 </para>
15
16 <!-- ##### SECTION See_Also ##### -->
17 <para>
18 <variablelist>
19
20 <varlistentry>
21 <term>#GdkRGB</term>
22 <listitem><para>the backend used by #GtkPreview.</para></listitem>
23 </varlistentry>
24
25 </variablelist>
26 </para>
27
28 <!-- ##### SECTION Stability_Level ##### -->
29
30
31 <!-- ##### STRUCT GtkPreview ##### -->
32 <para>
33 The #GtkPreview-struct struct contains private data only, and
34 should be accessed using the functions below.
35 </para>
36
37
38 <!-- ##### ARG GtkPreview:expand ##### -->
39 <para>
40
41 </para>
42
43 <!-- ##### STRUCT GtkPreviewInfo ##### -->
44 <para>
45 Contains information about global properties
46 of preview widgets.
47
48 The #GtkPreviewInfo struct contains the following fields.
49 (These fields should be considered read-only. They should never be set by
50 an application.)
51
52 <informaltable pgwide="1" frame="none" role="struct">
53 <tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/>
54 <tbody>
55
56 <row>
57 <entry>#GdkVisual *visual;</entry>
58 <entry>the visual used by all previews.</entry>
59 </row>
60
61 <row>
62 <entry>#GdkColormap *cmap;</entry>
63 <entry>the colormap used by all previews.</entry>
64 </row>
65
66 <row>
67 <entry>gdouble gamma;</entry>
68 <entry>the gamma correction value used by all previews (See gtk_preview_set_gamma()).</entry>
69 </row>
70
71 </tbody>
72 </tgroup>
73 </informaltable>
74
75 </para>
76
77 @lookup: 
78 @gamma: 
79
80 <!-- ##### UNION GtkDitherInfo ##### -->
81 <para>
82 This union not used in GTK+.
83 </para>
84
85
86 <!-- ##### FUNCTION gtk_preview_uninit ##### -->
87 <para>
88 This function is deprecated and does nothing.
89 </para>
90
91
92
93 <!-- ##### FUNCTION gtk_preview_new ##### -->
94 <para>
95 Create a new preview widget.
96 </para>
97
98 @type: the type data contained by the widget. 
99 (Grayscale or RGB)
100 @Returns: a new #GtkPreview
101
102
103 <!-- ##### FUNCTION gtk_preview_size ##### -->
104 <para>
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())
112 </para>
113
114 @preview: a #GtkPreview.
115 @width: the new width.
116 @height: the new height.
117
118
119 <!-- ##### FUNCTION gtk_preview_put ##### -->
120 <para>
121 Takes a portion of the contents of a preview widget
122 and draws it onto the given drawable, @window.
123 </para>
124
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.
135
136
137 <!-- ##### FUNCTION gtk_preview_draw_row ##### -->
138 <para>
139 Sets the data for a portion of a row.
140 </para>
141
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.
150
151
152 <!-- ##### FUNCTION gtk_preview_set_expand ##### -->
153 <para>
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.
164 </para>
165
166 @preview: a #GtkPreview.
167 @expand: whether the preview's window should expand or not.
168
169
170 <!-- ##### FUNCTION gtk_preview_set_gamma ##### -->
171 <para>
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
180 widgets.
181 </para>
182
183 @gamma_: the new gamma value.
184
185
186 <!-- ##### FUNCTION gtk_preview_set_color_cube ##### -->
187 <para>
188 This function is deprecated and does nothing. GdkRGB
189 automatically picks an optimium color cube for the
190 display.
191 </para>
192
193 @nred_shades: ignored
194 @ngreen_shades: ignored
195 @nblue_shades: ignored
196 @ngray_shades: ignored
197
198
199 <!-- ##### FUNCTION gtk_preview_set_install_cmap ##### -->
200 <para>
201 This function is deprecated
202 and does nothing. GdkRGB will automatically pick
203 a private colormap if it cannot allocate sufficient
204 colors.
205 </para>
206
207 @install_cmap: ignored.
208
209
210 <!-- ##### FUNCTION gtk_preview_set_reserved ##### -->
211 <para>
212 This function is deprecated and does nothing.
213 </para>
214
215 @nreserved: ignored.
216
217
218 <!-- ##### FUNCTION gtk_preview_set_dither ##### -->
219 <para>
220 Set the dithering mode for the display. 
221 </para>
222
223 @preview: a #GtkPreview.
224 @dither: the dithering mode.
225
226
227 <!-- ##### FUNCTION gtk_preview_get_visual ##### -->
228 <para>
229 Returns the visual used by preview widgets. This
230 function is deprecated, and you should use
231 gdk_rgb_get_visual() instead.
232 </para>
233
234 @Returns: the visual for previews.
235
236
237 <!-- ##### FUNCTION gtk_preview_get_cmap ##### -->
238 <para>
239 Returns the colormap used by preview widgets. This
240 function is deprecated, and you should use
241 gdk_rgb_get_cmap() instead.
242 </para>
243
244 @Returns: the colormap for previews.
245
246
247 <!-- ##### FUNCTION gtk_preview_get_info ##### -->
248 <para>
249 Return a #GtkPreviewInfo structure containing 
250 global information about preview widgets.
251 </para>
252
253 @Returns: a #GtkPreviewInfo structure. The return
254  value belongs to GTK+ and must not be modified
255  or freed.
256
257
258 <!-- ##### FUNCTION gtk_preview_reset ##### -->
259 <para>
260 This function is deprecated and does nothing. It was
261 once used for changing the colormap and visual on the fly.
262 </para>
263
264
265