Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into glucose-2

This commit is contained in:
Alan Hourihane 2008-05-13 15:59:45 +01:00
commit d426f0ee60
602 changed files with 5113 additions and 40818 deletions

9
.gitignore vendored
View file

@ -278,8 +278,13 @@ hw/xprint/doc/Xprt.1x
hw/xprint/doc/Xprt.man
hw/xprint/dpmsstubs-wrapper.c
hw/xprint/miinitext-wrapper.c
hw/xquartz/xpr/Xquartz
hw/xquartz/xpr/Xquartz.1
hw/xquartz/mach-startup/mach_startup.h
hw/xquartz/mach-startup/mach_startupServer.c
hw/xquartz/mach-startup/mach_startupServer.h
hw/xquartz/mach-startup/mach_startupUser.c
hw/xquartz/mach-startup/X11
hw/xquartz/mach-startup/Xquartz
hw/xquartz/doc/Xquartz.1
include/dix-config.h
include/kdrive-config.h
include/xgl-config.h

View file

@ -98,12 +98,6 @@ if XEVIE
BUILTIN_SRCS += $(XEVIE_SRCS)
endif
# XPrint: Printing via X Protocol
XPRINT_SRCS = xprint.c
if XPRINT
BUILTIN_SRCS += $(XPRINT_SRCS)
endif
# Multi-buffering extension
MULTIBUFFER_SRCS = mbuf.c
EXTRA_MULTIBUFFER_SRCS = mbufbf.c mbufpx.c
@ -149,7 +143,6 @@ EXTRA_DIST = \
$(XCALIBRATE_SRCS) \
$(XINERAMA_SRCS) \
$(XEVIE_SRCS) \
$(XPRINT_SRCS) \
$(MULTIBUFFER_SRCS) \
$(EXTRA_MULTIBUFFER_SRCS) \
$(FONTCACHE_SRCS) \

View file

