dmxextension.c File Reference
#include <stdlib.h>
#include "dmx.h"
#include "dmxinit.h"
#include "dmxextension.h"
#include "dmxwindow.h"
#include "dmxcb.h"
#include "dmxcursor.h"
#include "dmxpixmap.h"
#include "dmxgc.h"
#include "dmxfont.h"
#include "dmxcmap.h"
#include "dmxpict.h"
#include "dmxinput.h"
#include "dmxsync.h"
#include "dmxscrinit.h"
#include "input/dmxinputinit.h"
#include "windowstr.h"
#include "inputstr.h"
#include <X11/extensions/dmxproto.h>
#include "cursorstr.h"

Functions

Bool dmxGetScreenAttributes (int physical, DMXScreenAttributesPtr attr)
Bool dmxGetWindowAttributes (WindowPtr pWindow, DMXWindowAttributesPtr attr)
void dmxGetDesktopAttributes (DMXDesktopAttributesPtr attr)
int dmxGetInputCount (void)
int dmxGetInputAttributes (int deviceId, DMXInputAttributesPtr attr)
static void dmxAdjustCursorBoundaries (void)
int dmxAddInput (DMXInputAttributesPtr attr, int *id)
int dmxRemoveInput (int id)
unsigned long dmxGetNumScreens (void)
void dmxForceWindowCreation (WindowPtr pWindow)
void dmxFlushPendingSyncs (void)
void dmxUpdateScreenResources (ScreenPtr pScreen, int x, int y, int w, int h)
static void dmxBECreateScratchGCs (int scrnNum)
static void dmxBERestorePixmap (PixmapPtr pPixmap)
static void dmxBECreateResources (pointer value, XID id, RESTYPE type, pointer n)
static void dmxBECreateWindowTree (int idx)
static void dmxForceExposures (int idx)
static Bool dmxCompareScreens (DMXScreenInfo *new, DMXScreenInfo *old)
static void dmxBERestoreRenderPict (pointer value, XID id, pointer n)
static void dmxBERestoreRenderGlyph (pointer value, XID id, pointer n)
int dmxAttachScreen (int idx, DMXScreenAttributesPtr attr)
static void dmxBESavePixmap (PixmapPtr pPixmap)
static void dmxBEDestroyResources (pointer value, XID id, RESTYPE type, pointer n)
static void dmxBEDestroyScratchGCs (int scrnNum)
static void dmxBEDestroyWindowTree (int idx)
int dmxDetachScreen (int idx)

Variables

FontPtr defaultFont

Detailed Description

This file provides the only interface to the X server extension support in programs/Xserver/Xext. Those programs should only include dmxext.h


Function Documentation

int dmxAddInput ( DMXInputAttributesPtr  attr,
int *  id 
)

Add an input with the specified attributes. If the input is added, the physical id is returned in deviceId.

References dmxAdjustCursorBoundaries(), dmxInputAttachBackend(), dmxInputAttachConsole(), dmxSync(), DMXInputAttributesRec::inputType, DMXInputAttributesRec::name, DMXInputAttributesRec::physicalScreen, and DMXInputAttributesRec::sendsCore.

Referenced by ProcDMXAddInput().

static void dmxBECreateResources ( pointer  value,
XID  id,
RESTYPE  type,
pointer  n 
) [static]

Create resources on the back-end server. This function is called from dmxAttachScreen() via the dix layer's FindAllResources function. It walks all resources, compares them to the screen number passed in as n and calls the appropriate DMX function to create the associated resource on the back-end server.

References defaultFont, dmxBECreateColormap(), dmxBECreateCursor(), dmxBECreateGC(), dmxBECreatePixmap(), dmxBEFreeGlyphSet(), dmxBELoadFont(), dmxBERestorePixmap(), and dmxChangeGC().

Referenced by dmxAttachScreen().

static void dmxBECreateScratchGCs ( int  scrnNum) [static]

Create the scratch GCs per depth.

References dmxBECreateGC().

Referenced by dmxAttachScreen().

static void dmxBECreateWindowTree ( int  idx) [static]

Create window hierachy on back-end server. The window tree is created in a special order (bottom most subwindow first) so that the dmxCreateNonRootWindow() function does not need to recursively call itself to create each window's parents. This is required so that we have the opportunity to create each window's border and background pixmaps (where appropriate) before the window is created.

References _DMXScreenInfo::beDisplay, _dmxWinPriv::cmap, DMX_GET_WINDOW_PRIV, dmxBECreatePixmap(), dmxBERestorePixmap(), dmxCreateAndRealizeWindow(), dmxCreateRootWindow(), dmxGetDefaultWindowAttributes(), dmxScreens, _dmxWinPriv::mapped, _dmxWinPriv::offscreen, _DMXScreenInfo::rootWin, _dmxWinPriv::visual, and _dmxWinPriv::window.

