~ubuntu-branches/ubuntu/precise/gtkmm3.0/precise

« back to all changes in this revision

Viewing changes to gdk/gdkmm/visual.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2011-06-17 00:12:44 UTC
  • Revision ID: james.westby@ubuntu.com-20110617001244-9hl5an15hiaaahi6
Tags: upstream-3.0.1
ImportĀ upstreamĀ versionĀ 3.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- c++ -*-
 
2
// Generated by gtkmmproc -- DO NOT MODIFY!
 
3
#ifndef _GDKMM_VISUAL_H
 
4
#define _GDKMM_VISUAL_H
 
5
 
 
6
 
 
7
#include <glibmm.h>
 
8
 
 
9
/* $Id: visual.hg,v 1.4 2006/04/12 11:11:24 murrayc Exp $ */
 
10
 
 
11
/* visual.h
 
12
 *
 
13
 * Copyright (C) 1998-2002 The gtkmm Development Team
 
14
 *
 
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.
 
19
 *
 
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.
 
24
 *
 
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.
 
28
 */
 
29
 
 
30
#include <glibmm/object.h>
 
31
#include <gdkmm/screen.h>
 
32
#include <gdkmm/types.h>
 
33
//#include <gdk/gdk.h>
 
34
 
 
35
 
 
36
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
37
typedef struct _GdkVisual GdkVisual;
 
38
typedef struct _GdkVisualClass GdkVisualClass;
 
39
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
40
 
 
41
 
 
42
namespace Gdk
 
43
{ class Visual_Class; } // namespace Gdk
 
44
namespace Gdk
 
45
{
 
46
 
 
47
class Screen;
 
48
 
 
49
/** @addtogroup gdkmmEnums gdkmm Enums and Flags */
 
50
 
 
51
/**
 
52
 * @ingroup gdkmmEnums
 
53
 */
 
54
enum VisualType
 
55
{
 
56
  VISUAL_STATIC_GRAY,
 
57
  VISUAL_GRAYSCALE,
 
58
  VISUAL_STATIC_COLOR,
 
59
  VISUAL_PSEUDO_COLOR,
 
60
  VISUAL_TRUE_COLOR,
 
61
  VISUAL_DIRECT_COLOR
 
62
};
 
63
 
 
64
} // namespace Gdk
 
65
 
 
66
 
 
67
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
68
namespace Glib
 
69
{
 
70
 
 
71
template <>
 
72
class Value<Gdk::VisualType> : public Glib::Value_Enum<Gdk::VisualType>
 
73
{
 
74
public:
 
75
  static GType value_type() G_GNUC_CONST;
 
76
};
 
77
 
 
78
} // namespace Glib
 
79
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
80
 
 
81
 
 
82
namespace Gdk
 
