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_PIXMAP_H__
28#define __GDK_PIXMAP_H__
29
30#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
31#error "Only <gdk/gdk.h> can be included directly."
32#endif
33
34#include <gdk/gdktypes.h>
35#include <gdk/gdkdrawable.h>
36
37G_BEGIN_DECLS
38
39typedef struct _GdkPixmapObject GdkPixmapObject;
40typedef struct _GdkPixmapObjectClass GdkPixmapObjectClass;
41
42#define GDK_TYPE_PIXMAP (gdk_pixmap_get_type ())
43#define GDK_PIXMAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXMAP, GdkPixmap))
44#define GDK_PIXMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXMAP, GdkPixmapObjectClass))
45#define GDK_IS_PIXMAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXMAP))
46#define GDK_IS_PIXMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXMAP))
47#define GDK_PIXMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXMAP, GdkPixmapObjectClass))
48#define GDK_PIXMAP_OBJECT(object) ((GdkPixmapObject *) GDK_PIXMAP (object))
49
50struct _GdkPixmapObject
51{
52 GdkDrawable parent_instance;
53
54 GdkDrawable *GSEAL (impl); /* window-system-specific delegate object */
55
56 gint GSEAL (depth);
57};
58
59struct _GdkPixmapObjectClass
60{
61 GdkDrawableClass parent_class;
62
63};
64
65GType gdk_pixmap_get_type (void) G_GNUC_CONST;
66
67/* Pixmaps
68 */
69GdkPixmap* gdk_pixmap_new (GdkDrawable *drawable,
70 gint width,
71 gint height,
72 gint depth);
73#ifndef GDK_DISABLE_DEPRECATED
74GdkBitmap* gdk_bitmap_create_from_data (GdkDrawable *drawable,
75 const gchar *data,
76 gint width,
77 gint height);
78GdkPixmap* gdk_pixmap_create_from_data (GdkDrawable *drawable,
79 const gchar *data,
80 gint width,
81 gint height,
82 gint depth,
83 const GdkColor *fg,
84 const GdkColor *bg);
85
86GdkPixmap* gdk_pixmap_create_from_xpm (GdkDrawable *drawable,
87 GdkBitmap **mask,
88 const GdkColor *transparent_color,
89 const gchar *filename);
90GdkPixmap* gdk_pixmap_colormap_create_from_xpm (GdkDrawable *drawable,
91 GdkColormap *colormap,
92 GdkBitmap **mask,
93 const GdkColor *transparent_color,
94 const gchar *filename);
95GdkPixmap* gdk_pixmap_create_from_xpm_d (GdkDrawable *drawable,
96 GdkBitmap **mask,
97 const GdkColor *transparent_color,
98 gchar **data);
99GdkPixmap* gdk_pixmap_colormap_create_from_xpm_d (GdkDrawable *drawable,
100 GdkColormap *colormap,
101 GdkBitmap **mask,
102 const GdkColor *transparent_color,
103 gchar **data);
104#endif
105
106void gdk_pixmap_get_size (GdkPixmap *pixmap,
107 gint *width,
108 gint *height);
109
110/* Functions to create/lookup pixmaps from their native equivalents
111 */
112#ifndef GDK_MULTIHEAD_SAFE
113GdkPixmap* gdk_pixmap_foreign_new (GdkNativeWindow anid);
114GdkPixmap* gdk_pixmap_lookup (GdkNativeWindow anid);
115#endif /* GDK_MULTIHEAD_SAFE */
116
117GdkPixmap* gdk_pixmap_foreign_new_for_display (GdkDisplay *display,
118 GdkNativeWindow anid);
119GdkPixmap* gdk_pixmap_lookup_for_display (GdkDisplay *display,
120 GdkNativeWindow anid);
121GdkPixmap* gdk_pixmap_foreign_new_for_screen (GdkScreen *screen,
122 GdkNativeWindow anid,
123 gint width,
124 gint height,
125 gint depth);
126
127#ifndef GDK_DISABLE_DEPRECATED
128#define gdk_bitmap_ref g_object_ref
129#define gdk_bitmap_unref g_object_unref
130#define gdk_pixmap_ref g_object_ref
131#define gdk_pixmap_unref g_object_unref
132#endif /* GDK_DISABLE_DEPRECATED */
133
134G_END_DECLS
135
136#endif /* __GDK_PIXMAP_H__ */
137