1 #ifndef LCDF_GIFX_H
2 #define LCDF_GIFX_H
3 #include <lcdfgif/gif.h>
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
8 /* gifx.h - Functions to turn GIFs in memory into X Pixmaps.
9    Copyright (C) 1997-9 Eddie Kohler, eddietwo@lcs.mit.edu
10    This file is part of the LCDF GIF library.
11 
12    The LCDF GIF library is free software*. It is distributed under the GNU
13    General Public License, version 2 or later; you can copy, distribute, or
14    alter it at will, as long as this notice is kept intact and this source
15    code is made available. There is no warranty, express or implied.
16 
17    *There is a patent on the LZW compression method used by GIFs, and included
18    in gifwrite.c. Unisys, the patent holder, allows the compression algorithm
19    to be used without a license in software distributed at no cost to the
20    user. The decompression algorithm is not patented. */
21 
22 #include <X11/Xlib.h>
23 
24 #define GIFX_COLORMAP_EXTENSION -107
25 
26 
27 typedef struct Gif_XContext Gif_XContext;
28 typedef struct Gif_XColormap Gif_XColormap;
29 
30 struct Gif_XContext {
31 
32     Display *display;
33     int screen_number;
34     Drawable drawable;
35     Visual *visual;
36     uint16_t depth;
37     uint16_t ncolormap;
38     Colormap colormap;
39 
40     uint16_t nclosest;
41     Gif_Color *closest;
42 
43     int free_deleted_colormap_pixels;
44     Gif_XColormap *xcolormap;
45 
46     GC image_gc;
47     GC mask_gc;
48 
49     unsigned long transparent_pixel;
50     unsigned long foreground_pixel;
51     int refcount;
52 
53 };
54 
55 
56 Gif_XContext *	Gif_NewXContext(Display *, Window);
57 Gif_XContext *	Gif_NewXContextFromVisual(Display *, int screen_number,
58 					Visual *, int depth, Colormap);
59 void		Gif_DeleteXContext(Gif_XContext *);
60 
61 Pixmap		Gif_XImage(Gif_XContext *, Gif_Stream *, Gif_Image *);
62 Pixmap		Gif_XImageColormap(Gif_XContext *, Gif_Stream *,
63 				Gif_Colormap *, Gif_Image *);
64 Pixmap		Gif_XSubImage(Gif_XContext *, Gif_Stream *, Gif_Image *,
65 				int l, int t, int w, int h);
66 Pixmap		Gif_XSubImageColormap(Gif_XContext *, Gif_Image *,
67 				Gif_Colormap *, int l, int t, int w, int h);
68 
69 Pixmap		Gif_XMask(Gif_XContext *, Gif_Stream *, Gif_Image *);
70 Pixmap		Gif_XSubMask(Gif_XContext *, Gif_Image *,
71 				int l, int t, int w, int h);
72 
73 Pixmap		Gif_XNextImage(Gif_XContext *, Pixmap last_last, Pixmap last,
74 			       Gif_Stream *, int n);
75 
76 int		Gif_XAllocateColors(Gif_XContext *, Gif_Colormap *);
77 void		Gif_XDeallocateColors(Gif_XContext *, Gif_Colormap *);
78 unsigned long *	Gif_XClaimStreamColors(Gif_XContext *, Gif_Stream *, int *);
79 
80 
81 #ifdef __cplusplus
82 }
83 #endif
84 #endif
85