@ -87,6 +87,9 @@ _X_EXPORT unsigned long XRT_PIXMAP;
_X_EXPORT unsigned long XRT_GC;
_X_EXPORT unsigned long XRT_COLORMAP;
static Bool VisualsEqual(VisualPtr, ScreenPtr, VisualPtr);
_X_EXPORT XineramaVisualsEqualProcPtr XineramaVisualsEqualPtr = &VisualsEqual;
/*
* Function prototypes
*/
@ -668,10 +671,10 @@ Bool PanoramiXCreateConnectionBlock(void)
connSetupPrefix.length = length >> 2;
xfree(PanoramiXVisuals);
for (i = 0; i < PanoramiXNumDepths; i++)
xfree(PanoramiXDepths[i].vids);
xfree(PanoramiXDepths);
PanoramiXDepths = NULL;
/*
* OK, change some dimensions so it looks as if it were one big screen
@ -709,7 +712,7 @@ Bool PanoramiXCreateConnectionBlock(void)
* do their own back-mapping.
*/
static Bool
VisualsEqual(VisualPtr a, VisualPtr b)
VisualsEqual(VisualPtr a, ScreenPtr pScreenB, VisualPtr b)
{
return ((a->class == b->class) &&
(a->ColormapEntries == b->ColormapEntries) &&
@ -759,7 +762,6 @@ static void
PanoramiXMaybeAddVisual(VisualPtr pVisual)
{
ScreenPtr pScreen;
VisualPtr candidate = NULL;
int j, k;
Bool found = FALSE;
@ -767,10 +769,10 @@ PanoramiXMaybeAddVisual(VisualPtr pVisual)
pScreen = screenInfo.screens[j];
found = FALSE;
candidate = pScreen->visuals;
for (k = 0; k < pScreen->numVisuals; k++) {
candidate++;
if (VisualsEqual(pVisual, candidate)
VisualPtr candidate = &pScreen->visuals[k];
if ((*XineramaVisualsEqualPtr)(pVisual, pScreen, candidate)
#ifdef GLXPROXY
&& glxMatchVisual(screenInfo.screens[0], pVisual, pScreen)
#endif
@ -844,8 +846,13 @@ PanoramiXConsolidate(void)
_X_EXPORT VisualID
PanoramiXTranslateVisualID(int screen, VisualID orig)
{
ScreenPtr pOtherScreen = screenInfo.screens[screen];
VisualPtr pVisual = NULL;
int i, j;
int i;
/* if screen is 0, orig is already the correct visual ID */
if (screen == 0)
return orig;
for (i = 0; i < PanoramiXNumVisuals; i++) {
if (orig == PanoramiXVisuals[i].vid) {
@ -858,11 +865,13 @@ PanoramiXTranslateVisualID(int screen, VisualID orig)
return 0;
/* found the original, now translate it relative to the backend screen */
for (i = 0; i < PanoramiXNumScreens; i++)
for (j = 0; j < screenInfo.screens[i]->numVisuals; j++)
if (VisualsEqual(pVisual, &screenInfo.screens[i]->visuals[j]))
return screenInfo.screens[i]->visuals[j].vid;
for (i = 0; i < pOtherScreen->numVisuals; i++) {
VisualPtr pOtherVisual = &pOtherScreen->visuals[i];
if ((*XineramaVisualsEqualPtr)(pVisual, pOtherScreen, pOtherVisual))
return pOtherVisual->vid;
}
return 0;
}

View file

@ -30,6 +30,16 @@ extern unsigned long XRT_PIXMAP;
extern unsigned long XRT_GC;
extern unsigned long XRT_COLORMAP;
/*
* Drivers are allowed to wrap this function. Each wrapper can decide that the
* two visuals are unequal, but if they are deemed equal, the wrapper must call
* down and return FALSE if the wrapped function does. This ensures that all
* layers agree that the visuals are equal. The first visual is always from
* screen 0.
*/
typedef Bool (*XineramaVisualsEqualProcPtr)(VisualPtr, ScreenPtr, VisualPtr);
extern XineramaVisualsEqualProcPtr XineramaVisualsEqualPtr;
extern void XineramaGetImageData(
DrawablePtr *pDrawables,
int left,

File diff suppressed because it is too large Load diff

View file

@ -7,4 +7,5 @@ libcomposite_la_SOURCES = \
compext.c \
compint.h \
compinit.c \
compoverlay.c \
compwindow.c

View file

@ -54,10 +54,7 @@ static CARD8 CompositeReqCode;
static DevPrivateKey CompositeClientPrivateKey = &CompositeClientPrivateKey;
RESTYPE CompositeClientWindowType;
RESTYPE CompositeClientSubwindowsType;
static RESTYPE CompositeClientOverlayType;
static void deleteCompOverlayClient (CompOverlayClientPtr pOcToDel,
ScreenPtr pScreen);
RESTYPE CompositeClientOverlayType;
typedef struct _CompositeClient {
int major_version;
@ -107,19 +104,8 @@ static int
FreeCompositeClientOverlay (pointer value, XID ccwid)
{
CompOverlayClientPtr pOc = (CompOverlayClientPtr) value;
ScreenPtr pScreen = pOc->pScreen;
CompScreenPtr cs;
deleteCompOverlayClient(pOc, pScreen);
/* Unmap overlay window when there are no more clients using it */
cs = GetCompScreen(pScreen);
if (cs->pOverlayClients == NULL) {
if (cs->pOverlayWin != NULL) {
UnmapWindow(cs->pOverlayWin, FALSE);
}
}
compFreeOverlayClient (pOc);
return Success;
}
@ -304,137 +290,6 @@ ProcCompositeNameWindowPixmap (ClientPtr client)
}
/*
* Routines for manipulating the per-screen overlay clients list.
* This list indicates which clients have called GetOverlayWindow
* for this screen.
*/
/* Return the screen's overlay client list element for the given client */
static CompOverlayClientPtr
findCompOverlayClient (ClientPtr pClient, ScreenPtr pScreen)
{
CompScreenPtr cs = GetCompScreen(pScreen);
CompOverlayClientPtr pOc;
for (pOc = cs->pOverlayClients; pOc != NULL; pOc = pOc->pNext) {
if (pOc->pClient == pClient) {
return pOc;
}
}
return NULL;
}
static int
createCompOverlayClient (ClientPtr pClient, ScreenPtr pScreen)
{
CompScreenPtr cs = GetCompScreen(pScreen);
CompOverlayClientPtr pOc;
pOc = (CompOverlayClientPtr) xalloc(sizeof(CompOverlayClientRec));
if (pOc == NULL) {
return BadAlloc;
}
pOc->pClient = pClient;
pOc->pScreen = pScreen;
pOc->resource = FakeClientID(pClient->index);
pOc->pNext = cs->pOverlayClients;
cs->pOverlayClients = pOc;
/*
* Create a resource for this element so it can be deleted
* when the client goes away.
*/
if (!AddResource (pOc->resource, CompositeClientOverlayType,
(pointer) pOc)) {
xfree(pOc);
return BadAlloc;
}
return Success;
}
/*
* Delete the given overlay client list element from its screen list.
*/
static void
deleteCompOverlayClient (CompOverlayClientPtr pOcToDel, ScreenPtr pScreen)
{
CompScreenPtr cs = GetCompScreen(pScreen);
CompOverlayClientPtr pOc, pNext;
CompOverlayClientPtr pOcLast = NULL;
pOc = cs->pOverlayClients;
while (pOc != NULL) {
pNext = pOc->pNext;
if (pOc == pOcToDel) {
xfree(pOc);
if (pOcLast == NULL) {
cs->pOverlayClients = pNext;
} else {
pOcLast->pNext = pNext;
}
break;
}
pOcLast = pOc;
pOc = pNext;
}
}
/*
* Delete all the hide-counts list elements for this screen.
*/
void
deleteCompOverlayClientsForScreen (ScreenPtr pScreen)
{
CompScreenPtr cs = GetCompScreen(pScreen);
CompOverlayClientPtr pOc, pTmp;
pOc = cs->pOverlayClients;
while (pOc != NULL) {
pTmp = pOc->pNext;
FreeResource(pOc->resource, 0);
pOc = pTmp;
}
cs->pOverlayClients = NULL;
}
/*
** If necessary, create the overlay window. And map it
** Note: I found it excessively difficult to destroy this window
** during compCloseScreen; DeleteWindow can't be called because
** the input devices are already shut down. So we are going to
** just allocate an overlay window once per screen per X server
** invocation.
*/
static WindowPtr
createOverlayWindow (ScreenPtr pScreen)
{
int wid = FakeClientID(0);
WindowPtr pWin;
XID overrideRedirect = TRUE;
int result;
pWin = CreateWindow (
wid, WindowTable[pScreen->myNum],
0, 0, pScreen->width, pScreen->height, 0,
InputOutput, CWOverrideRedirect, &overrideRedirect,
WindowTable[pScreen->myNum]->drawable.depth,
serverClient, pScreen->rootVisual, &result);
if (pWin == NULL) {
return NULL;
}
if (!AddResource(wid, RT_WINDOW, (pointer)pWin)) {
DeleteWindow(pWin, None);
return NULL;
}
return pWin;
}
static int
ProcCompositeGetOverlayWindow (ClientPtr client)
{
@ -456,28 +311,31 @@ ProcCompositeGetOverlayWindow (ClientPtr client)
}
pScreen = pWin->drawable.pScreen;
/*
* Create an OverlayClient structure to mark this client's
* interest in the overlay window
*/
pOc = compCreateOverlayClient(pScreen, client);
if (pOc == NULL)
return BadAlloc;
/*
* Make sure the overlay window exists
*/
cs = GetCompScreen(pScreen);
if (cs->pOverlayWin == NULL) {
cs->pOverlayWin = createOverlayWindow(pScreen);
if (cs->pOverlayWin == NULL) {
if (cs->pOverlayWin == NULL)
if (!compCreateOverlayWindow(pScreen))
{
FreeResource (pOc->resource, RT_NONE);
return BadAlloc;
}
}
rc = XaceHook(XACE_RESOURCE_ACCESS, client, cs->pOverlayWin->drawable.id,
RT_WINDOW, cs->pOverlayWin, RT_NONE, NULL, DixGetAttrAccess);
if (rc != Success)
{
FreeResource (pOc->resource, RT_NONE);
return rc;
MapWindow(cs->pOverlayWin, serverClient);
/* Record that client is using this overlay window */
pOc = findCompOverlayClient(client, pScreen);
if (pOc == NULL) {
int ret = createCompOverlayClient(client, pScreen);
if (ret != Success) {
return ret;
}
}
rep.type = X_Reply;
@ -504,7 +362,6 @@ ProcCompositeReleaseOverlayWindow (ClientPtr client)
WindowPtr pWin;
ScreenPtr pScreen;
CompOverlayClientPtr pOc;
CompScreenPtr cs;
REQUEST_SIZE_MATCH(xCompositeReleaseOverlayWindowReq);
pWin = (WindowPtr) LookupIDByType (stuff->window, RT_WINDOW);
@ -519,18 +376,12 @@ ProcCompositeReleaseOverlayWindow (ClientPtr client)
* Has client queried a reference to the overlay window
* on this screen? If not, generate an error.
*/
pOc = findCompOverlayClient(client, pWin->drawable.pScreen);
if (pOc == NULL) {
pOc = compFindOverlayClient (pWin->drawable.pScreen, client);
if (pOc == NULL)
return BadMatch;
}
/* The delete function will free the client structure */
FreeResource (pOc->resource, 0);
cs = GetCompScreen(pScreen);
if (cs->pOverlayClients == NULL) {
UnmapWindow(cs->pOverlayWin, FALSE);
}
FreeResource (pOc->resource, RT_NONE);
return client->noClientException;
}

View file

@ -76,14 +76,6 @@ compCloseScreen (int index, ScreenPtr pScreen)
pScreen->CopyWindow = cs->CopyWindow;
pScreen->PositionWindow = cs->PositionWindow;
deleteCompOverlayClientsForScreen(pScreen);
/*
** Note: no need to call DeleteWindow; the server has
** already destroyed it.
*/
cs->pOverlayWin = NULL;
xfree (cs);
dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, NULL);
ret = (*pScreen->CloseScreen) (index, pScreen);
@ -122,11 +114,11 @@ compChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
if (ret && (mask & CWBackingStore)) {
if (pWin->backingStore != NotUseful) {
compRedirectWindow(serverClient, pWin, CompositeRedirectAutomatic);
pWin->backStorage = TRUE;
pWin->backStorage = (pointer) (intptr_t) 1;
} else {
compUnredirectWindow(serverClient, pWin,
CompositeRedirectAutomatic);
pWin->backStorage = FALSE;
pWin->backStorage = NULL;
}
}
@ -380,6 +372,7 @@ compScreenInit (ScreenPtr pScreen)
return FALSE;
cs->damaged = FALSE;
cs->overlayWid = FakeClientID(0);
cs->pOverlayWin = NULL;
cs->pOverlayClients = NULL;

View file

@ -155,6 +155,7 @@ typedef struct _CompScreen {
VisualID *alternateVisuals;
WindowPtr pOverlayWin;
Window overlayWid;
CompOverlayClientPtr pOverlayClients;
} CompScreenRec, *CompScreenPtr;
@ -172,6 +173,7 @@ extern DevPrivateKey CompSubwindowsPrivateKey;
extern RESTYPE CompositeClientWindowType;
extern RESTYPE CompositeClientSubwindowsType;
extern RESTYPE CompositeClientOverlayType;
/*
* compalloc.c
@ -229,6 +231,25 @@ CompositeRegisterAlternateVisuals (ScreenPtr pScreen,
Bool
compScreenInit (ScreenPtr pScreen);
/*
* compoverlay.c
*/
void
compFreeOverlayClient (CompOverlayClientPtr pOcToDel);
CompOverlayClientPtr
compFindOverlayClient (ScreenPtr pScreen, ClientPtr pClient);
CompOverlayClientPtr
compCreateOverlayClient (ScreenPtr pScreen, ClientPtr pClient);
Bool
compCreateOverlayWindow (ScreenPtr pScreen);
void
compDestroyOverlayWindow (ScreenPtr pScreen);
/*
* compwindow.c
*/
@ -292,9 +313,6 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc);
void
compWindowUpdate (WindowPtr pWin);
void
deleteCompOverlayClientsForScreen (ScreenPtr pScreen);
WindowPtr
CompositeRealChildHead (WindowPtr pWin);

159
composite/compoverlay.c Normal file
View file

@ -0,0 +1,159 @@
/*
* Copyright © 2006 Sun Microsystems
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Sun Microsystems not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. Sun Microsystems makes no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
* Copyright © 2003 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Keith Packard not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. Keith Packard makes no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "compint.h"
#include "xace.h"
/*
* Delete the given overlay client list element from its screen list.
*/
void
compFreeOverlayClient (CompOverlayClientPtr pOcToDel)
{
ScreenPtr pScreen = pOcToDel->pScreen;
CompScreenPtr cs = GetCompScreen (pScreen);
CompOverlayClientPtr *pPrev, pOc;
for (pPrev = &cs->pOverlayClients; (pOc = *pPrev); pPrev = &pOc->pNext)
{
if (pOc == pOcToDel) {
*pPrev = pOc->pNext;
xfree (pOc);
break;
}
}
/* Destroy overlay window when there are no more clients using it */
if (cs->pOverlayClients == NULL)
compDestroyOverlayWindow (pScreen);
}
/*
* Return the client's first overlay client rec from the given screen
*/
CompOverlayClientPtr
compFindOverlayClient (ScreenPtr pScreen, ClientPtr pClient)
{
CompScreenPtr cs = GetCompScreen(pScreen);
CompOverlayClientPtr pOc;
for (pOc = cs->pOverlayClients; pOc != NULL; pOc = pOc->pNext)
if (pOc->pClient == pClient)
return pOc;
return NULL;
}
/*
* Create an overlay client object for the given client
*/
CompOverlayClientPtr
compCreateOverlayClient (ScreenPtr pScreen, ClientPtr pClient)
{
CompScreenPtr cs = GetCompScreen(pScreen);
CompOverlayClientPtr pOc;
pOc = (CompOverlayClientPtr) xalloc(sizeof(CompOverlayClientRec));
if (pOc == NULL)
return NULL;
pOc->pClient = pClient;
pOc->pScreen = pScreen;
pOc->resource = FakeClientID(pClient->index);
pOc->pNext = cs->pOverlayClients;
cs->pOverlayClients = pOc;
/*
* Create a resource for this element so it can be deleted
* when the client goes away.
*/
if (!AddResource (pOc->resource, CompositeClientOverlayType, (pointer) pOc))
return NULL;
return pOc;
}
/*
* Create the overlay window and map it
*/
Bool
compCreateOverlayWindow (ScreenPtr pScreen)
{
CompScreenPtr cs = GetCompScreen(pScreen);
WindowPtr pRoot = WindowTable[pScreen->myNum];
WindowPtr pWin;
XID overrideRedirect = TRUE;
int result;
pWin = cs->pOverlayWin =
CreateWindow (cs->overlayWid, pRoot,
0, 0, pScreen->width, pScreen->height, 0,
InputOutput, CWOverrideRedirect, &overrideRedirect,
pRoot->drawable.depth,
serverClient, pScreen->rootVisual, &result);
if (pWin == NULL)
return FALSE;
if (!AddResource(pWin->drawable.id, RT_WINDOW, (pointer)pWin))
return FALSE;
MapWindow(pWin, serverClient);
return TRUE;
}
/*
* Destroy the overlay window
*/
void
compDestroyOverlayWindow (ScreenPtr pScreen)
{
CompScreenPtr cs = GetCompScreen(pScreen);
cs->pOverlayWin = NullWindow;
FreeResource (cs->overlayWid, RT_NONE);
}

View file

@ -54,7 +54,7 @@ compCheckWindow (WindowPtr pWin, pointer data)
PixmapPtr pWinPixmap = (*pScreen->GetWindowPixmap) (pWin);
PixmapPtr pParentPixmap = pWin->parent ? (*pScreen->GetWindowPixmap) (pWin->parent) : 0;
PixmapPtr pScreenPixmap = (*pScreen->GetScreenPixmap) (pScreen);
if (!pWin->parent)
{
assert (pWin->redirectDraw == RedirectDrawNone);
@ -122,7 +122,7 @@ compSetPixmapVisitWindow (WindowPtr pWindow, pointer data)
SetWinSize (pWindow);
SetBorderSize (pWindow);
if (HasBorder (pWindow))
QueueWorkProc (compRepaintBorder, serverClient,
QueueWorkProc (compRepaintBorder, serverClient,
(pointer) pWindow->drawable.id);
return WT_WALKCHILDREN;
}
@ -146,15 +146,15 @@ compCheckRedirect (WindowPtr pWin)
Bool should;
should = pWin->realized && (pWin->drawable.class != InputOnly) &&
(cw != NULL);
(cw != NULL) && (pWin->parent != NULL);
/* Never redirect the overlay window */
if (cs->pOverlayWin != NULL) {
if (pWin == cs->pOverlayWin) {
should = FALSE;
}
}
}
if (should != (pWin->redirectDraw != RedirectDrawNone))
{
if (should)
@ -276,10 +276,10 @@ compClipNotify (WindowPtr pWin, int dx, int dy)
ScreenPtr pScreen = pWin->drawable.pScreen;
CompScreenPtr cs = GetCompScreen (pScreen);
CompWindowPtr cw = GetCompWindow (pWin);
if (cw)
{
if (cw->borderClipX != pWin->drawable.x ||
if (cw->borderClipX != pWin->drawable.x ||
cw->borderClipY != pWin->drawable.y)
{
REGION_TRANSLATE (pScreen, &cw->borderClip,
@ -324,7 +324,7 @@ compImplicitRedirect (WindowPtr pWin, WindowPtr pParent)
ScreenPtr pScreen = pWin->drawable.pScreen;
XID winVisual = wVisual (pWin);
XID parentVisual = wVisual (pParent);
if (winVisual != parentVisual &&
(compIsAlternateVisual (pScreen, winVisual) ||
compIsAlternateVisual (pScreen, parentVisual)))
@ -345,11 +345,11 @@ compMoveWindow (WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind)
WindowPtr pParent;
int draw_x, draw_y;
unsigned int w, h, bw;
/* if this is a root window, can't be moved */
if (!(pParent = pWin->parent))
return;
bw = wBorderWidth (pWin);
draw_x = pParent->drawable.x + x + (int)bw;
draw_y = pParent->drawable.y + y + (int)bw;
@ -390,18 +390,18 @@ compResizeWindow (WindowPtr pWin, int x, int y,
WindowPtr pParent;
int draw_x, draw_y;
unsigned int bw;
/* if this is a root window, can't be moved */
if (!(pParent = pWin->parent))
return;
bw = wBorderWidth (pWin);
draw_x = pParent->drawable.x + x + (int)bw;
draw_y = pParent->drawable.y + y + (int)bw;
compReallocPixmap (pWin, draw_x, draw_y, w, h, bw);
}
compCheckTree (pScreen);
pScreen->ResizeWindow = cs->ResizeWindow;
(*pScreen->ResizeWindow) (pWin, x, y, w, h, pSib);
cs->ResizeWindow = pScreen->ResizeWindow;
@ -430,11 +430,11 @@ compChangeBorderWidth (WindowPtr pWin, unsigned int bw)
WindowPtr pParent;
int draw_x, draw_y;
unsigned int w, h;
/* if this is a root window, can't be moved */
if (!(pParent = pWin->parent))
return;
draw_x = pWin->drawable.x;
draw_y = pWin->drawable.y;
w = pWin->drawable.width;
@ -481,13 +481,13 @@ compReparentWindow (WindowPtr pWin, WindowPtr pPriorParent)
*/
if (compImplicitRedirect (pWin, pWin->parent))
compRedirectWindow (serverClient, pWin, CompositeRedirectAutomatic);
/*
* Allocate any necessary redirect pixmap
* (this actually should never be true; pWin is always unmapped)
*/
compCheckRedirect (pWin);
/*
* Reset pixmap pointers as appropriate
*/
@ -514,7 +514,7 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
{
PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWin);
CompWindowPtr cw = GetCompWindow (pWin);
assert (cw->oldx != COMP_ORIGIN_INVALID);
assert (cw->oldy != COMP_ORIGIN_INVALID);
if (cw->pOldPixmap)
@ -526,7 +526,7 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
RegionRec rgnDst;
PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWin);
GCPtr pGC;
dx = ptOldOrg.x - pWin->drawable.x;
dy = ptOldOrg.y - pWin->drawable.y;
REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy);
@ -535,10 +535,10 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst,
&pWin->borderClip, prgnSrc);
REGION_TRANSLATE (pWin->drawable.pScreen, &rgnDst,
REGION_TRANSLATE (pWin->drawable.pScreen, &rgnDst,
-pPixmap->screen_x, -pPixmap->screen_y);
dx = dx + pPixmap->screen_x - cw->oldx;
dy = dy + pPixmap->screen_y - cw->oldy;
pGC = GetScratchGC (pPixmap->drawable.depth, pScreen);
@ -546,7 +546,7 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
{
BoxPtr pBox = REGION_RECTS (&rgnDst);
int nBox = REGION_NUM_RECTS (&rgnDst);
ValidateGC(&pPixmap->drawable, pGC);
while (nBox--)
{
@ -568,7 +568,7 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
ptOldOrg.x += dx;
ptOldOrg.y += dy;
}
pScreen->CopyWindow = cs->CopyWindow;
if (ptOldOrg.x != pWin->drawable.x || ptOldOrg.y != pWin->drawable.y)
{
@ -634,7 +634,7 @@ compDestroyWindow (WindowPtr pWin)
FreeResource (cw->clients->id, RT_NONE);
while ((csw = GetCompSubwindows (pWin)))
FreeResource (csw->clients->id, RT_NONE);
if (pWin->redirectDraw != RedirectDrawNone)
compFreePixmap (pWin);
ret = (*pScreen->DestroyWindow) (pWin);
@ -699,7 +699,7 @@ PictFormatPtr
compWindowFormat (WindowPtr pWin)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
return PictureMatchVisual (pScreen, pWin->drawable.depth,
compGetWindowVisual (pWin));
}
@ -716,24 +716,24 @@ compWindowUpdateAutomatic (WindowPtr pWin)
int error;
RegionPtr pRegion = DamageRegion (cw->damage);
PicturePtr pSrcPicture = CreatePicture (0, &pSrcPixmap->drawable,
pSrcFormat,
pSrcFormat,
0, 0,
serverClient,
&error);
XID subwindowMode = IncludeInferiors;
PicturePtr pDstPicture = CreatePicture (0, &pParent->drawable,
pDstFormat,
CPSubwindowMode,
CPSubwindowMode,
&subwindowMode,
serverClient,
&error);
/*
* First move the region from window to screen coordinates
*/
REGION_TRANSLATE (pScreen, pRegion,
REGION_TRANSLATE (pScreen, pRegion,
pWin->drawable.x, pWin->drawable.y);
/*
* Clip against the "real" border clip
*/
@ -742,14 +742,14 @@ compWindowUpdateAutomatic (WindowPtr pWin)
/*
* Now translate from screen to dest coordinates
*/
REGION_TRANSLATE (pScreen, pRegion,
REGION_TRANSLATE (pScreen, pRegion,
-pParent->drawable.x, -pParent->drawable.y);
/*
* Clip the picture
*/
SetPictureClipRegion (pDstPicture, 0, 0, pRegion);
/*
* And paint
*/
@ -813,7 +813,7 @@ CompositeRealChildHead (WindowPtr pWin)
if (!pChild) {
return NullWindow;
}
cs = GetCompScreen(pWin->drawable.pScreen);
if (pChild == cs->pOverlayWin) {
return pChild;

View file

@ -48,6 +48,15 @@ struct config_hal_info {
LibHalContext *hal_ctx;
};
/* Used for special handling of xkb options. */
struct xkb_options {
char* layout;
char* model;
char* rules;
char* variant;
};
static void
remove_device(DeviceIntPtr dev)
{
@ -119,7 +128,7 @@ get_prop_string(LibHalContext *hal_ctx, const char *udi, const char *name)
return ret;
}
/* this function is no longer used... keep it here in case its needed in
/* this function is no longer used... keep it here in case its needed in
* the future. */
#if 0
static char *
@ -155,7 +164,7 @@ get_prop_string_array(LibHalContext *hal_ctx, const char *udi, const char *prop)
return ret;
}
#endif
#endif
static void
device_added(LibHalContext *hal_ctx, const char *udi)
@ -164,12 +173,13 @@ device_added(LibHalContext *hal_ctx, const char *udi)
InputOption *options = NULL, *tmpo = NULL;
DeviceIntPtr dev;
DBusError error;
struct xkb_options xkb_opts = {0};
LibHalPropertySet *set = NULL;
LibHalPropertySetIterator set_iter;
char *psi_key = NULL, *tmp_val, *tmp_key;
char *psi_key = NULL, *tmp_val;
dbus_error_init(&error);
driver = get_prop_string(hal_ctx, udi, "input.x11_driver");
@ -178,13 +188,13 @@ device_added(LibHalContext *hal_ctx, const char *udi)
LogMessageVerb(X_INFO,7,"config/hal: no driver specified for device %s\n", udi);
goto unwind;
}
path = get_prop_string(hal_ctx, udi, "input.device");
if (!path) {
LogMessage(X_WARNING,"config/hal: no driver or path specified for %s\n", udi);
goto unwind;
}
name = get_prop_string(hal_ctx, udi, "info.product");
if (!name)
name = xstrdup("(unnamed)");
@ -194,7 +204,7 @@ device_added(LibHalContext *hal_ctx, const char *udi)
LogMessage(X_ERROR, "config/hal: couldn't allocate space for input options!\n");
goto unwind;
}
options->key = xstrdup("_source");
options->value = xstrdup("server/hal");
if (!options->key || !options->value) {
@ -202,14 +212,14 @@ device_added(LibHalContext *hal_ctx, const char *udi)
goto unwind;
}
/* most drivers use device.. not path. evdev uses both however, but the
/* most drivers use device.. not path. evdev uses both however, but the
* path version isn't documented apparently. support both for now. */
add_option(&options, "path", path);
add_option(&options, "device", path);
add_option(&options, "driver", driver);
add_option(&options, "name", name);
config_info = xalloc(strlen(udi) + 5); /* "hal:" and NULL */
if (!config_info) {
LogMessage(X_ERROR, "config/hal: couldn't allocate name\n");
@ -220,58 +230,126 @@ device_added(LibHalContext *hal_ctx, const char *udi)
/* ok, grab options from hal.. iterate through all properties
* and lets see if any of them are options that we can add */
set = libhal_device_get_all_properties(hal_ctx, udi, &error);
if (!set) {
LogMessage(X_ERROR, "config/hal: couldn't get property list for %s: %s (%s)\n",
udi, error.name, error.message);
goto unwind;
}
libhal_psi_init(&set_iter,set);
while (libhal_psi_has_more(&set_iter)) {
/* we are looking for supported keys.. extract and add to options */
psi_key = libhal_psi_get_key(&set_iter);
psi_key = libhal_psi_get_key(&set_iter);
if (psi_key){
/* normal options first (input.x11_options.<propname>) */
if (!strncasecmp(psi_key, LIBHAL_PROP_KEY, sizeof(LIBHAL_PROP_KEY)-1)){
/* only support strings for all values */
tmp_val = get_prop_string(hal_ctx, udi, psi_key);
if (tmp_val){
add_option(&options, psi_key + sizeof(LIBHAL_PROP_KEY)-1, tmp_val);
xfree(tmp_val);
char* tmp;
/* xkb needs special handling. HAL specs include
* input.xkb.xyz options, but the x11-input.fdi specifies
* input.x11_options.Xkbxyz options. By default, we use
* the former, unless the specific X11 ones are specified.
* Since we can't predict the order in which the keys
* arrive, we need to store them.
*/
#ifndef HAVE_STRCASESTR
int psi_key_len = strlen(psi_key);
char *lower_psi_key = xalloc(psi_key_len + 1);
CopyISOLatin1Lowered((unsigned char *) lower_psi_key,
(unsigned char *) psi_key,
psi_key_len);
if ((tmp = strstr(lower_psi_key, "xkb")))
#else
if ((tmp = strcasestr(psi_key, "xkb")))
#endif
{
if (!strcasecmp(&tmp[3], "layout"))
{
if (xkb_opts.layout)
xfree(xkb_opts.layout);
xkb_opts.layout = strdup(tmp_val);
} else if (!strcasecmp(&tmp[3], "model"))
{
if (xkb_opts.model)
xfree(xkb_opts.model);
xkb_opts.model = strdup(tmp_val);
} else if (!strcasecmp(&tmp[3], "rules"))
{
if (xkb_opts.rules)
xfree(xkb_opts.rules);
xkb_opts.rules = strdup(tmp_val);
} else if (!strcasecmp(&tmp[3], "variant"))
{
if (xkb_opts.variant)
xfree(xkb_opts.variant);
xkb_opts.variant = strdup(tmp_val);
}
} else
{
/* all others */
add_option(&options, psi_key + sizeof(LIBHAL_PROP_KEY)-1, tmp_val);
xfree(tmp_val);
}
#ifndef HAVE_STRCASESTR
xfree(lower_psi_key);
#endif
}
/* evdev's XKB options... we should probably depreciate this usage */
} else if (!strncasecmp(psi_key, LIBHAL_XKB_PROP_KEY, sizeof(LIBHAL_XKB_PROP_KEY)-1)){
/* only support strings for all values */
tmp_val = get_prop_string(hal_ctx, udi, psi_key);
if (tmp_val){
/* add "xkb_" + NULL */
tmp_key = xalloc(strlen(psi_key) - ( sizeof(LIBHAL_XKB_PROP_KEY) - 1) + 5);
if (!tmp_key){
LogMessage(X_ERROR, "config/hal: couldn't allocate memory for option %s\n", psi_key);
} else {
sprintf(tmp_key, "xkb_%s", psi_key + sizeof(LIBHAL_XKB_PROP_KEY)-1);
add_option(&options, tmp_key, tmp_val);
xfree(tmp_key);
char* tmp;
tmp = &psi_key[sizeof(LIBHAL_XKB_PROP_KEY) - 1];
if (!strcasecmp(tmp, "layout"))
{
if (!xkb_opts.layout)
xkb_opts.layout = strdup(tmp_val);
} else if (!strcasecmp(tmp, "rules"))
{
if (!xkb_opts.rules)
xkb_opts.rules = strdup(tmp_val);
} else if (!strcasecmp(tmp, "variant"))
{
if (!xkb_opts.variant)
xkb_opts.variant = strdup(tmp_val);
} else if (!strcasecmp(tmp, "model"))
{
if (!xkb_opts.model)
xkb_opts.model = strdup(tmp_val);
}
xfree(tmp_val);
}
}
}
}
/* psi_key doesn't need to be freed */
libhal_psi_next(&set_iter);
}
/* Now add xkb options */
if (xkb_opts.layout)
add_option(&options, "xkb_layout", xkb_opts.layout);
if (xkb_opts.rules)
add_option(&options, "xkb_rules", xkb_opts.rules);
if (xkb_opts.variant)
add_option(&options, "xkb_variant", xkb_opts.variant);
if (xkb_opts.model)
add_option(&options, "xkb_model", xkb_opts.model);
/* this isn't an error, but how else do you output something that the user can see? */
LogMessage(X_INFO, "config/hal: Adding input device %s\n", name);
if (NewInputDeviceRequest(options, &dev) != Success) {
@ -304,6 +382,15 @@ unwind:
xfree(tmpo);
}
if (xkb_opts.layout)
xfree(xkb_opts.layout);
if (xkb_opts.rules)
xfree(xkb_opts.rules);
if (xkb_opts.model)
xfree(xkb_opts.model);
if (xkb_opts.variant)
xfree(xkb_opts.variant);
dbus_error_free(&error);
return;
@ -413,7 +500,7 @@ config_hal_init(void)
/* verbose message */
LogMessageVerb(X_INFO,7,"config/hal: initialized");
return 1;
}

View file

@ -191,7 +191,7 @@ dnl Checks for library functions.
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp strchr strrchr \
strtol getopt getopt_long vsnprintf walkcontext backtrace \
getisax getzoneid shmctl64])
getisax getzoneid shmctl64 strcasestr])
AC_FUNC_ALLOCA
dnl Old HAS_* names used in os/*.c.
AC_CHECK_FUNC([getdtablesize],
@ -402,6 +402,9 @@ case $host_os in
*solaris*)
PKG_CHECK_EXISTS(libdrm, DRI=yes, DRI=no)
;;
darwin*)
AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
;;
esac
AM_CONDITIONAL(KDRIVE_HW, test "x$KDRIVE_HW" = xyes)
@ -524,11 +527,11 @@ AC_ARG_ENABLE(glx-tls, AS_HELP_STRING([--enable-glx-tls], [Build GLX with
dnl Extensions.
AC_ARG_ENABLE(registry, AS_HELP_STRING([--disable-registry], [Build string registry module (default: enabled)]), [XREGISTRY=$enableval], [XREGISTRY=yes])
AC_ARG_ENABLE(composite, AS_HELP_STRING([--disable-composite], [Build Composite extension (default: enabled)]), [COMPOSITE=$enableval], [COMPOSITE=auto])
AC_ARG_ENABLE(composite, AS_HELP_STRING([--disable-composite], [Build Composite extension (default: enabled)]), [COMPOSITE=$enableval], [COMPOSITE=yes])
AC_ARG_ENABLE(mitshm, AS_HELP_STRING([--disable-shm], [Build SHM extension (default: enabled)]), [MITSHM=$enableval], [MITSHM=yes])
AC_ARG_ENABLE(xres, AS_HELP_STRING([--disable-xres], [Build XRes extension (default: enabled)]), [RES=$enableval], [RES=yes])
AC_ARG_ENABLE(xtrap, AS_HELP_STRING([--disable-xtrap], [Build XTrap extension (default: enabled)]), [XTRAP=$enableval], [XTRAP=yes])
AC_ARG_ENABLE(record, AS_HELP_STRING([--disable-record], [Build Record extension (default: disabled)]), [RECORD=$enableval], [RECORD=no])
AC_ARG_ENABLE(record, AS_HELP_STRING([--enable-record], [Build Record extension (default: disabled)]), [RECORD=$enableval], [RECORD=no])
AC_ARG_ENABLE(xv, AS_HELP_STRING([--disable-xv], [Build Xv extension (default: enabled)]), [XV=$enableval], [XV=yes])
AC_ARG_ENABLE(xvmc, AS_HELP_STRING([--disable-xvmc], [Build XvMC extension (default: enabled)]), [XVMC=$enableval], [XVMC=yes])
AC_ARG_ENABLE(dga, AS_HELP_STRING([--disable-dga], [Build DGA extension (default: auto)]), [DGA=$enableval], [DGA=auto])
@ -562,11 +565,7 @@ AC_ARG_ENABLE(dmx, AS_HELP_STRING([--enable-dmx], [Build DMX server (d
AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server (default: yes)]), [XVFB=$enableval], [XVFB=yes])
AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto])
AC_ARG_ENABLE(xquartz, AS_HELP_STRING([--enable-xquartz], [Build Xquartz server for OS-X (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto])
AC_ARG_ENABLE(x11app, AS_HELP_STRING([--enable-x11app], [Build Apple's X11.app for Xquartz (default: auto)]), [X11APP=$enableval], [X11APP=auto])
AC_ARG_WITH(x11app-archs, AS_HELP_STRING([--with-x11app-archs=ARCHS], [Architectures to build X11.app for, space delimeted (default: "ppc i386")]), [X11APP_ARCHS=$enableval], [X11APP_ARCHS="ppc i386"])
AC_SUBST([X11APP_ARCHS])
AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto])
AC_ARG_ENABLE(xprint, AS_HELP_STRING([--enable-xprint], [Build Xprint extension and server (default: no)]), [XPRINT=$enableval], [XPRINT=no])
AC_ARG_ENABLE(xgl, AS_HELP_STRING([--enable-xgl], [Build Xgl server (default: no)]), [XGL=$enableval], [XGL=no])
AC_ARG_ENABLE(xglx, AS_HELP_STRING([--enable-xglx], [Build Xglx xgl module (default: no)]), [XGLX=$enableval], [XGLX=no])
AC_ARG_ENABLE(xegl, AS_HELP_STRING([--enable-xegl], [Build Xegl xgl module (default: no)]), [XEGL=$enableval], [XEGL=no])
@ -644,6 +643,40 @@ XORG_CHECK_LINUXDOC
dnl Handle installing libxf86config
AM_CONDITIONAL(INSTALL_LIBXF86CONFIG, [test "x$INSTALL_LIBXF86CONFIG" = xyes])
dnl XQuartz DDX Detection... Yes, it's ugly to have it here... but we need to handle this early on
case $host_os in
darwin*)
if test x$XQUARTZ = xauto; then
AC_CACHE_CHECK([whether to build Xquartz],xorg_cv_Carbon_framework,[
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -framework Carbon"
AC_LINK_IFELSE([char FSFindFolder(); int main() { FSFindFolder(); return 0;}],
[xorg_cv_Carbon_framework=yes],
[xorg_cv_Carbon_framework=no])
LDFLAGS=$save_LDFLAGS])
if test "X$xorg_cv_Carbon_framework" = Xyes; then
XQUARTZ=yes
else
XQUARTZ=no
fi
fi
if test "x$XQUARTZ" = xyes ; then
XQUARTZ=yes
XVFB=no
XNEST=no
COMPOSITE=no
DGA=no
DPMSExtension=no
XF86BIGFONT=no
XF86MISC=no
XF86VIDMODE=no
fi
;;
esac
dnl ---------------------------------------------------------------------------
dnl Extension section
dnl ---------------------------------------------------------------------------
@ -788,18 +821,6 @@ if test "x$XREGISTRY" = xyes; then
AC_DEFINE(XREGISTRY, 1, [Build registry module])
fi
dnl XQuartz DDX Detection... Yes, it's ugly to have it here... but we need to disable COMPOSITE for
if test "x$COMPOSITE" = xauto; then
case $host_os in
darwin*)
test "x$XQUARTZ" = xyes -o "x$XQUARTZ" = xauto && COMPOSITE=no
;;
*)
COMPOSITE=yes
;;
esac
fi
AM_CONDITIONAL(COMPOSITE, [test "x$COMPOSITE" = xyes])
if test "x$COMPOSITE" = xyes; then
AC_DEFINE(COMPOSITE, 1, [Support Composite Extension])
@ -965,15 +986,6 @@ if test "x$DPMSExtension" = xyes; then
AC_DEFINE(DPMSExtension, 1, [Support DPMS extension])
fi
if test "x$XPRINT" = xauto; then
PKG_CHECK_MODULES([XPRINTPROTO], [printproto], [XPRINT=yes], [XPRINT=no])
fi
AM_CONDITIONAL(XPRINT, [test "x$XPRINT" = xyes])
if test "x$XPRINT" = xyes; then
AC_DEFINE(XPRINT, 1, [Build Print extension])
REQUIRED_MODULES="$REQUIRED_MODULES printproto"
fi
if test "x$BUILTIN_FONTS" = xyes; then
AC_DEFINE(BUILTIN_FONTS, 1, [Use only built-in fonts])
AC_DEFINE(NOFONTSERVERACCESS, 1, [Avoid using a font server])
@ -1126,15 +1138,25 @@ PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS])
# OpenSSL used for SHA1 hashing in render/glyph.c, but we don't need all of
# the OpenSSL libraries, just libcrypto
PKG_CHECK_EXISTS([openssl],
[PKG_CHECK_MODULES([OPENSSL], [openssl],
# Some systems have matching functionality in the smaller/simpler libmd
# Builders who want to force a choice can set SHA1_LIB and SHA1_CFLAGS
if test "x$SHA1_LIB" = "x" ; then
AC_CHECK_LIB([md], [SHA1Init], [SHA1_LIB="-lmd"
AC_DEFINE([HAVE_SHA1_IN_LIBMD], [1],
[Define to use libmd SHA1 functions instead of OpenSSL libcrypto])])
fi
if test "x$SHA1_LIB" = "x" ; then
PKG_CHECK_EXISTS([openssl],
[PKG_CHECK_MODULES([OPENSSL], [openssl],
[OPENSSL_LIB_FLAGS=`$PKG_CONFIG --libs-only-L --libs-only-other openssl`])])
LIBCRYPTO="$OPENSSL_LIB_FLAGS -lcrypto"
SHA1_LIB="$OPENSSL_LIB_FLAGS -lcrypto"
SHA1_CFLAGS="$OPENSSL_CFLAGS"
fi
# Autotools has some unfortunate issues with library handling. In order to
# get a server to rebuild when a dependency in the tree is changed, it must
# be listed in SERVERNAME_DEPENDENCIES. However, no system libraries may be
# listed there, or some versions of autotols will break (especially if a -L
# listed there, or some versions of autotools will break (especially if a -L
# is required to find the library). So, we keep two sets of libraries
# detected: NAMESPACE_LIBS for in-tree libraries to be linked against, which
# will go into the _DEPENDENCIES and _LDADD of the server, and
@ -1146,9 +1168,9 @@ LIBCRYPTO="$OPENSSL_LIB_FLAGS -lcrypto"
# XSERVER_SYS_LIBS is the set of out-of-tree libraries which all servers
# require.
#
XSERVER_CFLAGS="${XSERVERCFLAGS_CFLAGS} ${OPENSSL_CFLAGS}"
XSERVER_CFLAGS="${XSERVERCFLAGS_CFLAGS} ${SHA1_CFLAGS}"
XSERVER_LIBS="$DIX_LIB $CONFIG_LIB $MI_LIB $OS_LIB"
XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS} ${LIBCRYPTO}"
XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS} ${SHA1_LIB}"
AC_SUBST([XSERVER_LIBS])
AC_SUBST([XSERVER_SYS_LIBS])
@ -1596,62 +1618,6 @@ if test "x$MFB" = xyes -o "x$AFB" = xyes; then
fi
fi
dnl Xprint DDX
AC_MSG_CHECKING([whether to build Xprint DDX])
AC_MSG_RESULT([$XPRINT])
if test "x$XPRINT" = xyes; then
PKG_CHECK_MODULES([XPRINTMODULES], [printproto x11 xfont $XDMCP_MODULES xau])
XPRINT_CFLAGS="$XPRINTMODULES_CFLAGS -DXPRINT"
XPRINT_LIBS="$XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $RENDER_LIB $COMPOSITE_LIB $RANDR_LIB $XI_LIB $FIXES_LIB $DAMAGE_LIB $XI_LIB $GLX_LIBS $MIEXT_DAMAGE_LIB $XKB_LIB $XKB_STUB_LIB"
XPRINT_SYS_LIBS="$XPRINTMODULES_LIBS"
xpconfigdir=$libdir/X11/xserver
AC_SUBST([xpconfigdir])
AC_PATH_PROG(MKFONTSCALE, mkfontscale)
AC_PATH_PROG(MKFONTDIR, mkfontdir)
# freetype support code borrowed from lib/XFont
if test x$XP_USE_FREETYPE = xyes; then
AC_DEFINE(XP_USE_FREETYPE,1,[Support FreeType rasterizer in Xprint for nearly all font file formats])
if test "$freetype_config" = "auto" ; then
PKG_CHECK_MODULES(FREETYPE, freetype2,
freetype_config=no, freetype_config=yes)
fi
if test "$freetype_config" = "yes"; then
AC_PATH_PROG(ft_config,freetype-config,no)
if test "$ft_config" = "no"; then
AC_MSG_ERROR([You must have freetype installed; see http://www.freetype.org/])
fi
else
ft_config="$freetype_config"
fi
if test "$freetype_config" != "no"; then
FREETYPE_CFLAGS="`$ft_config --cflags`"
FREETYPE_LIBS="`$ft_config --libs`"
fi
FREETYPE_REQUIRES="freetype2"
else
FREETYPE_CFLAGS=""
FREETYPE_LIBS=""
FREETYPE_REQUIRES=""
fi
XPRINT_CFLAGS="$XPRINT_CFLAGS $FREETYPE_CFLAGS"
XPRINT_SYS_LIBS="$XPRINT_SYS_LIBS $FREETYPE_LIBS"
# end freetype support
AC_SUBST([XPRINT_CFLAGS])
AC_SUBST([XPRINT_LIBS])
AC_SUBST([XPRINT_SYS_LIBS])
fi
AM_CONDITIONAL(XP_USE_FREETYPE, [test "x$XPRINT" = xyes && test "x$XP_USE_FREETYPE" = xyes])
dnl XWin DDX
AC_MSG_CHECKING([whether to build XWin DDX])
@ -1722,22 +1688,6 @@ AM_CONDITIONAL(XWIN_RANDR, [test "x$XWIN" = xyes])
AM_CONDITIONAL(XWIN_XV, [test "x$XWIN" = xyes && test "x$XV" = xyes])
dnl Darwin / OS X DDX
if test "X$XQUARTZ" = Xauto; then
AC_CACHE_CHECK([whether to build Xquartz],xorg_cv_Carbon_framework,[
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -framework Carbon"
AC_LINK_IFELSE([char FSFindFolder(); int main() { FSFindFolder(); return 0;}],
[xorg_cv_Carbon_framework=yes],
[xorg_cv_Carbon_framework=no])
LDFLAGS=$save_LDFLAGS])
if test "X$xorg_cv_Carbon_framework" = Xyes; then
XQUARTZ=yes
else
XQUARTZ=no
fi
fi
if test "x$XQUARTZ" = xyes; then
AC_DEFINE(XQUARTZ,1,[Have Quartz])
AC_DEFINE(ROOTLESS,1,[Build Rootless code])
@ -1749,23 +1699,6 @@ if test "x$XQUARTZ" = xyes; then
AC_CHECK_LIB([Xplugin],[xp_init],[:])
CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DNO_ALLOCA"
if test "x$XF86MISC" = xyes || test "x$XF86MISC" = xauto; then
AC_MSG_NOTICE([Disabling XF86Misc extension])
XF86MISC=no
fi
if test "x$XF86VIDMODE" = xyes || test "x$XF86VIDMODE" = xauto; then
AC_MSG_NOTICE([Disabling XF86VidMode extension])
XF86VIDMODE=no
fi
if test "x$XF86BIGFONT" = xyes || test "x$XF86BIGFONT" = xauto; then
AC_MSG_NOTICE([Disabling XF86BigFont extension])
XF86BIGFONT=no
fi
if test "x$DGA" = xyes || test "x$DGA" = xauto; then
AC_MSG_NOTICE([Disabling DGA extension])
DGA=no
fi
fi
# Support for objc in autotools is minimal and not documented.
@ -1783,17 +1716,6 @@ AM_CONDITIONAL(HAVE_XPLUGIN, [test "x$ac_cv_lib_Xplugin_xp_init" = xyes])
AM_CONDITIONAL(HAVE_AGL_FRAMEWORK, [test "x$xorg_cv_AGL_framework" = xyes])
AM_CONDITIONAL(XQUARTZ, [test "x$XQUARTZ" = xyes])
if test "x$X11APP" = xauto; then
AC_MSG_CHECKING([whether to build X11.app])
if test "x$XQUARTZ" = xyes ; then
X11APP=yes
else
X11APP=no
fi
AC_MSG_RESULT([$X11APP])
fi
AM_CONDITIONAL(X11APP,[test "X$X11APP" = Xyes])
if test "x$LAUNCHD" = "xauto"; then
if test "x$XQUARTZ" = "xyes" ; then
LAUNCHD=yes
@ -2195,6 +2117,8 @@ hw/xwin/Makefile
hw/xquartz/Makefile
hw/xquartz/GL/Makefile
hw/xquartz/bundle/Makefile
hw/xquartz/doc/Makefile
hw/xquartz/mach-startup/Makefile
hw/xquartz/xpr/Makefile
hw/kdrive/Makefile
hw/kdrive/ati/Makefile
@ -2217,41 +2141,5 @@ hw/kdrive/smi/Makefile
hw/kdrive/src/Makefile
hw/kdrive/vesa/Makefile
hw/kdrive/via/Makefile
hw/xprint/Makefile
hw/xprint/doc/Makefile
hw/xprint/pcl/Makefile
hw/xprint/pcl-mono/Makefile
hw/xprint/raster/Makefile
hw/xprint/ps/Makefile
hw/xprint/etc/Makefile
hw/xprint/etc/Xsession.d/Makefile
hw/xprint/etc/init.d/Makefile
hw/xprint/etc/profile.d/Makefile
hw/xprint/config/Makefile
hw/xprint/config/C/print/attributes/Makefile
hw/xprint/config/C/print/ddx-config/Makefile
hw/xprint/config/C/print/ddx-config/raster/Makefile
hw/xprint/config/C/print/models/CANONBJ10E-GS/Makefile
hw/xprint/config/C/print/models/PSdefault/fonts/Makefile
hw/xprint/config/C/print/models/PSdefault/Makefile
hw/xprint/config/C/print/models/PSspooldir/Makefile
hw/xprint/config/C/print/models/SPSPARC2/Makefile
hw/xprint/config/C/print/models/SPSPARC2/fonts/Makefile
hw/xprint/config/C/print/models/GSdefault/Makefile
hw/xprint/config/C/print/models/HPLJ4050-PS/Makefile
hw/xprint/config/C/print/models/HPLJ4050-PS/fonts/Makefile
hw/xprint/config/C/print/models/Makefile
hw/xprint/config/C/print/models/PS2PDFspooldir-GS/Makefile
hw/xprint/config/C/print/models/CANONC3200-PS/Makefile
hw/xprint/config/C/print/models/CANONC3200-PS/fonts/Makefile
hw/xprint/config/C/print/models/HPLJ4family/fonts/Makefile
hw/xprint/config/C/print/models/HPLJ4family/Makefile
hw/xprint/config/C/print/models/HPDJ1600C/Makefile
hw/xprint/config/C/print/models/HPDJ1600C/fonts/Makefile
hw/xprint/config/C/print/Makefile
hw/xprint/config/C/Makefile
hw/xprint/config/en_US/print/attributes/Makefile
hw/xprint/config/en_US/print/Makefile
hw/xprint/config/en_US/Makefile
xorg-server.pc
])

View file

@ -1,10 +1,6 @@
standard_dix_libs = libdix.la libxpstubs.la
if XPRINT
noinst_LTLIBRARIES = $(standard_dix_libs) libXpdix.la
else
noinst_LTLIBRARIES = $(standard_dix_libs)
endif
AM_CFLAGS = $(DIX_CFLAGS) \
-DVENDOR_NAME=\""@VENDOR_NAME@"\" \
@ -45,12 +41,6 @@ libdix_la_SOURCES = \
libxpstubs_la_SOURCES = \
xpstubs.c
if XPRINT
libXpdix_la_SOURCES = $(libdix_la_SOURCES)
libXpdix_la_CPPFLAGS = -I$(top_srcdir)/hw/xprint
libXpdix_la_CFLAGS = $(AM_CFLAGS) $(XPRINT_CFLAGS)
endif
EXTRA_DIST = buildatoms BuiltInAtoms CHANGES Xserver.d Xserver-dtrace.h.in
# Install list of protocol names

View file

@ -399,9 +399,6 @@ Dispatch(void)
}
isItTimeToYield = FALSE;
#ifdef XPRINT
requestingClient = client;
#endif
#ifdef SMART_SCHEDULE
start_tick = SmartScheduleTime;
#endif
@ -472,9 +469,6 @@ Dispatch(void)
client = clients[clientReady[nready]];
if (client)
client->smart_stop_tick = SmartScheduleTime;
#endif
#ifdef XPRINT
requestingClient = NULL;
#endif
}
dispatchException &= ~DE_PRIORITYCHANGE;

View file

@ -302,8 +302,14 @@ doOpenFont(ClientPtr client, OFclosurePtr c)
c->fontname = newname;
c->fnamelen = newlen;
c->current_fpe = 0;
if (--aliascount <= 0)
if (--aliascount <= 0) {
/* We've tried resolving this alias 20 times, we're
* probably stuck in an infinite loop of aliases pointing
* to each other - time to take emergency exit!
*/
err = BadImplementation;
break;
}
continue;
}
if (err == BadFontName) {
@ -1931,37 +1937,27 @@ GetDefaultPointSize ()
FontResolutionPtr
GetClientResolutions (int *num)
{
#ifdef XPRINT
if (requestingClient && requestingClient->fontResFunc != NULL &&
!requestingClient->clientGone)
{
return (*requestingClient->fontResFunc)(requestingClient, num);
}
else
#endif
{
static struct _FontResolution res;
ScreenPtr pScreen;
static struct _FontResolution res;
ScreenPtr pScreen;
pScreen = screenInfo.screens[0];
res.x_resolution = (pScreen->width * 25.4) / pScreen->mmWidth;
/*
* XXX - we'll want this as long as bitmap instances are prevalent
so that we can match them from scalable fonts
*/
if (res.x_resolution < 88)
res.x_resolution = 75;
else
res.x_resolution = 100;
res.y_resolution = (pScreen->height * 25.4) / pScreen->mmHeight;
if (res.y_resolution < 88)
res.y_resolution = 75;
else
res.y_resolution = 100;
res.point_size = 120;
*num = 1;
return &res;
}
pScreen = screenInfo.screens[0];
res.x_resolution = (pScreen->width * 25.4) / pScreen->mmWidth;
/*
* XXX - we'll want this as long as bitmap instances are prevalent
so that we can match them from scalable fonts
*/
if (res.x_resolution < 88)
res.x_resolution = 75;
else
res.x_resolution = 100;
res.y_resolution = (pScreen->height * 25.4) / pScreen->mmHeight;
if (res.y_resolution < 88)
res.y_resolution = 75;
else
res.y_resolution = 100;
res.point_size = 120;
*num = 1;
return &res;
}
/*

View file

@ -407,8 +407,8 @@ GetKeyboardValuatorEvents(xEvent *events, DeviceIntPtr pDev, int type,
int num_valuators, int *valuators) {
int numEvents = 0;
CARD32 ms = 0;
KeySym *map = pDev->key->curKeySyms.map;
KeySym sym = map[key_code * pDev->key->curKeySyms.mapWidth];
KeySym *map;
KeySym sym;
deviceKeyButtonPointer *kbp = NULL;
if (!events)
@ -419,11 +419,14 @@ GetKeyboardValuatorEvents(xEvent *events, DeviceIntPtr pDev, int type,
return 0;
if (!pDev->key || !pDev->focus || !pDev->kbdfeed ||
(pDev->coreEvents && !inputInfo.keyboard->key))
(pDev->coreEvents && !(inputInfo.keyboard && inputInfo.keyboard->key)))
return 0;
if (key_code < 8 || key_code > 255)
return 0;
map = pDev->key->curKeySyms.map;
sym = map[key_code * pDev->key->curKeySyms.mapWidth];
if (pDev->coreEvents)
numEvents = 2;
@ -539,6 +542,9 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons,
if ((type == ButtonPress || type == ButtonRelease) && !pDev->button)
return 0;
if(pDev->coreEvents && !cp)
return 0;
/* FIXME: I guess it should, in theory, be possible to post button events
* from devices without valuators. */

View file

@ -143,9 +143,6 @@ Bool loadableFonts = FALSE;
CursorPtr rootCursor;
Bool blackRoot=FALSE;
Bool whiteRoot=FALSE;
#ifdef XPRINT
ClientPtr requestingClient; /* XXX this should be obsolete now, remove? */
#endif
_X_EXPORT TimeStamp currentTime;
_X_EXPORT TimeStamp lastDeviceEventTime;

View file

@ -103,9 +103,6 @@ Equipment Corporation.
#include "extnsionst.h"
#include "privates.h"
#include "registry.h"
#ifdef XPRINT
#include "DiPrint.h"
#endif
#ifdef PANORAMIX
#include "panoramiXsrv.h"
#else
@ -251,9 +248,6 @@ int main(int argc, char *argv[], char *envp[])
InitGlobals();
InitRegions();
#ifdef XPRINT
PrinterInitGlobals();
#endif
CheckUserParameters(argc, argv, envp);
@ -348,9 +342,6 @@ int main(int argc, char *argv[], char *envp[])
InitCallbackManager();
InitVisualWrap();
InitOutput(&screenInfo, argc, argv);
#ifdef XPRINT
PrinterInitOutput(&screenInfo, argc, argv);
#endif
if (screenInfo.numScreens < 1)
FatalError("no screens found");

View file

@ -31,12 +31,8 @@ from The Open Group.
#include "misc.h"
#include <X11/fonts/font.h>
#ifdef XPRINT
#include "DiPrint.h"
#else
extern Bool XpClientIsBitmapClient(ClientPtr client);
extern Bool XpClientIsPrintClient(ClientPtr client, FontPathElementPtr fpe);
#endif
Bool
XpClientIsBitmapClient(
@ -52,27 +48,3 @@ XpClientIsPrintClient(
{
return FALSE;
}
#ifdef XPRINT
int
PrinterOptions(
int argc,
char **argv,
int i)
{
return i;
}
void
PrinterInitOutput(
ScreenInfo *pScreenInfo,
int argc,
char **argv)
{
}
void PrinterUseMsg(void)
{
}
void PrinterInitGlobals(void)
{
}
#endif /* XPRINT */

View file

@ -18,6 +18,7 @@ libexa_la_SOURCES = \
exa.c \
exa.h \
exa_accel.c \
exa_glyphs.c \
exa_migration.c \
exa_offscreen.c \
exa_render.c \

View file

@ -739,6 +739,8 @@ exaCloseScreen(int i, ScreenPtr pScreen)
PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
#endif
exaGlyphsFini(pScreen);
pScreen->CreateGC = pExaScr->SavedCreateGC;
pScreen->CloseScreen = pExaScr->SavedCloseScreen;
pScreen->GetImage = pExaScr->SavedGetImage;
@ -752,7 +754,9 @@ exaCloseScreen(int i, ScreenPtr pScreen)
#ifdef RENDER
if (ps) {
ps->Composite = pExaScr->SavedComposite;
ps->Glyphs = pExaScr->SavedGlyphs;
ps->Trapezoids = pExaScr->SavedTrapezoids;
ps->Triangles = pExaScr->SavedTriangles;
}
#endif
@ -914,6 +918,9 @@ exaDriverInit (ScreenPtr pScreen,
pExaScr->SavedComposite = ps->Composite;
ps->Composite = exaComposite;
pExaScr->SavedGlyphs = ps->Glyphs;
ps->Glyphs = exaGlyphs;
pExaScr->SavedTriangles = ps->Triangles;
ps->Triangles = exaTriangles;
@ -973,6 +980,8 @@ exaDriverInit (ScreenPtr pScreen,
}
}
exaGlyphsInit(pScreen);
LogMessage(X_INFO, "EXA(%d): Driver registered support for the following"
" operations:\n", pScreen->myNum);
assert(pScreenInfo->PrepareSolid != NULL);

897
exa/exa_glyphs.c Normal file
View file

@ -0,0 +1,897 @@
/*
* Copyright © 2008 Red Hat, Inc.
* Partly based on code Copyright © 2000 SuSE, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Red Hat not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Red Hat makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* Red Hat DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL Red Hat
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of SuSE not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. SuSE makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Owen Taylor <otaylor@fishsoup.net>
* Based on code by: Keith Packard
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <stdlib.h>
#include "exa_priv.h"
#include "mipict.h"
#if DEBUG_GLYPH_CACHE
#define DBG_GLYPH_CACHE(a) ErrorF a
#else
#define DBG_GLYPH_CACHE(a)
#endif
/* Width of the pixmaps we use for the caches; this should be less than
* max texture size of the driver; this may need to actually come from
* the driver.
*/
#define CACHE_PICTURE_WIDTH 1024
/* Maximum number of glyphs we buffer on the stack before flushing
* rendering to the mask or destination surface.
*/
#define GLYPH_BUFFER_SIZE 256
typedef struct {
PicturePtr source;
ExaCompositeRectRec rects[GLYPH_BUFFER_SIZE];
int count;
} ExaGlyphBuffer, *ExaGlyphBufferPtr;
typedef enum {
ExaGlyphSuccess, /* Glyph added to render buffer */
ExaGlyphFail, /* out of memory, etc */
ExaGlyphNeedFlush, /* would evict a glyph already in the buffer */
} ExaGlyphCacheResult;
void
exaGlyphsInit(ScreenPtr pScreen)
{
ExaScreenPriv(pScreen);
int i = 0;
memset(pExaScr->glyphCaches, 0, sizeof(pExaScr->glyphCaches));
pExaScr->glyphCaches[i].format = PICT_a8;
pExaScr->glyphCaches[i].glyphWidth = pExaScr->glyphCaches[i].glyphHeight = 16;
i++;
pExaScr->glyphCaches[i].format = PICT_a8;
pExaScr->glyphCaches[i].glyphWidth = pExaScr->glyphCaches[i].glyphHeight = 32;
i++;
pExaScr->glyphCaches[i].format = PICT_a8r8g8b8;
pExaScr->glyphCaches[i].glyphWidth = pExaScr->glyphCaches[i].glyphHeight = 16;
i++;
pExaScr->glyphCaches[i].format = PICT_a8r8g8b8;
pExaScr->glyphCaches[i].glyphWidth = pExaScr->glyphCaches[i].glyphHeight = 32;
i++;
assert(i == EXA_NUM_GLYPH_CACHES);
for (i = 0; i < EXA_NUM_GLYPH_CACHES; i++) {
pExaScr->glyphCaches[i].columns = CACHE_PICTURE_WIDTH / pExaScr->glyphCaches[i].glyphWidth;
pExaScr->glyphCaches[i].size = 256;
pExaScr->glyphCaches[i].hashSize = 557;
}
}
static void
exaUnrealizeGlyphCaches(ScreenPtr pScreen,
unsigned int format)
{
ExaScreenPriv(pScreen);
int i;
for (i = 0; i < EXA_NUM_GLYPH_CACHES; i++) {
ExaGlyphCachePtr cache = &pExaScr->glyphCaches[i];
if (cache->format != format)
continue;
if (cache->picture) {
FreePicture ((pointer) cache->picture, (XID) 0);
cache->picture = NULL;
}
if (cache->hashEntries) {
xfree(cache->hashEntries);
cache->hashEntries = NULL;
}
if (cache->glyphs) {
xfree(cache->glyphs);
cache->glyphs = NULL;
}
cache->glyphCount = 0;
}
}
/* All caches for a single format share a single pixmap for glyph storage,
* allowing mixing glyphs of different sizes without paying a penalty
* for switching between source pixmaps. (Note that for a size of font
* right at the border between two sizes, we might be switching for almost
* every glyph.)
*
* This function allocates the storage pixmap, and then fills in the
* rest of the allocated structures for all caches with the given format.
*/
static Bool
exaRealizeGlyphCaches(ScreenPtr pScreen,
unsigned int format)
{
ExaScreenPriv(pScreen);
int depth = PIXMAN_FORMAT_DEPTH(format);
PictFormatPtr pPictFormat;
PixmapPtr pPixmap;
PicturePtr pPicture;
int height;
int i;
int error;
pPictFormat = PictureMatchFormat(pScreen, depth, format);
if (!pPictFormat)
return FALSE;
/* Compute the total vertical size needed for the format */
height = 0;
for (i = 0; i < EXA_NUM_GLYPH_CACHES; i++) {
ExaGlyphCachePtr cache = &pExaScr->glyphCaches[i];
int rows;
if (cache->format != format)
continue;
cache->yOffset = height;
rows = (cache->size + cache->columns - 1) / cache->columns;
height += rows * cache->glyphHeight;
}
/* Now allocate the pixmap and picture */
pPixmap = (*pScreen->CreatePixmap) (pScreen,
CACHE_PICTURE_WIDTH,
height, depth, 0);
if (!pPixmap)
return FALSE;
pPicture = CreatePicture(0, &pPixmap->drawable, pPictFormat,
0, 0, serverClient, &error);
(*pScreen->DestroyPixmap) (pPixmap); /* picture holds a refcount */
if (!pPicture)
return FALSE;
/* And store the picture in all the caches for the format */
for (i = 0; i < EXA_NUM_GLYPH_CACHES; i++) {
ExaGlyphCachePtr cache = &pExaScr->glyphCaches[i];
int j;
if (cache->format != format)
continue;
cache->picture = pPicture;
cache->picture->refcnt++;
cache->hashEntries = xalloc(sizeof(int) * cache->hashSize);
cache->glyphs = xalloc(sizeof(ExaCachedGlyphRec) * cache->size);
cache->glyphCount = 0;
if (!cache->hashEntries || !cache->glyphs)
goto bail;
for (j = 0; j < cache->hashSize; j++)
cache->hashEntries[j] = -1;
cache->evictionPosition = rand() % cache->size;
}
/* Each cache references the picture individually */
FreePicture ((pointer) pPicture, (XID) 0);
return TRUE;
bail:
exaUnrealizeGlyphCaches(pScreen, format);
return FALSE;
}
void
exaGlyphsFini (ScreenPtr pScreen)
{
ExaScreenPriv(pScreen);
int i;
for (i = 0; i < EXA_NUM_GLYPH_CACHES; i++) {
ExaGlyphCachePtr cache = &pExaScr->glyphCaches[i];
if (cache->picture)
exaUnrealizeGlyphCaches(pScreen, cache->format);
}
}
static int
exaGlyphCacheHashLookup(ExaGlyphCachePtr cache,
GlyphPtr pGlyph)
{
int slot;
slot = (*(CARD32 *) pGlyph->sha1) % cache->hashSize;
while (TRUE) { /* hash table can never be full */
int entryPos = cache->hashEntries[slot];
if (entryPos == -1)
return -1;
if (memcmp(pGlyph->sha1, cache->glyphs[entryPos].sha1, sizeof(pGlyph->sha1)) == 0){
return entryPos;
}
slot--;
if (slot < 0)
slot = cache->hashSize - 1;
}
}
static void
exaGlyphCacheHashInsert(ExaGlyphCachePtr cache,
GlyphPtr pGlyph,
int pos)
{
int slot;
memcpy(cache->glyphs[pos].sha1, pGlyph->sha1, sizeof(pGlyph->sha1));
slot = (*(CARD32 *) pGlyph->sha1) % cache->hashSize;
while (TRUE) { /* hash table can never be full */
if (cache->hashEntries[slot] == -1) {
cache->hashEntries[slot] = pos;
return;
}
slot--;
if (slot < 0)
slot = cache->hashSize - 1;
}
}
static void
exaGlyphCacheHashRemove(ExaGlyphCachePtr cache,
int pos)
{
int slot;
int emptiedSlot = -1;
slot = (*(CARD32 *) cache->glyphs[pos].sha1) % cache->hashSize;
while (TRUE) { /* hash table can never be full */
int entryPos = cache->hashEntries[slot];
if (entryPos == -1)
return;
if (entryPos == pos) {
cache->hashEntries[slot] = -1;
emptiedSlot = slot;
} else if (emptiedSlot != -1) {
/* See if we can move this entry into the emptied slot, we can't
* do that if if entry would have hashed between the current position
* and the emptied slot. (taking wrapping into account). Bad positions
* are:
*
* | XXXXXXXXXX |
* i j
*
* |XXX XXXX|
* j i
*
* i - slot, j - emptiedSlot
*
* (Knuth 6.4R)
*/
int entrySlot = (*(CARD32 *) cache->glyphs[entryPos].sha1) % cache->hashSize;
if (!((entrySlot >= slot && entrySlot < emptiedSlot) ||
(emptiedSlot < slot && (entrySlot < emptiedSlot || entrySlot >= slot))))
{
cache->hashEntries[emptiedSlot] = entryPos;
cache->hashEntries[slot] = -1;
emptiedSlot = slot;
}
}
slot--;
if (slot < 0)
slot = cache->hashSize - 1;
}
}
#define CACHE_X(pos) (((pos) % cache->columns) * cache->glyphWidth)
#define CACHE_Y(pos) (cache->yOffset + ((pos) / cache->columns) * cache->glyphHeight)
/* The most efficient thing to way to upload the glyph to the screen
* is to use the UploadToScreen() driver hook; this allows us to
* pipeline glyph uploads and to avoid creating offscreen pixmaps for
* glyphs that we'll never use again.
*/
static Bool
exaGlyphCacheUploadGlyph(ScreenPtr pScreen,
ExaGlyphCachePtr cache,
int pos,
GlyphPtr pGlyph)
{
ExaScreenPriv(pScreen);
PicturePtr pGlyphPicture = GlyphPicture(pGlyph)[pScreen->myNum];
PixmapPtr pGlyphPixmap = (PixmapPtr)pGlyphPicture->pDrawable;
ExaPixmapPriv(pGlyphPixmap);
PixmapPtr pCachePixmap = (PixmapPtr)cache->picture->pDrawable;
ExaMigrationRec pixmaps[1];
int cacheXoff, cacheYoff;
if (!pExaScr->info->UploadToScreen || pExaScr->swappedOut || pExaPixmap->accel_blocked)
return FALSE;
/* If the glyph pixmap is already uploaded, no point in doing
* things this way */
if (exaPixmapIsOffscreen(pGlyphPixmap))
return FALSE;
/* UploadToScreen only works if bpp match */
if (pGlyphPixmap->drawable.bitsPerPixel != pCachePixmap->drawable.bitsPerPixel)
return FALSE;
/* cache pixmap must be offscreen. */
pixmaps[0].as_dst = TRUE;
pixmaps[0].as_src = FALSE;
pixmaps[0].pPix = pCachePixmap;
pixmaps[0].pReg = NULL;
exaDoMigration (pixmaps, 1, TRUE);
pCachePixmap = exaGetOffscreenPixmap ((DrawablePtr)pCachePixmap, &cacheXoff, &cacheYoff);
if (!pCachePixmap)
return FALSE;
if (!pExaScr->info->UploadToScreen(pCachePixmap,
CACHE_X(pos) + cacheXoff,
CACHE_Y(pos) + cacheYoff,
pGlyph->info.width,
pGlyph->info.height,
(char *)pExaPixmap->sys_ptr,
pExaPixmap->sys_pitch))
return FALSE;
exaPixmapDirty (pCachePixmap,
CACHE_X(pos) + cacheXoff,
CACHE_Y(pos) + cacheYoff,
CACHE_X(pos) + cacheXoff + pGlyph->info.width,
CACHE_Y(pos) + cacheYoff + pGlyph->info.height);
return TRUE;
}
static ExaGlyphCacheResult
exaGlyphCacheBufferGlyph(ScreenPtr pScreen,
ExaGlyphCachePtr cache,
ExaGlyphBufferPtr buffer,
GlyphPtr pGlyph,
int xGlyph,
int yGlyph)
{
ExaCompositeRectPtr rect;
int pos;
if (buffer->source && buffer->source != cache->picture)
return ExaGlyphNeedFlush;
if (!cache->picture) {
if (!exaRealizeGlyphCaches(pScreen, cache->format))
return ExaGlyphFail;
}
DBG_GLYPH_CACHE(("(%d,%d,%s): buffering glyph %lx\n",
cache->glyphWidth, cache->glyphHeight, cache->format == PICT_a8 ? "A" : "ARGB",
(long)*(CARD32 *) pGlyph->sha1));
pos = exaGlyphCacheHashLookup(cache, pGlyph);
if (pos != -1) {
DBG_GLYPH_CACHE((" found existing glyph at %d\n", pos));
} else {
if (cache->glyphCount < cache->size) {
/* Space remaining; we fill from the start */
pos = cache->glyphCount;
cache->glyphCount++;
DBG_GLYPH_CACHE((" storing glyph in free space at %d\n", pos));
exaGlyphCacheHashInsert(cache, pGlyph, pos);
} else {
/* Need to evict an entry. We have to see if any glyphs
* already in the output buffer were at this position in
* the cache
*/
pos = cache->evictionPosition;
DBG_GLYPH_CACHE((" evicting glyph at %d\n", pos));
if (buffer->count) {
int x, y;
int i;
x = CACHE_X(pos);
y = CACHE_Y(pos);
for (i = 0; i < buffer->count; i++) {
if (buffer->rects[i].xSrc == x && buffer->rects[i].ySrc == y) {
DBG_GLYPH_CACHE((" must flush buffer\n"));
return ExaGlyphNeedFlush;
}
}
}
/* OK, we're all set, swap in the new glyph */
exaGlyphCacheHashRemove(cache, pos);
exaGlyphCacheHashInsert(cache, pGlyph, pos);
/* And pick a new eviction position */
cache->evictionPosition = rand() % cache->size;
}
/* Now actually upload the glyph into the cache picture; if
* we can't do it with UploadToScreen (because the glyph is
* offscreen, etc), we fall back to CompositePicture.
*/
if (!exaGlyphCacheUploadGlyph(pScreen, cache, pos, pGlyph)) {
CompositePicture (PictOpSrc,
GlyphPicture(pGlyph)[pScreen->myNum],
None,
cache->picture,
0, 0,
0, 0,
CACHE_X(pos),
CACHE_Y(pos),
pGlyph->info.width,
pGlyph->info.height);
}
}
buffer->source = cache->picture;
rect = &buffer->rects[buffer->count];
rect->xSrc = CACHE_X(pos);
rect->ySrc = CACHE_Y(pos);
rect->xDst = xGlyph - pGlyph->info.x;
rect->yDst = yGlyph - pGlyph->info.y;
rect->width = pGlyph->info.width;
rect->height = pGlyph->info.height;
buffer->count++;
return ExaGlyphSuccess;
}
#undef CACHE_X
#undef CACHE_Y
static ExaGlyphCacheResult
exaBufferGlyph(ScreenPtr pScreen,
ExaGlyphBufferPtr buffer,
GlyphPtr pGlyph,
int xGlyph,
int yGlyph)
{
ExaScreenPriv(pScreen);
unsigned int format = (GlyphPicture(pGlyph)[pScreen->myNum])->format;
int width = pGlyph->info.width;
int height = pGlyph->info.height;
ExaCompositeRectPtr rect;
PicturePtr source;
int i;
if (buffer->count == GLYPH_BUFFER_SIZE)
return ExaGlyphNeedFlush;
if (PICT_FORMAT_BPP(format) == 1)
format = PICT_a8;
for (i = 0; i < EXA_NUM_GLYPH_CACHES; i++) {
ExaGlyphCachePtr cache = &pExaScr->glyphCaches[i];
if (format == cache->format &&
width <= cache->glyphWidth &&
height <= cache->glyphHeight) {
ExaGlyphCacheResult result = exaGlyphCacheBufferGlyph(pScreen, &pExaScr->glyphCaches[i],
buffer,
pGlyph, xGlyph, yGlyph);
switch (result) {
case ExaGlyphFail:
break;
case ExaGlyphSuccess:
case ExaGlyphNeedFlush:
return result;
}
}
}
/* Couldn't find the glyph in the cache, use the glyph picture directly */
source = GlyphPicture(pGlyph)[pScreen->myNum];
if (buffer->source && buffer->source != source)
return ExaGlyphNeedFlush;
buffer->source = source;
rect = &buffer->rects[buffer->count];
rect->xSrc = 0;
rect->ySrc = 0;
rect->xDst = xGlyph - pGlyph->info.x;
rect->yDst = yGlyph - pGlyph->info.y;
rect->width = pGlyph->info.width;
rect->height = pGlyph->info.height;
buffer->count++;
return ExaGlyphSuccess;
}
static void
exaGlyphsToMask(PicturePtr pMask,
ExaGlyphBufferPtr buffer)
{
exaCompositeRects(PictOpAdd, buffer->source, pMask,
buffer->count, buffer->rects);
buffer->count = 0;
buffer->source = NULL;
}
static void
exaGlyphsToDst(CARD8 op,
PicturePtr pSrc,
PicturePtr pDst,
ExaGlyphBufferPtr buffer,
INT16 xSrc,
INT16 ySrc,
INT16 xDst,
INT16 yDst)
{
int i;
for (i = 0; i < buffer->count; i++) {
ExaCompositeRectPtr rect = &buffer->rects[i];
CompositePicture (op,
pSrc,
buffer->source,
pDst,
xSrc + rect->xDst - xDst,
ySrc + rect->yDst - yDst,
rect->xSrc,
rect->ySrc,
rect->xDst,
rect->yDst,
rect->width,
rect->height);
}
buffer->count = 0;
buffer->source = NULL;
}
/* Cut and paste from render/glyph.c - probably should export it instead */
static void
GlyphExtents (int nlist,
GlyphListPtr list,
GlyphPtr *glyphs,
BoxPtr extents)
{
int x1, x2, y1, y2;
int n;
GlyphPtr glyph;
int x, y;
x = 0;
y = 0;
extents->x1 = MAXSHORT;
extents->x2 = MINSHORT;
extents->y1 = MAXSHORT;
extents->y2 = MINSHORT;
while (nlist--)
{
x += list->xOff;
y += list->yOff;
n = list->len;
list++;
while (n--)
{
glyph = *glyphs++;
x1 = x - glyph->info.x;
if (x1 < MINSHORT)
x1 = MINSHORT;
y1 = y - glyph->info.y;
if (y1 < MINSHORT)
y1 = MINSHORT;
x2 = x1 + glyph->info.width;
if (x2 > MAXSHORT)
x2 = MAXSHORT;
y2 = y1 + glyph->info.height;
if (y2 > MAXSHORT)
y2 = MAXSHORT;
if (x1 < extents->x1)
extents->x1 = x1;
if (x2 > extents->x2)
extents->x2 = x2;
if (y1 < extents->y1)
extents->y1 = y1;
if (y2 > extents->y2)
extents->y2 = y2;
x += glyph->info.xOff;
y += glyph->info.yOff;
}
}
}
/**
* Returns TRUE if the glyphs in the lists intersect. Only checks based on
* bounding box, which appears to be good enough to catch most cases at least.
*/
static Bool
exaGlyphsIntersect(int nlist, GlyphListPtr list, GlyphPtr *glyphs)
{
int x1, x2, y1, y2;
int n;
GlyphPtr glyph;
int x, y;
BoxRec extents;
Bool first = TRUE;
x = 0;
y = 0;
while (nlist--) {
x += list->xOff;
y += list->yOff;
n = list->len;
list++;
while (n--) {
glyph = *glyphs++;
if (glyph->info.width == 0 || glyph->info.height == 0) {
x += glyph->info.xOff;
y += glyph->info.yOff;
continue;
}
x1 = x - glyph->info.x;
if (x1 < MINSHORT)
x1 = MINSHORT;
y1 = y - glyph->info.y;
if (y1 < MINSHORT)
y1 = MINSHORT;
x2 = x1 + glyph->info.width;
if (x2 > MAXSHORT)
x2 = MAXSHORT;
y2 = y1 + glyph->info.height;
if (y2 > MAXSHORT)
y2 = MAXSHORT;
if (first) {
extents.x1 = x1;
extents.y1 = y1;
extents.x2 = x2;
extents.y2 = y2;
first = FALSE;
} else {
if (x1 < extents.x2 && x2 > extents.x1 &&
y1 < extents.y2 && y2 > extents.y1)
{
return TRUE;
}
if (x1 < extents.x1)
extents.x1 = x1;
if (x2 > extents.x2)
extents.x2 = x2;
if (y1 < extents.y1)
extents.y1 = y1;
if (y2 > extents.y2)
extents.y2 = y2;
}
x += glyph->info.xOff;
y += glyph->info.yOff;
}
}
return FALSE;
}
#define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0)
void
exaGlyphs (CARD8 op,
PicturePtr pSrc,
PicturePtr pDst,
PictFormatPtr maskFormat,
INT16 xSrc,
INT16 ySrc,
int nlist,
GlyphListPtr list,
GlyphPtr *glyphs)
{
PicturePtr pPicture;
PixmapPtr pMaskPixmap = 0;
PicturePtr pMask;
ScreenPtr pScreen = pDst->pDrawable->pScreen;
int width = 0, height = 0;
int x, y;
int xDst = list->xOff, yDst = list->yOff;
int n;
GlyphPtr glyph;
int error;
BoxRec extents = {0, 0, 0, 0};
CARD32 component_alpha;
ExaGlyphBuffer buffer;
/* If we don't have a mask format but all the glyphs have the same format
* and don't intersect, use the glyph format as mask format for the full
* benefits of the glyph cache.
*/
if (!maskFormat) {
Bool sameFormat = TRUE;
int i;
maskFormat = list[0].format;
for (i = 0; i < nlist; i++) {
if (maskFormat->format != list[i].format->format) {
sameFormat = FALSE;
break;
}
}
if (!sameFormat || (maskFormat->depth != 1 &&
exaGlyphsIntersect(nlist, list, glyphs))) {
maskFormat = NULL;
}
}
if (maskFormat)
{
GCPtr pGC;
xRectangle rect;
GlyphExtents (nlist, list, glyphs, &extents);
if (extents.x2 <= extents.x1 || extents.y2 <= extents.y1)
return;
width = extents.x2 - extents.x1;
height = extents.y2 - extents.y1;
if (maskFormat->depth == 1) {
PictFormatPtr a8Format = PictureMatchFormat (pScreen, 8, PICT_a8);
if (a8Format)
maskFormat = a8Format;
}
pMaskPixmap = (*pScreen->CreatePixmap) (pScreen, width, height,
maskFormat->depth,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pMaskPixmap)
return;
component_alpha = NeedsComponent(maskFormat->format);
pMask = CreatePicture (0, &pMaskPixmap->drawable,
maskFormat, CPComponentAlpha, &component_alpha,
serverClient, &error);
if (!pMask)
{
(*pScreen->DestroyPixmap) (pMaskPixmap);
return;
}
pGC = GetScratchGC (pMaskPixmap->drawable.depth, pScreen);
ValidateGC (&pMaskPixmap->drawable, pGC);
rect.x = 0;
rect.y = 0;
rect.width = width;
rect.height = height;
(*pGC->ops->PolyFillRect) (&pMaskPixmap->drawable, pGC, 1, &rect);
FreeScratchGC (pGC);
x = -extents.x1;
y = -extents.y1;
}
else
{
pMask = pDst;
x = 0;
y = 0;
}
buffer.count = 0;
buffer.source = NULL;
while (nlist--)
{
x += list->xOff;
y += list->yOff;
n = list->len;
while (n--)
{
glyph = *glyphs++;
pPicture = GlyphPicture (glyph)[pScreen->myNum];
if (glyph->info.width > 0 && glyph->info.height > 0 &&
exaBufferGlyph(pScreen, &buffer, glyph, x, y) == ExaGlyphNeedFlush)
{
if (maskFormat)
exaGlyphsToMask(pMask, &buffer);
else
exaGlyphsToDst(op, pSrc, pDst, &buffer,
xSrc, ySrc, xDst, yDst);
exaBufferGlyph(pScreen, &buffer, glyph, x, y);
}
x += glyph->info.xOff;
y += glyph->info.yOff;
}
list++;
}
if (maskFormat)
exaGlyphsToMask(pMask, &buffer);
else
exaGlyphsToDst(op, pSrc, pDst, &buffer,
xSrc, ySrc, xDst, yDst);
if (maskFormat)
{
x = extents.x1;
y = extents.y1;
CompositePicture (op,
pSrc,
pMask,
pDst,
xSrc + x - xDst,
ySrc + y - yDst,
0, 0,
x, y,
width, height);
FreePicture ((pointer) pMask, (XID) 0);
(*pScreen->DestroyPixmap) (pMaskPixmap);
}
}

View file

@ -61,6 +61,7 @@
#define DEBUG_MIGRATE 0
#define DEBUG_PIXMAP 0
#define DEBUG_OFFSCREEN 0
#define DEBUG_GLYPH_CACHE 0
#if DEBUG_TRACE_FALL
#define EXA_FALLBACK(x) \
@ -95,6 +96,38 @@ enum ExaMigrationHeuristic {
ExaMigrationSmart
};
typedef struct {
unsigned char sha1[20];
} ExaCachedGlyphRec, *ExaCachedGlyphPtr;
typedef struct {
/* The identity of the cache, statically configured at initialization */
unsigned int format;
int glyphWidth;
int glyphHeight;
int size; /* Size of cache; eventually this should be dynamically determined */
/* Hash table mapping from glyph sha1 to position in the glyph; we use
* open addressing with a hash table size determined based on size and large
* enough so that we always have a good amount of free space, so we can
* use linear probing. (Linear probing is preferrable to double hashing
* here because it allows us to easily remove entries.)
*/
int *hashEntries;
int hashSize;
ExaCachedGlyphPtr glyphs;
int glyphCount; /* Current number of glyphs */
PicturePtr picture; /* Where the glyphs of the cache are stored */
int yOffset; /* y location within the picture where the cache starts */
int columns; /* Number of columns the glyphs are layed out in */
int evictionPosition; /* Next random position to evict a glyph */
} ExaGlyphCacheRec, *ExaGlyphCachePtr;
#define EXA_NUM_GLYPH_CACHES 4
typedef void (*EnableDisableFBAccessProcPtr)(int, Bool);
typedef struct {
ExaDriverPtr info;
@ -122,6 +155,8 @@ typedef struct {
unsigned disableFbCount;
Bool optimize_migration;
unsigned offScreenCounter;
ExaGlyphCacheRec glyphCaches[EXA_NUM_GLYPH_CACHES];
} ExaScreenPrivRec, *ExaScreenPrivPtr;
/*
@ -209,6 +244,15 @@ typedef struct _ExaMigrationRec {
RegionPtr pReg;
} ExaMigrationRec, *ExaMigrationPtr;
typedef struct {
INT16 xSrc;
INT16 ySrc;
INT16 xDst;
INT16 yDst;
INT16 width;
INT16 height;
} ExaCompositeRectRec, *ExaCompositeRectPtr;
/**
* exaDDXDriverInit must be implemented by the DDX using EXA, and is the place
* to set EXA options or hook in screen functions to handle using EXA as the AA.
@ -422,6 +466,13 @@ exaComposite(CARD8 op,
CARD16 width,
CARD16 height);
void
exaCompositeRects(CARD8 op,
PicturePtr Src,
PicturePtr pDst,
int nrect,
ExaCompositeRectPtr rects);
void
exaTrapezoids (CARD8 op, PicturePtr pSrc, PicturePtr pDst,
PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc,
@ -432,6 +483,13 @@ exaTriangles (CARD8 op, PicturePtr pSrc, PicturePtr pDst,
PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc,
int ntri, xTriangle *tris);
/* exa_glyph.c */
void
exaGlyphsInit(ScreenPtr pScreen);
void
exaGlyphsFini (ScreenPtr pScreen);
void
exaGlyphs (CARD8 op,
PicturePtr pSrc,

View file

@ -331,6 +331,231 @@ exaTryDriverSolidFill(PicturePtr pSrc,
return 1;
}
static int
exaTryDriverCompositeRects(CARD8 op,
PicturePtr pSrc,
PicturePtr pDst,
int nrect,
ExaCompositeRectPtr rects)
{
ExaScreenPriv (pDst->pDrawable->pScreen);
int src_off_x, src_off_y, dst_off_x, dst_off_y;
PixmapPtr pSrcPix, pDstPix;
ExaPixmapPrivPtr pSrcExaPix, pDstExaPix;
struct _Pixmap scratch;
ExaMigrationRec pixmaps[2];
if (!pExaScr->info->PrepareComposite)
return -1;
pSrcPix = exaGetDrawablePixmap(pSrc->pDrawable);
pSrcExaPix = ExaGetPixmapPriv(pSrcPix);
pDstPix = exaGetDrawablePixmap(pDst->pDrawable);
pDstExaPix = ExaGetPixmapPriv(pDstPix);
/* Check whether the accelerator can use these pixmaps.
* FIXME: If it cannot, use temporary pixmaps so that the drawing
* happens within limits.
*/
if (pSrcExaPix->accel_blocked ||
pDstExaPix->accel_blocked)
{
return -1;
}
if (pExaScr->info->CheckComposite &&
!(*pExaScr->info->CheckComposite) (op, pSrc, NULL, pDst))
{
return -1;
}
exaGetDrawableDeltas (pDst->pDrawable, pDstPix, &dst_off_x, &dst_off_y);
pixmaps[0].as_dst = TRUE;
pixmaps[0].as_src = exaOpReadsDestination(op);
pixmaps[0].pPix = pDstPix;
pixmaps[0].pReg = NULL;
pixmaps[1].as_dst = FALSE;
pixmaps[1].as_src = TRUE;
pixmaps[1].pPix = pSrcPix;
pixmaps[1].pReg = NULL;
exaDoMigration(pixmaps, 2, TRUE);
pSrcPix = exaGetOffscreenPixmap (pSrc->pDrawable, &src_off_x, &src_off_y);
if (!exaPixmapIsOffscreen(pDstPix))
return 0;
if (!pSrcPix && pExaScr->info->UploadToScratch)
{
pSrcPix = exaGetDrawablePixmap (pSrc->pDrawable);
if ((*pExaScr->info->UploadToScratch) (pSrcPix, &scratch))
pSrcPix = &scratch;
}
if (!pSrcPix)
return 0;
if (!(*pExaScr->info->PrepareComposite) (op, pSrc, NULL, pDst, pSrcPix,
NULL, pDstPix))
return -1;
while (nrect--)
{
INT16 xDst = rects->xDst + pDst->pDrawable->x;
INT16 yDst = rects->yDst + pDst->pDrawable->y;
INT16 xSrc = rects->xSrc + pSrc->pDrawable->x;
INT16 ySrc = rects->ySrc + pSrc->pDrawable->y;
RegionRec region;
BoxPtr pbox;
int nbox;
if (!miComputeCompositeRegion (&region, pSrc, NULL, pDst,
xSrc, ySrc, 0, 0, xDst, yDst,
rects->width, rects->height))
goto next_rect;
REGION_TRANSLATE(pScreen, &region, dst_off_x, dst_off_y);
nbox = REGION_NUM_RECTS(&region);
pbox = REGION_RECTS(&region);
xSrc = xSrc + src_off_x - xDst - dst_off_x;
ySrc = ySrc + src_off_y - yDst - dst_off_y;
while (nbox--)
{
(*pExaScr->info->Composite) (pDstPix,
pbox->x1 + xSrc,
pbox->y1 + ySrc,
0, 0,
pbox->x1,
pbox->y1,
pbox->x2 - pbox->x1,
pbox->y2 - pbox->y1);
pbox++;
}
next_rect:
REGION_UNINIT(pDst->pDrawable->pScreen, &region);
rects++;
}
(*pExaScr->info->DoneComposite) (pDstPix);
exaMarkSync(pDst->pDrawable->pScreen);
return 1;
}
/**
* Copy a number of rectangles from source to destination in a single
* operation. This is specialized for building a glyph mask: we don'y
* have a mask argument because we don't need it for that, and we
* don't have he special-case fallbacks found in exaComposite() - if the
* driver can support it, we use the driver functionality, otherwise we
* fallback straight to software.
*/
void
exaCompositeRects(CARD8 op,
PicturePtr pSrc,
PicturePtr pDst,
int nrect,
ExaCompositeRectPtr rects)
{
PixmapPtr pPixmap = exaGetDrawablePixmap(pDst->pDrawable);
ExaPixmapPriv(pPixmap);
int xoff, yoff;
int x1 = MAXSHORT;
int y1 = MAXSHORT;
int x2 = MINSHORT;
int y2 = MINSHORT;
RegionRec region;
RegionPtr pending_damage;
BoxRec box;
int n;
ExaCompositeRectPtr r;
/* We have to manage the damage ourselves, since CompositeRects isn't
* something in the screen that can be managed by the damage extension,
* and EXA depends on damage to track what needs to be migrated between
* offscreen and onscreen.
*/
/* Compute the overall extents of the composited region - we're making
* the assumption here that we are compositing a bunch of glyphs that
* cluster closely together and damaging each glyph individually would
* be a loss compared to damaging the bounding box.
*/
n = nrect;
r = rects;
while (n--) {
int rect_x2 = r->xDst + r->width;
int rect_y2 = r->yDst + r->width;
if (r->xDst < x1) x1 = r->xDst;
if (r->xDst < y1) y1 = r->xDst;
if (rect_x2 > x2) x2 = rect_x2;
if (rect_y2 > y2) y2 = rect_y2;
r++;
}
if (x2 <= x1 && y2 <= y1)
return;
box.x1 = x1;
box.x2 = x2 < MAXSHORT ? x2 : MAXSHORT;
box.y1 = y1;
box.y2 = y2 < MAXSHORT ? y2 : MAXSHORT;
/* The pixmap migration code relies on pendingDamage indicating
* the bounds of the current rendering, so we need to force
* the actual damage into that region before we do anything, and
* (see use of DamagePendingRegion in exaCopyDirty)
*/
REGION_INIT(pScreen, &region, &box, 1);
exaGetDrawableDeltas(pDst->pDrawable, pPixmap, &xoff, &yoff);
REGION_TRANSLATE(pScreen, &region, xoff, yoff);
pending_damage = DamagePendingRegion(pExaPixmap->pDamage);
REGION_UNION(pScreen, pending_damage, pending_damage, &region);
REGION_TRANSLATE(pScreen, &region, -xoff, -yoff);
/************************************************************/
ValidatePicture (pSrc);
ValidatePicture (pDst);
if (exaTryDriverCompositeRects(op, pSrc, pDst, nrect, rects) != 1) {
n = nrect;
r = rects;
while (n--) {
ExaCheckComposite (op, pSrc, NULL, pDst,
r->xSrc, r->ySrc,
0, 0,
r->xDst, r->yDst,
r->width, r->height);
r++;
}
}
/************************************************************/
/* Now we have to flush the damage out from pendingDamage => damage
* Calling DamageDamageRegion has that effect. (We could pass
* in an empty region here, but we pass in the same region we
* use above; the effect is the same.)
*/
DamageDamageRegion(pDst->pDrawable, &region);
REGION_UNINIT(pScreen, &region);
}
static int
exaTryDriverComposite(CARD8 op,
PicturePtr pSrc,

View file

@ -26,10 +26,6 @@ if KDRIVE
KDRIVE_SUBDIRS = kdrive
endif
if XPRINT
XPRINT_SUBDIRS = xprint
endif
if XQUARTZ
XQUARTZ_SUBDIRS = xquartz
endif
@ -42,10 +38,9 @@ SUBDIRS = \
$(XNEST_SUBDIRS) \
$(DMX_SUBDIRS) \
$(KDRIVE_SUBDIRS) \
$(XQUARTZ_SUBDIRS) \
$(XPRINT_SUBDIRS)
$(XQUARTZ_SUBDIRS)
DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive xgl xprint
DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive xgl
relink:
for i in $(SUBDIRS) ; do $(MAKE) -C $$i relink ; done

View file

@ -150,11 +150,22 @@ ephyrScreenInitialize (KdScreenInfo *screen, EphyrScrPriv *scrpriv)
screen->fb[0].depth = 16;
screen->fb[0].bitsPerPixel = 16;
}
else
else if (screen->fb[0].depth <= 24)
{
screen->fb[0].depth = 24;
screen->fb[0].bitsPerPixel = 32;
}
else if (screen->fb[0].depth <= 30)
{
screen->fb[0].depth = 30;
screen->fb[0].bitsPerPixel = 32;
}
else
{
ErrorF("\nXephyr: Unsupported screen depth %d\n",
screen->fb[0].depth);
return FALSE;
}
hostx_get_visual_masks (screen, &redMask, &greenMask, &blueMask);

View file

@ -1353,12 +1353,6 @@ KdInitOutput (ScreenInfo *pScreenInfo,
KdCardInfo *card;
KdScreenInfo *screen;
#ifdef COMPOSITE
/* kind of a hack: we want Composite enabled, but it's disabled per
* default. */
noCompositeExtension = FALSE;
#endif
if (!kdCardInfo)
{
InitCard (0);

View file

@ -25,6 +25,7 @@ MODEDEFSOURCES = $(srcdir)/vesamodes $(srcdir)/extramodes
xf86DefModeSet.c: $(srcdir)/modeline2c.awk $(MODEDEFSOURCES)
cat $(MODEDEFSOURCES) | $(AWK) -f $(srcdir)/modeline2c.awk > $@
echo >> $@
BUILT_SOURCES = xf86DefModeSet.c

View file

@ -1363,7 +1363,7 @@ do { \
# define write_mem_barrier() /* NOP */
# if !defined(__SUNPRO_C)
# if !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__)
# if !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) && !defined(__m32r__)
# ifdef GCCUSESGAS
/*
@ -1472,7 +1472,7 @@ inl(unsigned short port)
# endif /* GCCUSESGAS */
# else /* !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__)*/
# else /* !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__) && !defined(__m32r__) */
static __inline__ void
outb(unsigned short port, unsigned char val)

View file

@ -2773,7 +2773,7 @@ xf86FindPrimaryDevice()
}
}
#if !defined(__sparc) && !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__) && !defined(__arm__)
#if !defined(__sparc) && !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__) && !defined(__arm__) && !defined(__m32r__)
#include "vgaHW.h"
#include "compiler.h"
#endif
@ -2785,7 +2785,7 @@ static void
CheckGenericGA()
{
/* This needs to be changed for multiple domains */
#if !defined(__sparc__) && !defined(__sparc) && !defined(__powerpc__) && !defined(__mips__) && !defined(__ia64__) && !defined(__arm__) && !defined(__s390__)
#if !defined(__sparc__) && !defined(__sparc) && !defined(__powerpc__) && !defined(__mips__) && !defined(__ia64__) && !defined(__arm__) && !defined(__s390__) && !defined(__m32r__)
IOADDRESS GenericIOBase = VGAHW_GET_IOBASE();
CARD8 CurrentValue, TestValue;

View file

@ -632,10 +632,10 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
/*
* Locate bus slot that had register IO enabled at server startup
*/
xf86AccessInit();
xf86FindPrimaryDevice();
if (xorgHWAccess) {
xf86AccessInit();
xf86FindPrimaryDevice();
}
/*
* Now call each of the Probe functions. Each successful probe will
* result in an extra entry added to the xf86Screens[] list for each

View file

@ -2598,7 +2598,7 @@ static void drmSIGIOHandler(int interrupt, void *closure)
#if 0
fprintf(stderr, "Trying %d\n", entry->fd);
#endif
if ((count = read(entry->fd, buf, sizeof(buf))) > 0) {
if ((count = read(entry->fd, buf, sizeof(buf) - 1)) > 0) {
buf[count] = '\0';
#if 0
fprintf(stderr, "Got %s\n", buf);

View file

@ -310,12 +310,12 @@ fbdev_open_pci(struct pci_device * pPci, char **namep)
/* There are two ways to that we can determine which fb device is
* associated with this PCI device. The more modern way is to look in
* the sysfs directory for the PCI device for a file named
* "graphics:fb*"
* "graphics/fb*"
*/
for (i = 0; i < 8; i++) {
sprintf(filename,
"/sys/bus/pci/devices/%04x:%02x:%02x.%d/graphics:fb%d",
"/sys/bus/pci/devices/%04x:%02x:%02x.%d/graphics/fb%d",
pPci->domain, pPci->bus, pPci->dev, pPci->func, i);
fd = open(filename, O_RDONLY, 0);

View file

@ -942,6 +942,7 @@ _X_HIDDEN void *xfree86LookupTab[] = {
SYMFUNC(xf86CrtcDestroy)
SYMFUNC(xf86CrtcInUse)
SYMFUNC(xf86CrtcSetScreenSubpixelOrder)
SYMFUNC(xf86RotateFreeShadow)
SYMFUNC(xf86RotateCloseScreen)
SYMFUNC(xf86CrtcRotate)
SYMFUNC(xf86CrtcSetMode)

View file

@ -664,6 +664,12 @@ xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation,
Bool
xf86CrtcRotate (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation);
/*
* free shadow memory allocated for all crtcs
*/
void
xf86RotateFreeShadow(ScrnInfoPtr pScrn);
/*
* Clean up rotation during CloseScreen
*/

View file

@ -363,7 +363,7 @@ DDCModeFromDetailedTiming(int scrnIndex, struct detailed_timings *timing,
/* We only do seperate sync currently */
if (timing->sync != 0x03) {
xf86DrvMsg(scrnIndex, X_INFO,
"%s: %dx%d Warning: We only handle seperate"
"%s: %dx%d Warning: We only handle separate"
" sync.\n", __func__, timing->h_active, timing->v_active);
}

View file

@ -457,8 +457,7 @@ xf86RotateDestroy (xf86CrtcPtr crtc)
}
for (c = 0; c < xf86_config->num_crtc; c++)
if (xf86_config->crtc[c]->rotatedPixmap ||
xf86_config->crtc[c]->rotatedData)
if (xf86_config->crtc[c]->transform_in_use)
return;
/*
@ -478,6 +477,24 @@ xf86RotateDestroy (xf86CrtcPtr crtc)
}
}
_X_EXPORT void
xf86RotateFreeShadow(ScrnInfoPtr pScrn)
{
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
int c;
for (c = 0; c < config->num_crtc; c++) {
xf86CrtcPtr crtc = config->crtc[c];
if (crtc->rotatedPixmap || crtc->rotatedData) {
crtc->funcs->shadow_destroy(crtc, crtc->rotatedPixmap,
crtc->rotatedData);
crtc->rotatedPixmap = NULL;
crtc->rotatedData = NULL;
}
}
}
_X_EXPORT void
xf86RotateCloseScreen (ScreenPtr screen)
{

View file

@ -237,6 +237,12 @@
# if defined(linux)
# define ARCH_PCI_INIT linuxPciInit
# endif
#elif defined(__m32r__)
# if defined(linux)
# define ARCH_PCI_INIT linuxPciInit
# define INCLUDE_XF86_MAP_PCI_MEM
# define INCLUDE_XF86_NO_DOMAIN
# endif
#elif defined(__sparc__) || defined(sparc)
# if defined(linux)
# define ARCH_PCI_INIT linuxPciInit

View file

@ -65,6 +65,7 @@ xf86AccResFromOS(resPtr ret)
defined(__sparc__) || \
defined(__mips__) || \
defined(__sh__) || \
defined(__m32r__) || \
defined(__mc68000__) || \
defined(__arm__) || \
defined(__s390__) || \

View file

@ -558,7 +558,7 @@ xf86EnableIO(void)
#endif
}
close(fd);
#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) && !defined(__arm__)
#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) && !defined(__arm__) && !defined(__m32r__)
if (ioperm(0, 1024, 1) || iopl(3)) {
if (errno == ENODEV)
ErrorF("xf86EnableIOPorts: no I/O ports found\n");
@ -585,7 +585,7 @@ xf86DisableIO(void)
#if defined(__powerpc__)
munmap(ioBase, 0x20000);
ioBase = NULL;
#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__)
#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__) && !defined(__m32r__)
iopl(0);
ioperm(0, 1024, 0);
#endif

View file

@ -465,7 +465,7 @@ CreateFiles(TreeNode *files)
Widget w;
char *value;
value = file->file_logfile ? file->file_logfile : "";
value = (file && file->file_logfile) ? file->file_logfile : "";
node = NewNode(files, NULL, NULL, files->node,
(TreeData*)XtCalloc(1, sizeof(TreeData)));
CreateFilesField(node, "LogFile", value);
@ -509,10 +509,14 @@ UpdateFiles(TreeNode *files)
/* LogFile */
files = files->child;
XtVaGetValues(files->data->files.text, XtNstring, &str, NULL);
XtFree(XF86Config->conf_files->file_logfile);
if (*str)
if (XF86Config->conf_files && XF86Config->conf_files->file_logfile)
XtFree(XF86Config->conf_files->file_logfile);
if (*str) {
if (XF86Config->conf_files == NULL)
XF86Config->conf_files = XtCalloc(1, sizeof(XF86ConfFilesRec));
XF86Config->conf_files->file_logfile = XtNewString(str);
else
}
else if (XF86Config->conf_files)
XF86Config->conf_files->file_logfile = NULL;
}
@ -527,10 +531,11 @@ CreateFontPath(TreeNode *fontpath, char *path)
if (path == NULL) {
if (XF86Font_path) {
path = XtNewString(XF86Font_path);
if (XF86Config->conf_files && XF86Config->conf_files->file_fontpath) {
if (XF86Config->conf_files && XF86Config->conf_files->file_fontpath)
XtFree(XF86Config->conf_files->file_fontpath);
XF86Config->conf_files->file_fontpath = XtNewString(path);
}
if (XF86Config->conf_files == NULL)
XF86Config->conf_files = XtCalloc(1, sizeof(XF86ConfFilesRec));
XF86Config->conf_files->file_fontpath = XtNewString(path);
}
else if (XF86Config->conf_files && XF86Config->conf_files->file_fontpath)
path = XtNewString(XF86Config->conf_files->file_fontpath);
@ -629,9 +634,14 @@ FontPathChanged(TreeNode *node)
pos += len - 2;
}
if (XF86Config->conf_files->file_fontpath)
XtFree(XF86Config->conf_files->file_fontpath);
XF86Config->conf_files->file_fontpath = fontpath;
if (XF86Config->conf_files) {
if (XF86Config->conf_files->file_fontpath)
XtFree(XF86Config->conf_files->file_fontpath);
}
else if (fontpath)
XF86Config->conf_files = XtCalloc(1, sizeof(XF86ConfFilesRec));
if (XF86Config->conf_files)
XF86Config->conf_files->file_fontpath = fontpath;
}
static void
@ -703,10 +713,11 @@ CreateModulePath(TreeNode *modulepath, char *path)
if (path == NULL) {
if (XF86Module_path) {
path = XtNewString(XF86Module_path);
if (XF86Config->conf_files && XF86Config->conf_files->file_modulepath) {
if (XF86Config->conf_files == NULL)
XF86Config->conf_files = XtCalloc(1, sizeof(XF86ConfFilesRec));
else if (XF86Config->conf_files->file_modulepath)
XtFree(XF86Config->conf_files->file_modulepath);
XF86Config->conf_files->file_modulepath = XtNewString(path);
}
XF86Config->conf_files->file_modulepath = XtNewString(path);
}
else if (XF86Config->conf_files && XF86Config->conf_files->file_modulepath)
path = XtNewString(XF86Config->conf_files->file_modulepath);
@ -799,9 +810,14 @@ ModulePathChanged(TreeNode *node)
pos += len - 2;
}
if (XF86Config->conf_files->file_modulepath)
XtFree(XF86Config->conf_files->file_modulepath);
XF86Config->conf_files->file_modulepath = modulepath;
if (XF86Config->conf_files) {
if (XF86Config->conf_files->file_modulepath)
XtFree(XF86Config->conf_files->file_modulepath);
}
else if (modulepath)
XF86Config->conf_files = XtCalloc(1, sizeof(XF86ConfFilesRec));
if (XF86Config->conf_files)
XF86Config->conf_files->file_modulepath = modulepath;
}
static void
@ -921,6 +937,8 @@ NewModuleCallback(Widget unused, XtPointer user_data, XtPointer call_data)
DeleteNode(node);
load = (XF86LoadPtr)XtCalloc(1, sizeof(XF86LoadRec));
load->load_name = XtNewString(label);
if (XF86Config->conf_modules == NULL)
XF86Config->conf_modules = XtCalloc(1, sizeof(XF86ConfModuleRec));
XF86Config->conf_modules->mod_load_lst =
xf86addModule(XF86Config->conf_modules->mod_load_lst, load);

View file

@ -342,7 +342,9 @@ XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint)
if (!infoRec->offscreenDepthsInitialized)
XAAInitializeOffscreenDepths (pScreen);
if(pScrn->vtSema && (infoRec->offscreenDepths & (1 << (depth - 1))) &&
if(pScrn->vtSema &&
(usage_hint != CREATE_PIXMAP_USAGE_GLYPH_PICTURE) &&
(infoRec->offscreenDepths & (1 << (depth - 1))) &&
(size >= MIN_OFFPIX_SIZE) && !SwitchedOut &&
(!infoRec->maxOffPixWidth || (w <= infoRec->maxOffPixWidth)) &&
(!infoRec->maxOffPixHeight || (h <= infoRec->maxOffPixHeight)) )

View file

@ -588,150 +588,6 @@ XAADoGlyphs (CARD8 op,
IS_OFFSCREEN_PIXMAP(pSrc->pDrawable))
return FALSE;
if(maskFormat && (maskFormat->depth == 1) &&
(pSrc->pDrawable->width == 1) && (pSrc->pDrawable->height == 1) &&
(op == PictOpOver) && infoRec->WriteBitmap &&
!(infoRec->WriteBitmapFlags & NO_TRANSPARENCY))
{
CARD16 red, green, blue, alpha;
CARD32 pixel =
*((CARD32*)(((PixmapPtr)(pSrc->pDrawable))->devPrivate.ptr));
CARD32 *bits, *pntr, *pnt;
int x, y, i, n, left, top, right, bottom, width, height, pitch;
int L, T, R, B, X, Y, h, w, dwords, row, column, nbox;
int leftEdge, rightEdge, topLine, botLine;
BoxPtr pbox;
GlyphPtr glyph;
if(!XAAGetRGBAFromPixel(pixel,&red,&green,&blue,&alpha,pSrc->format))
return FALSE;
if(alpha != 0xffff) return FALSE;
XAAGetPixelFromRGBA(&pixel, red, green, blue, 0, pDst->format);
if((infoRec->WriteBitmapFlags & RGB_EQUAL) && !((red == green) && (green == blue)))
return FALSE;
x = pDst->pDrawable->x;
y = pDst->pDrawable->y;
while(nlist--) {
x += list->xOff;
y += list->yOff;
left = right = X = x;
top = bottom = Y = y;
for(i = 0; i < list->len; i++) {
glyph = glyphs[i];
L = X - glyph->info.x;
if(L < left) left = L;
R = L + glyph->info.width;
if(R > right) right = R;
T = Y - glyph->info.y;
if(T < top) top = T;
B = T + glyph->info.height;
if(B > bottom) bottom = B;
X += glyph->info.xOff;
Y += glyph->info.yOff;
}
width = right - left;
height = bottom - top;
if(width && height) {
pitch = (((width + 31) & ~31) >> 5) + 1;
pntr = (CARD32*)xalloc(sizeof(CARD32) * pitch * height);
if(!pntr)
return TRUE;
bzero(pntr, sizeof(CARD32) * pitch * height);
n = list->len;
X = x; Y = y;
while(n--) {
glyph = *glyphs++;
h = glyph->info.height;
w = glyph->info.width;
if(h && w) {
row = y - top - glyph->info.y;
column = x - left - glyph->info.x;
pnt = pntr + (row * pitch) + (column >> 5);
column &= 31;
dwords = ((w + 31) >> 5) - 1;
bits = (CARD32*)(glyph + 1);
if(dwords) {
while(h--) {
for(i = 0; i <= dwords; i++) {
if(column) {
pnt[i] |= SHIFT_L(*bits, column);
pnt[i + 1] |= SHIFT_R(*bits, 32 - column);
} else
pnt[i] |= *bits;
if(i != dwords) bits++;
}
bits++;
pnt += pitch;
}
} else {
if(column) {
while(h--) {
pnt[0] |= SHIFT_L(*bits, column);
pnt[0 + 1] |= SHIFT_R(*bits, 32 - column);
bits++;
pnt += pitch;
}
} else {
while(h--) {
*pnt |= *bits++;
pnt += pitch;
}
}
}
}
x += glyph->info.xOff;
y += glyph->info.yOff;
}
nbox = REGION_NUM_RECTS(pDst->pCompositeClip);
pbox = REGION_RECTS(pDst->pCompositeClip);
while(nbox && (top >= pbox->y2)) {
pbox++; nbox--;
}
while(nbox && (bottom > pbox->y1)) {
leftEdge = max(left, pbox->x1);
rightEdge = min(right, pbox->x2);
if(rightEdge > leftEdge) {
column = leftEdge - left;
topLine = max(top, pbox->y1);
botLine = min(bottom, pbox->y2);
h = botLine - topLine;
if(h > 0) {
(*infoRec->WriteBitmap)(infoRec->pScrn,
leftEdge, topLine, rightEdge - leftEdge, h,
(unsigned char*)(pntr +
((topLine - top) * pitch) + (column >> 5)),
pitch << 2, column & 31, pixel, -1, GXcopy, ~0);
}
}
nbox--; pbox++;
}
xfree(pntr);
} else {
x = X; y = Y;
}
list++;
}
return TRUE;
}
/*
* If it looks like we have a chance of being able to draw these
* glyphs with an accelerated Composite, do that now to avoid

View file

@ -44,11 +44,6 @@ xnestRealizeFont(ScreenPtr pScreen, FontPtr pFont)
FontSetPrivate(pFont, xnestFontPrivateIndex, NULL);
#ifdef XPRINT
if (requestingClient && XpClientIsPrintClient(requestingClient, NULL))
return True;
#endif
name_atom = MakeAtom("FONT", 4, True);
value_atom = 0L;

View file

@ -1,701 +0,0 @@
/*
(c) Copyright 1996 Hewlett-Packard Company
(c) Copyright 1996 International Business Machines Corp.
(c) Copyright 1996 Sun Microsystems, Inc.
(c) Copyright 1996 Novell, Inc.
(c) Copyright 1996 Digital Equipment Corp.
(c) Copyright 1996 Fujitsu Limited
(c) Copyright 1996 Hitachi, Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the names of the copyright holders shall
not be used in advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization from said
copyright holders.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <scrnintstr.h>
#include "attributes.h"
/*
* default medium-source-sizes supported = na-letter w/.25" margins
*/
static XpOidMediumDiscreteSize DefaultMediumSize = {
xpoid_val_medium_size_na_letter, xFalse, {6.35, 209.55, 6.35, 273.05}
};
static XpOidMediumDiscreteSizeList DefaultMediumSizeList = {
&DefaultMediumSize, 1
};
static XpOidMediumSourceSize DefaultMediumSourceSize = {
xpoid_unspecified, XpOidMediumSS_DISCRETE, { &DefaultMediumSizeList }
};
static XpOidMediumSS DefaultMediumSS = {
&DefaultMediumSourceSize, 1
};
/*
* if 'valid_oid_list' is NULL any oid found is considered valid
*/
XpOid
XpGetOidAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidList* valid_oid_list)
{
XpOid value_oid;
value_oid = XpOidFromString(XpGetStringAttr(pContext, pool, oid));
if((const XpOidList*)NULL == valid_oid_list
||
XpOidListHasOid(valid_oid_list, value_oid))
{
return value_oid;
}
else
{
return xpoid_none;
}
}
void
XpPutOidAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
XpOid value_oid)
{
XpPutStringAttr(pContext, pool, oid, XpOidString(value_oid));
}
void
XpValidateOidAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidList* valid_oids,
XpOid default_oid)
{
XpOid value_oid;
value_oid = XpGetOidAttr(pContext, pool, oid, valid_oids);
XpPutOidAttr(pContext, pool, oid,
value_oid == xpoid_none ? default_oid : value_oid);
}
/*
* if 'valid_card_list' is NULL any cardinal found is considered valid
*/
unsigned long
XpGetCardAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidCardList* valid_card_list)
{
unsigned long value_card;
if(XpOidParseUnsignedValue(XpGetStringAttr(pContext, pool, oid),
(const char**)NULL,
&value_card))
{
if((const XpOidCardList*)NULL == valid_card_list
||
XpOidCardListHasCard(valid_card_list, value_card))
{
return value_card;
}
}
return 0;
}
void
XpPutCardAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
unsigned long value_card)
{
if(value_card > 0)
{
char value_out[16];
sprintf(value_out, "%lu", value_card);
XpPutStringAttr(pContext, pool, oid, value_out);
}
else
XpPutStringAttr(pContext, pool, oid, (const char*)NULL);
}
void
XpValidateCardAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidCardList* valid_cards,
unsigned long default_card)
{
unsigned long value_card;
value_card = XpGetCardAttr(pContext, pool, oid, valid_cards);
XpPutCardAttr(pContext, pool, oid,
value_card == 0 ? default_card : value_card);
}
XpOidList*
XpGetListAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidList* valid_oid_list)
{
return XpOidListNew(XpGetStringAttr(pContext, pool, oid), valid_oid_list);
}
void
XpPutListAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidList* list)
{
char* value_out;
value_out = XpOidListString(list);
XpPutStringAttr(pContext, pool, oid, value_out);
XpOidFree(value_out);
}
void
XpValidateListAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidList* valid_oids,
const XpOidList* default_oids)
{
XpOidList* list = XpGetListAttr(pContext, pool, oid, valid_oids);
if(XpOidListCount(list) == 0)
XpPutListAttr(pContext, pool, oid, default_oids);
else
XpPutListAttr(pContext, pool, oid, list);
XpOidListDelete(list);
}
XpOidCardList*
XpGetCardListAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidCardList* valid_card_list)
{
return XpOidCardListNew(XpGetStringAttr(pContext, pool, oid),
valid_card_list);
}
void
XpPutCardListAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidCardList* list)
{
char* value_out;
value_out = XpOidCardListString(list);
XpPutStringAttr(pContext, pool, oid, value_out);
XpOidFree(value_out);
}
void
XpValidateCardListAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidCardList* valid_cards,
const XpOidCardList* default_cards)
{
XpOidCardList* list = XpGetCardListAttr(pContext, pool, oid, valid_cards);
if(XpOidCardListCount(list) == 0 && (XpOidCardList*)NULL != default_cards)
XpPutCardListAttr(pContext, pool, oid, default_cards);
else
XpPutCardListAttr(pContext, pool, oid, list);
XpOidCardListDelete(list);
}
XpOidDocFmtList*
XpGetDocFmtListAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidDocFmtList* valid_fmt_list)
{
return XpOidDocFmtListNew(XpGetStringAttr(pContext, pool, oid),
valid_fmt_list);
}
void
XpPutDocFmtListAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidDocFmtList* list)
{
char* value_out;
value_out = XpOidDocFmtListString(list);
XpPutStringAttr(pContext, pool, oid, value_out);
XpOidFree(value_out);
}
void
XpValidateDocFmtListAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidDocFmtList* valid_fmts,
const XpOidDocFmtList* default_fmts)
{
XpOidDocFmtList* list;
list = XpGetDocFmtListAttr(pContext, pool, oid, valid_fmts);
if(XpOidDocFmtListCount(list) == 0
&&
(XpOidDocFmtList*)NULL != default_fmts)
{
XpPutDocFmtListAttr(pContext, pool, oid, default_fmts);
}
else
{
XpPutDocFmtListAttr(pContext, pool, oid, list);
}
XpOidDocFmtListDelete(list);
}
XpOidMediumSS*
XpGetMediumSSAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidList* valid_trays,
const XpOidList* valid_sizes)
{
return XpOidMediumSSNew(XpGetStringAttr(pContext, pool, oid),
valid_trays, valid_sizes);
}
void
XpPutMediumSSAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidMediumSS* msss)
{
char* value_out;
value_out = XpOidMediumSSString(msss);
XpPutStringAttr(pContext, pool, oid, value_out);
XpOidFree(value_out);
}
const XpOidMediumSS*
XpGetDefaultMediumSS()
{
return &DefaultMediumSS;
}
XpOidTrayMediumList*
XpGetTrayMediumListAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidList* valid_trays,
const XpOidMediumSS* msss)
{
return XpOidTrayMediumListNew(XpGetStringAttr(pContext, pool, oid),
valid_trays, msss);
}
void
XpPutTrayMediumListAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidTrayMediumList* tm)
{
char* value_out;
value_out = XpOidTrayMediumListString(tm);
XpPutStringAttr(pContext, pool, oid, value_out);
XpOidFree(value_out);
}
void
XpValidatePrinterMediaAttrs(XpContextPtr pContext,
const XpOidList* valid_trays,
const XpOidList* valid_sizes)
{
const XpOidMediumSS* msss;
XpOidMediumSS* pool_msss;
XpOidTrayMediumList* tm;
pool_msss = XpGetMediumSSAttr(pContext, XPPrinterAttr,
xpoid_att_medium_source_sizes_supported,
valid_trays, valid_sizes);
if(0 == XpOidMediumSSCount(pool_msss))
msss = XpGetDefaultMediumSS();
else
msss = pool_msss;
XpPutMediumSSAttr(pContext, XPPrinterAttr,
xpoid_att_medium_source_sizes_supported, msss);
tm = XpGetTrayMediumListAttr(pContext, XPPrinterAttr,
xpoid_att_input_trays_medium,
valid_trays, msss);
XpPutTrayMediumListAttr(pContext, XPPrinterAttr,
xpoid_att_input_trays_medium, tm);
XpOidMediumSSDelete(pool_msss);
XpOidTrayMediumListDelete(tm);
}
void
XpValidatePrinterPool(XpContextPtr pContext,
const XpValidatePoolsRec* vpr)
{
/*
* content-orientations-supported
*/
XpValidateListAttr(pContext, XPPrinterAttr,
xpoid_att_content_orientations_supported,
vpr->valid_content_orientations_supported,
vpr->default_content_orientations_supported);
/*
* document-formats-supported
*/
XpValidateDocFmtListAttr(pContext, XPPrinterAttr,
xpoid_att_document_formats_supported,
vpr->valid_document_formats_supported,
vpr->default_document_formats_supported);
/*
* plexes-supported
*/
XpValidateListAttr(pContext, XPPrinterAttr, xpoid_att_plexes_supported,
vpr->valid_plexes_supported,
vpr->default_plexes_supported);
/*
* printer-resolutions-supported
*/
XpValidateCardListAttr(pContext, XPPrinterAttr,
xpoid_att_printer_resolutions_supported,
vpr->valid_printer_resolutions_supported,
vpr->default_printer_resolutions_supported);
/*
* xp-embedded-formats-supported
*/
XpValidateDocFmtListAttr(pContext, XPPrinterAttr,
xpoid_att_xp_embedded_formats_supported,
vpr->valid_xp_embedded_formats_supported,
vpr->default_xp_embedded_formats_supported);
/*
* xp-listfonts-modes-supported
*/
XpValidateListAttr(pContext, XPPrinterAttr,
xpoid_att_xp_listfonts_modes_supported,
vpr->valid_xp_listfonts_modes_supported,
vpr->default_xp_listfonts_modes_supported);
/*
* xp-raw-formats-supported
*/
XpValidateDocFmtListAttr(pContext, XPPrinterAttr,
xpoid_att_xp_raw_formats_supported,
vpr->valid_xp_raw_formats_supported,
vpr->default_xp_raw_formats_supported);
/*
* xp-setup-proviso
*/
XpValidateOidAttr(pContext, XPPrinterAttr, xpoid_att_xp_setup_proviso,
vpr->valid_xp_setup_proviso, xpoid_none);
/*
* medium-source-sizes-supported
* input-trays-mdeium
*/
XpValidatePrinterMediaAttrs(pContext,
vpr->valid_input_trays,
vpr->valid_medium_sizes);
/*
* available-compressions-supported
*/
XpValidateListAttr(pContext, XPPrinterAttr,
xpoid_att_available_compressions_supported,
vpr->valid_available_compressions_supported,
vpr->default_available_compressions_supported);
}
void
XpValidateNotificationProfile(XpContextPtr pContext)
{
const char* value_in;
const char* value_out;
value_in = XpGetStringAttr(pContext, XPJobAttr,
xpoid_att_notification_profile);
value_out = XpOidNotifyString(XpOidNotifyParse(value_in));
XpPutStringAttr(pContext, XPJobAttr,
xpoid_att_notification_profile, value_out);
}
void
XpValidateJobPool(XpContextPtr pContext,
const XpValidatePoolsRec* vpr)
{
/*
* Note: the 'vpr' argument is unused in this
* implementation; it is reserved for future use
*/
XpOidList* job_attrs_supported;
/*
* only validate attributes found in job-attributes-supported
*/
job_attrs_supported = XpGetListAttr(pContext, XPPrinterAttr,
xpoid_att_job_attributes_supported,
(const XpOidList*)NULL);
/*
* notification-profile
*/
if(XpOidListHasOid(job_attrs_supported, xpoid_att_notification_profile))
{
XpValidateNotificationProfile(pContext);
}
/*
* clean up
*/
XpOidListDelete(job_attrs_supported);
}
static void
XpValidateDocOrPagePool(XpContextPtr pContext,
XPAttributes pool, /* XPDocAttr or XPPageAttr */
const XpOidList* attrs_supported,
const XpValidatePoolsRec* vpr)
{
/*
* content-orientation
*/
if(XpOidListHasOid(attrs_supported, xpoid_att_content_orientation))
{
XpOidList* content_orientations_supported;
content_orientations_supported =
XpGetListAttr(pContext, XPPrinterAttr,
xpoid_att_content_orientations_supported,
vpr->valid_content_orientations_supported);
XpValidateOidAttr(pContext, pool, xpoid_att_content_orientation,
content_orientations_supported, xpoid_none);
XpOidListDelete(content_orientations_supported);
}
/*
* copy-count
*/
if(XpOidListHasOid(attrs_supported, xpoid_att_copy_count))
XpValidateCardAttr(pContext, pool, xpoid_att_copy_count,
(const XpOidCardList*)NULL, 0);
/*
* default-printer-resolution
*/
if(XpOidListHasOid(attrs_supported, xpoid_att_default_printer_resolution))
{
XpOidCardList* printer_resolutions_supported;
printer_resolutions_supported =
XpGetCardListAttr(pContext, XPPrinterAttr,
xpoid_att_printer_resolutions_supported,
vpr->valid_printer_resolutions_supported);
XpValidateCardAttr(pContext, pool,
xpoid_att_default_printer_resolution,
printer_resolutions_supported, 0);
XpOidCardListDelete(printer_resolutions_supported);
}
/*
* default-input-tray
*/
if(XpOidListHasOid(attrs_supported, xpoid_att_default_input_tray))
{
XpOidTrayMediumList* input_trays_medium;
const char* value_in;
XpOid value_tray;
input_trays_medium =
XpGetTrayMediumListAttr(pContext, XPPrinterAttr,
xpoid_att_input_trays_medium,
(const XpOidList*)NULL,
(const XpOidMediumSS*)NULL);
value_in =
XpGetStringAttr(pContext, pool, xpoid_att_default_input_tray);
value_tray = XpOidFromString(value_in);
if(!XpOidTrayMediumListHasTray(input_trays_medium, value_tray))
value_tray = xpoid_none;
XpPutOidAttr(pContext, pool, xpoid_att_default_input_tray, value_tray);
XpOidTrayMediumListDelete(input_trays_medium);
}
/*
* default-medium
*/
if(XpOidListHasOid(attrs_supported, xpoid_att_default_medium))
{
XpOidMediumSS* msss;
const char* value_in;
XpOid value_size;
msss = XpGetMediumSSAttr(pContext, XPPrinterAttr,
xpoid_att_medium_source_sizes_supported,
(const XpOidList*)NULL,
(const XpOidList*)NULL);
value_in = XpGetStringAttr(pContext, pool, xpoid_att_default_medium);
value_size = XpOidFromString(value_in);
if(!XpOidMediumSSHasSize(msss, value_size))
value_size = xpoid_none;
XpPutOidAttr(pContext, pool, xpoid_att_default_medium, value_size);
XpOidMediumSSDelete(msss);
}
/*
* document-format
*/
if(XpOidListHasOid(attrs_supported, xpoid_att_document_format))
{
XpOidDocFmtList* document_formats_supported;
const char* value_in;
XpOidDocFmt* document_format;
const char* value_out;
document_formats_supported =
XpGetDocFmtListAttr(pContext, XPPrinterAttr,
xpoid_att_document_formats_supported,
vpr->valid_document_formats_supported);
value_in = XpGetStringAttr(pContext, pool, xpoid_att_document_format);
document_format = XpOidDocFmtNew(value_in);
if(XpOidDocFmtListHasFmt(document_formats_supported, document_format))
value_out = XpOidDocFmtString(document_format);
else
value_out = XpOidDocFmtString(vpr->default_document_format);
XpOidDocFmtListDelete(document_formats_supported);
XpOidDocFmtDelete(document_format);
XpPutStringAttr(pContext, pool, xpoid_att_document_format, value_out);
XpOidFree(value_out);
}
/*
* plex
*/
if(XpOidListHasOid(attrs_supported, xpoid_att_plex))
{
XpOidList* plexes_supported;
plexes_supported =
XpGetListAttr(pContext, XPPrinterAttr, xpoid_att_plexes_supported,
vpr->valid_plexes_supported);
XpValidateOidAttr(pContext, pool, xpoid_att_plex,
plexes_supported, xpoid_none);
XpOidListDelete(plexes_supported);
}
/*
* xp-listfonts-modes
*/
if(XpOidListHasOid(attrs_supported, xpoid_att_xp_listfonts_modes))
{
XpOidList* xp_listfonts_modes_supported;
xp_listfonts_modes_supported =
XpGetListAttr(pContext, XPPrinterAttr,
xpoid_att_xp_listfonts_modes_supported,
vpr->valid_xp_listfonts_modes_supported);
XpValidateListAttr(pContext, pool, xpoid_att_xp_listfonts_modes,
xp_listfonts_modes_supported,
(const XpOidList*)NULL);
XpOidListDelete(xp_listfonts_modes_supported);
}
/*
* available-compressions
*/
if(XpOidListHasOid(attrs_supported, xpoid_att_available_compression))
{
XpOidList* available_compressions_supported;
available_compressions_supported =
XpGetListAttr(pContext, XPPrinterAttr,
xpoid_att_available_compressions_supported,
vpr->valid_available_compressions_supported);
XpValidateOidAttr(pContext, pool, xpoid_att_available_compression,
available_compressions_supported, xpoid_none);
XpOidListDelete(available_compressions_supported);
}
}
void
XpValidateDocumentPool(XpContextPtr pContext,
const XpValidatePoolsRec* vpr)
{
XpOidList* document_attrs_supported;
/*
* only validate attributes found in document-attributes-supported
*/
document_attrs_supported =
XpGetListAttr(pContext, XPPrinterAttr,
xpoid_att_document_attributes_supported,
(const XpOidList*)NULL);
/*
* validate
*/
XpValidateDocOrPagePool(pContext, XPDocAttr,
document_attrs_supported, vpr);
/*
* clean up
*/
XpOidListDelete(document_attrs_supported);
}
void
XpValidatePagePool(XpContextPtr pContext,
const XpValidatePoolsRec* vpr)
{
XpOidList* page_attrs_supported;
/*
* only validate attributes found in xp-page-attributes-supported
*/
page_attrs_supported =
XpGetListAttr(pContext, XPPrinterAttr,
xpoid_att_xp_page_attributes_supported,
(const XpOidList*)NULL);
/*
* validate
*/
XpValidateDocOrPagePool(pContext, XPPageAttr,
page_attrs_supported, vpr);
/*
* clean up
*/
XpOidListDelete(page_attrs_supported);
}
void
XpValidateAttributePool(XpContextPtr pContext,
XPAttributes pool,
const XpValidatePoolsRec* vpr)
{
switch(pool)
{
case XPPrinterAttr:
XpValidatePrinterPool(pContext, vpr);
break;
case XPDocAttr:
XpValidateDocumentPool(pContext, vpr);
break;
case XPJobAttr:
XpValidateJobPool(pContext, vpr);
break;
case XPPageAttr:
XpValidatePagePool(pContext, vpr);
break;
default:
break;
}
}

