1 /* GDK - The GIMP Drawing Kit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
22 * file for a list of people on the GTK+ Team. See the ChangeLog
23 * files for a list of changes. These files are distributed with
24 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
27 #ifndef __GDK_VISUAL_H__
28 #define __GDK_VISUAL_H__
30 #include <gdk/gdktypes.h>
34 #define GDK_TYPE_VISUAL (gdk_visual_get_type ())
35 #define GDK_VISUAL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_VISUAL, GdkVisual))
36 #define GDK_VISUAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_VISUAL, GdkVisualClass))
37 #define GDK_IS_VISUAL(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_VISUAL))
38 #define GDK_IS_VISUAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_VISUAL))
39 #define GDK_VISUAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_VISUAL, GdkVisualClass))
41 typedef struct _GdkVisualClass GdkVisualClass;
53 GDK_VISUAL_STATIC_GRAY,
55 GDK_VISUAL_STATIC_COLOR,
56 GDK_VISUAL_PSEUDO_COLOR,
57 GDK_VISUAL_TRUE_COLOR,
58 GDK_VISUAL_DIRECT_COLOR
62 * "type" is the type of visual this is (PseudoColor, TrueColor, etc).
63 * "depth" is the bit depth of this visual.
64 * "colormap_size" is the size of a colormap for this visual.
65 * "bits_per_rgb" is the number of significant bits per red, green and blue.
66 * The red, green and blue masks, shifts and precisions refer
67 * to value needed to calculate pixel values in TrueColor and DirectColor
68 * visuals. The "mask" is the significant bits within the pixel. The
69 * "shift" is the number of bits left we must shift a primary for it
70 * to be in position (according to the "mask"). "prec" refers to how
71 * much precision the pixel value contains for a particular primary.
75 GObject parent_instance;
79 GdkByteOrder byte_order;
96 GType gdk_visual_get_type (void) G_GNUC_CONST;
98 #ifndef GDK_MULTIHEAD_SAFE
99 gint gdk_visual_get_best_depth (void);
100 GdkVisualType gdk_visual_get_best_type (void);
101 GdkVisual* gdk_visual_get_system (void);
102 GdkVisual* gdk_visual_get_best (void);
103 GdkVisual* gdk_visual_get_best_with_depth (gint depth);
104 GdkVisual* gdk_visual_get_best_with_type (GdkVisualType visual_type);
105 GdkVisual* gdk_visual_get_best_with_both (gint depth,
106 GdkVisualType visual_type);
108 void gdk_query_depths (gint **depths,
110 void gdk_query_visual_types (GdkVisualType **visual_types,
113 GList* gdk_list_visuals (void);
116 GdkScreen *gdk_visual_get_screen (GdkVisual *visual);
118 #ifndef GDK_DISABLE_DEPRECATED
119 #define gdk_visual_ref(v) g_object_ref(v)
120 #define gdk_visual_unref(v) g_object_unref(v)
125 #endif /* __GDK_VISUAL_H__ */