/* * Copyright 1990 Ithaca Software, Alameda, CA * */

#ifndef X11DATA_DEFINED


typedef struct {

	/* X server communication */
	XDisplay			*display;
	Screen				*screen;
	Visual				*visual;

	/* back link for error handling */
	Display_Context		*dc;

	/* windows and sizes */
	XWindow				window, 
						parent_window, 
						root_window;
	int					window_x, 
						window_y, 
						window_width, 
						window_height;

	/* graphics contexts and incarnations */
	GC					face_gc, 
						line_gc, 
						blended_face_gc, 
						pixar_gc,
						text_gc;

	Incarnation			last_line_rendition, 
						last_face_rendition,
						last_text_rendition;

	Incarnation			last_line_xform_rendition, 
						last_face_xform_rendition,
						last_text_xform_rendition,
						last_blended_face_xform_rendition,
						last_pixar_xform_rendition;

	/* new rendition function pointers, set based on visual type */
	void				(*new_line_rendition)(),		
						(*new_face_rendition)(),
						(*new_text_rendition)();

	/* mouse handling */
	int					yfudge;
	int					mouse_x,
						mouse_y,
						mouse_buttons;
	boolean				mouse_latched,
						mouse_valid;
	int					latched_mouse_x,
						latched_mouse_y,
						latched_mouse_buttons;

	/* resizing hints */
	boolean				stretching_was_on,
						resizing_was_on;

	/* color allocation variables */

	unsigned long		*colormap_map;
	Colormap			cmap,
						default_cmap;
	int					bits_per_color; /* # of planes (per color, if direct) */
	boolean				mapped_colors;	
	boolean				xor_in_progress;

	/* create all the stipples at once */
	Pixmap				stipples[TOTAL_BIT_PATTERNS];

	/* pixel array data */
	XImage				*pixar_image;
	boolean				red_first;		/* for DirectColor rgb's */

	/* prevent excess calls to install-color-map */
	boolean				cmap_installed,
						focus_on_us;

	/* allow init_update to resize things */
	boolean				first_update;

	/* flag for resize event confusion */
	boolean				resize_in_progress;

	/* flag to trim debug output */
	boolean				check_since_finish;

	/* data for X to use to figure out compose sequences. somehow. */
	XComposeStatus		compose_status;

	/* data for us to use to figure out compose sequences. */
	int					first_key;

#	ifdef	APOLLO
		boolean			apollo_kludged;
#	endif	/* APOLLO */

}	XData;


#define X11DATA_DEFINED

#endif	/* ifndef X11DATA_DEFINED */
/* (mustn't end with a '#' line) */