View file

@ -1,219 +0,0 @@
/*
(c) Copyright 1996 Hewlett-Packard Company
(c) Copyright 1996 International Business Machines Corp.
(c) Copyright 1996 Sun Microsystems, Inc.
(c) Copyright 1996 Novell, Inc.
(c) Copyright 1996 Digital Equipment Corp.
(c) Copyright 1996 Fujitsu Limited
(c) Copyright 1996 Hitachi, Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the names of the copyright holders shall
not be used in advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization from said
copyright holders.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _Xp_AttrValid_h
#define _Xp_AttrValid_h
#include <X11/extensions/Printstr.h>
#include "Oid.h"
#define XpNumber(a) (sizeof(a) / sizeof(*(a)))
/*
* Attribute pool validation valid values and defaults
*/
typedef struct
{
XpOidList* valid_content_orientations_supported;
XpOidList* default_content_orientations_supported;
XpOidDocFmtList* valid_document_formats_supported;
XpOidDocFmtList* default_document_formats_supported;
XpOidList* valid_input_trays;
XpOidList* valid_medium_sizes;
XpOidList* valid_plexes_supported;
XpOidList* default_plexes_supported;
XpOidCardList* valid_printer_resolutions_supported;
XpOidCardList* default_printer_resolutions_supported;
XpOidDocFmtList* valid_xp_embedded_formats_supported;
XpOidDocFmtList* default_xp_embedded_formats_supported;
XpOidList* valid_xp_listfonts_modes_supported;
XpOidList* default_xp_listfonts_modes_supported;
XpOidDocFmtList* valid_xp_raw_formats_supported;
XpOidDocFmtList* default_xp_raw_formats_supported;
XpOidList* valid_xp_setup_proviso;
XpOidDocFmt* default_document_format;
XpOidList* valid_available_compressions_supported;
XpOidList* default_available_compressions_supported;
} XpValidatePoolsRec;
/*
* XpOid resource access
*/
#define XpGetStringAttr(pContext, pool, oid) \
(const char*)XpGetOneAttribute(pContext, pool, (char*)XpOidString(oid))
#define XpPutStringAttr(pContext, pool, oid, value) \
XpPutOneAttribute(pContext, pool, XpOidString(oid), value)
#ifdef _XP_PRINT_SERVER_ /* needed for XpContextPtr in Printstr.h */
/*
* XpOid-valued attribute access
*/
XpOid XpGetOidAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidList* valid_oid_list);
void XpPutOidAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
XpOid value_oid);
void XpValidateOidAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidList* valid_oids,
XpOid default_oid);
/*
* cardinal-valued attribute access
*/
unsigned long XpGetCardAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidCardList* valid_card_list);
void XpPutCardAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
unsigned long value_card);
void XpValidateCardAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidCardList* valid_cards,
unsigned long default_card);
/*
* XpOidList-valued attribute access
*/
XpOidList* XpGetListAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidList* valid_oid_list);
void XpPutListAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidList* list);
void XpValidateListAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidList* valid_oids,
const XpOidList* default_oids);
/*
* XpOidCardList-valued attribute access
*/
XpOidCardList* XpGetCardListAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidCardList* valid_card_list);
void XpPutCardListAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidCardList* list);
void XpValidateCardListAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidCardList* valid_cards,
const XpOidCardList* default_cards);
/*
* XpOidDocFmtList-valued attribute access
*/
XpOidDocFmtList* XpGetDocFmtListAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidDocFmtList* valid_fmt_list);
void XpPutDocFmtListAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidDocFmtList* list);
void XpValidateDocFmtListAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidDocFmtList* valid_fmts,
const XpOidDocFmtList* default_fmts);
/*
* XpOidMediumSS-valued attribute access
*/
XpOidMediumSS* XpGetMediumSSAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidList* valid_trays,
const XpOidList* valid_sizes);
void XpPutMediumSSAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidMediumSS* msss);
const XpOidMediumSS* XpGetDefaultMediumSS(void);
/*
* XpOidTrayMediumList-valued attribute access
*/
XpOidTrayMediumList* XpGetTrayMediumListAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidList* valid_trays,
const XpOidMediumSS* msss);
void XpPutTrayMediumListAttr(XpContextPtr pContext,
XPAttributes pool,
XpOid oid,
const XpOidTrayMediumList* tm);
void XpValidatePrinterMediaAttrs(XpContextPtr pContext,
const XpOidList* valid_trays,
const XpOidList* valid_sizes);
/*
* Attribute pool validation
*/
void XpValidateAttributePool(XpContextPtr pContext,
XPAttributes pool,
const XpValidatePoolsRec* vpr);
void XpValidatePrinterPool(XpContextPtr pContext,
const XpValidatePoolsRec* vpr);
void XpValidateNotificationProfile(XpContextPtr pContext);
void XpValidateJobPool(XpContextPtr pContext,
const XpValidatePoolsRec* vpr);
void XpValidateDocumentPool(XpContextPtr pContext,
const XpValidatePoolsRec* vpr);
void XpValidatePagePool(XpContextPtr pContext,
const XpValidatePoolsRec* vpr);
#endif /* _XP_PRINT_SERVER_ */
#endif /* _Xp_AttrValid_h - don't add anything after this line */