83
{
 
84
 
 
85
 
 
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
 
91
 * bits.
 
92
 *
 
93
 * There are several standard visuals. The visual returned by Gdk::Screen::get_system_visual() is the system's default visual.
 
94
 *
 
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.
 
100
 */
 
101
 
 
102
class Visual : public Glib::Object
 
103
{
 
104
  
 
105
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
106
 
 
107
public:
 
108
  typedef Visual CppObjectType;
 
109
  typedef Visual_Class CppClassType;
 
110
  typedef GdkVisual BaseObjectType;
 
111
  typedef GdkVisualClass BaseClassType;
 
112
 
 
113
private:  friend class Visual_Class;
 
114
  static CppClassType visual_class_;
 
115
 
 
116
private:
 
117
  // noncopyable
 
118
  Visual(const Visual&);
 
119
  Visual& operator=(const Visual&);
 
120
 
 
121
protected:
 
122
  explicit Visual(const Glib::ConstructParams& construct_params);
 
123
  explicit Visual(GdkVisual* castitem);
 
124
 
 
125
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
126
 
 
127
public:
 
128
  virtual ~Visual();
 
129
 
 
130
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
131
  static GType get_type()      G_GNUC_CONST;
 
132
 
 
133
 
 
134
  static GType get_base_type() G_GNUC_CONST;
 
135
#endif
 
136
 
 
137
  ///Provides access to the underlying C GObject.
 
138
  GdkVisual*       gobj()       { return reinterpret_cast<GdkVisual*>(gobject_); }
 
139
 
 
140
  ///Provides access to the underlying C GObject.
 
141
  const GdkVisual* gobj() const { return reinterpret_cast<GdkVisual*>(gobject_); }
 
142
 
 
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();
 
145
 
 
146
private:
 
147
 
 
148
protected:
 
149
 
 
150
  Visual();
 
151
 
 
152
public:
 
153
   
 
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.
 
158
   */
 
159
  static Glib::RefPtr<Visual> get_system();
 
160
   
 
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.
 
164
   */
 
165
  static Glib::RefPtr<Visual> get_best();
 
166
   
 
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.
 
173
   */
 
174
  static Glib::RefPtr<Visual> get_best(int depth);
 
175
   
 
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
 
179
   *  @a visual_type.
 
180
   * @param visual_type A visual type.
 
181
   * @return Best visual of the given type.
 
182
   */
 
183
  static Glib::RefPtr<Visual> get_best(VisualType visual_type);
 
184
   
 
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.
 
190
   */
 
191
  static Glib::RefPtr<Visual> get_best(int depth, VisualType visual_type);
 
192
 
 
193
   
 
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
 
196
   * per pixel.
 
197
   * @return Best available depth.
 
198
   */
 
199
  static int get_best_depth();
 
200
   
 
201
  /** Return the best available visual type for the default GDK screen.
 
202
   * @return Best visual type.
 
203
   */
 
204
  static VisualType get_best_type();
 
205
 
 
206
   
 
207
  /** Gets the screen to which this visual belongs
 
208
   * 
 
209
   * @newin{2,2}
 
210
   * @return The screen to which this visual belongs.
 
211
   */
 
212
  Glib::RefPtr<Screen> get_screen();
 
213
   
 
214
  /** Gets the screen to which this visual belongs
 
215
   * 
 
216
   * @newin{2,2}
 
217
   * @return The screen to which this visual belongs.
 
218
   */
 
219
  Glib::RefPtr<const Screen> get_screen() const;
 
220
   
 
221
   
 
222
  VisualType get_visual_type() const;
 
223
   
 
224
  int get_depth() const;
 
225
   
 
226
  ByteOrder get_byte_order();
 
227
   
 
228
  int get_colormap_size() const;
 
229
   
 
230
  int get_bits_per_rgb() const;
 
231
   
 
232
  void get_red_pixel_details(guint32& mask, int& shift, int& precision) const;
 
233
   
 
234
  void get_green_pixel_details(guint32& mask, int& shift, int& precision) const;
 
235
   
 
236
  void get_blue_pixel_details(guint32& mask, int& shift, int& precision) const;
 
237
                                                  
 
238
 
 
239
public:
 
240
 
 
241
public:
 
242
  //C++ methods used to invoke GTK+ virtual functions:
 
243
 
 
244
protected:
 
245
  //GTK+ Virtual Functions (override these to change behaviour):
 
246
 
 
247
  //Default Signal Handlers::
 
248
 
 
249
 
 
250
};
 
251
 
 
252
} //namespace Gdk
 
253
 
 
254
 
 
255
namespace Glib
 
256
{
 
257
  /** A Glib::wrap() method for this object.
 
258
   * 
 
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.
 
262
   *
 
263
   * @relates Gdk::Visual
 
264
   */
 
265
  Glib::RefPtr<Gdk::Visual> wrap(GdkVisual* object, bool take_copy = false);
 
266
}
 
267
 
 
268
 
 
269
#endif /* _GDKMM_VISUAL_H */
 
270