.EH ''''
.OH ''''
.EF ''''
.OF ''''
.ps 10
.nr PS 10
\&
.NH 1
C language Binding for VEX protocol version 3.4.  August 15, 1989.
.LP
Please refer to the protocol portion of the document for a description of
the semantics of these routines.  They are a simple veneer over the protocol
and perform no magic.
.LP
Bool
XVideoQueryExtension (display)
.RS
Display	*display;
.RE
.IP
Returns True if the specified display supports the VEX extension, False
otherwise.
.LP
int
XVideoGetEventBase (display)
.RS
Display *display;
.RE
.IP
Returns the first event number that this extension will generate from
the specified display.  Use this to gather events from the display.
.LP
Status XQueryVideo(dpy, screen_number)
.RS
Display *dpy;
.br
int screen_number;
.RE
.IP
Updates Xlib private information about video hardware for the screen 
associated with the specified screen.  Clients should call this routine
when they receive a VideoChange event.
Status is 0 if the screen has no video hardware; otherwise it is nonzero.
.LP
XChangeConnectivity(dpy, time, old_state, new_state)
.RS
.br
Display *dpy;
.br
Time time;
.br
unsigned long old_state;
.br
unsigned long new_state;
.RE
.IP
Change the state of the network to new_state.
.LP
XChangeBlendmap(dpy, w, blendmap)
.RS
.br
Display *dpy;
.br
Window w;
.br
Colormap blendmap;
.RE
.IP
Change named window's blendmap.
.LP
XRenderVideo(dpy, src, dest, src_x, src_y, src_width, src_height, dest_x, dest_y,
dest_width, dest_height, full_motion, priority, subwindow_mode)
.RS
.br
Display *dpy;
.br
VideoIn src;
.br
Drawable dest;
.br
unsigned int src_x, src_y;
.br
unsigned int src_width, src_height;
.br
unsigned int dest_x, dest_y;
.br
unsigned int dest_width, dest_height;
.br
Bool full_motion;
.br
int priority;
.br
int subwindow_mode;
.RE
.IP
The video input source is displayed on the destination window.
.LP
XUpdateTranslucent(dpy, src, dest, gc, src_x, src_y, width, height, dest_x, dest_y)
.RS
.br
Display *dpy;
.br
Drawable src;
.br
Drawable dest;
.br
GC gc;
.br
int src_x, src_y;
.br
unsigned int width, height;
.br
int dest_x, dest_y;
.RE
.IP
Update a rectangle of a translucent associated with src or obtain pixels in
translucent associated with src.
.LP
XFillTranslucentRectangle(dpy, w, gc, rectangles, nrectangles)
.RS
Display *dpy;
.br
Window w;
.br
GC gc;
.br
XRectangle *rectangles;
.br
int nrectangles;
.RE
.IP
Fill specified rectangles in the translucent associated with the given
window.
.LP
XCaptureGraphics(dpy, src, dest, src_x, src_y, src_width, src_height,
dest_x, dest_y, dest_width, dest_height, full_motion, priority, subwindow_mode)
.RS
Display *dpy;
.br
Drawable src;
.br
VideoOut dest;
.br
unsigned int src_x, src_y;
.br
unsigned int src_width, src_height;
.br
unsigned int dest_x, dest_y;
.br
unsigned int dest_width, dest_height;
.br
Bool full_motion;
.br
int priority;
.br
int subwindow_mode;
.RE
.IP
The specified region of the source is converted into a video signal and
directed to the destination.
.LP
XStopVideo(dpy, action, drawables, ndrawables)
.RS
Display *dpy;
.br
int action;
.br
Drawable *drawables;
.br
unsigned long ndrawables;
.RE
.IP
The video actions previously requested on any of the listed
video windows are stopped.
.LP
XSetting *
XQueryVideoControls(dpy, vid, controls, ncontrols, nsettings_return)
.RS
Display *dpy;
.br
VideoID vid;
.br
Atom *controls;
.br
unsigned long ncontrols;
.br
unsigned long *nsettings_return;
.RE
.IP
Returns a list of settings for the named videoID.
Use XDeleteSettingList to free the returned list when it is no longer needed.
.LP
XChangeVideoControls(dpy, settings, nsettings)
.RS
Display *dpy;
.br
XSetting *settings;
.br
unsigned long nsettings;
.RE
.IP
Set the video controls given in the list of settings.
.LP
XInstallBlendmap(dpy, bmap)
.RS
Display *dpy;
.br
Colormap bmap;
.RE
.IP
Install this blendmap as an installed map for its screen.
.LP
XUninstallBlendmap(dpy, bmap)
.RS
Display *dpy;
.br
Colormap bmap;
.RE
.IP
Uninstall this blendmap for its screen.
.LP
Colormap *XListInstalledBlendmaps(dpy, win, num_return)
.RS
Display *dpy;
.br
Window win;
.br
int *num_return;
.RE
.IP
Return a list of the currently installed blendmaps.
.LP
XRedirectVideoRequests(dpy, win)
.RS
Display *dpy;
.br
Window win;
.RE
.LP
The following routines manipulate Xlib data structures.
.LP
XVisualInfo *XGetVEXVisualInfo( dpy, visual_info_mask, visual_info_template, nitems)
.RS
Display *dpy;
.br
long visual_info_mask;
.br
XVisualInfo *visual_info_template;
.br
int *nitems;    /* RETURN */
.RE
.IP
This procedure returns a list of visual information structures
from the list of VEX unique visuals that match the specified attributes
given in the visual information template.
.LP
XVisualInfo *XGetVEXorCoreVisualInfo( dpy, visual_info_mask, visual_info_template, nitems)
.RS
Display *dpy;
.br
long visual_info_mask;
.br
XVisualInfo *visual_info_template;
.br
int *nitems;    /* RETURN */
.RE
.IP
This procedure returns a list of visual information structures
from either the core list or the VEX unique visuals list that match 
the specified attributes given in the visual information template.
.LP
XVin *XGetVins( dpy, screen_number, nitems)
.RS
Display *dpy;
.br
int screen_number;
.br
int *nitems;        /* RETURN */
.RE
.IP
Returns an array of XVin structures for the named screen.
.LP
XVout *XGetVouts( dpy, screen_number, nitems)
.RS
Display *dpy;
.br
int screen_number;
.br
int *nitems;        /* RETURN */
.RE
.IP
Returns an array of XVout structures for the named screen.
.LP
XVdev *XGetVdevs( dpy, screen_number, nitems)
.RS
Display *dpy;
.br
int screen_number;
.br
int *nitems;        /* RETURN */
.RE
.IP
Returns an array of XVdev structures for the named screen.
.LP
Bool ScreenHasVideo( dpy, screen_number)
.RS
Display *dpy;
.br
int screen_number;
.RE
.IP
Returns True if the named screen has video hardware associated with it.
Returns False otherwise.
.LP
Status BmapsOfScreen( dpy, screen_number, min_bmaps, max_bmaps)
.RS
Display *dpy;
.br
int screen_number;
.br
min_bmaps
.br
max_bmaps
.RE
.IP
Returns the minimum and maximum number of installed blendmaps for the
named screen.  
Status is nonzero if the named screen has video hardware associated with it.
Status is zero otherwise.
.LP
Status OverlapsOfScreen( dpy, screen_number, input_overlap, capture_overlap,
io_overlap)
.RS
Display *dpy;
.br
int screen_number;
.br
Bool *input_overlap
.br
Bool *capture_overlap
.br
Bool *io_overlap
.RE
.IP
Returns information on video overlapping capability for the named screen.
Overlapping capabilities are defined in the QueryVideo section of the
VEX protocol.
Status is nonzero if the named screen has video hardware associated with it.
Status is zero otherwise.
.LP
Status VideoTimestamps( dpy, screen_number, video_change_time,
video_connectivity_time)
.RS
Display *dpy;
.br
int screen_number;
.br
unsigned long *video_change_time;
.br
unsigned long *video_connectivity_time;
.RE
.IP
Returns timestamp information for for the named screen.
"video_change_time" is the time of the last change in the list of video
devices (returned by the QueryVideo protocol reply and the VideoChange
event.
"video_connectivity_time" is the time of the last change in the connectivity
of video input, outputs and devices.
Status is nonzero if the named screen has video hardware associated with it.
Status is zero otherwise.
.LP
XSetting *
XCreateSettingList(control_list, ncontrol)
.RS
XControl *control_list;
.br
unsigned long ncontrol;
.RE
.IP
Create a list of setting structures corresponding to the input control_list.
Constant data is copied from the XControls to the XSettings:
name, id, format, length.
Space is allocated for value data and the list pointer is set in the
XSettings structures.
.LP
XDeleteSettingList(setting_list, nsetting)
.RS
XSetting *setting_list;
.br
unsigned long nsetting;
.RE
.IP
Delete a list of setting structures which was allocated by XCreateSettingList
or XQueryVideoControls.
.NH 1
Data Structures for C language Binding.
.nf
\f(C
.ta \w'aaaaaaaa'u \w'aaaaaaaaaaaaaaaa'u \w'aaaaaaaaaaaaaaaaaaaaaaaa'u \w'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'u
/*
 * New types for video extension client library
 */
typedef struct {
	long		numerator;
	long		denominator;
} XFraction;

typedef struct {
	XFraction	base;
	XFraction	increment;
	unsigned long	limit;
	char		type;
	char		pad1;
	short		pad2;
} XFractionRange;

typedef struct {
	Atom		name;
	VideoID		id;
	char		event;
	char		format;
	short		pad1;
	unsigned long	length;		/* always in bytes */
} XControl;

typedef struct {
	Atom		name;
	VideoID		id;
	char		event;
	char		format;
	unsigned long	length;		/* always in bytes */
	union {
		char	*p8List;
		short	*p16List;
		long	*p32List;
	} value
} XSetting;

typedef struct {
	XRectangle	base;
	XRectangle	limit;
	short		x_inc;
	short		y_inc;
	unsigned short	width_inc;
	unsigned short	height_inc;
	char		type;
	char		pad1;
	short		pad2;
} XRectangleRange;

typedef struct {
	XFraction	frame_rate;
	XRectangleRange	src;
	XRectangleRange	dest;
	XFractionRange	x_scale;
	XFractionRange	y_scale;
} XPlacement;

typedef struct {
	XFraction	frame_rate;
	XFraction	field_rate;
	unsigned short	width;
	unsigned short	height;
	int		nplacement;
	XPlacement	*placement;
} XVideoGeometry;

typedef struct {
	int		depth;
	VisualID	visualid;
} XRenderModel;

typedef struct {
	VideoID		src;
	VideoID		dst;
	long		old_state;
	long		new_state;
} XVideoConnection;

typedef struct {
	int		render_model_index;
	Colormap	blendmap;
} XBlendModel;


/*
 * Aggregate QueryVideo types
 */
typedef struct {
	int		model_mask;     /* WindowModel and/or BufferModel */
	VisualID	model_visual;
} XIOModel;

typedef struct {
	Bool		composite;
	int		nmodels;
	XIOModel	*models;
	int		npixmap_depths;
	int		*pixmap_depths;
} ModelInfo;

typedef struct {
	VideoIn		id;
	int		ndevice_controls;
	XControl	*device_controls;
	XVideoGeometry	geometry;
	ModelInfo	input_models;
	VisualID	bmap_visual;
	Colormap	default_blendmap;
	XRectangle	clip_size;
} XVin;

typedef struct {
	VideoOut	id;
	int		ndevice_controls;
	XControl	*device_controls;
	XVideoGeometry	geometry;
	ModelInfo	output_models;
} XVout;

typedef struct {
	VideoDevice	id;
	int		ndevice_controls;
	XControl	*device_controls;
	Atom		name;
} XVdev;

/*
 * New events for video extension client library
 * A "XEvent" structure always	has type as the first entry.  This
 * uniquely identifies what  kind of event it is.  The second entry
 * is always a pointer to the display the event was read from.
 * The third entry is always a window of one type or another,
 */

typedef struct {
	int	      type;	/* of event */
	unsigned long serial;	/* # of last request processed by server */
	Bool	      send_event; /* true if this came from a SendEvent request */
	Display	      *display;/* Display the event was read from */
	Window	      window;	/* unused */
	VideoID	      vid;	/* from Setting given to ChangeVideoControls */
	Atom	      name;	/* from Setting given to ChangeVideoControls */
	Time	      time;	/* current server time */
	char	      state;	/* Success, Fail */
} XVideoControlEvent;

typedef struct {
	int	      type;	/* of event */
	unsigned long serial;	/* # of last request processed by server */
	Bool	      send_event;/* true if this came from a SendEvent request */
	Display	      *display;	/* Display the event was read from */
	Window	      window;	/* window on which EXPOSURE was selected */
	VideoIO	      vid;
	Time	      time;	/* current server time */
	unsigned short action_mask; /* Scale, Placement, Clip, Overlap */
	char	      state;	/* Success, Fail, Subset */
} XVideoViolationEvent;

typedef struct {
	int	      type;	/* of event */
	unsigned long serial;	/* # of last request processed by server */
	Bool	      send_event;/* true if this came from a SendEvent request */
	Display	      *display;	/* Display the event was read from */
	Window	      window;	/* window on which EXPOSURE was selected */
	VideoIn	      vin;	/* vin on which RenderVideo was requested */
	Time	      time;	/* current server time */
	char	      state;	/* Acquired or Lost */
} XVideoSyncEvent;

typedef struct {
	int	      type;	/* of event */
	unsigned long serial;	/* # of last request processed by server */
	Bool	      send_event;/* true if this came from a SendEvent request */
	Display	      *display;	/* Display the event was read from */
	Window	      window;	/* window on which EXPOSURE was selected */
	VideoIn	      vin;	/* vin on which RenderVideo was requested */
	Time	      time;	/* current server time */
} XVideoOverrideEvent;

typedef struct {
	int	      type;	/* of event */
	unsigned longserial;	/* # of last request processed by server */
	Bool	      send_event;/* true if this came from a SendEvent request */
	Display	      *display;	/* Display the event was read from */
	Window	      window;	/* unused */
	int	      screen;
	VideoDevice   vdev;	/* vdev which changed state */
	Time	      time;	/* current server time */
	char	      state;	/* Online or Offline */
} XVideoChangeEvent;

typedef struct {
	int	      type;	/* of event */
	unsigned long serial;	/* # of last request processed by server */
	Bool	      send_event;/* true if this came from a SendEvent request */
	Display	      *display;	/* Display the event was read from */
	Window	      window;	/* unused */
	int	      screen;
	unsigned long new_state;/* index into list of adjacency Matrices */
	Time	      time;	/* of last successful ChangeVideoConnectivity */
} XVideoConnectivityStateEvent;
.DE