View file

@ -1,85 +0,0 @@
/*
(c) Copyright 1996 Hewlett-Packard Company
(c) Copyright 1996 International Business Machines Corp.
(c) Copyright 1996 Sun Microsystems, Inc.
(c) Copyright 1996 Novell, Inc.
(c) Copyright 1996 Digital Equipment Corp.
(c) Copyright 1996 Fujitsu Limited
(c) Copyright 1996 Hitachi, Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the names of the copyright holders shall
not be used in advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization from said
copyright holders.
*/
/*
* The XpDiListEntry struct is the type of each element of the array
* handed back to the extension code to handle a GetPrinterList request.
* We don't use the printerDb directly because of the desire to handle
* multiple locales. Creating this new array for each GetPrinterList
* request will allow us to build it with the description in the locale of
* the requesting client.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/fonts/fontstruct.h>
#ifndef _XpDiPrint_H_
#define _XpDiPrint_H_ 1
#include "scrnintstr.h"
typedef struct _diListEntry {
char *name;
char *description;
char *localeName;
unsigned long rootWinId;
} XpDiListEntry;
extern void XpDiFreePrinterList(XpDiListEntry **list);
extern XpDiListEntry **XpDiGetPrinterList(
int nameLen,
char *name,
int localeLen,
char *locale);
extern char * XpDiGetDriverName(int index, char *printerName);
extern WindowPtr XpDiValidatePrinter(char *printerName, int printerNameLen);
extern int PrinterOptions(int argc, char **argv, int i);
extern void PrinterUseMsg(void);
extern void PrinterInitGlobals(void);
extern void PrinterInitOutput(ScreenInfo *pScreenInfo, int argc, char **argv);
extern Bool XpClientIsPrintClient(ClientPtr client, FontPathElementPtr fpe);
extern Bool XpClientIsBitmapClient(ClientPtr client);
extern void _XpVoidNoop(void);
extern Bool _XpBoolNoop(void);
#endif /* _XpDiPrint_H_ */

