2
// Generated by gtkmmproc -- DO NOT MODIFY!
3
#ifndef _GDKMM_VISUAL_H
4
#define _GDKMM_VISUAL_H
9
/* $Id: visual.hg,v 1.4 2006/04/12 11:11:24 murrayc Exp $ */
13
* Copyright (C) 1998-2002 The gtkmm Development Team
15
* This library is free software; you can redistribute it and/or
16
* modify it under the terms of the GNU Lesser General Public
17
* License as published by the Free Software Foundation; either
18
* version 2.1 of the License, or (at your option) any later version.
20
* This library is distributed in the hope that it will be useful,
21
* but WITHOUT ANY WARRANTY; without even the implied warranty of
22
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23
* Lesser General Public License for more details.
25
* You should have received a copy of the GNU Lesser General Public
26
* License along with this library; if not, write to the Free
27
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30
#include <glibmm/object.h>
31
#include <gdkmm/screen.h>
32
#include <gdkmm/types.h>
33
//#include <gdk/gdk.h>
36
#ifndef DOXYGEN_SHOULD_SKIP_THIS
37
typedef struct _GdkVisual GdkVisual;
38
typedef struct _GdkVisualClass GdkVisualClass;
39
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
43
{ class Visual_Class; } // namespace Gdk
49
/** @addtogroup gdkmmEnums gdkmm Enums and Flags */
67
#ifndef DOXYGEN_SHOULD_SKIP_THIS
72
class Value<Gdk::VisualType> : public Glib::Value_Enum<Gdk::VisualType>
75
static GType value_type() G_GNUC_CONST;
79
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
86
/** A Gdk::Visual describes a particular video hardware display format.
87
* It includes information about the number of bits used for each color, the way the bits are translated into an RGB value
88
* for display, and the way the bits are stored in memory. For example, a piece of display hardware might support 24-bit
89
* 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
90
* 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
93
* There are several standard visuals. The visual returned by Gdk::Screen::get_system_visual() is the system's default visual.
95
* A number of methods are provided for determining the "best" available visual. For the purposes of making this
96
* determination, higher bit depths are considered better, and for visuals of the same bit depth, GDK_VISUAL_PSEUDO_COLOR
97
* is preferred at 8bpp, otherwise, the visual types are ranked in the order of (highest to lowest) GDK_VISUAL_DIRECT_COLOR,
98
* GDK_VISUAL_TRUE_COLOR, GDK_VISUAL_PSEUDO_COLOR, GDK_VISUAL_STATIC_COLOR, GDK_VISUAL_GRAYSCALE, then
99
* GDK_VISUAL_STATIC_GRAY.
102
class Visual : public Glib::Object
105
#ifndef DOXYGEN_SHOULD_SKIP_THIS
108
typedef Visual CppObjectType;
109
typedef Visual_Class CppClassType;
110
typedef GdkVisual BaseObjectType;
111
typedef GdkVisualClass BaseClassType;
113
private: friend class Visual_Class;
114
static CppClassType visual_class_;
118
Visual(const Visual&);
119
Visual& operator=(const Visual&);
122
explicit Visual(const Glib::ConstructParams& construct_params);
123
explicit Visual(GdkVisual* castitem);
125
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
130
#ifndef DOXYGEN_SHOULD_SKIP_THIS
131
static GType get_type() G_GNUC_CONST;
134
static GType get_base_type() G_GNUC_CONST;
137
///Provides access to the underlying C GObject.
138
GdkVisual* gobj() { return reinterpret_cast<GdkVisual*>(gobject_); }
140
///Provides access to the underlying C GObject.
141
const GdkVisual* gobj() const { return reinterpret_cast<GdkVisual*>(gobject_); }
143
///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
144
GdkVisual* gobj_copy();
154
/** Get the system's default visual for the default GDK screen.
155
* This is the visual for the root window of the display.
156
* The return value should not be freed.
157
* @return System visual.
159
static Glib::RefPtr<Visual> get_system();
161
/** Get the visual with the most available colors for the default
162
* GDK screen. The return value should not be freed.
163
* @return Best visual.
165
static Glib::RefPtr<Visual> get_best();
167
/** Get the best visual with depth @a depth for the default GDK screen.
168
* Color visuals and visuals with mutable colormaps are preferred
169
* over grayscale or fixed-colormap visuals. The return value should not
170
* be freed. <tt>0</tt> may be returned if no visual supports @a depth.
171
* @param depth A bit depth.
172
* @return Best visual for the given depth.
174
static Glib::RefPtr<Visual> get_best(int depth);
176
/** Get the best visual of the given @a visual_type for the default GDK screen.
177
* Visuals with higher color depths are considered better. The return value
178
* should not be freed. <tt>0</tt> may be returned if no visual has type
180
* @param visual_type A visual type.
181
* @return Best visual of the given type.
183
static Glib::RefPtr<Visual> get_best(VisualType visual_type);
185
/** Combines get_best_with_depth() and get_best_with_type().
186
* @param depth A bit depth.
187
* @param visual_type A visual type.
188
* @return Best visual with both @a depth and
189
* @a visual_type, or <tt>0</tt> if none.
191
static Glib::RefPtr<Visual> get_best(int depth, VisualType visual_type);
194
/** Get the best available depth for the default GDK screen. "Best"
195
* means "largest," i.e. 32 preferred over 24 preferred over 8 bits
197
* @return Best available depth.
199
static int get_best_depth();
201
/** Return the best available visual type for the default GDK screen.
202
* @return Best visual type.
204
static VisualType get_best_type();
207
/** Gets the screen to which this visual belongs
210
* @return The screen to which this visual belongs.
212
Glib::RefPtr<Screen> get_screen();
214
/** Gets the screen to which this visual belongs
217
* @return The screen to which this visual belongs.
219
Glib::RefPtr<const Screen> get_screen() const;
222
VisualType get_visual_type() const;
224
int get_depth() const;
226
ByteOrder get_byte_order();
228
int get_colormap_size() const;
230
int get_bits_per_rgb() const;
232
void get_red_pixel_details(guint32& mask, int& shift, int& precision) const;
234
void get_green_pixel_details(guint32& mask, int& shift, int& precision) const;
236
void get_blue_pixel_details(guint32& mask, int& shift, int& precision) const;
242
//C++ methods used to invoke GTK+ virtual functions:
245
//GTK+ Virtual Functions (override these to change behaviour):
247
//Default Signal Handlers::
257
/** A Glib::wrap() method for this object.
259
* @param object The C instance.
260
* @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
261
* @result A C++ instance that wraps this C instance.
263
* @relates Gdk::Visual
265
Glib::RefPtr<Gdk::Visual> wrap(GdkVisual* object, bool take_copy = false);
269
#endif /* _GDKMM_VISUAL_H */