Gtk-- Reference: Gtk::Preview

Class Index | Cross Index | Namespace Index

# Class Gtk::Preview

A widget to display RGB or grayscale data.
Contained in: Gtk
Derived from: Gtk::Widget
Derived by: none

#include <gtk--/preview.h>

### public function member index:
``explicit`` | `Preview` | `(`GtkPreviewType` `type`)`;
``void`` | `draw_row` | `(`const` `guchar`* `data`, `gint` `x`, `gint` `y`, `gint` `w`)`;
``static` `Gdk_Colormap`` | `get_cmap` | `()`;
``static` `GtkPreviewInfo`*` | `get_info` | `()`;
``static` `Gdk_Visual`` | `get_visual` | `()`;
``GtkPreview`*` | `gtkobj` | `()`;
``const` `GtkPreview`*` | `gtkobj` | `() `const``;
``static` `bool`` | `isA` | `(`Object`* `object`)`;
``void`` | `put` | `(`Gdk_Window`& `window`, `Gdk_GC`& `gc`, `gint` `srcx`, `gint` `srcy`, `gint` `destx`, `gint` `desty`, `gint` `width`, `gint` `height`)`;
``static` `void`` | `reset` | `()`;
``static` `void`` | `set_color_cube` | `(`guint` `nred_shades`, `guint` `ngreen_shades`, `guint` `nblue_shades`, `guint` `ngray_shades`)`;
``void`` | `set_dither` | `(`GdkRgbDither` `dither`)`;
``void`` | `set_expand` | `(`bool` `expand`)`;
``static` `void`` | `set_gamma` | `(`double` `gamma`)`;
``static` `void`` | `set_install_cmap` | `(`bool` `install_cmap`)`;
``static` `void`` | `set_reserved` | `(`gint` `nreserved`)`;
``void`` | `size` | `(`gint` `width`, `gint` `height`)`;
``static` `void`` | `uninit` | `()`;
``virtual`` | `~Preview` | `()`;

## Description:

## Function Member Descriptions:

Gtk::Preview::draw_row - Sets the data for a portion of a row.

``void`` `draw_row``(`const` `guchar`* `data`, `gint` `x`, `gint` `y`, `gint` `w`)`;

> data: The new data for the portion. It should contain w bytes of data if the preview is of type `GTK_TYPE_GRAYSCALE`, and 3*w bytes of data if the preview is of type `GTK_TYPE_COLOR`.

> x: The starting value on the row to set.

> y: The row to change.

> w: The number of pixels in the row to change.

Gtk::Preview::gtkobj - Returns the underlaying gtk+ object.

``GtkPreview`*` `gtkobj``()`;
Gtk::Preview::isA - Returns true if object is this type.

``static` `bool`` `isA``(`Object`* `object`)`;
Gtk::Preview::reset - This function is deprecated and does nothing. It was once used for changing the colormap and visual on the fly.

``static` `void`` `reset``()`;
Gtk::Preview::set_color_cube - This function is deprecated and does nothing. `Gdk:::RGB` automatically picks an optimium color cube for the display.

``static` `void`` `set_color_cube``(`guint` `nred_shades`, `guint` `ngreen_shades`, `guint` `nblue_shades`, `guint` `ngray_shades`)`;
Gtk::Preview::set_dither - Set the dithering mode for the display.

``void`` `set_dither``(`GdkRgbDither` `dither`)`;

> dither: The dithering mode. There are three values:

> `GDK_RGB_DITHER_NONE`: Never use dithering.

> `GDK_RGB_DITHER_NORMAL`: Use dithering in 8 bits per pixel (and below) only.

> `GDK_RGB_DITHER_MAX`: Use dithering in 16 bits per pixel and below.

Gtk::Preview::set_expand - Determines the way that the the preview widget behaves when the size it is allocated is larger than the requested size.

``void`` `set_expand``(`bool` `expand`)`;

> If expand is FALSE, then the preview's window and buffer will be no larger than the size set with `size`, and the data set will be centered in the allocation if it is larger. If expand is TRUE then the window and buffer will expand with the allocation; the application is responsible for catching the "size_allocate" signal and providing the data appropriate for this size.

> expand: Whether the preview's window should expand or not.

Gtk::Preview::set_gamma - Set the gamma-correction value for all preview widgets. (This function

``static` `void`` `set_gamma``(`double` `gamma`)`;

> will eventually be replaced with a function that sets a per-preview-widget gamma value). The resulting intensity is given by: destination_value * pow (source_value/255, 1/gamma). The gamma value is applied when the data is set with `draw_row` so changing this value will not affect existing data in preview widgets.

> gamma: The new gamma value.

Gtk::Preview::set_install_cmap - This function is deprecated and does nothing. `Gdk::RGB` will automatically pick a private colormap if it cannot allocate sufficient colors.

``static` `void`` `set_install_cmap``(`bool` `install_cmap`)`;
Gtk::Preview::set_reserved - This function is deprecated and does nothing.

``static` `void`` `set_reserved``(`gint` `nreserved`)`;
Gtk::Preview::size - Set the size that the preview widget will request in response to a "size_request"

``void`` `size``(`gint` `width`, `gint` `height`)`;

> signal. The drawing area may actually be allocated a size larger than this depending on how it is packed within the enclosing containers. The effect of this is determined by whether the preview is set to expand or not (see `set_expand`).

> width: The new width.

> height: The new height.

Gtk::Preview::uninit - This function is deprecated and does nothing.

``static` `void`` `uninit``()`;