File diff suppressed because it is too large Load diff

View file

@ -1,58 +0,0 @@
SUBDIRS = doc pcl pcl-mono raster ps etc config
bin_PROGRAMS = Xprt
Xprt_CFLAGS = @DIX_CFLAGS@ @XPRINT_CFLAGS@ \
-DPRINT_ONLY_SERVER -D_XP_PRINT_SERVER_ \
-DXPRINTDIR=\"$(libdir)/X11/xserver\" \
-DXPRASTERDDX -DXPPCLDDX -DXPMONOPCLDDX -DXPPSDDX \
-DXFree86Server
Xprt_LDFLAGS = -L$(top_srcdir)
XPRINT_LIBS = \
@XPRINT_LIBS@ \
ps/libps.la \
raster/libraster.la \
pcl/libpcl.la \
pcl-mono/libpcl.la \
$(top_builddir)/fb/libfb.la \
$(top_builddir)/render/librender.la \
$(top_builddir)/dix/libXpdix.la \
$(XSERVER_LIBS) \
$(top_builddir)/Xext/libXext.la \
$(top_builddir)/xkb/libxkb.la \
$(top_builddir)/xkb/libxkbstubs.la \
$(top_builddir)/os/libos.la # for Xprintf
Xprt_DEPENDENCIES = $(XPRINT_LIBS)
Xprt_LDADD = $(XPRINT_LIBS) $(XPRINT_SYS_LIBS) $(XSERVER_SYS_LIBS)
miinitext-wrapper.c:
echo "#include \"$(top_srcdir)/mi/miinitext.c\"" >> $@
dpmsstubs-wrapper.c:
echo "#include \"$(top_srcdir)/Xext/dpmsstubs.c\"" >> $@
Xprt_SOURCES = \
attributes.c \
attributes.h \
AttrValid.c \
AttrValid.h \
ddxInit.c \
DiPrint.h \
Init.c \
mediaSizes.c \
Oid.c \
OidDefs.h \
Oid.h \
OidStrs.h \
spooler.c \
spooler.h \
Util.c \
miinitext-wrapper.c \
dpmsstubs-wrapper.c \
$(top_srcdir)/fb/fbcmap_mi.c
EXTRA_DIST = ValTree.c
CLEANFILES = miinitext-wrapper.c dpmsstubs-wrapper.c

