Logo Search packages:      
Sourcecode: ardour version File versions

Gdk::Visual Class Reference

#include <visual.h>

Inheritance diagram for Gdk::Visual:

sigc::trackable

List of all members.


Detailed Description

A Gdk::Visual describes a particular video hardware display format. It includes information about the number of bits used for each color, the way the bits are translated into an RGB value for display, and the way the bits are stored in memory. For example, a piece of display hardware might support 24-bit color, 16-bit color, or 8-bit color; meaning 24/16/8-bit pixel sizes. For a given pixel size, pixels can be in different formats; for example the "red" element of an RGB pixel may be in the top 8 bits of the pixel, or may be in the lower 4 bits.

Usually you can avoid thinking about visuals in GTK+. Visuals are useful to interpret the contents of a GdkImage, but you should avoid Gdk::Image precisely because its contents depend on the display hardware; use Gdk::Pixbuf instead, for all but the most low-level purposes. Also, anytime you provide a Gdk::Colormap, the visual is implied as part of the colormap (Gdk::Colormap::get_visual()), so you won't have to provide a visual in addition.

There are several standard visuals. The visual returned by get_system() is the system's default visual. get_visual() returns the visual most suited to displaying full-color image data. If you use the calls in Gdk::RGB, you should create your windows using this visual (and the colormap returned by Gdk::Rgb::get_colormap()).

A number of methods are provided for determining the "best" available visual. For the purposes of making this determination, higher bit depths are considered better, and for visuals of the same bit depth, GDK_VISUAL_PSEUDO_COLOR is preferred at 8bpp, otherwise, the visual types are ranked in the order of (highest to lowest) GDK_VISUAL_DIRECT_COLOR, GDK_VISUAL_TRUE_COLOR, GDK_VISUAL_PSEUDO_COLOR, GDK_VISUAL_STATIC_COLOR, GDK_VISUAL_GRAYSCALE, then GDK_VISUAL_STATIC_GRAY.

Definition at line 108 of file visual.h.


Public Types

typedef GdkVisualClass BaseClassType
typedef GdkVisual BaseObjectType
typedef Visual_Class CppClassType
typedef Visual CppObjectType
typedef void(* DestroyNotify )(gpointer data)

Public Member Functions

bool _cpp_destruction_is_in_progress () const
void * get_data (const QueryQuark &key)
template<class PropertyType>
void get_property (const Glib::ustring &property_name, PropertyType &value) const
 You probably want to use a specific property_*() accessor method instead.
void get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const
 You probably want to use a specific property_*() accessor method instead.
Glib::RefPtr< const Screenget_screen () const
Glib::RefPtr< Screenget_screen ()
const GdkVisual * gobj () const
 Provides access to the underlying C GObject.
GdkVisual * gobj ()
 Provides access to the underlying C GObject.
GObject * gobj_copy () const
GdkVisual * gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
virtual void reference () const
void remove_data (const QueryQuark &quark)
void set_data (const Quark &key, void *data, DestroyNotify notify)
void set_data (const Quark &key, void *data)
template<class PropertyType>
void set_property (const Glib::ustring &property_name, const PropertyType &value)
 You probably want to use a specific property_*() accessor method instead.
void set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value)
 You probably want to use a specific property_*() accessor method instead.
void * steal_data (const QueryQuark &quark)
virtual void unreference () const

Static Public Member Functions

static ObjectBase * _get_current_wrapper (GObject *object)
static GType get_base_type () G_GNUC_CONST
static Glib::RefPtr< Visualget_best (int depth, VisualType visual_type)
static Glib::RefPtr< Visualget_best (VisualType visual_type)
static Glib::RefPtr< Visualget_best (int depth)
static Glib::RefPtr< Visualget_best ()
static int get_best_depth ()
static VisualType get_best_type ()
static Glib::RefPtr< Visualget_system ()
static GType get_type () G_GNUC_CONST

Protected Member Functions

void _set_current_wrapper (GObject *object)
virtual void destroy_notify_ ()
void initialize (GObject *castitem)
bool is_anonymous_custom_ () const
bool is_derived_ () const
 Visual (GdkVisual *castitem)
 Visual (const Glib::ConstructParams &construct_params)

Static Protected Member Functions

static void destroy_notify_callback_ (void *data)

Protected Attributes

bool cpp_destruction_in_progress_
const char * custom_type_name_
GObject * gobject_

Package Functions

void add_destroy_notify_callback (void *data, func_destroy_notify func) const
void notify_callbacks ()
 Execute and remove all previously installed callbacks.
void remove_destroy_notify_callback (void *data) const

Package Attributes

 __pad0__:func_destroy_notify func_destroy_notify

Private Member Functions

Visualoperator= (const Visual &)
 Visual (const Visual &)

Static Private Attributes

static CppClassType visual_class_

Friends

class Glib::GSigConnectionNode
class Glib::Object_Class
class Visual_Class

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Glib::Object > wrap (GObject *object, bool take_copy=false)
Glib::RefPtr< Gdk::Visualwrap (GdkVisual *object, bool take_copy=false)

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index