1 /* GDK - The GTK+ 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 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
28 #error "Only <gdk/gdk.h> can be included directly."
31 #ifndef __GDK_VISUAL_H__
32 #define __GDK_VISUAL_H__
34 #include <gdk/gdktypes.h>
38 #define GDK_TYPE_VISUAL (gdk_visual_get_type ())
39 #define GDK_VISUAL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_VISUAL, GdkVisual))
40 #define GDK_VISUAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_VISUAL, GdkVisualClass))
41 #define GDK_IS_VISUAL(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_VISUAL))
42 #define GDK_IS_VISUAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_VISUAL))
43 #define GDK_VISUAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_VISUAL, GdkVisualClass))
45 typedef struct _GdkVisualClass GdkVisualClass;
57 GDK_VISUAL_STATIC_GRAY,
59 GDK_VISUAL_STATIC_COLOR,
60 GDK_VISUAL_PSEUDO_COLOR,
61 GDK_VISUAL_TRUE_COLOR,
62 GDK_VISUAL_DIRECT_COLOR
66 * "type" is the type of visual this is (PseudoColor, TrueColor, etc).
67 * "depth" is the bit depth of this visual.
68 * "colormap_size" is the size of a colormap for this visual.
69 * "bits_per_rgb" is the number of significant bits per red, green and blue.
70 * The red, green and blue masks, shifts and precisions refer
71 * to value needed to calculate pixel values in TrueColor and DirectColor
72 * visuals. The "mask" is the significant bits within the pixel. The
73 * "shift" is the number of bits left we must shift a primary for it
74 * to be in position (according to the "mask"). "prec" refers to how
75 * much precision the pixel value contains for a particular primary.
79 GObject parent_instance;
83 GdkByteOrder byte_order;
100 GType gdk_visual_get_type (void) G_GNUC_CONST;
102 #ifndef GDK_MULTIHEAD_SAFE
103 gint gdk_visual_get_best_depth (void);
104 GdkVisualType gdk_visual_get_best_type (void);
105 GdkVisual* gdk_visual_get_system (void);
106 GdkVisual* gdk_visual_get_best (void);
107 GdkVisual* gdk_visual_get_best_with_depth (gint depth);
108 GdkVisual* gdk_visual_get_best_with_type (GdkVisualType visual_type);
109 GdkVisual* gdk_visual_get_best_with_both (gint depth,
110 GdkVisualType visual_type);
112 void gdk_query_depths (gint **depths,
114 void gdk_query_visual_types (GdkVisualType **visual_types,
117 GList* gdk_list_visuals (void);
120 GdkScreen *gdk_visual_get_screen (GdkVisual *visual);
122 #ifndef GDK_DISABLE_DEPRECATED
123 #define gdk_visual_ref(v) g_object_ref(v)
124 #define gdk_visual_unref(v) g_object_unref(v)
129 #endif /* __GDK_VISUAL_H__ */