File diff suppressed because it is too large Load diff

View file

@ -1,293 +0,0 @@
/*
(c) Copyright 1996 Hewlett-Packard Company
(c) Copyright 1996 International Business Machines Corp.
(c) Copyright 1996 Sun Microsystems, Inc.
(c) Copyright 1996 Novell, Inc.
(c) Copyright 1996 Digital Equipment Corp.
(c) Copyright 1996 Fujitsu Limited
(c) Copyright 1996 Hitachi, Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the names of the copyright holders shall
not be used in advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization from said
copyright holders.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _Xp_Oid_h
#define _Xp_Oid_h
#include <X11/Xproto.h>
/*
* include the auto-generated XpOid enum definition
*/
#include "OidDefs.h"
/*
* messages
*/
#define XPMSG_WARN_MSS "Syntax error parsing medium-source-sizes"
#define XPMSG_WARN_ITM "Syntax error parsing input-trays-medium"
#define XPMSG_WARN_DOC_FMT "Syntax error parsing document format"
#define XPMSG_WARN_DOCFMT_LIST "Syntax error parsing document format list"
#define XPMSG_WARN_CARD_LIST "Syntax error parsing cardinal list"
/*
* macros for memory allocation
*/
#define XpOidMalloc(size) ((char*)Xalloc((unsigned long)(size)))
#define XpOidCalloc(count, size) \
((char*)Xcalloc((unsigned long)((count)*(size))))
#define XpOidFree(mem) (Xfree((unsigned long*)(mem)))
/*
* list of object identifiers
*/
typedef struct _XpOidList
{
XpOid* list;
int count;
} XpOidList;
/*
* linked list of object identifiers
*/
typedef struct XpOidNodeStruct
{
XpOid oid;
struct XpOidNodeStruct* next;
} *XpOidNode;
typedef struct _XpOidLinkedList
{
XpOidNode head;
XpOidNode tail;
XpOidNode current;
int count;
} XpOidLinkedList;
/*
* XpOidMediumSourceSize and related definitions
*/
typedef struct
{
float minimum_x;
float maximum_x;
float minimum_y;
float maximum_y;
} XpOidArea;
typedef struct
{
float lower_bound;
float upper_bound;
} XpOidRealRange;
typedef struct
{
XpOidRealRange range_across_feed;
float increment_across_feed;
XpOidRealRange range_in_feed;
float increment_in_feed;
BOOL long_edge_feeds;
XpOidArea assured_reproduction_area;
} XpOidMediumContinuousSize;
typedef struct
{
XpOid page_size;
BOOL long_edge_feeds;
XpOidArea assured_reproduction_area;
} XpOidMediumDiscreteSize;
typedef struct
{
XpOidMediumDiscreteSize* list;
int count;
} XpOidMediumDiscreteSizeList;
typedef struct
{
XpOid input_tray; /* may be set to xpoid_none or xpoid_unspecified */
enum { XpOidMediumSS_DISCRETE, XpOidMediumSS_CONTINUOUS } mstag;
union
{
XpOidMediumDiscreteSizeList* discrete;
XpOidMediumContinuousSize* continuous_size;
} ms; /* "ms" is short for medium-size */
} XpOidMediumSourceSize;
typedef struct
{
XpOidMediumSourceSize* mss;
int count;
} XpOidMediumSS;
typedef struct
{
XpOid input_tray; /* may be set to xpoid_none */
XpOid medium;
} XpOidTrayMedium;
typedef struct
{
XpOidTrayMedium* list;
int count;
} XpOidTrayMediumList;
typedef enum {
XPOID_NOTIFY_UNSUPPORTED,
XPOID_NOTIFY_NONE,
XPOID_NOTIFY_EMAIL
} XpOidNotify;
typedef struct
{
unsigned long *list;
int count;
} XpOidCardList;
typedef struct
{
char* format;
char* variant;
char* version;
} XpOidDocFmt;
typedef struct
{
XpOidDocFmt* list;
int count;
} XpOidDocFmtList;
/*
* XpOid public methods
*/
const char* XpOidString(XpOid);
int XpOidStringLength(XpOid);
XpOid XpOidFromString(const char* value);
BOOL XpOidTrayMediumListHasTray(const XpOidTrayMediumList* list, XpOid tray);
/*
* XpOidList public methods
*/
XpOidList* XpOidListNew(const char* value_string,
const XpOidList* valid_oids);
#define XpOidListInit(l, a, c) { (l)->list = (a); (l)->count = (c); }
void XpOidListDelete(XpOidList*);
#define XpOidListCount(l) ((l) ? (l)->count : 0)
#define XpOidListGetOid(l, i) ((l) ? (l)->list[(i)] : xpoid_none)
int XpOidListGetIndex(const XpOidList* list, XpOid oid);
BOOL XpOidListHasOid(const XpOidList* list, XpOid oid);
char* XpOidListString(const XpOidList*);
/*
* XpOidLinkedList public methods
*/
XpOidLinkedList* XpOidLinkedListNew(void);
void XpOidLinkedListDelete(XpOidLinkedList*);
#define XpOidLinkedListCount(l) ((l) ? (l)->count : 0)
XpOid XpOidLinkedListGetOid(XpOidLinkedList* list, int i);
void XpOidLinkedListAddOid(XpOidLinkedList* list, XpOid oid);
int XpOidLinkedListGetIndex(XpOidLinkedList* list, XpOid oid);
BOOL XpOidLinkedListHasOid(XpOidLinkedList* list,
XpOid oid);
XpOid XpOidLinkedListFirstOid(XpOidLinkedList* list);
XpOid XpOidLinkedListNextOid(XpOidLinkedList* list);
/*
* XpOidMediumSourceSize public methods
*/
XpOidMediumSS* XpOidMediumSSNew(const char* value_string,
const XpOidList* valid_trays,
const XpOidList* valid_medium_sizes);
void XpOidMediumSSDelete(XpOidMediumSS*);
#define XpOidMediumSSCount(me) ((me) ? (me)->count : 0)
BOOL XpOidMediumSSHasSize(XpOidMediumSS*, XpOid medium_size);
char* XpOidMediumSSString(const XpOidMediumSS*);
/*
* XpOidTrayMediumList public methods
*/
XpOidTrayMediumList* XpOidTrayMediumListNew(const char* value_string,
const XpOidList* valid_trays,
const XpOidMediumSS* msss);
void XpOidTrayMediumListDelete(XpOidTrayMediumList* me);
#define XpOidTrayMediumListCount(me) ((me) ? (me)->count : 0)
#define XpOidTrayMediumListTray(me, i) \
((me) ? (me)->list[(i)].input_tray : xpoid_none)
#define XpOidTrayMediumListMedium(me, i) \
((me) ? (me)->list[(i)].medium : xpoid_none)
char* XpOidTrayMediumListString(const XpOidTrayMediumList*);
/*
* XpOidNotify public methods
*/
XpOidNotify XpOidNotifyParse(const char* value_string);
const char* XpOidNotifyString(XpOidNotify notify);
/*
* XpOidDocFmt public methods
*/
XpOidDocFmt* XpOidDocFmtNew(const char* value_string);
void XpOidDocFmtDelete(XpOidDocFmt*);
char* XpOidDocFmtString(XpOidDocFmt*);
/*
* XpOidDocFmtList public methods
*/
XpOidDocFmtList* XpOidDocFmtListNew(const char* value_string,
const XpOidDocFmtList* valid_fmts);
void XpOidDocFmtListDelete(XpOidDocFmtList*);
char* XpOidDocFmtListString(const XpOidDocFmtList*);
#define XpOidDocFmtListCount(me) ((me) ? (me)->count : 0)
#define XpOidDocFmtListGetDocFmt(me, i) \
((me) ? &(me)->list[(i)] : (XpDocFmt*)NULL)
BOOL XpOidDocFmtListHasFmt(const XpOidDocFmtList* list,
const XpOidDocFmt* fmt);
/*
* XpOidCardList public methods
*/
XpOidCardList* XpOidCardListNew(const char* value_string,
const XpOidCardList* valid_cards);
#define XpOidCardListInit(l, a, c) { (l)->list = (a); (l)->count = (c); }
void XpOidCardListDelete(XpOidCardList*);
char* XpOidCardListString(const XpOidCardList*);
#define XpOidCardListCount(me) ((me) ? (me)->count : 0)
#define XpOidCardListGetCard(me, i) ((me) ? (me)->list[(i)] : 0)
BOOL XpOidCardListHasCard(const XpOidCardList*, unsigned long);
/*
* misc parsing functions
*/
BOOL XpOidParseUnsignedValue(const char* value_string,
const char** ptr_return,
unsigned long* unsigned_return);
#endif /* _Xp_Oid_h - don't add anything after this line */

View file

