824N/A/* Copyright (c) 1993, 1998, Oracle and/or its affiliates. All rights reserved. 824N/A * Permission is hereby granted, free of charge, to any person obtaining a 824N/A * copy of this software and associated documentation files (the "Software"), 824N/A * to deal in the Software without restriction, including without limitation 824N/A * the rights to use, copy, modify, merge, publish, distribute, sublicense, 824N/A * and/or sell copies of the Software, and to permit persons to whom the 824N/A * Software is furnished to do so, subject to the following conditions: 824N/A * The above copyright notice and this permission notice (including the next 824N/A * paragraph) shall be included in all copies or substantial portions of the 824N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 824N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 824N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 824N/A * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 824N/A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 824N/A * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 824N/A * DEALINGS IN THE SOFTWARE. 824N/A/* Mbufset Shared Info format */ 824N/A unsigned int mbufseq;
/* incremented on composition or display 824N/A unsigned char enabled;
/* nonzero if an mbufset is active */ 824N/A * This portion of the file file describes the shared memory info page 824N/A * grabber. Many of the structures are shapes specific, and their 824N/A * definitions are copied from shapes #include files. If the shapes 824N/A * structures are changed, then this file would be messed up; but 824N/A * if that happens, a lot of other things would get messed up too, so 833N/A * let's hope that it never happens. 824N/A * This structure is defined in such a way as to allow expansion. In 824N/A * particular, the field 'w_clipoff' contains the offset, in bytes, of 824N/A * the clip data relative to the start of the window information area. 824N/A * Do not attempt to refer directly to the 'w_shape_hdr' element of 824N/A * this structure, as that can cause old executables to break with new 824N/A * Here is a brief description of the WXINFO structure elements 824N/A * which are relavent to the client: * w_flag set to WMODIF by the server whenever any field * in the window info area is changed. Set back to * WSEEN by the client once the info has been read. * The window-info area should be locked while examining * this flag and copying information from the * w_magic Set to 0x47524142 ("GRAB"). * w_version version of window-info area. This header file * currently describes version 1. Programs should * check the version number and either refuse to run * with older versions or at least be careful not to * use fields not defined in older versions. The * comments in the WXINFO structure definition will * show you which these are. * w_devname Ascii device name. Let's hope there's never a * framebuffer with a filename larger than 20 characters. * w_cinfofd File descriptor of wininfo file. This file has * been mmap'ed, so there is no reason for the * application to need to use this. * w_cdevfd File descriptor of the framebuffer named in w_devname. * w_crefcnt Lock count for nested locking. * w_cookie Internal use only. NOT related to the window cookie * that was returned by X_GrabWindow(). * w_clockp pointer to lockpage, used by wx_lock(). * w_clipoff Byte offset from start of info page to start of * w_clipsize size of cliplist. * w_org, w_dim window dimensions, i.e. bounding box of whole window * In 16-bit signed fract format. * w_depth depth of window * w_borderwidth server's idea of the window's bw. This need not be * equal to what the client requested since * something like OLWM could override the client * request and the clinet now has wrong bw. * Interpreting the clip info: * The client is interested in the following structures: * w_shape_hdr pointed to via the wx_clipinfo macro. * w_shape contains flags and a bounding-box for the cliplist. * cliparray follows w_shape. Contains the clip list. * w_shape.SHAPE_FLAGS contains flags that describe the cliplist. If * DGA_SH_EMPTY_FLAG is set, then the clip list is empty (window obscured or * If DGA_SH_RECT_FLAG is set, the clip list is a single rectangle * described by w_shape->SHAPE_{XMIN,YMIN,XMAX,YMAX}. * For non-empty cliplists, use the dga_win_clipinfo(win) routine to get * a pointer to the cliplist. * "Normal" cliplists are a sequence of signed shorts which describes * a sequence of rectangles. The data consists of a sequence of one * or more ymin,ymax pairs, each of which is followed by a sequence of * one or more xmin,xmax pairs. xmin,xmax sequences are terminated by * a single value of DGA_X_EOL. ymin,ymax sequences are terminated by a * single value of DGA_Y_EOL. This is best described with some sample * ptr = dga_win_clipinfo(win); * while( (y0=*ptr++) != DGA_Y_EOL ) * while( (x0=*ptr++) != DGA_X_EOL ) * printf("rectangle from (%d,%d) to (%d,%d)\n",x0,y0,x1-1,y1-1); * Note that the xmax, ymax values are actually one pixel too high. This * may be a bug or a feature, I don't know. #
if !
defined (
WMODIF)
/* cliplist flag, one of: */#
define WMODIF 1 /* server has set a new cliplist */#
define WEXTEND 2 /* extended cliplist present */#
define WXMAGIC 0x47524142 /* "GRAB" *//* Cursor Grabber defines and structures */ /* image data floats under here */ int c_scurgfd;
/* file descriptor for server */ int c_ref_cnt;
/* total number of cur-grabbers*/ int c_index;
/* entry no. in global array */ int c_offset;
/* offset in bytes from top of * page to save_under info */ void*
c_slockp;
/* all windows on this screen use */ void*
c_slockp;
/* all windows on this screen use */ int c_smemsize;
/* number of bytes for saved cursor */ * FLOATING INFO STARTS HERE, CLIENT DO NOT * REFER DIRECTLY TO ANYTHING BELOW THIS LINE. /* Ancillary Buffers ... */ /* The following buffer types also defined(duplicated) in dga.h file. * to this enumerated values, please also update dga.h which is located /* dga_buffer: This structure will contain pDraw pointer and * buffer_site as his first two members, since all the buffer * API's type case the pointer to dga_buffer and dereference * pDraw -> Will be assigned at the client side. * buffer_site -> Software Buffers - DGA_SITE_SYSTEM * Hardware Buffers - DGA_SITE_DEVICE * fn -> shared of file name of the specified buffer. * buffer_type -> Type of the buffer. * sitechg -> Initialized to DGA_SITECHG_INITIAL when the * buffer is created. When the buffer is getting * reallocated, this will have DGA_SITECHG_CACHE. * bitsPerPixel -> depth of the buffer * bytesPerPixel-> (bitsPerPixel +7) >> 3 * width -> buffer width (Window's width) * height -> buffer height (Window's height) * linebytes -> ((bytesPerPixel * width) + 3) & ~3 * b_offset -> offset to data member from buffer address * allocsize -> Shared file size. * data -> Buffer data bits pointer. * pad -> Padding to make sure it is 64-bit aligned, for now. /* ABINFO: This structure contains buffer pointers and their * s_modified -> Will be set to "1" when the buffer is resized. * remap_flag -> This is used across server and client dga implementation * buffer_swap -> swap counter. int width;
/* width & height are used to detect resize */ /* VERSION 0 INFO STARTS HERE */ /* points to unlock page */ /* points to unlock page */ /* server info, meaningless to client */ int w_srefcnt;
/* lock count for nested locks */ char w_devname[
20];
/* framebuffer device name */ int w_crefcnt;
/* lock count for nested locks */ short *
w_cclipptr;
/* client virtual pointer to clip array. */ /* VERSION 1 INFO STARTS HERE */ int *
w_sclipptr;
/* server's pointer to clip array */ /* VERSION 2 INFO STARTS HERE */ /* cursor grabber info */ short number_wids;
/* number of contiguous wids alloc */ short wid;
/* current wid */ /* integer version of window bounds */ int xleft,
ytop;
/* upper-left corner, in pixels */ short w_auxdevid;
/* ID number for aux dev type */ void *
wdev;
/* pointer to server-internal data */ char *
w_srtndlink;
/* server's retained struct pointer */ /* VERSION 3 INFO STARTS HERE */ u_char pad[
1];
/* Padding for int alignment */ * Attributes of multibuffer set * Note: the number of buffers in an mbuf set is specified by * wx_dbuf.number_buffers. int w_obsolete;
/* 0 when shinfo no longer is valid */ /* VERSION 4 INFO STARTS HERE */ /* so the server knows to recalculate */ /* the overlay's opaque shape */ int w_ovlstate;
/* conflict mode of an overlay, one of: */ /* MPG_NONE => DGA_OVLSTATE_SAFE */ /* MPG_SAFE => DGA_OVLSTATE_SAFE */ /* MPG_SOFT => DGA_OVLSTATE_MULTIWID */ /* MPG_HARD => DGA_OVLSTATE_CONFLICT */ /* VERSION 5 INFO STARTS HERE */ * FLOATING INFO STARTS HERE, DO NOT REFER * DIRECTLY TO ANYTHING BELOW THIS LINE. #
define WG_LOCKDEV 0
/* use GRABPAGEALLOC from fb */#
endif /* _DGA_WINSHARED_H */