Referenced by dmxAttachScreen().

static void dmxBEDestroyResources ( pointer  value,
XID  id,
RESTYPE  type,
pointer  n 
) [static]

Destroy resources on the back-end server. This function is called from dmxDetachScreen() via the dix layer's FindAllResources function. It walks all resources, compares them to the screen number passed in as n and calls the appropriate DMX function to free the associated resource on the back-end server.

References dmxBEFreeColormap(), dmxBEFreeCursor(), dmxBEFreeFont(), dmxBEFreeGC(), dmxBEFreeGlyphSet(), dmxBEFreePicture(), dmxBEFreePixmap(), and dmxBESavePixmap().

Referenced by dmxDetachScreen().

static void dmxBEDestroyScratchGCs ( int  scrnNum) [static]

Destroy the scratch GCs that are created per depth.

References dmxBEFreeGC().

Referenced by dmxDetachScreen().

static void dmxBEDestroyWindowTree ( int  idx) [static]

Destroy window hierachy on back-end server. To ensure that all XDestroyWindow() calls succeed, they must be performed in a bottom up order so that windows are not destroyed before their children. XDestroyWindow(), which is called from dmxBEDestroyWindow(), will destroy a window as well as all of it's children.

References dmxBEDestroyWindow(), dmxBEFreePixmap(), and dmxBESavePixmap().

Referenced by dmxDetachScreen().

static void dmxBERestorePixmap ( PixmapPtr  pPixmap) [static]
static void dmxBERestoreRenderGlyph ( pointer  value,
XID  id,
pointer  n 
) [static]
static void dmxBERestoreRenderPict ( pointer  value,
XID  id,
pointer  n 
) [static]

Restore Render's picture

References dmxBECreatePicture(), dmxBECreatePixmap(), and dmxBERestorePixmap().

Referenced by dmxAttachScreen().

static void dmxBESavePixmap ( PixmapPtr  pPixmap) [static]

Save the pixmap image only when there is not another screen with that pixmap from which the image can be read when the screen is reattached. To do this, we first try to find a pixmap on another screen corresponding to the one we are trying to save. If we find one, then we do not need to save the image data since during reattachment, the image data can be read from that other pixmap. However, if we do not find one, then we need to save the image data. The common case for these are for the default stipple and root tile.

References _DMXScreenInfo::beDisplay, _dmxPixPriv::detachedImage, DMX_GET_PIXMAP_PRIV, dmxLog(), dmxScreens, dmxWarning, and _dmxPixPriv::pixmap.

Referenced by dmxBEDestroyResources(), dmxBEDestroyWindowTree(), and dmxDetachScreen().

void dmxFlushPendingSyncs ( void  )

Flush pending syncs for all screens.

References dmxSync().

Referenced by ProcDMXForceWindowCreation(), ProcDMXGetWindowAttributes(), and ProcDMXSync().

static void dmxForceExposures ( int  idx) [static]

Referenced by dmxAttachScreen().

void dmxForceWindowCreation ( WindowPtr  pWindow)

Make sure that dmxCreateAndRealizeWindow has been called for pWindow.

References DMX_GET_WINDOW_PRIV, dmxCreateAndRealizeWindow(), and _dmxWinPriv::window.

Referenced by ProcDMXForceWindowCreation().

int dmxGetInputCount ( void  )

Return the total number of devices, not just dmxNumInputs. The number returned should be the same as that returned by XListInputDevices.

References dmxInputs, and dmxNumInputs.

Referenced by dmxInputLogDevices(), and ProcDMXGetInputCount().

unsigned long dmxGetNumScreens ( void  )

Return the value of dmxNumScreens -- the total number of backend screens in use (these are logical screens and may be larger than the number of backend displays).

References dmxNumScreens.

Referenced by ProcDMXGetScreenAttributes(), and ProcDMXGetScreenCount().

Bool dmxGetWindowAttributes ( WindowPtr  pWindow,
DMXWindowAttributesPtr  attr 
)

This routine provides information to the DMX protocol extension about a particular window.

References DMX_GET_WINDOW_PRIV, _dmxWinPriv::offscreen, DMXWindowAttributesRec::pos, DMXWindowAttributesRec::screen, DMXWindowAttributesRec::vis, _dmxWinPriv::window, and DMXWindowAttributesRec::window.

Referenced by dmxPopulate().

int dmxRemoveInput ( int  id)

Remove the input with physical id id.

References dmxInputDetachId().

Referenced by ProcDMXRemoveInput().

void dmxUpdateScreenResources ( ScreenPtr  pScreen,
int  x,
int  y,
int  w,
int  h 
)

Update DMX's screen resources to match those of the newly moved and/or resized "root" window.

References _DMXScreenInfo::beXDPI, _DMXScreenInfo::beYDPI, and dmxScreens.

Referenced by dmxCreateWindow().


Variable Documentation