@ -1,170 +0,0 @@
/*
(c) Copyright 1996 Hewlett-Packard Company
(c) Copyright 1996 International Business Machines Corp.
(c) Copyright 1996 Sun Microsystems, Inc.
(c) Copyright 1996 Novell, Inc.
(c) Copyright 1996 Digital Equipment Corp.
(c) Copyright 1996 Fujitsu Limited
(c) Copyright 1996 Hitachi, Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the names of the copyright holders shall
not be used in advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization from said
copyright holders.
*/
/* This is an automatically-generated file. Do not edit. */
typedef enum {
xpoid_none,
xpoid_unspecified,
xpoid_att_descriptor,
xpoid_att_content_orientation,
xpoid_att_copy_count,
xpoid_att_default_printer_resolution,
xpoid_att_default_input_tray,
xpoid_att_default_medium,
xpoid_att_document_format,
xpoid_att_plex,
xpoid_att_xp_listfonts_modes,
xpoid_att_job_name,
xpoid_att_job_owner,
xpoid_att_notification_profile,
xpoid_att_xp_setup_state,
xpoid_att_xp_spooler_command_options,
xpoid_att_content_orientations_supported,
xpoid_att_document_formats_supported,
xpoid_att_dt_pdm_command,
xpoid_att_input_trays_medium,
xpoid_att_medium_source_sizes_supported,
xpoid_att_plexes_supported,
xpoid_att_printer_model,
xpoid_att_printer_name,
xpoid_att_printer_resolutions_supported,
xpoid_att_xp_embedded_formats_supported,
xpoid_att_xp_listfonts_modes_supported,
xpoid_att_xp_page_attributes_supported,
xpoid_att_xp_raw_formats_supported,
xpoid_att_xp_setup_proviso,
xpoid_att_document_attributes_supported,
xpoid_att_job_attributes_supported,
xpoid_att_locale,
xpoid_att_multiple_documents_supported,
xpoid_att_available_compression,
xpoid_att_available_compressions_supported,
xpoid_val_content_orientation_portrait,
xpoid_val_content_orientation_landscape,
xpoid_val_content_orientation_reverse_portrait,
xpoid_val_content_orientation_reverse_landscape,
xpoid_val_medium_size_iso_a0,
xpoid_val_medium_size_iso_a1,
xpoid_val_medium_size_iso_a2,
xpoid_val_medium_size_iso_a3,
xpoid_val_medium_size_iso_a4,
xpoid_val_medium_size_iso_a5,
xpoid_val_medium_size_iso_a6,
xpoid_val_medium_size_iso_a7,
xpoid_val_medium_size_iso_a8,
xpoid_val_medium_size_iso_a9,
xpoid_val_medium_size_iso_a10,
xpoid_val_medium_size_iso_b0,
xpoid_val_medium_size_iso_b1,
xpoid_val_medium_size_iso_b2,
xpoid_val_medium_size_iso_b3,
xpoid_val_medium_size_iso_b4,
xpoid_val_medium_size_iso_b5,
xpoid_val_medium_size_iso_b6,
xpoid_val_medium_size_iso_b7,
xpoid_val_medium_size_iso_b8,
xpoid_val_medium_size_iso_b9,
xpoid_val_medium_size_iso_b10,
xpoid_val_medium_size_na_letter,
xpoid_val_medium_size_na_legal,
xpoid_val_medium_size_executive,
xpoid_val_medium_size_folio,
xpoid_val_medium_size_invoice,
xpoid_val_medium_size_ledger,
xpoid_val_medium_size_quarto,
xpoid_val_medium_size_iso_c3,
xpoid_val_medium_size_iso_c4,
xpoid_val_medium_size_iso_c5,
xpoid_val_medium_size_iso_c6,
xpoid_val_medium_size_iso_designated_long,
xpoid_val_medium_size_na_10x13_envelope,
xpoid_val_medium_size_na_9x12_envelope,
xpoid_val_medium_size_na_number_10_envelope,
xpoid_val_medium_size_na_7x9_envelope,
xpoid_val_medium_size_na_9x11_envelope,
xpoid_val_medium_size_na_10x14_envelope,
xpoid_val_medium_size_na_number_9_envelope,
xpoid_val_medium_size_na_6x9_envelope,
xpoid_val_medium_size_na_10x15_envelope,
xpoid_val_medium_size_monarch_envelope,
xpoid_val_medium_size_a,
xpoid_val_medium_size_b,
xpoid_val_medium_size_c,
xpoid_val_medium_size_d,
xpoid_val_medium_size_e,
xpoid_val_medium_size_jis_b0,
xpoid_val_medium_size_jis_b1,
xpoid_val_medium_size_jis_b2,
xpoid_val_medium_size_jis_b3,
xpoid_val_medium_size_jis_b4,
xpoid_val_medium_size_jis_b5,
xpoid_val_medium_size_jis_b6,
xpoid_val_medium_size_jis_b7,
xpoid_val_medium_size_jis_b8,
xpoid_val_medium_size_jis_b9,
xpoid_val_medium_size_jis_b10,
xpoid_val_medium_size_hp_2x_postcard,
xpoid_val_medium_size_hp_european_edp,
xpoid_val_medium_size_hp_mini,
xpoid_val_medium_size_hp_postcard,
xpoid_val_medium_size_hp_tabloid,
xpoid_val_medium_size_hp_us_edp,
xpoid_val_medium_size_hp_us_government_legal,
xpoid_val_medium_size_hp_us_government_letter,
xpoid_val_plex_simplex,
xpoid_val_plex_duplex,
xpoid_val_plex_tumble,
xpoid_val_input_tray_top,
xpoid_val_input_tray_middle,
xpoid_val_input_tray_bottom,
xpoid_val_input_tray_envelope,
xpoid_val_input_tray_manual,
xpoid_val_input_tray_large_capacity,
xpoid_val_input_tray_main,
xpoid_val_input_tray_side,
xpoid_val_event_report_job_completed,
xpoid_val_delivery_method_electronic_mail,
xpoid_val_xp_setup_mandatory,
xpoid_val_xp_setup_optional,
xpoid_val_xp_setup_ok,
xpoid_val_xp_setup_incomplete,
xpoid_val_xp_list_glyph_fonts,
xpoid_val_xp_list_internal_printer_fonts,
xpoid_val_available_compressions_0,
xpoid_val_available_compressions_01,
xpoid_val_available_compressions_02,
xpoid_val_available_compressions_03,
xpoid_val_available_compressions_012,
xpoid_val_available_compressions_013,
xpoid_val_available_compressions_023,
xpoid_val_available_compressions_0123
} XpOid;

View file

@ -1,172 +0,0 @@
/*
(c) Copyright 1996 Hewlett-Packard Company
(c) Copyright 1996 International Business Machines Corp.
(c) Copyright 1996 Sun Microsystems, Inc.
(c) Copyright 1996 Novell, Inc.
(c) Copyright 1996 Digital Equipment Corp.
(c) Copyright 1996 Fujitsu Limited
(c) Copyright 1996 Hitachi, Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the names of the copyright holders shall
not be used in advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization from said
copyright holders.
*/
/* This is an automatically-generated file. Do not edit. */
static int XpOidStringMapCount = 127;
static const XpOidStringMapEntry XpOidStringMap[] = {
{ "", 0 },
{ "", 0 },
{ "descriptor", 10 },
{ "content-orientation", 19 },
{ "copy-count", 10 },
{ "default-printer-resolution", 26 },
{ "default-input-tray", 18 },
{ "default-medium", 14 },
{ "document-format", 15 },
{ "plex", 4 },
{ "xp-listfonts-modes", 18 },
{ "job-name", 8 },
{ "job-owner", 9 },
{ "notification-profile", 20 },
{ "xp-setup-state", 14 },
{ "xp-spooler-command-options", 26 },
{ "content-orientations-supported", 30 },
{ "document-formats-supported", 26 },
{ "dt-pdm-command", 14 },
{ "input-trays-medium", 18 },
{ "medium-source-sizes-supported", 29 },
{ "plexes-supported", 16 },
{ "printer-model", 13 },
{ "printer-name", 12 },
{ "printer-resolutions-supported", 29 },
{ "xp-embedded-formats-supported", 29 },
{ "xp-listfonts-modes-supported", 28 },
{ "xp-page-attributes-supported", 28 },
{ "xp-raw-formats-supported", 24 },
{ "xp-setup-proviso", 16 },
{ "document-attributes-supported", 29 },
{ "job-attributes-supported", 24 },
{ "locale", 6 },
{ "multiple-documents-supported", 28 },
{ "available-compression", 21 },
{ "available-compressions-supported", 32 },
{ "portrait", 8 },
{ "landscape", 9 },
{ "reverse-portrait", 16 },
{ "reverse-landscape", 17 },
{ "iso-a0", 6 },
{ "iso-a1", 6 },
{ "iso-a2", 6 },
{ "iso-a3", 6 },
{ "iso-a4", 6 },
{ "iso-a5", 6 },
{ "iso-a6", 6 },
{ "iso-a7", 6 },
{ "iso-a8", 6 },
{ "iso-a9", 6 },
{ "iso-a10", 7 },
{ "iso-b0", 6 },
{ "iso-b1", 6 },
{ "iso-b2", 6 },
{ "iso-b3", 6 },
{ "iso-b4", 6 },
{ "iso-b5", 6 },
{ "iso-b6", 6 },
{ "iso-b7", 6 },
{ "iso-b8", 6 },
{ "iso-b9", 6 },
{ "iso-b10", 7 },
{ "na-letter", 9 },
{ "na-legal", 8 },
{ "executive", 9 },
{ "folio", 5 },
{ "invoice", 7 },
{ "ledger", 6 },
{ "quarto", 6 },
{ "iso-c3", 6 },
{ "iso-c4", 6 },
{ "iso-c5", 6 },
{ "iso-c6", 6 },
{ "iso-designated-long", 19 },
{ "na-10x13-envelope", 17 },
{ "na-9x12-envelope", 16 },
{ "na-number-10-envelope", 21 },
{ "na-7x9-envelope", 15 },
{ "na-9x11-envelope", 16 },
{ "na-10x14-envelope", 17 },
{ "na-number-9-envelope", 20 },
{ "na-6x9-envelope", 15 },
{ "na-10x15-envelope", 17 },
{ "monarch-envelope", 16 },
{ "a", 1 },
{ "b", 1 },
{ "c", 1 },
{ "d", 1 },
{ "e", 1 },
{ "jis-b0", 6 },
{ "jis-b1", 6 },
{ "jis-b2", 6 },
{ "jis-b3", 6 },
{ "jis-b4", 6 },
{ "jis-b5", 6 },
{ "jis-b6", 6 },
{ "jis-b7", 6 },
{ "jis-b8", 6 },
{ "jis-b9", 6 },
{ "jis-b10", 7 },
{ "hp-2x-postcard", 14 },
{ "hp-european-edp", 15 },
{ "hp-mini", 7 },
{ "hp-postcard", 11 },
{ "hp-tabloid", 10 },
{ "hp-us-edp", 9 },
{ "hp-us-government-legal", 22 },
{ "hp-us-government-letter", 23 },
{ "simplex", 7 },
{ "duplex", 6 },
{ "tumble", 6 },
{ "top", 3 },
{ "middle", 6 },
{ "bottom", 6 },
{ "envelope", 8 },
{ "manual", 6 },
{ "large-capacity", 14 },
{ "main", 4 },
{ "side", 4 },
{ "event-report-job-completed", 26 },
{ "electronic-mail", 15 },
{ "xp-setup-mandatory", 18 },
{ "xp-setup-optional", 17 },
{ "xp-setup-ok", 11 },
{ "xp-setup-incomplete", 19 },
{ "xp-list-glyph-fonts", 19 },
{ "xp-list-internal-printer-fonts", 30 },
{ "0", 1 },
{ "01", 2 },
{ "02", 2 },
{ "03", 2 },
{ "012", 3 },
{ "013", 3 },
{ "023", 3 },
{ "0123", 4 }
};

View file

@ -1,370 +0,0 @@
/*
(c) Copyright 1996 Hewlett-Packard Company
(c) Copyright 1996 International Business Machines Corp.
(c) Copyright 1996 Sun Microsystems, Inc.
(c) Copyright 1996 Novell, Inc.
(c) Copyright 1996 Digital Equipment Corp.
(c) Copyright 1996 Fujitsu Limited
(c) Copyright 1996 Hitachi, Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the names of the copyright holders shall
not be used in advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization from said
copyright holders.
*/
/* To get the tempnam() prototype in <stdio.h> */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#if defined(linux) && defined(__STRICT_ANSI__)
#undef __STRICT_ANSI__
#endif
#include <X11/Xos.h> /* for unistd.h and string.h */
#include <stdio.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include "misc.h"
#include "dixstruct.h"
#include <X11/extensions/Print.h>
#include "attributes.h"
#define IN_FILE_STRING "%(InFile)%"
#define OUT_FILE_STRING "%(OutFile)%"
/*
* ReplaceAnyString returns a string combining the input strings.
* It replaces all occurances of 'target' with the supplied
* 'replacement'.
* The original input string will generally be freed,
* and the caller is responsible for freeing whatever string is returned.
*/
char *
ReplaceAnyString(
char *string,
char *target,
char *replacement)
{
char *pKeyString;
if(replacement != (char *)NULL)
{
while((pKeyString = strstr(string, target)) != (char *)NULL)
{
char *newString;
newString = (char *)xalloc(strlen(string) + strlen(replacement) -
strlen(target) + 1);
strncpy(newString, string, pKeyString - string);
newString[pKeyString - string] = '\0';
strcat(newString, replacement);
strcat(newString, pKeyString + strlen(target));
xfree(string);
string = newString;
}
}
return string;
}
/*
* ReplaceFileString returns a string combining the input strings.
* It replaces all occurances of IN_FILE_STRING with the supplied
* inFileName, and all occurances of OUT_FILE_STRING with the
* supplied outFileName. The original input string will generally be freed,
* and the caller is responsible for freeing whatever string is returned.
*/
char *
ReplaceFileString(
char *string,
char *inFileName,
char *outFileName)
{
char *pKeyString,
*pInFileString = IN_FILE_STRING,
*pOutFileString = OUT_FILE_STRING;
if(inFileName != (char *)NULL)
{
while((pKeyString = strstr(string, pInFileString)) !=
(char *)NULL)
{
char *newString;
newString = (char *)xalloc(strlen(string) +
strlen(inFileName) + 1);
strncpy(newString, string, pKeyString - string);
newString[pKeyString - string] = '\0';
strcat(newString, inFileName);
strcat(newString, pKeyString + strlen(pInFileString));
xfree(string);
string = newString;
}
}
if(outFileName != (char *)NULL)
{
while((pKeyString = strstr(string, pOutFileString)) !=
(char *)NULL)
{
char *newString;
newString = (char *)xalloc(strlen(string) +
strlen(outFileName) + 1);
strncpy(newString, string, pKeyString - string);
newString[pKeyString - string] = '\0';
strcat(newString, outFileName);
strcat(newString, pKeyString + strlen(pOutFileString));
xfree(string);
string = newString;
}
}
return string;
}
/*
* TransferBytes reads numBytes of data from pSrcFile and writes them
* to pDstFile. It returns the number of bytes actually transfered,
* which will be numBytes if it's successful. Neither pSrcFile nor
* pDstFile are rewound or their pointers otherwise modified prior to
* beginning the transfer.
*/
int
TransferBytes(
FILE *pSrcFile,
FILE *pDstFile,
int numBytes)
{
char buf[10240];
#define BUF_SIZE (sizeof(buf)*sizeof(char))
int bytesWritten = 0;
unsigned bytesToXfer;
for(bytesToXfer = min(BUF_SIZE, (unsigned)numBytes);
bytesToXfer > 0;
bytesToXfer = min(BUF_SIZE, (unsigned)(numBytes - bytesWritten)))
{
if(fread((void *)buf, (size_t) 1, bytesToXfer, pSrcFile) < bytesToXfer)
return bytesWritten;
if(fwrite((void *)buf, (size_t) 1, bytesToXfer, pDstFile) < bytesToXfer)
return bytesWritten;
bytesWritten += bytesToXfer;
}
return bytesWritten;
}
/*
* CopyContentsAndDelete - does the work of copying and deleting the
* pre, no, and post raster files as well as the raster file itself.
*/
Bool
CopyContentsAndDelete(
FILE **ppSrcFile,
char **pSrcFileName,
FILE *pDstFile)
{
struct stat statBuf;
if(stat(*pSrcFileName, &statBuf) < 0)
return FALSE;
rewind(*ppSrcFile);
if(TransferBytes(*ppSrcFile, pDstFile,
(int)statBuf.st_size) != (int)statBuf.st_size)
return FALSE;
fclose(*ppSrcFile);
*ppSrcFile = (FILE *)NULL;
unlink(*pSrcFileName);
xfree(*pSrcFileName);
*pSrcFileName = (char *)NULL;
return TRUE;
}
#define QUADPAD(x) ((((x)+3)>>2)<<2)
int
XpSendDocumentData(
ClientPtr client,
FILE *fp,
int fileLen,
int maxBufSize)
{
xPrintGetDocumentDataReply *pRep;
int bytesWritten;
unsigned bytesToWrite;
int result = Success;
if(client->clientGone)
return Success;
pRep = (xPrintGetDocumentDataReply *)xalloc(sz_xPrintGetDocumentDataReply+
QUADPAD(maxBufSize));
for(bytesToWrite = min(maxBufSize, fileLen),
bytesWritten = 0;
bytesToWrite > 0;
bytesToWrite = min(maxBufSize, fileLen - bytesWritten))
{
pRep->type = X_Reply;
pRep->sequenceNumber = client->sequence;
pRep->length = (QUADPAD(bytesToWrite)) >> 2;
pRep->dataLen = bytesToWrite;
if(fread((void *)(pRep + 1), 1, bytesToWrite, fp) < bytesToWrite)
{
result = BadAlloc; /* XXX poor error choice? */
pRep->statusCode = 2; /* XXX Is this the right value??? */
}
else
pRep->statusCode = 0; /* XXX Ignored??? */
pRep->finishedFlag = FALSE;
if (client->swapped) {
int n;
long l;
swaps(&pRep->sequenceNumber, n);
swapl(&pRep->length, l);
swapl(&pRep->statusCode, l); /* XXX Why are these longs??? */
swapl(&pRep->finishedFlag, l); /* XXX Why are these longs??? */
swapl(&pRep->dataLen, l);
}
(void)WriteToClient(client,
sz_xPrintGetDocumentDataReply + bytesToWrite,
(char *)pRep);
bytesWritten += bytesToWrite;
}
xfree(pRep);
return result;
}
/*
* XpFinishDocData - send a DocumentData reply with the "finishedFlag"
* field set to TRUE. This routine should be called from the EndJob
* function of a driver after the driver has sent all required
* document data (presumably via XpSendDocumentData).
*/
int
XpFinishDocData(
ClientPtr client)
{
xPrintGetDocumentDataReply rep;
if(client->clientGone)
return Success;
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
rep.length = 0;
rep.dataLen = 0;
rep.finishedFlag = TRUE;
rep.statusCode = 0;
if (client->swapped) {
int n;
long l;
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, l);
swapl(&rep.statusCode, l); /* XXX Why are these longs??? */
swapl(&rep.finishedFlag, l); /* XXX Why are these longs??? */
swapl(&rep.dataLen, l);
}
(void)WriteToClient(client, sz_xPrintGetDocumentDataReply, (char *)&rep);
return Success;
}
#ifndef HAVE_MKSTEMP
static
char *XpDirName(char *fname)
{
char *fn, *ptr;
fn = (char *)xalloc(strlen(fname) + 1);
if (fn) {
strcpy(fn, fname);
ptr = strrchr(fn, '/');
if (!ptr) {
ptr = fn;
*ptr++ = '.';
} else if (ptr == fn)
ptr++;
*ptr = '\0';
}
return fn;
}
#endif
Bool
XpOpenTmpFile(
char *mode,
char **fname,
FILE **stream)
{
#ifndef HAVE_MKSTEMP
char *fn = NULL;
/* note that there is a small race condition here... */
if (!(*fname = tempnam(NULL, NULL)) ||
!(fn = XpDirName(*fname)) ||
access(fn, W_OK) ||
!(*stream = fopen(*fname, mode)))
{
xfree(fn);
xfree(*fname);
*fname = NULL;
*stream = NULL;
return FALSE;
}
xfree(fn);
#else
int fd;
*stream = NULL;
*fname = (char *)xalloc(14);
if (*fname == NULL)
return FALSE;
strcpy(*fname, "/tmp/xpXXXXXX");
fd = mkstemp(*fname);
if (fd < 0) {
xfree(*fname);
*fname = NULL;
return FALSE;
}
*stream = fdopen(fd, mode);
if (stream == NULL) {
xfree(*fname);
*fname = NULL;
return FALSE;
}
#endif
return TRUE;
}

View file

