]> Pileus Git - ~andy/gtk/blob - gdk/gdkvisual.h
Updated Korean 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 #ifndef __GDK_VISUAL_H__
28 #define __GDK_VISUAL_H__
29
30 #include <gdk/gdktypes.h>
31
32 G_BEGIN_DECLS
33
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))
40
41 typedef struct _GdkVisualClass    GdkVisualClass;
42
43 /* Types of visuals.
44  *   StaticGray:
45  *   Grayscale:
46  *   StaticColor:
47  *   PseudoColor:
48  *   TrueColor:
49  *   DirectColor:
50  */
51 typedef enum
52 {
53   GDK_VISUAL_STATIC_GRAY,
54   GDK_VISUAL_GRAYSCALE,
55   GDK_VISUAL_STATIC_COLOR,
56   GDK_VISUAL_PSEUDO_COLOR,
57   GDK_VISUAL_TRUE_COLOR,
58   GDK_VISUAL_DIRECT_COLOR
59 } GdkVisualType;
60
61 /* The visual type.
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.
72  */
73 struct _GdkVisual
74 {
75   GObject parent_instance;
76   
77   GdkVisualType type;
78   gint depth;
79   GdkByteOrder byte_order;
80   gint colormap_size;
81   gint bits_per_rgb;
82
83   guint32 red_mask;
84   gint red_shift;
85   gint red_prec;
86
87   guint32 green_mask;
88   gint green_shift;
89   gint green_prec;
90
91   guint32 blue_mask;
92   gint blue_shift;
93   gint blue_prec;
94 };
95
96 GType         gdk_visual_get_type            (void) G_GNUC_CONST;
97
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);
107
108 void gdk_query_depths       (gint           **depths,
109                              gint            *count);
110 void gdk_query_visual_types (GdkVisualType  **visual_types,
111                              gint            *count);
112
113 GList* gdk_list_visuals (void);
114 #endif
115
116 GdkScreen *gdk_visual_get_screen (GdkVisual *visual);
117
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)
121 #endif
122
123 G_END_DECLS
124
125 #endif /* __GDK_VISUAL_H__ */