File: ddxli.h

package info (click to toggle)
xli 1.17.0+20061110-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 1,540 kB
  • sloc: ansic: 25,840; makefile: 11
file content (115 lines) | stat: -rw-r--r-- 2,829 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/*
 * General Device dependent code for xli.
 *
 * Author; Graeme W. Gill
 */

/* OS dependent stuff */
#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/cursorfont.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <X11/extensions/XShm.h>

#if defined(SYSV) || defined(VMS)
#include <string.h>
#ifndef index			/* some SysV's do this for you */
#define index strchr
#endif
#ifndef rindex
#define rindex strrchr
#endif
#ifndef HAS_MEMCPY
#define HAS_MEMCPY
#endif
#else				/* !SYSV && !VMS */
#include <strings.h>
#endif				/* !SYSV && !VMS */

#ifdef VMS
#define R_OK 4
#define NO_UNCOMPRESS
#endif

/* equate bcopy with memcpy and bzero with memset where appropriate. */
#ifdef HAS_MEMCPY
#if defined(__linux__) || defined(__GLIBC__)
#include <string.h>
#else
#ifndef bcopy
#define bcopy(S,D,N) memcpy((char *)(D),(char *)(S),(N))
#endif
#ifndef bzero
#define bzero(P,N) memset((P),'\0',(N))
#endif
#endif /* !defined(__linux__) && !defined(__GLIBC__) */
#ifndef bfill
#define bfill(P,N,C) memset((P),(C),(N))
#endif
#else				/* !HAS_MEMCPY */
void bfill(char *s, int n, int c);
#endif				/* !HAS_MEMCPY */

/* xli specific data types */

/* If signed char is a legal declaration
 * else assume char is signed by default
 */
#define HAS_SIGNED_CHAR		

typedef unsigned long Pixel;	/* what X thinks a pixel is */
typedef unsigned short Intensity;	/* what X thinks an RGB intensity is */
typedef unsigned char byte;	/* unsigned byte type */

/* signed byte type */
#ifdef HAS_SIGNED_CHAR
typedef signed char sbyte;
#else
typedef char sbyte;
#endif

#ifndef HAVE_BOOLEAN
#define HAVE_BOOLEAN
typedef int boolean;
#endif

#ifndef FALSE
#define FALSE 0
#define TRUE (!FALSE)
#endif

/* Display device dependent Information structure */
typedef struct {
	int width;
	int height;
	Display *disp;
	int scrn;
	Colormap colormap;
} DisplayInfo;

/* This struct holds the X-client side bits for a rendered image. */

typedef struct {
	Display *disp;		/* destination display */
	int scrn;		/* destination screen */
	int depth;		/* depth of drawable we want/have */
	Drawable drawable;	/* drawable to send image to */
	Pixel *index;		/* array of pixel values allocated */
	int no;			/* number of pixels in the array */
	boolean rootimage;	/* True if is a root image - eg, retain colors */
	Pixel foreground;	/* foreground and background pixels for mono images */
	Pixel background;
	Colormap cmap;		/* colormap used for image */
	GC gc;			/* cached gc for sending image */
	XImage *ximage;		/* ximage structure */
	XShmSegmentInfo shm;	/* valid if shm.shmid >= 0 */
} XImageInfo;

/* ddxli.c */
char *xliDisplayName(char *name);
int xliParseXColor(DisplayInfo *dinfo, char *spec, XColor *xlicolor);
int xliDefaultVisual(void);
void xliGammaCorrectXColor(XColor *xlicolor, double gamma);