@ -1,191 +0,0 @@
/*
(c) Copyright 1996 Hewlett-Packard Company
(c) Copyright 1996 International Business Machines Corp.
(c) Copyright 1996 Sun Microsystems, Inc.
(c) Copyright 1996 Novell, Inc.
(c) Copyright 1996 Digital Equipment Corp.
(c) Copyright 1996 Fujitsu Limited
(c) Copyright 1996 Hitachi, Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the names of the copyright holders shall
not be used in advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization from said
copyright holders.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/X.h>
#include "scrnintstr.h"
#include "validate.h"
#include "windowstr.h"
#include "mi.h"
#include "regionstr.h"
#include "mivalidate.h"
/*
* XpValidateTree - a validateTree routine which ignores overlapping
* top-level windows when computing the clip lists for such windows.
* This can be used by any driver which maintains a separate memory
* store for each top-level window (with its respective children).
* If the pParent is not the root window, then miValidateTree
* is used unmodified.
*
* The strategy if pParent is the root is to save off the
* current values of pParent->firstChild and pParent->lastChild,
* replacing both with the single child of interest. We save off
* pChild->prevSib and pChild->nextSib, and replace them with NullWindow.
* We save off pParent->clipList, and replace it with
* pParent->winSize - pChild->winSize. We then call miValidateTree
* to do the needed ComputeClips on the pChild's heirarchy.
* pParent's clipList is then recomputed based on the sizes
* of its children, and the saved pointers are restored.
* The trees associated with the siblings of pChild must be descended
* and cleaned of any marks (i.e. the valdata pointer freed, and set to NULL),
* and pParent' AfterValidate structure's exposed field must be updated.
*/
/*ARGSUSED*/
int
XpValidateTree (pParent, pChild, kind)
WindowPtr pParent; /* Parent to validate */
WindowPtr pChild; /* First child of pParent that was
* affected */
VTKind kind; /* What kind of configuration caused call */
{
RegionRec origPrntClip; /* orig clipList for parent */
RegionRec childClip; /* The new borderClip for the current
* child */
RegionRec tmpPrntClip; /* parent clipList - child borderClip */
RegionRec exposed; /* For intermediate calculations */
register ScreenPtr pScreen;
register WindowPtr pWin;
Bool overlap;
int viewvals;
Bool forward;
WindowPtr origFirstChild, origLastChild, origPrevSib, origNextSib;
/*
* If we're validating something other than a top-level window,
* then just invoke miValidateTree.
*/
if(pParent->parent != NullWindow)
return miValidateTree(pParent, pChild, kind);
/*
* If it's a stack change of top levels then it's a no-op for
* this scheme, so we just clean up any marks on windows and return.
*/
if(kind == VTStack)
{
CleanMarks(pParent);
return 1;
}
pScreen = pParent->drawable.pScreen;
if (pChild == NullWindow)
pChild = pParent->firstChild;
/* Save off the existing window heirarchy */
origFirstChild = pParent->firstChild;
origLastChild = pParent->lastChild;
origPrevSib = pChild->prevSib;
origNextSib = pChild->nextSib;
pParent->firstChild = pChild;
pParent->lastChild = pChild;
pChild->prevSib = NullWindow;
pChild->nextSib = NullWindow;
/*
* Set pParent's clipList to be its winSize minus the pChild's
* borderSize.
*/
origPrntClip = pParent->clipList;
REGION_NULL(pScreen, &tmpPrntClip);
REGION_SUBRACT(pScreen, &tmpPrntClip, &pParent->winSize,
&pChild->borderSize);
pParent->clipList = tmpPrntClip;
/*
* Call miValidateTree on the pruned tree.
*/
(void) miValidateTree(pParent, pChild, kind);
/* Restore the saved heirarchy */
pChild->prevSib = origPrevSib;
pChild->nextSib = origNextSib;
pParent->firstChild = origFirstChild;
pParent->lastChild = origLastChild;
/*
* Compute pParent's clipList by taking its winSize and subracting
* the borderSize of each of its children.
*/
for(pWin = pParent->firstChild,
REGION_COPY(pScreen, &pParent->clipList, &pParent->winSize);
pWin != NullWindow;
pWin = pWin->nextSib)
{
REGION_SUBTRACT(pScreen, &pParent->clipList, &pParent->clipList,
&pWin->borderSize);
}
/*
* Compute pParent's AfterValidate structure by subracting the original
* clipList from the newly computed clipList.
*/
REGION_NULL(pScreen, &pParent->valdata->after.exposed);
REGION_SUBTRACT(pScreen, &pParent->valdata->after.exposed,
&pParent->clipList, &origPrntClip);
/*
* Remove the marks from all but pParent and pChild's heirarchy.
* i.e. from all of pChild's siblings and their children.
*/
for(pWin = pParent->firstChild; pWin != NullWindow; pWin = pWin->nextSib)
{
WindowPtr pCurChild = pWin;
if(pCurChild == pChild)
continue;
while (1)
{
if(pCurChild->valdata)
{
xfree(pCurChild->valdata);
pCurChild->valdata = (ValidatePtr)NULL;
}
if (pCurChild->firstChild)
{
pCurChild = pCurChild->firstChild;
continue;
}
while (!pCurChild->nextSib && (pCurChild != pWin))
pCurChild = pCurChild->parent;
if (pCurChild == pWin)
break;
pCurChild = pCurChild->nextSib;
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,130 +0,0 @@
/*
(c) Copyright 1996 Hewlett-Packard Company
(c) Copyright 1996 International Business Machines Corp.
(c) Copyright 1996 Sun Microsystems, Inc.
(c) Copyright 1996 Novell, Inc.
(c) Copyright 1996 Digital Equipment Corp.
(c) Copyright 1996 Fujitsu Limited
(c) Copyright 1996 Hitachi, Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the names of the copyright holders shall
not be used in advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization from said
copyright holders.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _Xp_attributes_h
#define _Xp_attributes_h 1
#include "scrnintstr.h"
#include "AttrValid.h"
#define BFuncArgs int ndx, ScreenPtr pScreen, int argc, char **argv
typedef Bool (*pBFunc)(BFuncArgs);
#define VFuncArgs char *name, XpValidatePoolsRec *pValRec, float *width, float *height, int *res
typedef void (*pVFunc)(VFuncArgs);
/*
* attributes.c
*/
void XpInitAttributes(XpContextPtr pContext);
void XpBuildAttributeStore(char *printerName,
char *qualifierName);
void XpAddPrinterAttribute(char *printerName,
char *printerQualifier,
char *attributeName,
char *attributeValue);
void XpDestroyAttributes(XpContextPtr pContext);
char *XpGetConfigDir(Bool useLocale);
char *XpGetOneAttribute(XpContextPtr pContext,
XPAttributes class,
char *attributeName);
void XpPutOneAttribute(XpContextPtr pContext,
XPAttributes class,
const char* attributeName,
const char* value);
int XpRehashAttributes(void);
char *XpGetAttributes(XpContextPtr pContext,
XPAttributes class);
int XpAugmentAttributes(XpContextPtr pContext,
XPAttributes class,
char *attributes);
int XpSetAttributes(XpContextPtr pContext,
XPAttributes class,
char *attributes);
const char *XpGetPrinterAttribute(const char *printerName,
const char *attribute);
void XpGetTrayMediumFromContext(XpContextPtr pCon,
char **medium,
char **tray);
int XpSubmitJob(char *fileName, XpContextPtr pContext);
/*
* mediaSizes.c
*/
int XpGetResolution(XpContextPtr pContext);
XpOid XpGetContentOrientation(XpContextPtr pContext);
XpOid XpGetAvailableCompression(XpContextPtr pContext);
XpOid XpGetPlex(XpContextPtr pContext);
XpOid XpGetPageSize(XpContextPtr pContext,
XpOid* pTray,
const XpOidMediumSS* msss);
void XpGetMediumMillimeters(XpOid page_size,
float *width,
float *height);
void XpGetMediumDimensions(XpContextPtr pContext,
unsigned short *width,
unsigned short *height);
void XpGetReproductionArea(XpContextPtr pContext,
xRectangle *pRect);
void XpGetMaxWidthHeightRes(const char *printer_name,
const XpValidatePoolsRec* vpr,
float *width,
float *height,
int* resolution);
/* Util.c */
char *ReplaceAnyString(char *string,
char *target,
char *replacement);
char *ReplaceFileString(char *string,
char *inFileName,
char *outFileName);
int TransferBytes(FILE *pSrcFile,
FILE *pDstFile,
int numBytes);
Bool CopyContentsAndDelete(FILE **ppSrcFile,
char **pSrcFileName,
FILE *pDstFile);
int XpSendDocumentData(ClientPtr client,
FILE *fp,
int fileLen,
int maxBufSize);
int XpFinishDocData(ClientPtr client);
Bool XpOpenTmpFile(char *mode,
char **fname,
FILE **stream);
#endif /* _Xp_attributes_h */

View file

@ -1 +0,0 @@
SUBDIRS = print

View file

@ -1,14 +0,0 @@
SUBDIRS = attributes ddx-config models
xpcdir = @xpconfigdir@/C/print
Xprinters.ghostscript: $(srcdir)/Xprinters
sed < $(srcdir)/Xprinters "s/#Printer xp_pdf_spooldir_tmp_Xprintjobs/Printer xp_pdf_spooldir_tmp_Xprintjobs/" > Xprinters.ghostscript
dist_xpc_DATA = Xprinters
xpc_DATA = Xprinters.ghostscript
CLEANFILES = Xprinters.ghostscript

View file

@ -1,49 +0,0 @@
########################################################################
#
# $Xorg: Xprinters,v 1.3 2000/08/17 19:48:02 cpqbld Exp $
#
# X*printers sample configuration file
#
#
# This file belongs in /usr/lib/X11/X*printers, where the "*" is the
# display number of the server. For example, if the server is
# invoked using the command X :0, then the X0printers file is used.
########################################################################
########################################################################
# Use lpstat to augment the list of printers managed by the
# server. (This is the default behavior if the X*printers file does
# not exist, or if an "Augment_Printer_List" line is not specified.)
########################################################################
#Augment_Printer_List %(default)%
########################################################################
# Use the specified command pipeline to augment the list of printers
# managed by the server.
########################################################################
#Augment_Printer_List lpstat -a | cut -d " " -f 1 # equivalent to default
########################################################################
# Do not augment the list of printers managed by the server.
########################################################################
#Augment_Printer_List %none%
########################################################################
# Preconfigured entry for the PSspooldir model
# (which sends jobs to /tmp/Xprintjobs instead to a physical printer)
########################################################################
#Printer xp_pdf_spooldir_tmp_Xprintjobs
Printer xp_ps_spooldir_tmp_Xprintjobs
########################################################################
# Add individual printers to the list of printers managed by the
# server. These are aliases, determined by driver name.
########################################################################
# EXAMPLES
#
# Printer xppspr
# Printer xppclpr
# Printer xppclmonopr
# Printer xprasterpr

View file

@ -1,3 +0,0 @@
xpcdir = @xpconfigdir@/C/print/attributes
dist_xpc_DATA = document job printer

View file

@ -1,49 +0,0 @@
# $Xorg: document,v 1.3 2000/08/17 19:48:03 cpqbld Exp $
# Document DPA-Object initial attribute values
# Attribute IDs must be qualified by using one of the following
# (listed in order of precedence):
#
# printer-name
# Set this attribute for a specific printer.
# Example: "dj_1.plex: duplex"
#
# printer-model
# Set this attribute for all printers of a specific model.
# Example: "HPDJ1600C.plex: duplex"
#
# '*'
# Set this attribute for all printers.
# Example: "*.plex: duplex"
*content-orientation: portrait
*copy-count: 1
*default-medium: iso-a4
*default-printer-resolution: 600
# "PSspooldir" jobs should always be 300 DPI
# (to be compatible to DPS-based PostScript viewers such as sdtimage)
PSspooldir.default-printer-resolution: 300
# "PS2PDFspooldir-GS" jobs should always be 600 DPI
PS2PDFspooldir-GS.default-printer-resolution: 600
# Some resolution defaults to make applications happy which are too lazy
# to pick an own default in absence of "default-printer-resolution"
HPLJ4050-PS.default-printer-resolution: 600
SPSPARC2.default-printer-resolution: 300
CANONBJ10E-GS.default-printer-resolution: 360
CANONC3200-PS.default-printer-resolution: 600
# EXAMPLES
#
# *content-orientation: landscape
# *copy-count: 3
# *default-input-tray: main
# *default-medium: iso-a4
# *default-printer-resolution: 600
# *document-format: {PCL 5}
# *plex: simplex
# *xp-listfonts-modes: xp-list-internal-printer-fonts

View file

@ -1,25 +0,0 @@
# $Xorg: job,v 1.3 2000/08/17 19:48:03 cpqbld Exp $
# Job DPA-Object initial attribute values
# Attribute IDs must be qualified by using one of the following
# (listed in order of precedence):
#
# printer-name
# Set this attribute for a specific printer.
# Example: "laser_1.job-priority: 1"
#
# printer-model
# Set this attribute for all printers of a specific model.
# Example: "HPDJ1600C.job-priority: 1"
#
# '*'
# Set this attribute for all printers.
# Example: "*.job-priority: 1"
*notification-profile: {}
# EXAMPLES
#
# *job-name: Example Job Name
# *notification-profile: {{event-report-job-completed} electronic-mail}
# *xp-spooler-command-options: -onb

View file

@ -1,96 +0,0 @@
# $Xorg: printer,v 1.3 2000/08/17 19:48:03 cpqbld Exp $
# Printer DPA-Object initial attribute values
# Attribute IDs must be qualified by using one of the following
# (listed in order of precedence):
#
# printer-name
# Set this attribute for a specific printer.
# Example: "dj_1.document-formats-ready: {pcl 5}"
#
# printer-model
# Set this attribute for all printers of a specific model.
# Example: "HPDJ1600C.document-formats-ready: {pcl 5}"
#
# '*'
# Set this attribute for all printers.
# Example: "*.document-formats-ready: {pcl 5}"
# Remove this line and replace them with per printer settings
# if you want to use more than one DDX!!
*xp-model-identifier: PSdefault
# Sample entry for the "PSspooldir" model
# Just add a printer called "xp_ps_spooldir_tmp_Xprintjobs" to "Xprinters"
# and you will get an extra printer which files the PostScript jobs
# in the "/tmp/Xprintjobs/" directory.
xp_ps_spooldir_tmp_Xprintjobs.xp-model-identifier: PSspooldir
# Sample entry for the "PS2PDFspooldir-GS" model
# Just add a printer called "xp_pdf_spooldir_tmp_Xprintjobs" to "Xprinters"
# and you will get an extra printer which convertes the PostScript jobs
# to PDF using "ps2pdf" and files them into the "/tmp/Xprintjobs/" directory.
# NOTE: Future versions of Xprint will use the PDF DDX instead directly
# instead of relying on GhostScript/ps2pdf...
xp_pdf_spooldir_tmp_Xprintjobs.xp-model-identifier: PS2PDFspooldir-GS
# IMPORTANT EXAMPLES
#
# The following are examples of how a printer name is bound
# to a model-config file and ddx driver.
#
# Warning: most X-Servers have a hard limit on the number of ddx
# drivers (ie, screens) they can support at runtime (usually 3 or
# 4). Whatever the number of printers, they cannot create a
# dependency for more than the limit on ddx drivers. Assuming
# "Xprinters" listed all four xp*pr printers below, X-Servers
# with a limit of 3 would not work.
#
# xppspr.xp-model-identifier: HPDJ1600C
# xppspr.xp-ddx-identifier: XP-POSTSCRIPT
# xppspr.document-formats-ready: { PostScript 2 }
#
# xppclpr.xp-model-identifier: HPDJ1600C
# xppclpr.xp-ddx-identifier: XP-PCL-COLOR
# xppclpr.document-formats-ready: { PCL 5 }
#
# xppclmonopr.xp-model-identifier: HPDJ1600C
# xppclmonopr.xp-ddx-identifier: XP-PCL-MONO
# xppclmonopr.document-formats-ready: { PCL 5 }
#
# xprasterpr.xp-model-identifier: HPDJ1600C
# xprasterpr.xp-ddx-identifier: XP-RASTER
# MORE EXAMPLES of items often configured in this file
#
# *descriptor: This printer has not been given a name
# *dt-pdm-command: dtpdm
# *input-trays-medium: {top na-letter} {bottom iso-a4}
# *xp-model-identifier: HPDJ1600C
# *xp-spooler-command: /opt/mystuff/bin/mylp -p %printer-name% -c %copy-count% \
# -j %job-name% -o %options%
# USUALLY SET BY THE ddx driver
#
# *content-orientations-supported: portrait landscape reverse-portrait reverse-landscape
# USUALLY SET BY THE model-config FILE
#
# *document-formats-supported: {PCL 5}
# *medium-source-sizes-supported: \
# { top {iso-a4 FALSE {10 200 10 287}} {iso-a5 FALSE {10 138 10 200}} } \
# { bottom {iso-a4 FALSE {10 200 10 287}} {iso-a5 FALSE {10 138 10 200}} }
# *plexes-supported: simplex duplex tumble
# *printer-model: Hewlett-Packard LaserJet IV
# *printer-resolutions-supported: 300
# *xp-ddx-identifier: XP-PCL-COLOR
# *xp-embedded-formats-supported: {PCL 5} {HPGL 2}
# *xp-listfonts-modes-supported: xp-list-internal-printer-fonts
# *xp-raw-formats-supported: {PCL 5}
# *xp-setup-proviso: xp-setup-optional

View file

@ -1 +0,0 @@
SUBDIRS = raster

View file

@ -1,3 +0,0 @@
xpcdir = @xpconfigdir@/C/print/ddx-config/raster
dist_xpc_DATA = pcl postscript

View file

@ -1,39 +0,0 @@
# $Xorg: pcl,v 1.3 2000/08/17 19:48:03 cpqbld Exp $
# This is the file which you should customize to include the printers that
# will print through the raster driver. The early part of this file
# specifies some commn useful defaults. You can override them when
# you list your printers in the second part of this file. This file is
# an X Resource file. To learn more about this file format, consult
# the functional specification.
# Note that the reference printer for CDEnext is the HP DeskJet 1600C.
# This driver may work for other printers, but the reference printer
# is the only officially supported printer.
# DEFAULTS
# ========
# The attributes below apply to all printers unless the section below
# specifies something different for the printer.
# Default printer attributes
# --------------------------
# Printer attributes control the choices that users will see in the
# setup dialog for those printers.
# The attributes below apply to all printes unless the section below
# specifies something different for the printer.
*.media-ready: na-letter-white
*.descriptor: Printer supported by CDEnext DtPrint System.
*.printer-model: HPDJ1600C
# Printer Specifics
# Use this section to override the defaults listed above or to override the
# printer attributes described in the model file.
# The lines describing "laser" are just a sample to help you get started.
# laser.printer-name: laser
# laser.spooler-name: laser

View file

@ -1,3 +0,0 @@
xpcdir = @xpconfigdir@/C/print/models/CANONBJ10E-GS
dist_xpc_DATA = model-config

View file

@ -1,23 +0,0 @@
# $Xprint.org: CANONBJ10E-GS model-config,v 1.4 2003/02/10 14:48:04 gisburn Exp $
*content-orientations-supported: portrait landscape
*descriptor: Canon BJ-10e (GhostScript)
*document-formats-supported: {POSTSCRIPT 2}
*input-trays-supported:
*medium-source-sizes-supported: \
{ '' \
{iso-b5 FALSE {6.35 169.65 6.35 243.65}}\
{iso-a4 FALSE {6.35 203.65 6.35 290.65}}\
{na-letter FALSE {6.35 209.55 6.35 273.05}}\
{na-legal FALSE {6.35 209.55 6.35 349.25}}\
}
*plexes-supported: simplex
*printer-model: "Canon BJ-10e (GhostScript)"
*printer-resolutions-supported: 360
*xp-ddx-identifier: XP-POSTSCRIPT
*xp-listfonts-modes-supported: xp-list-internal-printer-fonts xp-list-glyph-fonts
*xp-embedded-formats-supported: {POSTSCRIPT 2}
*xp-raw-formats-supported: {POSTSCRIPT 2}
*xp-setup-proviso: setup-optional
# EOF.

View file

@ -1,5 +0,0 @@
SUBDIRS = fonts
xpcdir = @xpconfigdir@/C/print/models/CANONC3200-PS
dist_xpc_DATA = model-config

View file

@ -1,54 +0,0 @@
xpcdir = @xpconfigdir@/C/print/models/CANONC3200-PS/fonts
parentdir = ../../PSdefault/fonts
XPFONTS = \
AvantGarde-Book.pmf \
AvantGarde-BookOblique.pmf \
AvantGarde-Demi.pmf \
AvantGarde-DemiOblique.pmf \
Courier-Bold.pmf \
Courier-BoldOblique.pmf \
Courier-Oblique.pmf \
Courier.pmf \
Helvetica-Bold.pmf \
Helvetica-BoldOblique.pmf \
Helvetica-Oblique.pmf \
Helvetica.pmf \
LubalinGraph-Book.pmf \
LubalinGraph-BookOblique.pmf \
LubalinGraph-Demi.pmf \
LubalinGraph-DemiOblique.pmf \
NewCentSchlbk-Bold.pmf \
NewCentSchlbk-BoldItal.pmf \
NewCentSchlbk-Ital.pmf \
NewCentSchlbk-Roman.pmf \
Souvenir-Demi.pmf \
Souvenir-DemiItalic.pmf \
Souvenir-Light.pmf \
Souvenir-LightItalic.pmf \
Symbol.pmf \
Times-Bold.pmf \
Times-BoldItalic.pmf \
Times-Italic.pmf \
Times-Roman.pmf \
ZapfDingbats.pmf
dest = $(DESTDIR)$(xpcdir)
remove-stuff:
for x in $(XPFONTS) ; do \
rm -f $(dest)/$$x ; \
done
@rm -f $(dest)/fonts.dir
install-data-hook: remove-stuff
mkdir -p $(dest) ; \
for x in $(XPFONTS) ; do \
ln -s $(parentdir)/$$x $(dest)/$$x ; \
done
$(MKFONTSCALE) -b -s -l $(dest)
uninstall-hook: remove-stuff

View file

@ -1,40 +0,0 @@
# $Xprint.org: CANONC3200-PS model-config,v 1.1 2004/06/24 09:18:04 gisburn Exp $
# model-config for the PostScript DDX
#
# automatically generated by xpppdtomodelconfig V0.1
#
# DO NOT MODIFY THIS FILE!!
#
# Attributes supported for this printer model
*content-orientations-supported: portrait landscape reverse-portrait reverse-landscape
*descriptor: Canon iR C3200
*document-formats-supported: {POSTSCRIPT 2}
*input-trays-supported:
*medium-source-sizes-supported: \
{ '' \
{iso-a4 FALSE {4.002 206 4.002 293}}\
{na-letter FALSE {4.002 211.9 4.002 275.4}}\
{na-legal FALSE {4.002 211.9 4.002 351.6}}\
{iso-a3 FALSE {4.002 293 4.002 416}}\
{iso-a5 FALSE {4.002 144 4.002 206}}\
{iso-b4 FALSE {4.002 246 4.002 349}}\
{iso-b5 FALSE {4.002 172 4.002 246}}\
{executive FALSE {4.002 180.1 4.002 262.7}}\
{invoice FALSE {4.002 135.7 4.002 211.9}}\
{monarch-envelope FALSE {4.002 94.3 4.002 186.5}}\
{na-number-10-envelop FALSE {4.002 100.8 4.002 237.3}}\
{iso-c5 FALSE {4.002 158 4.002 225}}\
}
*plexes-supported: simplex duplex tumble
*printer-model: "Canon iR C3200"
*printer-resolutions-supported: 600
*xp-ddx-identifier: XP-POSTSCRIPT
*xp-listfonts-modes-supported: xp-list-internal-printer-fonts xp-list-glyph-fonts
*xp-embedded-formats-supported: {POSTSCRIPT 2}
*xp-raw-formats-supported: {POSTSCRIPT 2}
*xp-setup-proviso: setup-optional
# NOTE: xp-psddx-* attributes are EXPERIMENTAL for now.
*xp-psddx-download-fonts: pfa pfb ttf ttc otf otc
*xp-psddx-download-font-type: pstype1
# EOF.

View file

@ -1,3 +0,0 @@
xpcdir = @xpconfigdir@/C/print/models/GSdefault
dist_xpc_DATA = model-config

View file

@ -1,137 +0,0 @@
# $Xprint.org: GSdefault model-config,v 1.1 2003/02/10 14:48:04 gisburn Exp $
# Generic default model-config for the PostScript DDX when using GhostScript
# as printer driver
#
# DO NOT MODIFY THIS FILE!!
#
# If you want to make customisations for your printer create a copy
# of this printer model.
# Example (for creating a model config "MYCOMPANYlaserxx"):
# 1. Create model config dir:
# % mkdir MYCOMPANYlaserxx
# 2. Link (or copy) the PMF (printer font metrics) for the
# printer buildin fonts:
# % ln -s GSdefault/fonts MYCOMPANYlaserxx/.
# 3. Copy the model config file:
# % cp GSdefault/model-config MYCOMPANYlaserxx/.
# 4. Customize MYCOMPANYlaserxx/model-config to match your needs.
#
# Attributes supported for this printer model
# You may want to cut the lists here down to the attributes supported
# by your printer.
*content-orientations-supported: portrait landscape reverse-portrait reverse-landscape
*descriptor: GhostScript default model
*document-formats-supported: {POSTSCRIPT 2}
*input-trays-supported:
*medium-source-sizes-supported: \
{ '' \
{na-letter FALSE {6.35 209.55 6.35 273.05}}\
{na-legal FALSE {6.35 209.55 6.35 349.25}}\
{executive FALSE {6.35 177.80 6.35 260.35}}\
{folio FALSE {6.35 204.47 6.35 323.85}}\
{invoice FALSE {6.35 133.35 6.35 209.55}}\
{ledger FALSE {6.35 273.05 6.35 425.45}}\
{quarto FALSE {6.35 209.55 6.35 268.732}}\
{a FALSE {6.35 209.55 6.35 273.05}}\
{b FALSE {6.35 273.05 6.35 425.45}}\
{c FALSE {6.35 425.45 6.35 552.45}}\
{d FALSE {6.35 552.45 6.35 857.25}}\
{e FALSE {6.35 857.25 6.35 1111.25}}\
{na-6x9-envelope FALSE {6.35 146.05 6.35 222.25}}\
{na-10x15-envelope FALSE {6.35 247.65 6.35 374.65}}\
{monarch-envelope FALSE {6.35 91.948 6.35 184.15}}\
{na-10x13-envelope FALSE {6.35 247.65 6.35 323.85}}\
{na-9x12-envelope FALSE {6.35 222.25 6.35 298.45}}\
{na-number-10-envelope FALSE {6.35 98.425 6.35 234.95}}\
{na-7x9-envelope FALSE {6.35 171.45 6.35 222.25}}\
{na-9x11-envelope FALSE {6.35 222.25 6.35 273.05}}\
{na-10x14-envelope FALSE {6.35 247.65 6.35 349.25}}\
{na-number-9-envelope FALSE {6.35 92.075 6.35 219.075}}\
{iso-a0 FALSE {6.35 834.65 6.35 1182.65}}\
{iso-a1 FALSE {6.35 587.65 6.35 834.65}}\
{iso-a2 FALSE {6.35 413.65 6.35 587.65}}\
{iso-a3 FALSE {6.35 290.65 6.35 413.65}}\
{iso-a4 FALSE {6.35 203.65 6.35 290.65}}\
{iso-a5 FALSE {6.35 141.65 6.35 203.65}}\
{iso-a6 FALSE {6.35 98.65 6.35 141.65}}\
{iso-a7 FALSE {6.35 67.65 6.35 98.65}}\
{iso-a8 FALSE {6.35 45.65 6.35 67.65}}\
{iso-a9 FALSE {6.35 30.65 6.35 45.65}}\
{iso-a10 FALSE {6.35 19.65 6.35 30.65}}\
{iso-b1 FALSE {6.35 700.65 6.35 993.65}}\
{iso-b2 FALSE {6.35 493.65 6.35 700.65}}\
{iso-b3 FALSE {6.35 346.65 6.35 493.65}}\
{iso-b4 FALSE {6.35 243.65 6.35 346.65}}\
{iso-b5 FALSE {6.35 169.65 6.35 243.65}}\
{iso-b6 FALSE {6.35 118.65 6.35 169.65}}\
{iso-b7 FALSE {6.35 81.65 6.35 118.65}}\
{iso-b8 FALSE {6.35 55.65 6.35 81.65}}\
{iso-b9 FALSE {6.35 37.65 6.35 55.65}}\
{iso-b10 FALSE {6.35 24.65 6.35 37.65}}\
{jis-b1 FALSE {6.35 721.65 6.35 1023.65}}\
{jis-b2 FALSE {6.35 508.65 6.35 721.65}}\
{jis-b3 FALSE {6.35 357.65 6.35 508.65}}\
{jis-b4 FALSE {6.35 250.65 6.35 357.65}}\
{jis-b5 FALSE {6.35 175.65 6.35 250.65}}\
{jis-b6 FALSE {6.35 121.65 6.35 175.65}}\
{jis-b7 FALSE {6.35 84.65 6.35 121.65}}\
{jis-b8 FALSE {6.35 57.65 6.35 84.65}}\
{jis-b9 FALSE {6.35 38.65 6.35 57.65}}\
{jis-b10 FALSE {6.35 25.65 6.35 38.65}}\
{iso-c3 FALSE {6.35 317.65 6.35 451.65}}\
{iso-c4 FALSE {6.35 222.65 6.35 317.65}}\
{iso-c5 FALSE {6.35 155.65 6.35 222.65}}\
{iso-c6 FALSE {6.35 107.65 6.35 155.65}}\
{iso-designated-long FALSE {6.35 103.65 6.35 213.65}}\
{hp-2x-postcard FALSE {6.35 141.65 6.35 193.65}}\
{hp-european-edp FALSE {6.35 298.45 6.35 349.25}}\
{hp-mini FALSE {6.35 133.35 6.35 209.55}}\
{hp-postcard FALSE {6.35 93.65 6.35 141.65}}\
{hp-tabloid FALSE {6.35 273.05 6.35 425.45}}\
{hp-us-edp FALSE {6.35 273.05 6.35 349.25}}\
{hp-us-government-legal FALSE {6.35 196.85 6.35 323.85}}\
{hp-us-government-letter FALSE {6.35 196.85 6.35 247.65}}\
}
# If you have more than one tray use the following example:
# 1. List the supported trays
#*input-trays-supported: main manual
# 2. Define each tray and it's paper sizes
#*medium-source-sizes-supported: \
#{ main \
# {na-letter FALSE {6.35 209.55 6.35 273.05}} \
# {na-legal FALSE {6.35 209.55 6.35 349.25}} \
# {iso-a4 FALSE {6.35 203.65 6.35 290.65}} \
#} \
#{ manual \
# {iso-a5 FALSE {6.35 141.65 6.35 203.65}} \
# {iso-c5 FALSE {6.35 155.65 6.35 222.65}} \
# {iso-designated-long FALSE {6.35 103.65 6.35 213.65}} \
# {jis-b5 FALSE {6.35 175.65 6.35 250.65}} \
# {monarch-envelope FALSE {6.35 91.948 6.35 184.15}} \
# {na-legal FALSE {6.35 209.55 6.35 349.25}} \
# {na-number-10-envelope FALSE {6.35 98.425 6.35 234.95}} \
# {executive FALSE {6.35 177.8 6.35 260.35}} \
# {iso-a3 FALSE {6.35 290.65 6.35 413.65}} \
# {iso-a0 FALSE {6.35 834.65 6.35 1182.65}} \
#}
*plexes-supported: simplex duplex tumble
*printer-model: "GhostScript default model"
# 75, 100, 120, 150, 180, 200, 240, 300, 360, 400, 600, 720,
# 940, 1200 and 2440 are supported DPI values, we limit it here
# to some common values:
*printer-resolutions-supported: 300 360 400 600
*xp-ddx-identifier: XP-POSTSCRIPT
*xp-listfonts-modes-supported: xp-list-internal-printer-fonts xp-list-glyph-fonts
*xp-embedded-formats-supported: {POSTSCRIPT 2}
*xp-raw-formats-supported: {POSTSCRIPT 2}
*xp-setup-proviso: setup-optional
# NOTE: xp-psddx-* attributes are EXPERIMENTAL for now.
# xp-psddx-download-fonts defines which fonts should be downloaded as outlines
# (valid types are "pfa", "pfb", "ttf", "ttc", "otf", "otc")
*xp-psddx-download-fonts: pfa pfb ttf ttc otf otc
# xp-psddx-download-font-type defines which font type is used to download outlines
# (valid values are "bitmap", "pstype1" and "pstype3")
*xp-psddx-download-font-type: pstype1
# EOF.

View file

@ -1,5 +0,0 @@
SUBDIRS = fonts
xpcdir = @xpconfigdir@/C/print/models/HPDJ1600C
dist_xpc_DATA = model-config

Some files were not shown because too many files have changed in this diff Show more