]> Pileus Git - ~andy/gtk/blob - gdk/gdkvisual.h
Updated Slovenian translation
[~andy/gtk] / gdk / gdkvisual.h
1 /* GDK - The GIMP Drawing Kit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
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.
8  *
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.
13  *
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.
18  */
19
20 /*
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/.
25  */
26
27 #if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
28 #error "Only <gdk/gdk.h> can be included directly."
29 #endif
30
31 #ifndef __GDK_VISUAL_H__
32 #define __GDK_VISUAL_H__
33
34 #include <gdk/gdktypes.h>
35
36 G_BEGIN_DECLS
37
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_IS_VISUAL(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_VISUAL))
41
42 /**
43  * GdkVisualType:
44  * @GDK_VISUAL_STATIC_GRAY: Each pixel value indexes a grayscale value
45  *     directly.
46  * @GDK_VISUAL_GRAYSCALE: Each pixel is an index into a color map that
47  *     maps pixel values into grayscale values. The color map can be
48  *     changed by an application.
49  * @GDK_VISUAL_STATIC_COLOR: Each pixel value is an index into a predefined,
50  *     unmodifiable color map that maps pixel values into RGB values.
51  * @GDK_VISUAL_PSEUDO_COLOR: Each pixel is an index into a color map that
52  *     maps pixel values into rgb values. The color map can be changed by
53  *     an application.
54  * @GDK_VISUAL_TRUE_COLOR: Each pixel value directly contains red, green,
55  *     and blue components. Use gdk_visual_get_red_pixel_details(), etc,
56  *     to obtain information about how the components are assembled into
57  *     a pixel value.
58  * @GDK_VISUAL_DIRECT_COLOR: Each pixel value contains red, green, and blue
59  *     components as for %GDK_VISUAL_TRUE_COLOR, but the components are
60  *     mapped via a color table into the final output table instead of
61  *     being converted directly.
62  *
63  * A set of values that describe the manner in which the pixel values
64  * for a visual are converted into RGB values for display.
65  */
66 typedef enum
67 {
68   GDK_VISUAL_STATIC_GRAY,
69   GDK_VISUAL_GRAYSCALE,
70   GDK_VISUAL_STATIC_COLOR,
71   GDK_VISUAL_PSEUDO_COLOR,
72   GDK_VISUAL_TRUE_COLOR,
73   GDK_VISUAL_DIRECT_COLOR
74 } GdkVisualType;
75
76 /**
77  * GdkVisual:
78  *
79  * The #GdkVisual structure contains information about
80  * a particular visual.
81  */
82
83 GType         gdk_visual_get_type            (void) G_GNUC_CONST;
84
85 #ifndef GDK_MULTIHEAD_SAFE
86 gint          gdk_visual_get_best_depth      (void);
87 GdkVisualType gdk_visual_get_best_type       (void);
88 GdkVisual*    gdk_visual_get_system          (void);
89 GdkVisual*    gdk_visual_get_best            (void);
90 GdkVisual*    gdk_visual_get_best_with_depth (gint           depth);
91 GdkVisual*    gdk_visual_get_best_with_type  (GdkVisualType  visual_type);
92 GdkVisual*    gdk_visual_get_best_with_both  (gint           depth,
93                                               GdkVisualType  visual_type);
94
95 void gdk_query_depths       (gint           **depths,
96                              gint            *count);
97 void gdk_query_visual_types (GdkVisualType  **visual_types,
98                              gint            *count);
99
100 GList* gdk_list_visuals (void);
101 #endif
102
103 GdkScreen    *gdk_visual_get_screen (GdkVisual *visual);
104
105 GdkVisualType gdk_visual_get_visual_type         (GdkVisual *visual);
106 gint          gdk_visual_get_depth               (GdkVisual *visual);
107 GdkByteOrder  gdk_visual_get_byte_order          (GdkVisual *visual);
108 gint          gdk_visual_get_colormap_size       (GdkVisual *visual);
109 gint          gdk_visual_get_bits_per_rgb        (GdkVisual *visual);
110 void          gdk_visual_get_red_pixel_details   (GdkVisual *visual,
111                                                   guint32   *mask,
112                                                   gint      *shift,
113                                                   gint      *precision);
114 void          gdk_visual_get_green_pixel_details (GdkVisual *visual,
115                                                   guint32   *mask,
116                                                   gint      *shift,
117                                                   gint      *precision);
118 void          gdk_visual_get_blue_pixel_details  (GdkVisual *visual,
119                                                   guint32   *mask,
120                                                   gint      *shift,
121                                                   gint      *precision);
122
123 G_END_DECLS
124
125 #endif /* __GDK_VISUAL_H__ */