mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 08:10:03 +01:00
Updated to compile against new XCB, fixed configure.ac help message.
This commit is contained in:
parent
3a6759d433
commit
30b0244db0
20 changed files with 384 additions and 385 deletions
|
|
@ -429,7 +429,7 @@ AC_ARG_ENABLE(xorg, AS_HELP_STRING([--enable-xorg], [Build Xorg server
|
||||||
AC_ARG_ENABLE(dmx, AS_HELP_STRING([--enable-dmx], [Build DMX server (default: auto)]), [DMX=$enableval], [DMX=auto])
|
AC_ARG_ENABLE(dmx, AS_HELP_STRING([--enable-dmx], [Build DMX server (default: auto)]), [DMX=$enableval], [DMX=auto])
|
||||||
AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server (default: yes)]), [XVFB=$enableval], [XVFB=yes])
|
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(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto])
|
||||||
AC_ARG_ENABLE(xscreen, AS_HELP_STRING([--enable-xnest], [Build Xscreen server (default: auto)]), [XNEST=$enableval], [XNEST=auto])
|
AC_ARG_ENABLE(xscreen, AS_HELP_STRING([--enable-xscreen], [Build Xscreen server (default: auto)]), [XNEST=$enableval], [XNEST=auto])
|
||||||
AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto])
|
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: auto)]), [XPRINT=$enableval], [XPRINT=auto])
|
AC_ARG_ENABLE(xprint, AS_HELP_STRING([--enable-xprint], [Build Xprint extension and server (default: auto)]), [XPRINT=$enableval], [XPRINT=auto])
|
||||||
AC_ARG_ENABLE(xgl, AS_HELP_STRING([--enable-xgl], [Build Xgl server (default: no)]), [XGL=$enableval], [XGL=no])
|
AC_ARG_ENABLE(xgl, AS_HELP_STRING([--enable-xgl], [Build Xgl server (default: no)]), [XGL=$enableval], [XGL=no])
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#include <X11/Xmd.h>
|
#include <X11/Xmd.h>
|
||||||
#include <X11/XCB/xcb.h>
|
#include <xcb/xcb.h>
|
||||||
#include <X11/XCB/xproto.h>
|
#include <xcb/xproto.h>
|
||||||
#include <X11/XCB/xcb_aux.h>
|
#include <xcb/xcb_aux.h>
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
|
|
@ -21,17 +21,17 @@ static ColormapPtr xsInstalledMap;
|
||||||
**/
|
**/
|
||||||
Bool xsCreateColormap(ColormapPtr pCmap)
|
Bool xsCreateColormap(ColormapPtr pCmap)
|
||||||
{
|
{
|
||||||
XCBVISUALID vid;
|
xcb_visualid_t vid;
|
||||||
VisualPtr pVis;
|
VisualPtr pVis;
|
||||||
|
|
||||||
pVis = pCmap->pVisual;
|
pVis = pCmap->pVisual;
|
||||||
pCmap->devPriv = xalloc(sizeof(XscreenPrivColormap));
|
pCmap->devPriv = xalloc(sizeof(XscreenPrivColormap));
|
||||||
XS_CMAP_PRIV(pCmap)->colormap = XCBCOLORMAPNew(xsConnection);
|
XS_CMAP_PRIV(pCmap)->colormap = xcb_generate_id(xsConnection);
|
||||||
vid = xsGetVisual(pVis)->visual_id;
|
vid = xsGetVisual(pVis)->visual_id;
|
||||||
XCBCreateColormap(xsConnection,
|
xcb_create_colormap(xsConnection,
|
||||||
(pVis->class & DynamicClass) ? XCBColormapAllocAll : XCBColormapAllocNone,
|
(pVis->class & DynamicClass) ? XCB_COLORMAP_ALLOC_ALL : XCB_COLORMAP_ALLOC_NONE,
|
||||||
XS_CMAP_PRIV(pCmap)->colormap,
|
XS_CMAP_PRIV(pCmap)->colormap,
|
||||||
xsBackingRoot.window,
|
xsBackingRoot,
|
||||||
vid);
|
vid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -40,7 +40,7 @@ Bool xsCreateColormap(ColormapPtr pCmap)
|
||||||
**/
|
**/
|
||||||
void xsDestroyColormap(ColormapPtr pCmap)
|
void xsDestroyColormap(ColormapPtr pCmap)
|
||||||
{
|
{
|
||||||
XCBFreeColormap(xsConnection, XS_CMAP_PRIV(pCmap)->colormap);
|
xcb_free_colormap(xsConnection, XS_CMAP_PRIV(pCmap)->colormap);
|
||||||
xfree(pCmap->devPriv);
|
xfree(pCmap->devPriv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -53,7 +53,7 @@ void xsSetInstalledColormapWindows(ScreenPtr pScreen)
|
||||||
void xsDirectUninstallColormaps(ScreenPtr pScreen)
|
void xsDirectUninstallColormaps(ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
int i, n;
|
int i, n;
|
||||||
XCBCOLORMAP pCmapIDs[MAXCMAPS];
|
xcb_colormap_t pCmapIDs[MAXCMAPS];
|
||||||
|
|
||||||
/*do I want this? What does it do?
|
/*do I want this? What does it do?
|
||||||
if (!xsDoDirectColormaps)
|
if (!xsDoDirectColormaps)
|
||||||
|
|
@ -64,11 +64,12 @@ void xsDirectUninstallColormaps(ScreenPtr pScreen)
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
ColormapPtr pCmap;
|
ColormapPtr pCmap;
|
||||||
|
|
||||||
pCmap = (ColormapPtr)LookupIDByType(pCmapIDs[i].xid, RT_COLORMAP);
|
pCmap = (ColormapPtr)LookupIDByType(pCmapIDs[i], RT_COLORMAP);
|
||||||
if (pCmap)
|
if (pCmap)
|
||||||
XCBUninstallColormap(xsConnection, XS_CMAP_PRIV(pCmap)->colormap);
|
xcb_uninstall_colormap(xsConnection, XS_CMAP_PRIV(pCmap)->colormap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void xsInstallColormap(ColormapPtr pCmap)
|
void xsInstallColormap(ColormapPtr pCmap)
|
||||||
{
|
{
|
||||||
int index;
|
int index;
|
||||||
|
|
@ -104,18 +105,18 @@ void xsUninstallColormap(ColormapPtr pCmap)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void xsStoreColors(ColormapPtr pCmap, int nColors, XCBCOLORITEM *pColors)
|
void xsStoreColors(ColormapPtr pCmap, int nColors, xcb_coloritem_t *pColors)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void xsResolveColor(CARD16 *r, CARD16 *g, CARD16 *b, VisualPtr pVisual)
|
void xsResolveColor(uint16_t *r, uint16_t *g, uint16_t *b, VisualPtr pVisual)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
int xsListInstalledColormaps(ScreenPtr pScreen, XCBCOLORMAP *pCmapIDs)
|
int xsListInstalledColormaps(ScreenPtr pScreen, xcb_colormap_t *pCmapIDs)
|
||||||
{
|
{
|
||||||
if (xsInstalledMap) {
|
if (xsInstalledMap) {
|
||||||
pCmapIDs->xid = xsInstalledMap->mid;
|
pCmapIDs = xsInstalledMap->mid;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
#define MAXCMAPS 1
|
#define MAXCMAPS 1
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
XCBCOLORMAP colormap;
|
xcb_colormap_t colormap;
|
||||||
} XscreenPrivColormap;
|
} XscreenPrivColormap;
|
||||||
|
|
||||||
#define XS_CMAP_PRIV(pCmap) \
|
#define XS_CMAP_PRIV(pCmap) \
|
||||||
|
|
@ -15,9 +15,9 @@ Bool xsCreateColormap(ColormapPtr pCmap);
|
||||||
void xsDestroyColormap(ColormapPtr pCmap);
|
void xsDestroyColormap(ColormapPtr pCmap);
|
||||||
void xsInstallColormap(ColormapPtr pCmap);
|
void xsInstallColormap(ColormapPtr pCmap);
|
||||||
void xsUninstallColormap(ColormapPtr pCmap);
|
void xsUninstallColormap(ColormapPtr pCmap);
|
||||||
int xsListInstalledColormaps(ScreenPtr pScreen, XCBCOLORMAP *pCmapIDs);
|
int xsListInstalledColormaps(ScreenPtr pScreen, xcb_colormap_t *pCmapIDs);
|
||||||
void xsStoreColors(ColormapPtr pCmap, int nColors, XCBCOLORITEM *pColors);
|
void xsStoreColors(ColormapPtr pCmap, int nColors, xcb_coloritem_t *pColors);
|
||||||
void xsResolveColor(CARD16 *r, CARD16 *g, CARD16 *b, VisualPtr pVisual);
|
void xsResolveColor(uint16_t *r, uint16_t *g, uint16_t *b, VisualPtr pVisual);
|
||||||
|
|
||||||
void xsSetInstalledColormapWindows(ScreenPtr pScreen);
|
void xsSetInstalledColormapWindows(ScreenPtr pScreen);
|
||||||
//void xsSetScreenSaverColormapWindow(ScreenPtr pScreen);
|
//void xsSetScreenSaverColormapWindow(ScreenPtr pScreen);
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
#include <xs-config.h>
|
#include <xs-config.h>
|
||||||
#endif
|
#endif
|
||||||
#include <X11/Xmd.h>
|
#include <X11/Xmd.h>
|
||||||
#include <X11/XCB/xcb.h>
|
#include <xcb/xcb.h>
|
||||||
#include <X11/XCB/xcb_aux.h>
|
#include <xcb/xcb_aux.h>
|
||||||
#include <X11/XCB/xproto.h>
|
#include <xcb/xproto.h>
|
||||||
#include <X11/XCB/xcb_image.h>
|
#include <xcb/xcb_image.h>
|
||||||
#include "regionstr.h"
|
#include "regionstr.h"
|
||||||
#include "gcstruct.h"
|
#include "gcstruct.h"
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
|
|
@ -18,16 +18,16 @@
|
||||||
#include "xs-globals.h"
|
#include "xs-globals.h"
|
||||||
#include "xs-window.h"
|
#include "xs-window.h"
|
||||||
|
|
||||||
void xsDoConfigure(XCBConfigureNotifyEvent *e)
|
void xsDoConfigure(xcb_configure_notify_event_t *e)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void xsHandleEvent(XCBGenericEvent *evt)
|
void xsHandleEvent(xcb_generic_event_t *evt)
|
||||||
{
|
{
|
||||||
switch (evt->response_type & ~0x80)
|
switch (evt->response_type & ~0x80)
|
||||||
{
|
{
|
||||||
case XCBConfigureNotify:
|
case XCB_CONFIGURE_NOTIFY:
|
||||||
xsDoConfigure((XCBConfigureNotifyEvent *)evt);
|
xsDoConfigure((xcb_configure_notify_event_t *)evt);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ErrorF("Warning: Unhandled Event");
|
ErrorF("Warning: Unhandled Event");
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
#include <xs-config.h>
|
#include <xs-config.h>
|
||||||
#endif
|
#endif
|
||||||
#include <X11/Xmd.h>
|
#include <X11/Xmd.h>
|
||||||
#include <X11/XCB/xcb.h>
|
#include <xcb/xcb.h>
|
||||||
#include <X11/XCB/xcb_aux.h>
|
#include <xcb/xcb_aux.h>
|
||||||
#include <X11/XCB/xproto.h>
|
#include <xcb/xproto.h>
|
||||||
#include <X11/XCB/xcb_image.h>
|
#include <xcb/xcb_image.h>
|
||||||
#include "regionstr.h"
|
#include "regionstr.h"
|
||||||
#include <X11/fonts/fontstruct.h>
|
#include <X11/fonts/fontstruct.h>
|
||||||
#include "gcstruct.h"
|
#include "gcstruct.h"
|
||||||
|
|
@ -23,8 +23,8 @@
|
||||||
Bool xsRealizeFont(ScreenPtr pScreen, FontPtr pFont)
|
Bool xsRealizeFont(ScreenPtr pScreen, FontPtr pFont)
|
||||||
{
|
{
|
||||||
pointer priv;
|
pointer priv;
|
||||||
XCBFONT font;
|
xcb_font_t font;
|
||||||
XCBATOM name_atom, value_atom;
|
xcb_atom_t name_atom, value_atom;
|
||||||
|
|
||||||
int nprops;
|
int nprops;
|
||||||
FontPropPtr props;
|
FontPropPtr props;
|
||||||
|
|
@ -33,33 +33,33 @@ Bool xsRealizeFont(ScreenPtr pScreen, FontPtr pFont)
|
||||||
|
|
||||||
FontSetPrivate(pFont, xsFontPrivateIndex, NULL);
|
FontSetPrivate(pFont, xsFontPrivateIndex, NULL);
|
||||||
|
|
||||||
name_atom.xid = MakeAtom("FONT", 4, TRUE);
|
name_atom = MakeAtom("FONT", 4, TRUE);
|
||||||
value_atom.xid = 0L;
|
value_atom = 0L;
|
||||||
|
|
||||||
nprops = pFont->info.nprops;
|
nprops = pFont->info.nprops;
|
||||||
props = pFont->info.props;
|
props = pFont->info.props;
|
||||||
|
|
||||||
for (i = 0; i < nprops; i++) {
|
for (i = 0; i < nprops; i++) {
|
||||||
if (props[i].name == name_atom.xid) {
|
if (props[i].name == name_atom) {
|
||||||
value_atom.xid = props[i].value;
|
value_atom = props[i].value;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!value_atom.xid)
|
if (!value_atom)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
name = NameForAtom(value_atom.xid);
|
name = NameForAtom(value_atom);
|
||||||
if (!name)
|
if (!name)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
priv = xalloc(sizeof(XscreenPrivFont));
|
priv = xalloc(sizeof(XscreenPrivFont));
|
||||||
FontSetPrivate(pFont, xsFontPrivateIndex, priv);
|
FontSetPrivate(pFont, xsFontPrivateIndex, priv);
|
||||||
|
|
||||||
font = XCBFONTNew(xsConnection);
|
font = xcb_generate_id(xsConnection);
|
||||||
XS_FONT_PRIV(pFont)->font = font;
|
XS_FONT_PRIV(pFont)->font = font;
|
||||||
XCBOpenFont(xsConnection, font, strlen(name), name);
|
xcb_open_font(xsConnection, font, strlen(name), name);
|
||||||
|
|
||||||
if (!XS_FONT_PRIV(pFont)->font.xid)
|
if (!XS_FONT_PRIV(pFont)->font)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
@ -68,8 +68,8 @@ Bool xsRealizeFont(ScreenPtr pScreen, FontPtr pFont)
|
||||||
Bool xsUnrealizeFont(ScreenPtr pScreen, FontPtr pFont)
|
Bool xsUnrealizeFont(ScreenPtr pScreen, FontPtr pFont)
|
||||||
{
|
{
|
||||||
if (XS_FONT_PRIV(pFont)) {
|
if (XS_FONT_PRIV(pFont)) {
|
||||||
if (XS_FONT_PRIV(pFont)->font.xid)
|
if (XS_FONT_PRIV(pFont)->font)
|
||||||
XCBCloseFont(xsConnection, XS_FONT_PRIV(pFont)->font);
|
xcb_close_font(xsConnection, XS_FONT_PRIV(pFont)->font);
|
||||||
xfree(XS_FONT_PRIV(pFont));
|
xfree(XS_FONT_PRIV(pFont));
|
||||||
FontSetPrivate(pFont, xsFontPrivateIndex, NULL);
|
FontSetPrivate(pFont, xsFontPrivateIndex, NULL);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
#define _XS_FONT_INCL_
|
#define _XS_FONT_INCL_
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
XCBFONT font;
|
xcb_font_t font;
|
||||||
} XscreenPrivFont;
|
} XscreenPrivFont;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,9 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <X11/Xmd.h>
|
#include <X11/Xmd.h>
|
||||||
#include <X11/XCB/xcb.h>
|
#include <xcb/xcb.h>
|
||||||
#include <X11/XCB/xproto.h>
|
#include <xcb/xproto.h>
|
||||||
#include <X11/XCB/xcb_aux.h>
|
#include <xcb/xcb_aux.h>
|
||||||
#include "gcstruct.h"
|
#include "gcstruct.h"
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
#include "pixmapstr.h"
|
#include "pixmapstr.h"
|
||||||
|
|
@ -80,8 +80,8 @@ Bool xsCreateGC(GCPtr pGC)
|
||||||
|
|
||||||
pGC->miTranslate = 1;
|
pGC->miTranslate = 1;
|
||||||
|
|
||||||
XS_GC_PRIV(pGC)->gc = XCBGCONTEXTNew(xsConnection);
|
XS_GC_PRIV(pGC)->gc = xcb_generate_id(xsConnection);
|
||||||
XCBCreateGC(xsConnection,
|
xcb_create_gc(xsConnection,
|
||||||
XS_GC_PRIV(pGC)->gc,
|
XS_GC_PRIV(pGC)->gc,
|
||||||
xsDefaultDrawables[pGC->depth],
|
xsDefaultDrawables[pGC->depth],
|
||||||
0L,
|
0L,
|
||||||
|
|
@ -99,107 +99,107 @@ void xsValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
|
||||||
|
|
||||||
void xsChangeGC(GCPtr pGC, unsigned long mask)
|
void xsChangeGC(GCPtr pGC, unsigned long mask)
|
||||||
{
|
{
|
||||||
XCBParamsGC values;
|
xcb_params_gc_t values;
|
||||||
|
|
||||||
if (mask & XCBGCFunction)
|
if (mask & XCB_GC_FUNCTION)
|
||||||
values.function = pGC->alu;
|
values.function = pGC->alu;
|
||||||
|
|
||||||
if (mask & XCBGCPlaneMask)
|
if (mask & XCB_GC_PLANE_MASK)
|
||||||
values.plane_mask = pGC->planemask;
|
values.plane_mask = pGC->planemask;
|
||||||
|
|
||||||
if (mask & XCBGCForeground)
|
if (mask & XCB_GC_FOREGROUND)
|
||||||
values.foreground = pGC->fgPixel;
|
values.foreground = pGC->fgPixel;
|
||||||
|
|
||||||
if (mask & XCBGCBackground)
|
if (mask & XCB_GC_BACKGROUND)
|
||||||
values.background = pGC->bgPixel;
|
values.background = pGC->bgPixel;
|
||||||
|
|
||||||
if (mask & XCBGCLineWidth)
|
if (mask & XCB_GC_LINE_WIDTH)
|
||||||
values.line_width = pGC->lineWidth;
|
values.line_width = pGC->lineWidth;
|
||||||
|
|
||||||
if (mask & XCBGCLineStyle)
|
if (mask & XCB_GC_LINE_STYLE)
|
||||||
values.line_style = pGC->lineStyle;
|
values.line_style = pGC->lineStyle;
|
||||||
|
|
||||||
if (mask & XCBGCCapStyle)
|
if (mask & XCB_GC_CAP_STYLE)
|
||||||
values.cap_style = pGC->capStyle;
|
values.cap_style = pGC->capStyle;
|
||||||
|
|
||||||
if (mask & XCBGCJoinStyle)
|
if (mask & XCB_GC_JOIN_STYLE)
|
||||||
values.join_style = pGC->joinStyle;
|
values.join_style = pGC->joinStyle;
|
||||||
|
|
||||||
if (mask & XCBGCFillStyle)
|
if (mask & XCB_GC_FILL_STYLE)
|
||||||
values.fill_style = pGC->fillStyle;
|
values.fill_style = pGC->fillStyle;
|
||||||
|
|
||||||
if (mask & XCBGCFillRule)
|
if (mask & XCB_GC_FILL_RULE)
|
||||||
values.fill_rule = pGC->fillRule;
|
values.fill_rule = pGC->fillRule;
|
||||||
|
|
||||||
if (mask & XCBGCTile) {
|
if (mask & XCB_GC_TILE) {
|
||||||
if (pGC->tileIsPixel)
|
if (pGC->tileIsPixel)
|
||||||
mask &= ~GCTile;
|
mask &= ~GCTile;
|
||||||
else
|
else
|
||||||
values.tile = XS_PIXMAP_PRIV(pGC->tile.pixmap)->pixmap.xid;
|
values.tile = XS_PIXMAP_PRIV(pGC->tile.pixmap)->pixmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mask & XCBGCStipple)
|
if (mask & XCB_GC_STIPPLE)
|
||||||
values.stipple = XS_PIXMAP_PRIV(pGC->stipple)->pixmap.xid;
|
values.stipple = XS_PIXMAP_PRIV(pGC->stipple)->pixmap;
|
||||||
|
|
||||||
if (mask & XCBGCTileStippleOriginX)
|
if (mask & XCB_GC_TILE_STIPPLE_ORIGIN_X)
|
||||||
values.tile_stipple_originX = pGC->patOrg.x;
|
values.tile_stipple_originX = pGC->patOrg.x;
|
||||||
|
|
||||||
if (mask & XCBGCTileStippleOriginY)
|
if (mask & XCB_GC_TILE_STIPPLE_ORIGIN_Y)
|
||||||
values.tile_stipple_originY = pGC->patOrg.y;
|
values.tile_stipple_originY = pGC->patOrg.y;
|
||||||
|
|
||||||
if (mask & XCBGCFont)
|
if (mask & XCB_GC_FONT)
|
||||||
values.font = XS_FONT_PRIV(pGC->font)->font.xid;
|
values.font = XS_FONT_PRIV(pGC->font)->font;
|
||||||
|
|
||||||
if (mask & XCBGCSubwindowMode)
|
if (mask & XCB_GC_SUBWINDOW_MODE)
|
||||||
values.subwindow_mode = pGC->subWindowMode;
|
values.subwindow_mode = pGC->subWindowMode;
|
||||||
|
|
||||||
if (mask & XCBGCGraphicsExposures)
|
if (mask & XCB_GC_GRAPHICS_EXPOSURES)
|
||||||
values.graphics_exposures = pGC->graphicsExposures;
|
values.graphics_exposures = pGC->graphicsExposures;
|
||||||
|
|
||||||
if (mask & XCBGCClipOriginY)
|
if (mask & XCB_GC_CLIP_ORIGIN_Y)
|
||||||
values.clip_originX = pGC->clipOrg.x;
|
values.clip_originX = pGC->clipOrg.x;
|
||||||
|
|
||||||
if (mask & XCBGCClipOriginX)
|
if (mask & XCB_GC_CLIP_ORIGIN_X)
|
||||||
values.clip_originY = pGC->clipOrg.y;
|
values.clip_originY = pGC->clipOrg.y;
|
||||||
|
|
||||||
if (mask & XCBGCClipMask) /* this is handled in change clip */
|
if (mask & XCB_GC_CLIP_MASK) /* this is handled in change clip */
|
||||||
mask &= ~GCClipMask;
|
mask &= ~GCClipMask;
|
||||||
|
|
||||||
if (mask & XCBGCDashOffset)
|
if (mask & XCB_GC_DASH_OFFSET)
|
||||||
values.dash_offset = pGC->dashOffset;
|
values.dash_offset = pGC->dashOffset;
|
||||||
|
|
||||||
if (mask & XCBGCDashList) {
|
if (mask & XCB_GC_DASH_LIST) {
|
||||||
mask &= ~GCDashList;
|
mask &= ~GCDashList;
|
||||||
XCBSetDashes(xsConnection,
|
xcb_set_dashes(xsConnection,
|
||||||
XS_GC_PRIV(pGC)->gc,
|
XS_GC_PRIV(pGC)->gc,
|
||||||
pGC->dashOffset,
|
pGC->dashOffset,
|
||||||
pGC->numInDashList,
|
pGC->numInDashList,
|
||||||
(BYTE *)pGC->dash);
|
(uint8_t *)pGC->dash);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mask & XCBGCArcMode)
|
if (mask & XCB_GC_ARC_MODE)
|
||||||
values.arc_mode = pGC->arcMode;
|
values.arc_mode = pGC->arcMode;
|
||||||
|
|
||||||
if (mask)
|
if (mask)
|
||||||
XCBAuxChangeGC(xsConnection, XS_GC_PRIV(pGC)->gc, mask, &values);
|
xcb_aux_change_gc(xsConnection, XS_GC_PRIV(pGC)->gc, mask, &values);
|
||||||
}
|
}
|
||||||
|
|
||||||
void xsCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst)
|
void xsCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst)
|
||||||
{
|
{
|
||||||
XCBCopyGC(xsConnection, XS_GC_PRIV(pGCSrc)->gc, XS_GC_PRIV(pGCDst)->gc, mask);
|
xcb_copy_gc(xsConnection, XS_GC_PRIV(pGCSrc)->gc, XS_GC_PRIV(pGCDst)->gc, mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
void xsDestroyGC(GCPtr pGC)
|
void xsDestroyGC(GCPtr pGC)
|
||||||
{
|
{
|
||||||
XCBFreeGC(xsConnection, XS_GC_PRIV(pGC)->gc);
|
xcb_free_gc(xsConnection, XS_GC_PRIV(pGC)->gc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void xsChangeClip(GCPtr pGC, int type, pointer pValue, int nRects)
|
void xsChangeClip(GCPtr pGC, int type, pointer pValue, int nRects)
|
||||||
{
|
{
|
||||||
int i, size;
|
int i, size;
|
||||||
BoxPtr pBox;
|
BoxPtr pBox;
|
||||||
XCBRECTANGLE *pRects;
|
xcb_rectangle_t *pRects;
|
||||||
XCBParamsGC param;
|
xcb_params_gc_t param;
|
||||||
|
|
||||||
xsDestroyClipHelper(pGC);
|
xsDestroyClipHelper(pGC);
|
||||||
|
|
||||||
|
|
@ -207,7 +207,7 @@ void xsChangeClip(GCPtr pGC, int type, pointer pValue, int nRects)
|
||||||
{
|
{
|
||||||
case CT_NONE:
|
case CT_NONE:
|
||||||
param.mask = None;
|
param.mask = None;
|
||||||
XCBAuxChangeGC(xsConnection, XS_GC_PRIV(pGC)->gc, XCBGCClipMask, ¶m);
|
xcb_aux_change_gc(xsConnection, XS_GC_PRIV(pGC)->gc, XCB_GC_CLIP_MASK, ¶m);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CT_REGION:
|
case CT_REGION:
|
||||||
|
|
@ -221,8 +221,8 @@ void xsChangeClip(GCPtr pGC, int type, pointer pValue, int nRects)
|
||||||
pRects[i].width = pBox[i].x2 - pBox[i].x1;
|
pRects[i].width = pBox[i].x2 - pBox[i].x1;
|
||||||
pRects[i].height = pBox[i].y2 - pBox[i].y1;
|
pRects[i].height = pBox[i].y2 - pBox[i].y1;
|
||||||
}
|
}
|
||||||
XCBSetClipRectangles(xsConnection,
|
xcb_set_clip_rectangles(xsConnection,
|
||||||
XCBClipOrderingUnsorted,
|
XCB_CLIP_ORDERING_UNSORTED,
|
||||||
XS_GC_PRIV(pGC)->gc,
|
XS_GC_PRIV(pGC)->gc,
|
||||||
0, 0,
|
0, 0,
|
||||||
nRects,
|
nRects,
|
||||||
|
|
@ -231,8 +231,8 @@ void xsChangeClip(GCPtr pGC, int type, pointer pValue, int nRects)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CT_PIXMAP:
|
case CT_PIXMAP:
|
||||||
param.mask = XS_PIXMAP_PRIV((PixmapPtr)pValue)->pixmap.xid;
|
param.mask = XS_PIXMAP_PRIV((PixmapPtr)pValue)->pixmap;
|
||||||
XCBAuxChangeGC(xsConnection, XS_GC_PRIV(pGC)->gc, XCBGCClipMask, ¶m);
|
xcb_aux_change_gc(xsConnection, XS_GC_PRIV(pGC)->gc, XCB_GC_CLIP_MASK, ¶m);
|
||||||
/*
|
/*
|
||||||
* Need to change into region, so subsequent uses are with
|
* Need to change into region, so subsequent uses are with
|
||||||
* current pixmap contents.
|
* current pixmap contents.
|
||||||
|
|
@ -244,17 +244,17 @@ void xsChangeClip(GCPtr pGC, int type, pointer pValue, int nRects)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CT_UNSORTED:
|
case CT_UNSORTED:
|
||||||
XCBSetClipRectangles(xsConnection,
|
xcb_set_clip_rectangles(xsConnection,
|
||||||
XCBClipOrderingUnsorted,
|
XCB_CLIP_ORDERING_UNSORTED,
|
||||||
XS_GC_PRIV(pGC)->gc,
|
XS_GC_PRIV(pGC)->gc,
|
||||||
pGC->clipOrg.x,
|
pGC->clipOrg.x,
|
||||||
pGC->clipOrg.y,
|
pGC->clipOrg.y,
|
||||||
nRects,
|
nRects,
|
||||||
(XCBRECTANGLE *)pValue);
|
(xcb_rectangle_t *)pValue);
|
||||||
break;
|
break;
|
||||||
case CT_YSORTED:
|
case CT_YSORTED:
|
||||||
XCBSetClipRectangles(xsConnection,
|
xcb_set_clip_rectangles(xsConnection,
|
||||||
XCBClipOrderingYSorted,
|
XCB_CLIP_ORDERING_Y_SORTED,
|
||||||
XS_GC_PRIV(pGC)->gc,
|
XS_GC_PRIV(pGC)->gc,
|
||||||
pGC->clipOrg.x,
|
pGC->clipOrg.x,
|
||||||
pGC->clipOrg.y,
|
pGC->clipOrg.y,
|
||||||
|
|
@ -262,8 +262,8 @@ void xsChangeClip(GCPtr pGC, int type, pointer pValue, int nRects)
|
||||||
pValue);
|
pValue);
|
||||||
break;
|
break;
|
||||||
case CT_YXSORTED:
|
case CT_YXSORTED:
|
||||||
XCBSetClipRectangles(xsConnection,
|
xcb_set_clip_rectangles(xsConnection,
|
||||||
XCBClipOrderingYXSorted,
|
XCB_CLIP_ORDERING_YX_SORTED,
|
||||||
XS_GC_PRIV(pGC)->gc,
|
XS_GC_PRIV(pGC)->gc,
|
||||||
pGC->clipOrg.x,
|
pGC->clipOrg.x,
|
||||||
pGC->clipOrg.y,
|
pGC->clipOrg.y,
|
||||||
|
|
@ -271,8 +271,8 @@ void xsChangeClip(GCPtr pGC, int type, pointer pValue, int nRects)
|
||||||
pValue);
|
pValue);
|
||||||
break;
|
break;
|
||||||
case CT_YXBANDED:
|
case CT_YXBANDED:
|
||||||
XCBSetClipRectangles(xsConnection,
|
xcb_set_clip_rectangles(xsConnection,
|
||||||
XCBClipOrderingYXBanded,
|
XCB_CLIP_ORDERING_YX_BANDED,
|
||||||
XS_GC_PRIV(pGC)->gc,
|
XS_GC_PRIV(pGC)->gc,
|
||||||
pGC->clipOrg.x,
|
pGC->clipOrg.x,
|
||||||
pGC->clipOrg.y,
|
pGC->clipOrg.y,
|
||||||
|
|
@ -311,11 +311,11 @@ void xsChangeClip(GCPtr pGC, int type, pointer pValue, int nRects)
|
||||||
|
|
||||||
void xsDestroyClip(GCPtr pGC)
|
void xsDestroyClip(GCPtr pGC)
|
||||||
{
|
{
|
||||||
XCBParamsGC param;
|
xcb_params_gc_t param;
|
||||||
param.mask = None;
|
param.mask = None;
|
||||||
xsDestroyClipHelper(pGC);
|
xsDestroyClipHelper(pGC);
|
||||||
|
|
||||||
XCBAuxChangeGC(xsConnection, XS_GC_PRIV(pGC)->gc, XCBGCClipMask, ¶m);
|
xcb_aux_change_gc(xsConnection, XS_GC_PRIV(pGC)->gc, XCB_GC_CLIP_MASK, ¶m);
|
||||||
|
|
||||||
|
|
||||||
pGC->clientClipType = CT_NONE;
|
pGC->clientClipType = CT_NONE;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
#define _XS_GC_INCL_
|
#define _XS_GC_INCL_
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
XCBGCONTEXT gc;
|
xcb_gcontext_t gc;
|
||||||
} XscreenPrivGC;
|
} XscreenPrivGC;
|
||||||
|
|
||||||
extern int xsGCPrivateIndex;
|
extern int xsGCPrivateIndex;
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
#include <xs-config.h>
|
#include <xs-config.h>
|
||||||
#endif
|
#endif
|
||||||
#include <X11/Xmd.h>
|
#include <X11/Xmd.h>
|
||||||
#include <X11/XCB/xcb.h>
|
#include <xcb/xcb.h>
|
||||||
#include <X11/XCB/xcb_aux.h>
|
#include <xcb/xcb_aux.h>
|
||||||
#include <X11/XCB/xproto.h>
|
#include <xcb/xproto.h>
|
||||||
#include <X11/XCB/xcb_image.h>
|
#include <xcb/xcb_image.h>
|
||||||
#include "regionstr.h"
|
#include "regionstr.h"
|
||||||
#include <X11/fonts/fontstruct.h>
|
#include <X11/fonts/fontstruct.h>
|
||||||
#include "gcstruct.h"
|
#include "gcstruct.h"
|
||||||
|
|
@ -43,12 +43,12 @@ void xsGetSpans(DrawablePtr pDrawable, int maxWidth, DDXPointPtr pPoints,
|
||||||
void xsQueryBestSize(int class, unsigned short *pWidth, unsigned short *pHeight,
|
void xsQueryBestSize(int class, unsigned short *pWidth, unsigned short *pHeight,
|
||||||
ScreenPtr pScreen)
|
ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
XCBQueryBestSizeCookie c;
|
xcb_query_best_size_cookie_t c;
|
||||||
XCBQueryBestSizeRep *r;
|
xcb_query_best_size_reply_t *r;
|
||||||
|
|
||||||
|
|
||||||
c = XCBQueryBestSize(xsConnection, class, (XCBDRAWABLE)xsBackingRoot, *pWidth,*pHeight);
|
c = xcb_query_best_size(xsConnection, class, (xcb_drawable_t)xsBackingRoot, *pWidth,*pHeight);
|
||||||
r = XCBQueryBestSizeReply(xsConnection, c, NULL);
|
r = xcb_query_best_size_reply(xsConnection, c, NULL);
|
||||||
|
|
||||||
*pWidth = r->width;
|
*pWidth = r->width;
|
||||||
*pHeight = r->height;
|
*pHeight = r->height;
|
||||||
|
|
@ -58,9 +58,8 @@ void xsPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
|
||||||
int w, int h, int leftPad, int format, char *pImage)
|
int w, int h, int leftPad, int format, char *pImage)
|
||||||
{
|
{
|
||||||
int size;
|
int size;
|
||||||
int i;
|
|
||||||
size = xsPixmapCalcSize(depth, w, h);
|
size = xsPixmapCalcSize(depth, w, h);
|
||||||
XCBPutImage(xsConnection,
|
xcb_put_image(xsConnection,
|
||||||
format,
|
format,
|
||||||
XS_DRAWABLE_ID(pDrawable),
|
XS_DRAWABLE_ID(pDrawable),
|
||||||
XS_GC_PRIV(pGC)->gc,
|
XS_GC_PRIV(pGC)->gc,
|
||||||
|
|
@ -69,17 +68,17 @@ void xsPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
|
||||||
leftPad,
|
leftPad,
|
||||||
depth,
|
depth,
|
||||||
size,
|
size,
|
||||||
(CARD8*) (pImage+leftPad));
|
(uint8_t*) (pImage+leftPad));
|
||||||
}
|
}
|
||||||
|
|
||||||
void xsGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
|
void xsGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
|
||||||
unsigned int format, unsigned long planeMask,
|
unsigned int format, unsigned long planeMask,
|
||||||
char *pImage)
|
char *pImage)
|
||||||
{
|
{
|
||||||
XCBImage *img;
|
xcb_image_t *img;
|
||||||
int length;
|
int length;
|
||||||
|
|
||||||
img = XCBImageGet(xsConnection,
|
img = xcb_image_get(xsConnection,
|
||||||
XS_DRAWABLE_ID(pDrawable),
|
XS_DRAWABLE_ID(pDrawable),
|
||||||
x, y,
|
x, y,
|
||||||
w, h,
|
w, h,
|
||||||
|
|
@ -89,13 +88,13 @@ void xsGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
|
||||||
if (img) {
|
if (img) {
|
||||||
length = img->bytes_per_line * img->height;
|
length = img->bytes_per_line * img->height;
|
||||||
memmove(pImage, img->data, length);
|
memmove(pImage, img->data, length);
|
||||||
XCBImageDestroy(img);
|
xcb_image_destroy(img);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool xsBitBlitPredicate(XCBGenericEvent *event)
|
static Bool xsBitBlitPredicate(xcb_generic_event_t *event)
|
||||||
{
|
{
|
||||||
return (event->response_type == XCBGraphicsExposure || event->response_type == XCBNoExposure);
|
return (event->response_type == XCB_GRAPHICS_EXPOSURE || event->response_type == XCB_NO_EXPOSURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static RegionPtr xsBitBlitHelper(GCPtr pGC)
|
static RegionPtr xsBitBlitHelper(GCPtr pGC)
|
||||||
|
|
@ -104,8 +103,8 @@ static RegionPtr xsBitBlitHelper(GCPtr pGC)
|
||||||
if (!pGC->graphicsExposures)
|
if (!pGC->graphicsExposures)
|
||||||
return NullRegion;
|
return NullRegion;
|
||||||
else {
|
else {
|
||||||
XCBGenericEvent *event;
|
xcb_generic_event_t *event;
|
||||||
XCBGraphicsExposureEvent *exp;
|
xcb_graphics_exposure_event_t *exp;
|
||||||
RegionPtr pReg, pTmpReg;
|
RegionPtr pReg, pTmpReg;
|
||||||
BoxRec Box;
|
BoxRec Box;
|
||||||
Bool pending, overlap;
|
Bool pending, overlap;
|
||||||
|
|
@ -117,16 +116,16 @@ static RegionPtr xsBitBlitHelper(GCPtr pGC)
|
||||||
|
|
||||||
pending = TRUE;
|
pending = TRUE;
|
||||||
while (pending) {
|
while (pending) {
|
||||||
event = XCBPollForEvent(xsConnection, &err);
|
event = xcb_poll_for_event(xsConnection);
|
||||||
if (!event)
|
if (!event)
|
||||||
break;
|
break;
|
||||||
switch (event->response_type) {
|
switch (event->response_type) {
|
||||||
case XCBNoExposure:
|
case XCB_NO_EXPOSURE:
|
||||||
pending = FALSE;
|
pending = FALSE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case XCBGraphicsExposure:
|
case XCB_GRAPHICS_EXPOSURE:
|
||||||
exp = (XCBGraphicsExposureEvent *) event;
|
exp = (xcb_graphics_exposure_event_t *) event;
|
||||||
Box.x1 = exp->x;
|
Box.x1 = exp->x;
|
||||||
Box.y1 = exp->y;
|
Box.y1 = exp->y;
|
||||||
Box.x2 = exp->x + exp->width;
|
Box.x2 = exp->x + exp->width;
|
||||||
|
|
@ -152,7 +151,7 @@ RegionPtr xsCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
|
||||||
GCPtr pGC, int srcx, int srcy, int width, int height,
|
GCPtr pGC, int srcx, int srcy, int width, int height,
|
||||||
int dstx, int dsty)
|
int dstx, int dsty)
|
||||||
{
|
{
|
||||||
XCBCopyArea(xsConnection,
|
xcb_copy_area(xsConnection,
|
||||||
XS_DRAWABLE_ID(pSrcDrawable),
|
XS_DRAWABLE_ID(pSrcDrawable),
|
||||||
XS_DRAWABLE_ID(pDstDrawable),
|
XS_DRAWABLE_ID(pDstDrawable),
|
||||||
XS_GC_PRIV(pGC)->gc,
|
XS_GC_PRIV(pGC)->gc,
|
||||||
|
|
@ -167,7 +166,7 @@ RegionPtr xsCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
|
||||||
GCPtr pGC, int srcx, int srcy, int width, int height,
|
GCPtr pGC, int srcx, int srcy, int width, int height,
|
||||||
int dstx, int dsty, unsigned long plane)
|
int dstx, int dsty, unsigned long plane)
|
||||||
{
|
{
|
||||||
XCBCopyPlane(xsConnection,
|
xcb_copy_plane(xsConnection,
|
||||||
XS_DRAWABLE_ID(pSrcDrawable),
|
XS_DRAWABLE_ID(pSrcDrawable),
|
||||||
XS_DRAWABLE_ID(pDstDrawable),
|
XS_DRAWABLE_ID(pDstDrawable),
|
||||||
XS_GC_PRIV(pGC)->gc,
|
XS_GC_PRIV(pGC)->gc,
|
||||||
|
|
@ -182,112 +181,112 @@ RegionPtr xsCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
|
||||||
void xsPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int nPoints,
|
void xsPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int nPoints,
|
||||||
DDXPointPtr pPoints)
|
DDXPointPtr pPoints)
|
||||||
{
|
{
|
||||||
XCBPolyPoint(xsConnection,
|
xcb_poly_point(xsConnection,
|
||||||
mode,
|
mode,
|
||||||
XS_DRAWABLE_ID(pDrawable),
|
XS_DRAWABLE_ID(pDrawable),
|
||||||
XS_GC_PRIV(pGC)->gc,
|
XS_GC_PRIV(pGC)->gc,
|
||||||
nPoints,
|
nPoints,
|
||||||
(XCBPOINT *)pPoints);
|
(xcb_point_t *)pPoints);
|
||||||
}
|
}
|
||||||
|
|
||||||
void xsPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int nPoints,
|
void xsPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int nPoints,
|
||||||
DDXPointPtr pPoints)
|
DDXPointPtr pPoints)
|
||||||
{
|
{
|
||||||
XCBPolyLine(xsConnection,
|
xcb_poly_line(xsConnection,
|
||||||
mode,
|
mode,
|
||||||
XS_DRAWABLE_ID(pDrawable),
|
XS_DRAWABLE_ID(pDrawable),
|
||||||
XS_GC_PRIV(pGC)->gc,
|
XS_GC_PRIV(pGC)->gc,
|
||||||
nPoints,
|
nPoints,
|
||||||
(XCBPOINT *)pPoints);
|
(xcb_point_t *)pPoints);
|
||||||
}
|
}
|
||||||
|
|
||||||
void xsPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nSegments,
|
void xsPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nSegments,
|
||||||
xSegment *pSegments)
|
xSegment *pSegments)
|
||||||
{
|
{
|
||||||
XCBPolySegment(xsConnection,
|
xcb_poly_segment(xsConnection,
|
||||||
XS_DRAWABLE_ID(pDrawable),
|
XS_DRAWABLE_ID(pDrawable),
|
||||||
XS_GC_PRIV(pGC)->gc,
|
XS_GC_PRIV(pGC)->gc,
|
||||||
nSegments,
|
nSegments,
|
||||||
(XCBSEGMENT *)pSegments);
|
(xcb_segment_t *)pSegments);
|
||||||
}
|
}
|
||||||
|
|
||||||
void xsPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nRectangles,
|
void xsPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nRectangles,
|
||||||
xRectangle *pRectangles)
|
xRectangle *pRectangles)
|
||||||
{
|
{
|
||||||
XCBPolyRectangle(xsConnection,
|
xcb_poly_rectangle(xsConnection,
|
||||||
XS_DRAWABLE_ID(pDrawable),
|
XS_DRAWABLE_ID(pDrawable),
|
||||||
XS_GC_PRIV(pGC)->gc,
|
XS_GC_PRIV(pGC)->gc,
|
||||||
nRectangles,
|
nRectangles,
|
||||||
(XCBRECTANGLE *)pRectangles);
|
(xcb_rectangle_t *)pRectangles);
|
||||||
}
|
}
|
||||||
|
|
||||||
void xsPolyArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc *pArcs)
|
void xsPolyArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc *pArcs)
|
||||||
{
|
{
|
||||||
XCBPolyArc(xsConnection,
|
xcb_poly_arc(xsConnection,
|
||||||
XS_DRAWABLE_ID(pDrawable),
|
XS_DRAWABLE_ID(pDrawable),
|
||||||
XS_GC_PRIV(pGC)->gc,
|
XS_GC_PRIV(pGC)->gc,
|
||||||
nArcs,
|
nArcs,
|
||||||
(XCBARC *)pArcs);
|
(xcb_arc_t *)pArcs);
|
||||||
}
|
}
|
||||||
|
|
||||||
void xsFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape, int mode,
|
void xsFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape, int mode,
|
||||||
int nPoints, DDXPointPtr pPoints)
|
int nPoints, DDXPointPtr pPoints)
|
||||||
{
|
{
|
||||||
XCBFillPoly(xsConnection,
|
xcb_fill_poly(xsConnection,
|
||||||
XS_DRAWABLE_ID(pDrawable),
|
XS_DRAWABLE_ID(pDrawable),
|
||||||
XS_GC_PRIV(pGC)->gc,
|
XS_GC_PRIV(pGC)->gc,
|
||||||
shape,
|
shape,
|
||||||
mode,
|
mode,
|
||||||
nPoints,
|
nPoints,
|
||||||
(XCBPOINT *)pPoints);
|
(xcb_point_t *)pPoints);
|
||||||
}
|
}
|
||||||
|
|
||||||
void xsPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nRectangles,
|
void xsPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nRectangles,
|
||||||
xRectangle *pRectangles)
|
xRectangle *pRectangles)
|
||||||
{
|
{
|
||||||
XCBPolyFillRectangle(xsConnection,
|
xcb_poly_fill_rectangle(xsConnection,
|
||||||
XS_DRAWABLE_ID(pDrawable),
|
XS_DRAWABLE_ID(pDrawable),
|
||||||
XS_GC_PRIV(pGC)->gc,
|
XS_GC_PRIV(pGC)->gc,
|
||||||
nRectangles,
|
nRectangles,
|
||||||
(XCBRECTANGLE*)pRectangles);
|
(xcb_rectangle_t*)pRectangles);
|
||||||
}
|
}
|
||||||
|
|
||||||
void xsPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc *pArcs)
|
void xsPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc *pArcs)
|
||||||
{
|
{
|
||||||
XCBPolyFillArc(xsConnection,
|
xcb_poly_fill_arc(xsConnection,
|
||||||
XS_DRAWABLE_ID(pDrawable),
|
XS_DRAWABLE_ID(pDrawable),
|
||||||
XS_GC_PRIV(pGC)->gc,
|
XS_GC_PRIV(pGC)->gc,
|
||||||
nArcs,
|
nArcs,
|
||||||
(XCBARC *)pArcs);
|
(xcb_arc_t *)pArcs);
|
||||||
}
|
}
|
||||||
|
|
||||||
int xsPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, char *string)
|
int xsPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, char *string)
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
int width, i;
|
int width, i;
|
||||||
XCBCHAR2B *str;
|
xcb_char2b_t *str;
|
||||||
XCBFONTABLE f;
|
xcb_fontable_t f;
|
||||||
XCBQueryTextExtentsCookie c;
|
xcb_query_text_extents_cookie_t c;
|
||||||
XCBQueryTextExtentsRep *r;
|
xcb_query_text_extents_reply_t *r;
|
||||||
XCBGenericError *e;
|
xcb_generic_error_t *e;
|
||||||
|
|
||||||
XCBPolyText8(xsConnection,
|
xcb_poly_text_8(xsConnection,
|
||||||
XS_DRAWABLE_ID(pDrawable),
|
XS_DRAWABLE_ID(pDrawable),
|
||||||
XS_GC_PRIV(pGC)->gc,
|
XS_GC_PRIV(pGC)->gc,
|
||||||
x, y,
|
x, y,
|
||||||
count,
|
count,
|
||||||
(BYTE *)string);
|
(uint8_t *)string);
|
||||||
|
|
||||||
f.font = xsFont(pGC->font);
|
f.font = xsFont(pGC->font);
|
||||||
f.gcontext = XS_GC_PRIV(pGC)->gc;
|
f.gcontext = XS_GC_PRIV(pGC)->gc;
|
||||||
str = xalloc(count * sizeof(XCBCHAR2B));
|
str = xalloc(count * sizeof(xcb_char2b_t));
|
||||||
for (i=0; i<count; i++) {
|
for (i=0; i<count; i++) {
|
||||||
str[i].byte1 = string[i];
|
str[i].byte1 = string[i];
|
||||||
str[i].byte2 = '\0';
|
str[i].byte2 = '\0';
|
||||||
}
|
}
|
||||||
c = XCBQueryTextExtents(xsConnection, f, count, str);
|
c = xcb_query_text_extents(xsConnection, f, count, str);
|
||||||
xfree(str);
|
xfree(str);
|
||||||
r = XCBQueryTextExtentsReply(xsConnection, c, NULL);
|
r = xcb_query_text_extents_reply(xsConnection, c, NULL);
|
||||||
if (r)
|
if (r)
|
||||||
if (!e)
|
if (!e)
|
||||||
width = r->overall_width;
|
width = r->overall_width;
|
||||||
|
|
@ -303,21 +302,21 @@ int xsPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, unsi
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
int width = 0;
|
int width = 0;
|
||||||
XCBFONTABLE f;
|
xcb_fontable_t f;
|
||||||
XCBQueryTextExtentsCookie c;
|
xcb_query_text_extents_cookie_t c;
|
||||||
XCBQueryTextExtentsRep *r;
|
xcb_query_text_extents_reply_t *r;
|
||||||
XCBGenericError *e;
|
xcb_generic_error_t *e;
|
||||||
|
|
||||||
XCBPolyText16(xsConnection,
|
xcb_poly_text_16(xsConnection,
|
||||||
XS_DRAWABLE_ID(pDrawable),
|
XS_DRAWABLE_ID(pDrawable),
|
||||||
XS_GC_PRIV(pGC)->gc,
|
XS_GC_PRIV(pGC)->gc,
|
||||||
x, y,
|
x, y,
|
||||||
count*2,
|
count*2,
|
||||||
(BYTE *)string);
|
(uint8_t *)string);
|
||||||
f.font = xsFont(pGC->font);
|
f.font = xsFont(pGC->font);
|
||||||
f.gcontext = XS_GC_PRIV(pGC)->gc;
|
f.gcontext = XS_GC_PRIV(pGC)->gc;
|
||||||
c = XCBQueryTextExtents(xsConnection, f, count, (XCBCHAR2B*)string);
|
c = xcb_query_text_extents(xsConnection, f, count, (xcb_char2b_t*)string);
|
||||||
r = XCBQueryTextExtentsReply(xsConnection, c, &e);
|
r = xcb_query_text_extents_reply(xsConnection, c, &e);
|
||||||
if (r)
|
if (r)
|
||||||
if (!e)
|
if (!e)
|
||||||
width = r->overall_width;
|
width = r->overall_width;
|
||||||
|
|
@ -330,7 +329,7 @@ int xsPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, unsi
|
||||||
void xsImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count,
|
void xsImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count,
|
||||||
char *string)
|
char *string)
|
||||||
{
|
{
|
||||||
XCBImageText8(xsConnection,
|
xcb_image_text_8(xsConnection,
|
||||||
count,
|
count,
|
||||||
XS_DRAWABLE_ID(pDrawable),
|
XS_DRAWABLE_ID(pDrawable),
|
||||||
XS_GC_PRIV(pGC)->gc,
|
XS_GC_PRIV(pGC)->gc,
|
||||||
|
|
@ -340,12 +339,12 @@ void xsImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count,
|
||||||
|
|
||||||
void xsImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, unsigned short *string)
|
void xsImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, unsigned short *string)
|
||||||
{
|
{
|
||||||
XCBImageText16(xsConnection,
|
xcb_image_text_16(xsConnection,
|
||||||
count,
|
count,
|
||||||
XS_DRAWABLE_ID(pDrawable),
|
XS_DRAWABLE_ID(pDrawable),
|
||||||
XS_GC_PRIV(pGC)->gc,
|
XS_GC_PRIV(pGC)->gc,
|
||||||
x, y,
|
x, y,
|
||||||
(XCBCHAR2B *)string);
|
(xcb_char2b_t *)string);
|
||||||
}
|
}
|
||||||
|
|
||||||
void xsImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
|
void xsImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
|
||||||
|
|
@ -365,30 +364,30 @@ void xsPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
|
||||||
void xsPushPixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDst,
|
void xsPushPixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDst,
|
||||||
int width, int height, int x, int y)
|
int width, int height, int x, int y)
|
||||||
{
|
{
|
||||||
XCBParamsGC param;
|
xcb_params_gc_t param;
|
||||||
XCBRECTANGLE rect;
|
xcb_rectangle_t rect;
|
||||||
/* only works for solid bitmaps */
|
/* only works for solid bitmaps */
|
||||||
if (pGC->fillStyle == FillSolid)
|
if (pGC->fillStyle == FillSolid)
|
||||||
{
|
{
|
||||||
param.stipple = XS_PIXMAP_PRIV(pBitmap)->pixmap.xid;
|
param.stipple = XS_PIXMAP_PRIV(pBitmap)->pixmap;
|
||||||
param.tile_stipple_originX = x;
|
param.tile_stipple_originX = x;
|
||||||
param.tile_stipple_originY = y;
|
param.tile_stipple_originY = y;
|
||||||
param.fill_style = XCBFillStyleStippled;
|
param.fill_style = XCB_FILL_STYLE_STIPPLED;
|
||||||
XCBAuxChangeGC(xsConnection, XS_GC_PRIV(pGC)->gc,
|
xcb_aux_change_gc(xsConnection, XS_GC_PRIV(pGC)->gc,
|
||||||
XCBGCStipple | XCBGCTileStippleOriginX | XCBGCTileStippleOriginY | XCBGCFillStyle,
|
XCB_GC_STIPPLE | XCB_GC_TILE_STIPPLE_ORIGIN_X | XCB_GC_TILE_STIPPLE_ORIGIN_Y | XCB_GC_FILL_STYLE,
|
||||||
¶m);
|
¶m);
|
||||||
rect.x = x;
|
rect.x = x;
|
||||||
rect.y = y;
|
rect.y = y;
|
||||||
rect.width = width;
|
rect.width = width;
|
||||||
rect.height = height;
|
rect.height = height;
|
||||||
XCBPolyFillRectangle (xsConnection,
|
xcb_poly_fill_rectangle (xsConnection,
|
||||||
XS_DRAWABLE_ID(pDst),
|
XS_DRAWABLE_ID(pDst),
|
||||||
XS_GC_PRIV(pGC)->gc,
|
XS_GC_PRIV(pGC)->gc,
|
||||||
1,
|
1,
|
||||||
&rect);
|
&rect);
|
||||||
param.fill_style = XCBFillStyleSolid;
|
param.fill_style = XCB_FILL_STYLE_SOLID;
|
||||||
XCBAuxChangeGC(xsConnection, XS_GC_PRIV(pGC)->gc,
|
xcb_aux_change_gc(xsConnection, XS_GC_PRIV(pGC)->gc,
|
||||||
XCBGCFillStyle,
|
XCB_GC_FILL_STYLE,
|
||||||
¶m);
|
¶m);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
#include <X11/Xmd.h>
|
#include <X11/Xmd.h>
|
||||||
#include <X11/XCB/xcb.h>
|
#include <xcb/xcb.h>
|
||||||
#include "screenint.h"
|
#include "screenint.h"
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
|
|
||||||
|
|
@ -7,9 +7,9 @@
|
||||||
#include "xs-gc.h"
|
#include "xs-gc.h"
|
||||||
#include "xs-window.h"
|
#include "xs-window.h"
|
||||||
|
|
||||||
XCBConnection *xsConnection;
|
xcb_connection_t *xsConnection;
|
||||||
XCBDRAWABLE xsDefaultDrawables[MAXDEPTH];
|
xcb_drawable_t xsDefaultDrawables[MAXDEPTH];
|
||||||
XCBDRAWABLE xsBackingRoot;
|
xcb_drawable_t xsBackingRoot;
|
||||||
int xsFontPrivateIndex;
|
int xsFontPrivateIndex;
|
||||||
int xsGCPrivateIndex;
|
int xsGCPrivateIndex;
|
||||||
int xsWindowPrivateIndex;
|
int xsWindowPrivateIndex;
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,12 @@ typedef enum {
|
||||||
|
|
||||||
#define XS_DRAWABLE_ID(/*DrawablePtr*/ d) \
|
#define XS_DRAWABLE_ID(/*DrawablePtr*/ d) \
|
||||||
(((d)->type == DRAWABLE_WINDOW)? \
|
(((d)->type == DRAWABLE_WINDOW)? \
|
||||||
((XCBDRAWABLE) (XS_WINDOW_PRIV((WindowPtr)(d))->window)) : \
|
((xcb_drawable_t) (XS_WINDOW_PRIV((WindowPtr)(d))->window)) : \
|
||||||
((XCBDRAWABLE) (XS_PIXMAP_PRIV((PixmapPtr)(d))->pixmap)))
|
((xcb_drawable_t) (XS_PIXMAP_PRIV((PixmapPtr)(d))->pixmap)))
|
||||||
|
|
||||||
extern XCBConnection *xsConnection;
|
extern xcb_connection_t *xsConnection;
|
||||||
extern XCBDRAWABLE xsDefaultDrawables[MAXDEPTH];
|
extern xcb_drawable_t xsDefaultDrawables[MAXDEPTH];
|
||||||
extern XCBDRAWABLE xsBackingRoot;
|
extern xcb_drawable_t xsBackingRoot;
|
||||||
extern int xsFontPrivateIndex;
|
extern int xsFontPrivateIndex;
|
||||||
extern int xsGCPrivateIndex;
|
extern int xsGCPrivateIndex;
|
||||||
extern int xsWindowPrivateIndex;
|
extern int xsWindowPrivateIndex;
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,10 @@
|
||||||
/* need to include Xmd before XCB stuff, or
|
/* need to include Xmd before XCB stuff, or
|
||||||
* things get redeclared.*/
|
* things get redeclared.*/
|
||||||
#include <X11/Xmd.h>
|
#include <X11/Xmd.h>
|
||||||
#include <X11/XCB/xcb.h>
|
#include <xcb/xcb.h>
|
||||||
#include <X11/XCB/xcb_aux.h>
|
#include <xcb/xcb_aux.h>
|
||||||
#include <X11/XCB/xproto.h>
|
#include <xcb/xproto.h>
|
||||||
#include <X11/XCB/shape.h>
|
#include <xcb/shape.h>
|
||||||
|
|
||||||
#include "gcstruct.h"
|
#include "gcstruct.h"
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
|
@ -26,12 +26,12 @@
|
||||||
#include "mi.h"
|
#include "mi.h"
|
||||||
|
|
||||||
|
|
||||||
void xsInitPixmapFormats(const XCBSetup *setup, PixmapFormatRec fmts[])
|
static void xsInitPixmapFormats(const xcb_setup_t *setup, PixmapFormatRec fmts[])
|
||||||
{
|
{
|
||||||
XCBFORMAT *bs_fmts; /*formats on backing server*/
|
xcb_format_t *bs_fmts; /*formats on backing server*/
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
bs_fmts = XCBSetupPixmapFormats(setup);
|
bs_fmts = xcb_setup_pixmap_formats(setup);
|
||||||
for (i = 0; i < setup->pixmap_formats_len; i++) {
|
for (i = 0; i < setup->pixmap_formats_len; i++) {
|
||||||
fmts[i].depth = bs_fmts[i].depth;
|
fmts[i].depth = bs_fmts[i].depth;
|
||||||
fmts[i].bitsPerPixel = bs_fmts[i].bits_per_pixel;
|
fmts[i].bitsPerPixel = bs_fmts[i].bits_per_pixel;
|
||||||
|
|
@ -45,13 +45,13 @@ void xsInitPixmapFormats(const XCBSetup *setup, PixmapFormatRec fmts[])
|
||||||
void InitOutput(ScreenInfo *si, int argc, char *argv[])
|
void InitOutput(ScreenInfo *si, int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int screennum;
|
int screennum;
|
||||||
const XCBSetup *setup;
|
const xcb_setup_t *setup;
|
||||||
XCBSCREEN *screen;
|
xcb_screen_t *screen;
|
||||||
char *display;
|
char *display;
|
||||||
|
|
||||||
/*FIXME: add a "-display" option*/
|
/*FIXME: add a "-display" option*/
|
||||||
/*Globals Globals Everywhere.*/
|
/*Globals Globals Everywhere.*/
|
||||||
xsConnection = XCBConnect(NULL, &screennum);
|
xsConnection = xcb_connect(NULL, &screennum);
|
||||||
|
|
||||||
if (!xsConnection) { /* failure to connect */
|
if (!xsConnection) { /* failure to connect */
|
||||||
/* prettify the display name */
|
/* prettify the display name */
|
||||||
|
|
@ -61,11 +61,11 @@ void InitOutput(ScreenInfo *si, int argc, char *argv[])
|
||||||
FatalError("Unable to open display \"%s\".\n", display);
|
FatalError("Unable to open display \"%s\".\n", display);
|
||||||
}
|
}
|
||||||
|
|
||||||
setup = XCBGetSetup(xsConnection);
|
setup = xcb_get_setup(xsConnection);
|
||||||
|
|
||||||
/*set up the root window*/
|
/*set up the root window*/
|
||||||
screen = XCBSetupRootsIter(setup).data;
|
screen = xcb_setup_roots_iterator(setup).data;
|
||||||
xsBackingRoot.window = screen->root;
|
xsBackingRoot = screen->root;
|
||||||
/*initialize the ScreenInfo pixmap/image fields*/
|
/*initialize the ScreenInfo pixmap/image fields*/
|
||||||
si->imageByteOrder = setup->image_byte_order;
|
si->imageByteOrder = setup->image_byte_order;
|
||||||
si->bitmapScanlineUnit = setup->bitmap_format_scanline_unit;
|
si->bitmapScanlineUnit = setup->bitmap_format_scanline_unit;
|
||||||
|
|
|
||||||
|
|
@ -19,10 +19,10 @@
|
||||||
/* need to include Xmd before XCB stuff, or
|
/* need to include Xmd before XCB stuff, or
|
||||||
* things get redeclared.*/
|
* things get redeclared.*/
|
||||||
#include <X11/Xmd.h>
|
#include <X11/Xmd.h>
|
||||||
#include <X11/XCB/xcb.h>
|
#include <xcb/xcb.h>
|
||||||
#include <X11/XCB/xcb_aux.h>
|
#include <xcb/xcb_aux.h>
|
||||||
#include <X11/XCB/xproto.h>
|
#include <xcb/xproto.h>
|
||||||
#include <X11/XCB/shape.h>
|
#include <xcb/shape.h>
|
||||||
|
|
||||||
#include "gcstruct.h"
|
#include "gcstruct.h"
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
|
@ -66,9 +66,9 @@ void OsVendorInit()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void xsChangePointerControl(DeviceIntPtr pDev UNUSED, PtrCtrl *ctl)
|
static void xsChangePointerControl(DeviceIntPtr pDev UNUSED, PtrCtrl *ctl)
|
||||||
{
|
{
|
||||||
XCBChangePointerControl(xsConnection,
|
xcb_change_pointer_control(xsConnection,
|
||||||
ctl->num, ctl->den,
|
ctl->num, ctl->den,
|
||||||
ctl->threshold,
|
ctl->threshold,
|
||||||
TRUE, TRUE);
|
TRUE, TRUE);
|
||||||
|
|
@ -76,19 +76,19 @@ void xsChangePointerControl(DeviceIntPtr pDev UNUSED, PtrCtrl *ctl)
|
||||||
/**
|
/**
|
||||||
* Manages initializing and setting up the pointer.
|
* Manages initializing and setting up the pointer.
|
||||||
**/
|
**/
|
||||||
int xsPtrProc(DeviceIntPtr pDev, int state)
|
static int xsPtrProc(DeviceIntPtr pDev, int state)
|
||||||
{
|
{
|
||||||
CARD8 map[MAX_BUTTONS];
|
uint8_t map[MAX_BUTTONS];
|
||||||
XCBGetPointerMappingCookie c;
|
xcb_get_pointer_mapping_cookie_t c;
|
||||||
XCBGetPointerMappingRep *r;
|
xcb_get_pointer_mapping_reply_t *r;
|
||||||
int nmap;
|
int nmap;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case DEVICE_INIT:
|
case DEVICE_INIT:
|
||||||
c = XCBGetPointerMapping(xsConnection);
|
c = xcb_get_pointer_mapping(xsConnection);
|
||||||
r = XCBGetPointerMappingReply(xsConnection, c, NULL);
|
r = xcb_get_pointer_mapping_reply(xsConnection, c, NULL);
|
||||||
nmap = r->map_len;
|
nmap = r->map_len;
|
||||||
for (i = 0; i <= nmap; i++)
|
for (i = 0; i <= nmap; i++)
|
||||||
map[i] = i; /* buttons are already mapped */
|
map[i] = i; /* buttons are already mapped */
|
||||||
|
|
@ -110,13 +110,13 @@ int xsPtrProc(DeviceIntPtr pDev, int state)
|
||||||
**/
|
**/
|
||||||
|
|
||||||
/* no-op function */
|
/* no-op function */
|
||||||
void xsBell(int vol UNUSED, DeviceIntPtr pDev UNUSED, pointer ctl UNUSED, int wtf_is_this UNUSED)
|
static void xsBell(int vol UNUSED, DeviceIntPtr pDev UNUSED, pointer ctl UNUSED, int wtf_is_this UNUSED)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*no-op function*/
|
/*no-op function*/
|
||||||
void xsKbdCtl(DeviceIntPtr pDev UNUSED, KeybdCtrl *ctl UNUSED)
|
static void xsKbdCtl(DeviceIntPtr pDev UNUSED, KeybdCtrl *ctl UNUSED)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -124,29 +124,29 @@ void xsKbdCtl(DeviceIntPtr pDev UNUSED, KeybdCtrl *ctl UNUSED)
|
||||||
/**
|
/**
|
||||||
* Manages initializing and setting up the keyboard.
|
* Manages initializing and setting up the keyboard.
|
||||||
**/
|
**/
|
||||||
int xsKbdProc(DeviceIntPtr pDev, int state)
|
static int xsKbdProc(DeviceIntPtr pDev, int state)
|
||||||
{
|
{
|
||||||
const XCBSetup *setup;
|
const xcb_setup_t *setup;
|
||||||
XCBGetKeyboardMappingCookie mapcook;
|
xcb_get_keyboard_mapping_cookie_t mapcook;
|
||||||
XCBGetKeyboardMappingRep *maprep;
|
xcb_get_keyboard_mapping_reply_t *maprep;
|
||||||
XCBGetModifierMappingCookie modcook;
|
xcb_get_modifier_mapping_cookie_t modcook;
|
||||||
XCBGetModifierMappingRep *modrep;
|
xcb_get_modifier_mapping_reply_t *modrep;
|
||||||
XCBGetKeyboardControlCookie ctlcook;
|
xcb_get_keyboard_control_cookie_t ctlcook;
|
||||||
XCBGetKeyboardControlRep *ctlrep;
|
xcb_get_keyboard_control_reply_t *ctlrep;
|
||||||
|
|
||||||
|
|
||||||
XCBKEYCODE min;
|
xcb_keycode_t min;
|
||||||
XCBKEYCODE max;
|
xcb_keycode_t max;
|
||||||
XCBKEYSYM *keysyms;
|
xcb_keysym_t *keysyms;
|
||||||
XCBKEYCODE *modcodes;
|
xcb_keycode_t *modcodes;
|
||||||
|
|
||||||
KeySymsRec keys;
|
KeySymsRec keys;
|
||||||
CARD8 modmap[MAP_LENGTH] = {0};
|
uint8_t modmap[MAP_LENGTH] = {0};
|
||||||
CARD8 keycode;
|
uint8_t keycode;
|
||||||
int i;
|
int i;
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
setup = XCBGetSetup(xsConnection);
|
setup = xcb_get_setup(xsConnection);
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case DEVICE_INIT:
|
case DEVICE_INIT:
|
||||||
|
|
@ -154,36 +154,36 @@ int xsKbdProc(DeviceIntPtr pDev, int state)
|
||||||
max = setup->max_keycode;
|
max = setup->max_keycode;
|
||||||
|
|
||||||
/*do all the requests*/
|
/*do all the requests*/
|
||||||
mapcook = XCBGetKeyboardMapping(xsConnection, min, max.id - min.id);
|
mapcook = xcb_get_keyboard_mapping(xsConnection, min, max - min);
|
||||||
modcook = XCBGetModifierMapping(xsConnection);
|
modcook = xcb_get_modifier_mapping(xsConnection);
|
||||||
ctlcook = XCBGetKeyboardControl(xsConnection);
|
ctlcook = xcb_get_keyboard_control(xsConnection);
|
||||||
|
|
||||||
/*wait for the keyboard mapping*/
|
/*wait for the keyboard mapping*/
|
||||||
maprep = XCBGetKeyboardMappingReply(xsConnection, mapcook, NULL);
|
maprep = xcb_get_keyboard_mapping_reply(xsConnection, mapcook, NULL);
|
||||||
keysyms = XCBGetKeyboardMappingKeysyms(maprep);
|
keysyms = xcb_get_keyboard_mapping_keysyms(maprep);
|
||||||
|
|
||||||
/* initialize the keycode list*/
|
/* initialize the keycode list*/
|
||||||
keys.minKeyCode = min.id;
|
keys.minKeyCode = min;
|
||||||
keys.maxKeyCode = max.id;
|
keys.maxKeyCode = max;
|
||||||
keys.mapWidth = maprep->keysyms_per_keycode;
|
keys.mapWidth = maprep->keysyms_per_keycode;
|
||||||
keys.map = (KeySym *)keysyms;
|
keys.map = (KeySym *)keysyms;
|
||||||
|
|
||||||
/*wait for the modifier mapping*/
|
/*wait for the modifier mapping*/
|
||||||
modrep = XCBGetModifierMappingReply(xsConnection, modcook, NULL);
|
modrep = xcb_get_modifier_mapping_reply(xsConnection, modcook, NULL);
|
||||||
modcodes = XCBGetModifierMappingKeycodes(modrep);
|
modcodes = xcb_get_modifier_mapping_keycodes(modrep);
|
||||||
|
|
||||||
|
|
||||||
/*initialize the modifiers*/
|
/*initialize the modifiers*/
|
||||||
for (j = 0; j < 8; j++) {
|
for (j = 0; j < 8; j++) {
|
||||||
for (i = 0; i < modrep->keycodes_per_modifier; i++) {
|
for (i = 0; i < modrep->keycodes_per_modifier; i++) {
|
||||||
keycode = modcodes[j * modrep->keycodes_per_modifier + i].id;
|
keycode = modcodes[j * modrep->keycodes_per_modifier + i];
|
||||||
if (keycode != 0)
|
if (keycode != 0)
|
||||||
modmap[keycode] |= 1<<j;
|
modmap[keycode] |= 1<<j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*wait for the ctl values*/
|
/*wait for the ctl values*/
|
||||||
ctlrep = XCBGetKeyboardControlReply(xsConnection, ctlcook, NULL);
|
ctlrep = xcb_get_keyboard_control_reply(xsConnection, ctlcook, NULL);
|
||||||
/*initialize the auto repeats*/
|
/*initialize the auto repeats*/
|
||||||
memmove(defaultKeyboardControl.autoRepeats,
|
memmove(defaultKeyboardControl.autoRepeats,
|
||||||
ctlrep->auto_repeats,
|
ctlrep->auto_repeats,
|
||||||
|
|
@ -206,13 +206,13 @@ int xsKbdProc(DeviceIntPtr pDev, int state)
|
||||||
* XCB.
|
* XCB.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
void xsBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadMask)
|
static void xsBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadMask)
|
||||||
{
|
{
|
||||||
/*handle events here*/
|
/*handle events here*/
|
||||||
XCBFlush(xsConnection);
|
xcb_flush(xsConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
void xsWakeupHandler(pointer blockData, int result, pointer pReadMask)
|
static void xsWakeupHandler(pointer blockData, int result, pointer pReadMask)
|
||||||
{
|
{
|
||||||
/*handle events here*/
|
/*handle events here*/
|
||||||
}
|
}
|
||||||
|
|
@ -227,7 +227,7 @@ void InitInput(int argc, char *argv[])
|
||||||
|
|
||||||
mieqInit(xsKbd, xsPtr);
|
mieqInit(xsKbd, xsPtr);
|
||||||
|
|
||||||
AddEnabledDevice(XCBGetFileDescriptor(xsConnection));
|
AddEnabledDevice(xcb_get_file_descriptor(xsConnection));
|
||||||
RegisterBlockAndWakeupHandlers(xsBlockHandler, xsWakeupHandler, NULL);
|
RegisterBlockAndWakeupHandlers(xsBlockHandler, xsWakeupHandler, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,9 @@ is" without express or implied warranty.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <X11/Xmd.h>
|
#include <X11/Xmd.h>
|
||||||
#include <X11/XCB/xcb.h>
|
#include <xcb/xcb.h>
|
||||||
#include <X11/XCB/xproto.h>
|
#include <xcb/xproto.h>
|
||||||
#include <X11/XCB/xcb_image.h>
|
#include <xcb/xcb_image.h>
|
||||||
#include "regionstr.h"
|
#include "regionstr.h"
|
||||||
#include "pixmapstr.h"
|
#include "pixmapstr.h"
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
|
|
@ -38,7 +38,7 @@ int XS_PIXMAP_PRIVIndex;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int xsNumFormats;
|
static int xsNumFormats;
|
||||||
static XCBFORMAT *xsFormats;
|
static xcb_format_t *xsFormats;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the list of available formats, used
|
* Initializes the list of available formats, used
|
||||||
|
|
@ -46,11 +46,11 @@ static XCBFORMAT *xsFormats;
|
||||||
**/
|
**/
|
||||||
void xsInitFormats()
|
void xsInitFormats()
|
||||||
{
|
{
|
||||||
const XCBSetup *setup;
|
const xcb_setup_t *setup;
|
||||||
|
|
||||||
setup = XCBGetSetup(xsConnection);
|
setup = xcb_get_setup(xsConnection);
|
||||||
xsNumFormats = XCBSetupPixmapFormatsLength(setup);
|
xsNumFormats = xcb_setup_pixmap_formats_length(setup);
|
||||||
xsFormats = XCBSetupPixmapFormats(setup);
|
xsFormats = xcb_setup_pixmap_formats(setup);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -105,14 +105,14 @@ PixmapPtr xsCreatePixmap(ScreenPtr pScreen, int width, int height, int depth)
|
||||||
pPixmap->devPrivate.ptr = (pointer)(pPixmap + 1);
|
pPixmap->devPrivate.ptr = (pointer)(pPixmap + 1);
|
||||||
#endif
|
#endif
|
||||||
if (width && height){
|
if (width && height){
|
||||||
XS_PIXMAP_PRIV(pPixmap)->pixmap = XCBPIXMAPNew(xsConnection);
|
XS_PIXMAP_PRIV(pPixmap)->pixmap = xcb_generate_id(xsConnection);
|
||||||
XCBCreatePixmap(xsConnection,
|
xcb_create_pixmap(xsConnection,
|
||||||
depth,
|
depth,
|
||||||
XS_PIXMAP_PRIV(pPixmap)->pixmap,
|
XS_PIXMAP_PRIV(pPixmap)->pixmap,
|
||||||
xsBackingRoot,
|
xsBackingRoot,
|
||||||
width, height);
|
width, height);
|
||||||
} else
|
} else
|
||||||
XS_PIXMAP_PRIV(pPixmap)->pixmap.xid = 0;
|
XS_PIXMAP_PRIV(pPixmap)->pixmap = 0;
|
||||||
|
|
||||||
return pPixmap;
|
return pPixmap;
|
||||||
}
|
}
|
||||||
|
|
@ -124,7 +124,7 @@ Bool xsDestroyPixmap(PixmapPtr pPixmap)
|
||||||
{
|
{
|
||||||
if(--pPixmap->refcnt)
|
if(--pPixmap->refcnt)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
XCBFreePixmap(xsConnection, XS_PIXMAP_PRIV(pPixmap)->pixmap);
|
xcb_free_pixmap(xsConnection, XS_PIXMAP_PRIV(pPixmap)->pixmap);
|
||||||
xfree(pPixmap);
|
xfree(pPixmap);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
@ -134,15 +134,15 @@ Bool xsDestroyPixmap(PixmapPtr pPixmap)
|
||||||
**/
|
**/
|
||||||
RegionPtr xsPixmapToRegion(PixmapPtr pPixmap)
|
RegionPtr xsPixmapToRegion(PixmapPtr pPixmap)
|
||||||
{
|
{
|
||||||
XCBImage *ximage;
|
xcb_image_t *ximage;
|
||||||
register RegionPtr pReg, pTmpReg;
|
register RegionPtr pReg, pTmpReg;
|
||||||
register int x, y;
|
register int x, y;
|
||||||
unsigned long previousPixel, currentPixel;
|
unsigned long previousPixel, currentPixel;
|
||||||
BoxRec Box;
|
BoxRec Box;
|
||||||
Bool overlap;
|
Bool overlap;
|
||||||
|
|
||||||
ximage = XCBImageGet(xsConnection,
|
ximage = xcb_image_get(xsConnection,
|
||||||
(XCBDRAWABLE)XS_PIXMAP_PRIV(pPixmap)->pixmap,
|
(xcb_drawable_t)XS_PIXMAP_PRIV(pPixmap)->pixmap,
|
||||||
0, 0,
|
0, 0,
|
||||||
pPixmap->drawable.width, pPixmap->drawable.height,
|
pPixmap->drawable.width, pPixmap->drawable.height,
|
||||||
1,
|
1,
|
||||||
|
|
@ -151,7 +151,7 @@ RegionPtr xsPixmapToRegion(PixmapPtr pPixmap)
|
||||||
pReg = REGION_CREATE(pPixmap->drawable.pScreen, NULL, 1);
|
pReg = REGION_CREATE(pPixmap->drawable.pScreen, NULL, 1);
|
||||||
pTmpReg = REGION_CREATE(pPixmap->drawable.pScreen, NULL, 1);
|
pTmpReg = REGION_CREATE(pPixmap->drawable.pScreen, NULL, 1);
|
||||||
if(!pReg || !pTmpReg) {
|
if(!pReg || !pTmpReg) {
|
||||||
XCBImageDestroy(ximage);
|
xcb_image_destroy(ximage);
|
||||||
return NullRegion;
|
return NullRegion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -160,7 +160,7 @@ RegionPtr xsPixmapToRegion(PixmapPtr pPixmap)
|
||||||
Box.y2 = y + 1;
|
Box.y2 = y + 1;
|
||||||
previousPixel = 0L;
|
previousPixel = 0L;
|
||||||
for (x = 0; x < pPixmap->drawable.width; x++) {
|
for (x = 0; x < pPixmap->drawable.width; x++) {
|
||||||
currentPixel = XCBImageGetPixel(ximage, x, y);
|
currentPixel = xcb_image_get_pixel(ximage, x, y);
|
||||||
if (previousPixel != currentPixel) {
|
if (previousPixel != currentPixel) {
|
||||||
if (previousPixel == 0L) {
|
if (previousPixel == 0L) {
|
||||||
/* left edge */
|
/* left edge */
|
||||||
|
|
@ -184,7 +184,7 @@ RegionPtr xsPixmapToRegion(PixmapPtr pPixmap)
|
||||||
}
|
}
|
||||||
|
|
||||||
REGION_DESTROY(pPixmap->drawable.pScreen, pTmpReg);
|
REGION_DESTROY(pPixmap->drawable.pScreen, pTmpReg);
|
||||||
XCBImageDestroy(ximage);
|
xcb_image_destroy(ximage);
|
||||||
|
|
||||||
REGION_VALIDATE(pPixmap->drawable.pScreen, pReg, &overlap);
|
REGION_VALIDATE(pPixmap->drawable.pScreen, pReg, &overlap);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ extern int xsPixmapPrivateIndex;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
XCBPIXMAP pixmap;
|
xcb_pixmap_t pixmap;
|
||||||
XSOwnership owned;
|
XSOwnership owned;
|
||||||
} XscreenPrivPixmap;
|
} XscreenPrivPixmap;
|
||||||
|
|
||||||
|
|
@ -18,7 +18,7 @@ typedef struct {
|
||||||
((XscreenPrivPixmap *)((pPixmap)->devPrivate.ptr))
|
((XscreenPrivPixmap *)((pPixmap)->devPrivate.ptr))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void xsInitFormats();
|
void xsInitFormats(void);
|
||||||
int xsPixmapCalcSize(int depth, int w, int h);
|
int xsPixmapCalcSize(int depth, int w, int h);
|
||||||
PixmapPtr xsCreatePixmap(ScreenPtr pScreen, int width, int height, int depth);
|
PixmapPtr xsCreatePixmap(ScreenPtr pScreen, int width, int height, int depth);
|
||||||
Bool xsDestroyPixmap(PixmapPtr pPixmap);
|
Bool xsDestroyPixmap(PixmapPtr pPixmap);
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,10 @@
|
||||||
/* need to include Xmd before XCB stuff, or
|
/* need to include Xmd before XCB stuff, or
|
||||||
* things get redeclared.*/
|
* things get redeclared.*/
|
||||||
#include <X11/Xmd.h>
|
#include <X11/Xmd.h>
|
||||||
#include <X11/XCB/xcb.h>
|
#include <xcb/xcb.h>
|
||||||
#include <X11/XCB/xcb_aux.h>
|
#include <xcb/xcb_aux.h>
|
||||||
#include <X11/XCB/xproto.h>
|
#include <xcb/xproto.h>
|
||||||
#include <X11/XCB/shape.h>
|
#include <xcb/shape.h>
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
#include "dix.h"
|
#include "dix.h"
|
||||||
#include "mi.h"
|
#include "mi.h"
|
||||||
|
|
|
||||||
|
|
@ -19,23 +19,23 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <X11/Xmd.h>
|
#include <X11/Xmd.h>
|
||||||
#include <X11/XCB/xcb.h>
|
#include <xcb/xcb.h>
|
||||||
#include <X11/XCB/xproto.h>
|
#include <xcb/xproto.h>
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
#include "dix.h"
|
#include "dix.h"
|
||||||
#include "mi.h"
|
#include "mi.h"
|
||||||
#include "mibstore.h"
|
#include "mibstore.h"
|
||||||
|
|
||||||
static int num_visuals = 0;
|
static int num_visuals = 0;
|
||||||
static XCBVISUALTYPE *visuals;
|
static xcb_visualtype_t *visuals;
|
||||||
static CARD8 *depths;
|
static uint8_t *depths;
|
||||||
|
|
||||||
void xsInitVisuals()
|
static void xsInitVisuals(void)
|
||||||
{
|
{
|
||||||
/*initialize the visuals*/
|
/*initialize the visuals*/
|
||||||
}
|
}
|
||||||
|
|
||||||
XCBVISUALTYPE *xsGetVisual(VisualPtr pVisual)
|
xcb_visualtype_t *xsGetVisual(VisualPtr pVisual)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
@ -52,30 +52,30 @@ XCBVISUALTYPE *xsGetVisual(VisualPtr pVisual)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
XCBVISUALTYPE *visualFromID(ScreenPtr pScreen, XCBVISUALID visual)
|
static xcb_visualtype_t *visualFromID(ScreenPtr pScreen, xcb_visualid_t visual)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < pScreen->numVisuals; i++)
|
for (i = 0; i < pScreen->numVisuals; i++)
|
||||||
if (pScreen->visuals[i].vid == visual.id)
|
if (pScreen->visuals[i].vid == visual)
|
||||||
return xsGetVisual(&pScreen->visuals[i]);
|
return xsGetVisual(&pScreen->visuals[i]);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
XCBVISUALTYPE *xsGetDefaultVisual(ScreenPtr pScreen)
|
static xcb_visualtype_t *xsGetDefaultVisual(ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
XCBVISUALID v;
|
xcb_visualid_t v;
|
||||||
|
|
||||||
v.id = pScreen->rootVisual;
|
v = pScreen->rootVisual;
|
||||||
return visualFromID(pScreen, v);
|
return visualFromID(pScreen, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
XCBCOLORMAP xsDefaultVisualColormap(XCBVISUALTYPE *visual)
|
xcb_colormap_t xsDefaultVisualColormap(xcb_visualtype_t *visual)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
XCBCOLORMAP noneCmap = { 0 };
|
xcb_colormap_t noneCmap = { 0 };
|
||||||
|
|
||||||
for (i = 0; i < num_visuals; i++)
|
for (i = 0; i < num_visuals; i++)
|
||||||
if (&visuals[i] == visual)
|
if (&visuals[i] == visual)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
XCBVISUALTYPE *xsGetVisual(VisualPtr pVisual);
|
xcb_visualtype_t *xsGetVisual(VisualPtr pVisual);
|
||||||
XCBVISUALTYPE *xsGetVisualFromID(ScreenPtr pScreen, XCBVISUALID visual);
|
xcb_visualtype_t *xsGetVisualFromID(ScreenPtr pScreen, xcb_visualid_t visual);
|
||||||
XCBVISUALTYPE *xsGetDefaultVisual(ScreenPtr pScreen);
|
xcb_visualtype_t *xsGetDefaultVisual(ScreenPtr pScreen);
|
||||||
XCBCOLORMAP xsDefaultVisualColormap(XCBVISUALTYPE *visual);
|
xcb_colormap_t xsDefaultVisualColormap(xcb_visualtype_t *visual);
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
#include <xs-config.h>
|
#include <xs-config.h>
|
||||||
#endif
|
#endif
|
||||||
#include <X11/Xmd.h>
|
#include <X11/Xmd.h>
|
||||||
#include <X11/XCB/xcb.h>
|
#include <xcb/xcb.h>
|
||||||
#include <X11/XCB/xcb_aux.h>
|
#include <xcb/xcb_aux.h>
|
||||||
#include <X11/XCB/xproto.h>
|
#include <xcb/xproto.h>
|
||||||
#include <X11/XCB/xcb_image.h>
|
#include <xcb/xcb_image.h>
|
||||||
#include "regionstr.h"
|
#include "regionstr.h"
|
||||||
#include <X11/fonts/fontstruct.h>
|
#include <X11/fonts/fontstruct.h>
|
||||||
#include "gcstruct.h"
|
#include "gcstruct.h"
|
||||||
|
|
@ -25,20 +25,20 @@
|
||||||
#include "xs-gc.h"
|
#include "xs-gc.h"
|
||||||
|
|
||||||
/*Forward decls*/
|
/*Forward decls*/
|
||||||
static WindowPtr xsTrackWindow(XCBWINDOW win, WindowPtr pParent);
|
static WindowPtr xsTrackWindow(xcb_window_t win, WindowPtr pParent);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the WindowPtr of a window with a given XID on the backing server.
|
* returns the WindowPtr of a window with a given XID on the backing server.
|
||||||
* if the window is not tracked by Xnest, NULL is returned.
|
* if the window is not tracked by Xnest, NULL is returned.
|
||||||
**/
|
**/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
XCBWINDOW win;
|
xcb_window_t win;
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
} XsWindowMatch;
|
} XsWindowMatch;
|
||||||
|
|
||||||
static int xsMatchFunc(WindowPtr pWin, XsWindowMatch *wm)
|
static int xsMatchFunc(WindowPtr pWin, XsWindowMatch *wm)
|
||||||
{
|
{
|
||||||
if (wm->win.xid == XS_WINDOW_PRIV(pWin)->window.xid) {
|
if (wm->win == XS_WINDOW_PRIV(pWin)->window) {
|
||||||
wm->pWin = pWin;
|
wm->pWin = pWin;
|
||||||
return WT_STOPWALKING;
|
return WT_STOPWALKING;
|
||||||
}
|
}
|
||||||
|
|
@ -46,10 +46,9 @@ static int xsMatchFunc(WindowPtr pWin, XsWindowMatch *wm)
|
||||||
return WT_WALKCHILDREN;
|
return WT_WALKCHILDREN;
|
||||||
}
|
}
|
||||||
|
|
||||||
WindowPtr xsGetWindow(XCBWINDOW window)
|
static WindowPtr xsGetWindow(xcb_window_t window)
|
||||||
{
|
{
|
||||||
XsWindowMatch wm;
|
XsWindowMatch wm;
|
||||||
int i;
|
|
||||||
|
|
||||||
wm.pWin = NULL;
|
wm.pWin = NULL;
|
||||||
wm.win = window;
|
wm.win = window;
|
||||||
|
|
@ -61,7 +60,7 @@ WindowPtr xsGetWindow(XCBWINDOW window)
|
||||||
/**
|
/**
|
||||||
* Removes a window from the window tree, rearranging the siblings.
|
* Removes a window from the window tree, rearranging the siblings.
|
||||||
**/
|
**/
|
||||||
void xsRemoveWindow(WindowPtr pWin)
|
static void xsRemoveWindow(WindowPtr pWin)
|
||||||
{
|
{
|
||||||
WindowPtr pPrev;
|
WindowPtr pPrev;
|
||||||
WindowPtr pNext;
|
WindowPtr pNext;
|
||||||
|
|
@ -88,7 +87,7 @@ void xsRemoveWindow(WindowPtr pWin)
|
||||||
* Inserts a window into the window tree.
|
* Inserts a window into the window tree.
|
||||||
* pParent must NOT be NULL, ie: this must NOT be called on the root window.
|
* pParent must NOT be NULL, ie: this must NOT be called on the root window.
|
||||||
**/
|
**/
|
||||||
void xsInsertWindow(WindowPtr pWin, WindowPtr pParent)
|
static void xsInsertWindow(WindowPtr pWin, WindowPtr pParent)
|
||||||
{
|
{
|
||||||
WindowPtr pPrev;
|
WindowPtr pPrev;
|
||||||
|
|
||||||
|
|
@ -130,7 +129,7 @@ void xsInsertWindow(WindowPtr pWin, WindowPtr pParent)
|
||||||
**/
|
**/
|
||||||
static void xsInitWindow(WindowPtr pWin, WindowPtr pParent, int x, int y, int w, int h, int bw)
|
static void xsInitWindow(WindowPtr pWin, WindowPtr pParent, int x, int y, int w, int h, int bw)
|
||||||
{
|
{
|
||||||
XCBWINDOW win;
|
xcb_window_t win;
|
||||||
int parent_x, parent_y;
|
int parent_x, parent_y;
|
||||||
|
|
||||||
win = XS_WINDOW_PRIV(pWin)->window;
|
win = XS_WINDOW_PRIV(pWin)->window;
|
||||||
|
|
@ -239,30 +238,30 @@ static void xsInitWindow(WindowPtr pWin, WindowPtr pParent, int x, int y, int w,
|
||||||
* the backing server *must* be grabbed when calling this function, since this
|
* the backing server *must* be grabbed when calling this function, since this
|
||||||
* function doesn't do the server grab on it's own
|
* function doesn't do the server grab on it's own
|
||||||
**/
|
**/
|
||||||
static void xsTrackChildren(WindowPtr pParent, CARD32 ev_mask)
|
static void xsTrackChildren(WindowPtr pParent, uint32_t ev_mask)
|
||||||
{
|
{
|
||||||
XCBWINDOW win;
|
xcb_window_t win;
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
XCBQueryTreeCookie qcook;
|
xcb_query_tree_cookie_t qcook;
|
||||||
XCBQueryTreeRep *qrep;
|
xcb_query_tree_reply_t *qrep;
|
||||||
XCBGetGeometryCookie gcook;
|
xcb_get_geometry_cookie_t gcook;
|
||||||
XCBGetGeometryRep *grep;
|
xcb_get_geometry_reply_t *grep;
|
||||||
XCBWINDOW *child;
|
xcb_window_t *child;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
win = XS_WINDOW_PRIV(pParent)->window;
|
win = XS_WINDOW_PRIV(pParent)->window;
|
||||||
qcook = XCBQueryTree(xsConnection, win);
|
qcook = xcb_query_tree(xsConnection, win);
|
||||||
qrep = XCBQueryTreeReply(xsConnection, qcook, NULL);
|
qrep = xcb_query_tree_reply(xsConnection, qcook, NULL);
|
||||||
child = XCBQueryTreeChildren(qrep);
|
child = xcb_query_tree_children(qrep);
|
||||||
for (i=0; i < qrep->children_len; i++) {
|
for (i=0; i < qrep->children_len; i++) {
|
||||||
pWin = xsGetWindow(child[i]);
|
pWin = xsGetWindow(child[i]);
|
||||||
if (!pWin){
|
if (!pWin){
|
||||||
gcook = XCBGetGeometry(xsConnection, (XCBDRAWABLE)child[i]);
|
gcook = xcb_get_geometry(xsConnection, (xcb_drawable_t)child[i]);
|
||||||
grep = XCBGetGeometryReply(xsConnection, gcook, NULL);
|
grep = xcb_get_geometry_reply(xsConnection, gcook, NULL);
|
||||||
pWin = AllocateWindow(pParent->drawable.pScreen);
|
pWin = AllocateWindow(pParent->drawable.pScreen);
|
||||||
XS_WINDOW_PRIV(pWin)->window = child[i];
|
XS_WINDOW_PRIV(pWin)->window = child[i];
|
||||||
xsInitWindow(pWin, pParent, grep->x, grep->y, grep->width, grep->height, grep->border_width);
|
xsInitWindow(pWin, pParent, grep->x, grep->y, grep->width, grep->height, grep->border_width);
|
||||||
XCBChangeWindowAttributes(xsConnection, child[i], XCBCWEventMask, &ev_mask);
|
xcb_change_window_attributes(xsConnection, child[i], XCB_CW_EVENT_MASK, &ev_mask);
|
||||||
} else {
|
} else {
|
||||||
xsRemoveWindow(pWin);
|
xsRemoveWindow(pWin);
|
||||||
}
|
}
|
||||||
|
|
@ -274,16 +273,16 @@ static void xsTrackChildren(WindowPtr pParent, CARD32 ev_mask)
|
||||||
* Allocates a new WindowPtr, and tracks it, inserting it into the
|
* Allocates a new WindowPtr, and tracks it, inserting it into the
|
||||||
* window tree. Assumes that pParent is the parent of the window.
|
* window tree. Assumes that pParent is the parent of the window.
|
||||||
**/
|
**/
|
||||||
static WindowPtr xsTrackWindow(XCBWINDOW win, WindowPtr pParent)
|
static WindowPtr xsTrackWindow(xcb_window_t win, WindowPtr pParent)
|
||||||
{
|
{
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
CARD32 ev_mask;
|
uint32_t ev_mask;
|
||||||
XCBGetGeometryCookie gcook;
|
xcb_get_geometry_cookie_t gcook;
|
||||||
XCBGetGeometryRep *grep;
|
xcb_get_geometry_reply_t *grep;
|
||||||
|
|
||||||
pWin = AllocateWindow(pParent->drawable.pScreen);
|
pWin = AllocateWindow(pParent->drawable.pScreen);
|
||||||
gcook = XCBGetGeometry(xsConnection, (XCBDRAWABLE)win);
|
gcook = xcb_get_geometry(xsConnection, (xcb_drawable_t)win);
|
||||||
grep = XCBGetGeometryReply(xsConnection, gcook, NULL);
|
grep = xcb_get_geometry_reply(xsConnection, gcook, NULL);
|
||||||
|
|
||||||
/*initialize the window*/
|
/*initialize the window*/
|
||||||
xsInitWindow(pWin, pParent,
|
xsInitWindow(pWin, pParent,
|
||||||
|
|
@ -292,13 +291,13 @@ static WindowPtr xsTrackWindow(XCBWINDOW win, WindowPtr pParent)
|
||||||
grep->border_width);
|
grep->border_width);
|
||||||
|
|
||||||
/*set the event mask*/
|
/*set the event mask*/
|
||||||
ev_mask = XCBEventMaskSubstructureNotify|XCBEventMaskStructureNotify;
|
ev_mask = XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY|XCB_EVENT_MASK_STRUCTURE_NOTIFY;
|
||||||
XCBChangeWindowAttributes(xsConnection, win, XCBCWEventMask, &ev_mask);
|
xcb_change_window_attributes(xsConnection, win, XCB_CW_EVENT_MASK, &ev_mask);
|
||||||
|
|
||||||
/*make sure we've got all the children of the window*/
|
/*make sure we've got all the children of the window*/
|
||||||
XCBGrabServer(xsConnection);
|
xcb_grab_server(xsConnection);
|
||||||
xsTrackChildren(pWin, ev_mask);
|
xsTrackChildren(pWin, ev_mask);
|
||||||
XCBUngrabServer(xsConnection);
|
xcb_ungrab_server(xsConnection);
|
||||||
return pWin;
|
return pWin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -309,15 +308,15 @@ static WindowPtr xsTrackWindow(XCBWINDOW win, WindowPtr pParent)
|
||||||
**/
|
**/
|
||||||
Bool xsCreateWindow(WindowPtr pWin)
|
Bool xsCreateWindow(WindowPtr pWin)
|
||||||
{
|
{
|
||||||
CARD32 mask;
|
uint32_t mask;
|
||||||
CARD32 ev_mask;
|
uint32_t ev_mask;
|
||||||
XCBSCREEN *screen;
|
xcb_screen_t *screen;
|
||||||
XCBVISUALID vid;
|
xcb_visualid_t vid;
|
||||||
XCBParamsCW params;
|
xcb_params_cw_t params;
|
||||||
|
|
||||||
/* Inits too much for CreateWindow calls, but.. well.. otherwise we'd
|
/* Inits too much for CreateWindow calls, but.. well.. otherwise we'd
|
||||||
* duplicate code. */
|
* duplicate code. */
|
||||||
screen = XCBSetupRootsIter (XCBGetSetup (xsConnection)).data;
|
screen = xcb_setup_roots_iterator (xcb_get_setup (xsConnection)).data;
|
||||||
/**
|
/**
|
||||||
* We need to special-case creating the root window, since
|
* We need to special-case creating the root window, since
|
||||||
* it's representation on the backing server has already been
|
* it's representation on the backing server has already been
|
||||||
|
|
@ -327,7 +326,7 @@ Bool xsCreateWindow(WindowPtr pWin)
|
||||||
XS_WINDOW_PRIV(pWin)->window = screen->root;
|
XS_WINDOW_PRIV(pWin)->window = screen->root;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/*FIXME! do we need to do this?
|
/*FIXME! do we need to do this?*/
|
||||||
/*initialize the root window*/
|
/*initialize the root window*/
|
||||||
xsInitWindow(pWin, NULL, /*root has no parent*/
|
xsInitWindow(pWin, NULL, /*root has no parent*/
|
||||||
0, 0, /*origin at 0, 0*/
|
0, 0, /*origin at 0, 0*/
|
||||||
|
|
@ -337,36 +336,35 @@ Bool xsCreateWindow(WindowPtr pWin)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*we want to listen to both motion and creation events on the root*/
|
/*we want to listen to both motion and creation events on the root*/
|
||||||
mask = XCBEventMaskSubstructureNotify | XCBEventMaskPointerMotion;
|
mask = XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_POINTER_MOTION;
|
||||||
XCBChangeWindowAttributes(xsConnection, screen->root, XCBCWEventMask, &ev_mask);
|
xcb_change_window_attributes(xsConnection, screen->root, XCB_CW_EVENT_MASK, &ev_mask);
|
||||||
|
|
||||||
/*track the children of the root window*/
|
/*track the children of the root window*/
|
||||||
XCBGrabServer(xsConnection);
|
xcb_grab_server(xsConnection);
|
||||||
xsTrackChildren(pWin, ev_mask);
|
xsTrackChildren(pWin, ev_mask);
|
||||||
XCBUngrabServer(xsConnection);
|
xcb_ungrab_server(xsConnection);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pWin->drawable.class == XCBWindowClassInputOnly) {
|
if (pWin->drawable.class == XCB_WINDOW_CLASS_INPUT_ONLY) {
|
||||||
0L;
|
vid = XCB_COPY_FROM_PARENT;
|
||||||
vid.id = XCBCopyFromParent;
|
|
||||||
} else {
|
} else {
|
||||||
if (pWin->optional && pWin->optional->visual != wVisual(pWin->parent)) {
|
if (pWin->optional && pWin->optional->visual != wVisual(pWin->parent)) {
|
||||||
ErrorF("Need to get visuals");
|
ErrorF("Need to get visuals");
|
||||||
exit(1);
|
exit(1);
|
||||||
} else {
|
} else {
|
||||||
vid.id = XCBCopyFromParent;
|
vid = XCB_COPY_FROM_PARENT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*we want all the important events on the window*/
|
/*we want all the important events on the window*/
|
||||||
params.event_mask = ((1<<25)-1) &
|
params.event_mask = ((1<<25)-1) &
|
||||||
~(XCBEventMaskSubstructureRedirect |
|
~(XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT |
|
||||||
XCBEventMaskPointerMotionHint |
|
XCB_EVENT_MASK_POINTER_MOTION_HINT |
|
||||||
XCBEventMaskResizeRedirect);
|
XCB_EVENT_MASK_RESIZE_REDIRECT);
|
||||||
|
|
||||||
/*If we're not creating the root window, continue as normal*/
|
/*If we're not creating the root window, continue as normal*/
|
||||||
XS_WINDOW_PRIV(pWin)->window = XCBWINDOWNew(xsConnection);
|
XS_WINDOW_PRIV(pWin)->window = xcb_generate_id(xsConnection);
|
||||||
XCBAuxCreateWindow(xsConnection,
|
xcb_aux_create_window(xsConnection,
|
||||||
pWin->drawable.depth,
|
pWin->drawable.depth,
|
||||||
XS_WINDOW_PRIV(pWin)->window,
|
XS_WINDOW_PRIV(pWin)->window,
|
||||||
XS_WINDOW_PRIV(pWin->parent)->window,
|
XS_WINDOW_PRIV(pWin->parent)->window,
|
||||||
|
|
@ -379,6 +377,7 @@ Bool xsCreateWindow(WindowPtr pWin)
|
||||||
vid,
|
vid,
|
||||||
mask,
|
mask,
|
||||||
¶ms);
|
¶ms);
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -393,8 +392,8 @@ Bool xsDestroyWindow(WindowPtr pWin)
|
||||||
* Might be wrong about this though.*/
|
* Might be wrong about this though.*/
|
||||||
if (XS_WINDOW_PRIV(pWin)->owned != XS_OWNED)
|
if (XS_WINDOW_PRIV(pWin)->owned != XS_OWNED)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
XCBDestroyWindow(xsConnection, XS_WINDOW_PRIV(pWin)->window);
|
xcb_destroy_window(xsConnection, XS_WINDOW_PRIV(pWin)->window);
|
||||||
XS_WINDOW_PRIV(pWin)->window = (XCBWINDOW){0};
|
XS_WINDOW_PRIV(pWin)->window = (xcb_window_t){0};
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -404,13 +403,13 @@ Bool xsDestroyWindow(WindowPtr pWin)
|
||||||
**/
|
**/
|
||||||
Bool xsPositionWindow(WindowPtr pWin, int x, int y)
|
Bool xsPositionWindow(WindowPtr pWin, int x, int y)
|
||||||
{
|
{
|
||||||
CARD32 list[2];
|
uint32_t list[2];
|
||||||
|
|
||||||
list[0] = x;
|
list[0] = x;
|
||||||
list[1] = y;
|
list[1] = y;
|
||||||
XCBConfigureWindow(xsConnection,
|
xcb_configure_window(xsConnection,
|
||||||
XS_WINDOW_PRIV(pWin)->window,
|
XS_WINDOW_PRIV(pWin)->window,
|
||||||
XCBConfigWindowX | XCBConfigWindowY,
|
XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y,
|
||||||
list);
|
list);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
@ -421,91 +420,91 @@ Bool xsPositionWindow(WindowPtr pWin, int x, int y)
|
||||||
|
|
||||||
Bool xsChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
|
Bool xsChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
|
||||||
{
|
{
|
||||||
XCBParamsCW param;
|
xcb_params_cw_t param;
|
||||||
PixmapPtr pPixmap;
|
PixmapPtr pPixmap;
|
||||||
|
|
||||||
if (mask & XCBCWBackPixmap) {
|
if (mask & XCB_CW_BACK_PIXMAP) {
|
||||||
switch (pWin->backgroundState) {
|
switch (pWin->backgroundState) {
|
||||||
case XCBBackPixmapNone:
|
case XCB_BACK_PIXMAP_NONE:
|
||||||
param.back_pixmap = 0;
|
param.back_pixmap = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case XCBBackPixmapParentRelative:
|
case XCB_BACK_PIXMAP_PARENT_RELATIVE:
|
||||||
param.back_pixmap = XCBBackPixmapParentRelative;
|
param.back_pixmap = XCB_BACK_PIXMAP_PARENT_RELATIVE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/*X server internal things.*/
|
/*X server internal things.*/
|
||||||
case BackgroundPixmap:
|
case BackgroundPixmap:
|
||||||
pPixmap = pWin->background.pixmap;
|
pPixmap = pWin->background.pixmap;
|
||||||
param.back_pixmap = XS_PIXMAP_PRIV(pPixmap)->pixmap.xid;
|
param.back_pixmap = XS_PIXMAP_PRIV(pPixmap)->pixmap;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BackgroundPixel:
|
case BackgroundPixel:
|
||||||
mask &= ~XCBCWBackPixmap;
|
mask &= ~XCB_CW_BACK_PIXMAP;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mask & XCBCWBackPixel) {
|
if (mask & XCB_CW_BACK_PIXEL) {
|
||||||
if (pWin->backgroundState == BackgroundPixel)
|
if (pWin->backgroundState == BackgroundPixel)
|
||||||
param.back_pixel = pWin->background.pixel;
|
param.back_pixel = pWin->background.pixel;
|
||||||
else
|
else
|
||||||
mask &= ~CWBackPixel;
|
mask &= ~CWBackPixel;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mask & XCBCWBorderPixmap) {
|
if (mask & XCB_CW_BORDER_PIXMAP) {
|
||||||
if (pWin->borderIsPixel)
|
if (pWin->borderIsPixel)
|
||||||
mask &= ~CWBorderPixmap;
|
mask &= ~CWBorderPixmap;
|
||||||
else
|
else
|
||||||
pPixmap = pWin->border.pixmap;
|
pPixmap = pWin->border.pixmap;
|
||||||
param.border_pixmap = XS_PIXMAP_PRIV(pPixmap)->pixmap.xid;
|
param.border_pixmap = XS_PIXMAP_PRIV(pPixmap)->pixmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mask & XCBCWBorderPixel) {
|
if (mask & XCB_CW_BORDER_PIXEL) {
|
||||||
if (pWin->borderIsPixel)
|
if (pWin->borderIsPixel)
|
||||||
param.border_pixel = pWin->border.pixel;
|
param.border_pixel = pWin->border.pixel;
|
||||||
else
|
else
|
||||||
mask &= ~XCBCWBorderPixel;
|
mask &= ~XCB_CW_BORDER_PIXEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mask & XCBCWBitGravity)
|
if (mask & XCB_CW_BIT_GRAVITY)
|
||||||
param.bit_gravity = pWin->bitGravity;
|
param.bit_gravity = pWin->bitGravity;
|
||||||
|
|
||||||
if (mask & XCBCWWinGravity) /* dix does this for us */
|
if (mask & XCB_CW_WIN_GRAVITY) /* dix does this for us */
|
||||||
mask &= ~CWWinGravity;
|
mask &= ~CWWinGravity;
|
||||||
|
|
||||||
if (mask & XCBCWBackingStore) /* this is really not useful */
|
if (mask & XCB_CW_BACKING_STORE) /* this is really not useful */
|
||||||
mask &= ~CWBackingStore;
|
mask &= ~CWBackingStore;
|
||||||
|
|
||||||
if (mask & XCBCWBackingPlanes) /* this is really not useful */
|
if (mask & XCB_CW_BACKING_PLANES) /* this is really not useful */
|
||||||
mask &= ~CWBackingPlanes;
|
mask &= ~CWBackingPlanes;
|
||||||
|
|
||||||
if (mask & XCBCWBackingPixel) /* this is really not useful */
|
if (mask & XCB_CW_BACKING_PIXEL) /* this is really not useful */
|
||||||
mask &= ~CWBackingPixel;
|
mask &= ~CWBackingPixel;
|
||||||
|
|
||||||
if (mask & XCBCWOverrideRedirect)
|
if (mask & XCB_CW_OVERRIDE_REDIRECT)
|
||||||
param.override_redirect = pWin->overrideRedirect;
|
param.override_redirect = pWin->overrideRedirect;
|
||||||
|
|
||||||
if (mask & XCBCWSaveUnder) /* this is really not useful */
|
if (mask & XCB_CW_SAVE_UNDER) /* this is really not useful */
|
||||||
mask &= ~CWSaveUnder;
|
mask &= ~CWSaveUnder;
|
||||||
|
|
||||||
if (mask & XCBCWEventMask) /* events are handled elsewhere */
|
if (mask & XCB_CW_EVENT_MASK) /* events are handled elsewhere */
|
||||||
mask &= ~CWEventMask;
|
mask &= ~CWEventMask;
|
||||||
|
|
||||||
if (mask & XCBCWDontPropagate) /* events are handled elsewhere */
|
if (mask & XCB_CW_DONT_PROPAGATE) /* events are handled elsewhere */
|
||||||
mask &= ~CWDontPropagate;
|
mask &= ~CWDontPropagate;
|
||||||
|
|
||||||
if (mask & XCBCWColormap) {
|
if (mask & XCB_CW_COLORMAP) {
|
||||||
ColormapPtr pCmap;
|
ColormapPtr pCmap;
|
||||||
pCmap = LookupIDByType(wColormap(pWin), RT_COLORMAP);
|
pCmap = LookupIDByType(wColormap(pWin), RT_COLORMAP);
|
||||||
param.colormap = XS_CMAP_PRIV(pCmap)->colormap.xid;
|
param.colormap = XS_CMAP_PRIV(pCmap)->colormap;
|
||||||
xsSetInstalledColormapWindows(pWin->drawable.pScreen);
|
xsSetInstalledColormapWindows(pWin->drawable.pScreen);
|
||||||
}
|
}
|
||||||
if (mask & XCBCWCursor) /* this is handeled in cursor code */
|
if (mask & XCB_CW_CURSOR) /* this is handeled in cursor code */
|
||||||
mask &= ~XCBCWCursor;
|
mask &= ~XCB_CW_CURSOR;
|
||||||
|
|
||||||
if (mask)
|
if (mask)
|
||||||
XCBAuxChangeWindowAttributes(xsConnection, XS_WINDOW_PRIV(pWin)->window, mask, ¶m);
|
xcb_aux_change_window_attributes(xsConnection, XS_WINDOW_PRIV(pWin)->window, mask, ¶m);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -514,11 +513,11 @@ Bool xsChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
|
||||||
* configuring a window with a zero mask) and that the cost of actually
|
* configuring a window with a zero mask) and that the cost of actually
|
||||||
* doing a configure for extra values is unneeded.
|
* doing a configure for extra values is unneeded.
|
||||||
**/
|
**/
|
||||||
void xsConfigureWindow(WindowPtr pWin, CARD32 mask)
|
void xsConfigureWindow(WindowPtr pWin, uint32_t mask)
|
||||||
{
|
{
|
||||||
WindowPtr pSib;
|
WindowPtr pSib;
|
||||||
CARD32 vmask;
|
uint32_t vmask;
|
||||||
XCBParamsConfigureWindow values;
|
xcb_params_configure_window_t values;
|
||||||
|
|
||||||
/* We fill the entire structure here, and let the mask weed out the
|
/* We fill the entire structure here, and let the mask weed out the
|
||||||
* extra data */
|
* extra data */
|
||||||
|
|
@ -529,22 +528,22 @@ void xsConfigureWindow(WindowPtr pWin, CARD32 mask)
|
||||||
values.height = pWin->drawable.height;
|
values.height = pWin->drawable.height;
|
||||||
values.border_width = wBorderWidth(pWin);
|
values.border_width = wBorderWidth(pWin);
|
||||||
|
|
||||||
XCBAuxConfigureWindow(xsConnection, XS_WINDOW_PRIV(pWin)->window, mask, &values);
|
xcb_aux_configure_window(xsConnection, XS_WINDOW_PRIV(pWin)->window, mask, &values);
|
||||||
|
|
||||||
if (mask & XCBConfigWindowStackMode) {
|
if (mask & XCB_CONFIG_WINDOW_STACK_MODE) {
|
||||||
/*get top sibling*/
|
/*get top sibling*/
|
||||||
for (pSib = pWin; pSib->prevSib != NULL; pSib = pSib->prevSib);
|
for (pSib = pWin; pSib->prevSib != NULL; pSib = pSib->prevSib);
|
||||||
|
|
||||||
vmask = XCBConfigWindowStackMode;
|
vmask = XCB_CONFIG_WINDOW_STACK_MODE;
|
||||||
values.stack_mode = XCBStackModeAbove;
|
values.stack_mode = XCB_STACK_MODE_ABOVE;
|
||||||
XCBAuxConfigureWindow(xsConnection, XS_WINDOW_PRIV(pSib)->window, vmask, &values);
|
xcb_aux_configure_window(xsConnection, XS_WINDOW_PRIV(pSib)->window, vmask, &values);
|
||||||
|
|
||||||
/* the rest of siblings */
|
/* the rest of siblings */
|
||||||
for (pSib = pSib->nextSib; pSib != NullWindow; pSib = pSib->nextSib) {
|
for (pSib = pSib->nextSib; pSib != NullWindow; pSib = pSib->nextSib) {
|
||||||
vmask = XCBConfigWindowSibling | XCBConfigWindowStackMode;
|
vmask = XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_STACK_MODE;
|
||||||
values.sibling = XS_WINDOW_PRIV(pSib)->window.xid;
|
values.sibling = XS_WINDOW_PRIV(pSib)->window;
|
||||||
values.stack_mode = Below;
|
values.stack_mode = Below;
|
||||||
XCBAuxConfigureWindow(xsConnection, XS_WINDOW_PRIV(pSib)->window, vmask, &values);
|
xcb_aux_configure_window(xsConnection, XS_WINDOW_PRIV(pSib)->window, vmask, &values);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -557,8 +556,8 @@ Bool xsRealizeWindow(WindowPtr pWin)
|
||||||
{
|
{
|
||||||
if (XS_IS_ROOT(pWin))
|
if (XS_IS_ROOT(pWin))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
xsConfigureWindow(pWin, XCBConfigWindowStackMode);
|
xsConfigureWindow(pWin, XCB_CONFIG_WINDOW_STACK_MODE);
|
||||||
XCBMapWindow(xsConnection, XS_WINDOW_PRIV(pWin)->window);
|
xcb_map_window(xsConnection, XS_WINDOW_PRIV(pWin)->window);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -567,7 +566,7 @@ Bool xsRealizeWindow(WindowPtr pWin)
|
||||||
**/
|
**/
|
||||||
Bool xsUnrealizeWindow(WindowPtr pWin)
|
Bool xsUnrealizeWindow(WindowPtr pWin)
|
||||||
{
|
{
|
||||||
XCBUnmapWindow(xsConnection, XS_WINDOW_PRIV(pWin)->window);
|
xcb_unmap_window(xsConnection, XS_WINDOW_PRIV(pWin)->window);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -578,7 +577,7 @@ void xsPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what)
|
||||||
|
|
||||||
pBox = REGION_RECTS(pRegion);
|
pBox = REGION_RECTS(pRegion);
|
||||||
for (i = 0; i < REGION_NUM_RECTS(pRegion); i++)
|
for (i = 0; i < REGION_NUM_RECTS(pRegion); i++)
|
||||||
XCBClearArea(xsConnection,
|
xcb_clear_area(xsConnection,
|
||||||
FALSE,
|
FALSE,
|
||||||
XS_WINDOW_PRIV(pWin)->window,
|
XS_WINDOW_PRIV(pWin)->window,
|
||||||
pBox[i].x1 - pWin->drawable.x,
|
pBox[i].x1 - pWin->drawable.x,
|
||||||
|
|
@ -600,5 +599,5 @@ void xsCopyWindow(WindowPtr pWin, xPoint oldOrigin, RegionPtr oldRegion)
|
||||||
|
|
||||||
void xsClipNotify(WindowPtr pWin, int dx, int dy)
|
void xsClipNotify(WindowPtr pWin, int dx, int dy)
|
||||||
{
|
{
|
||||||
xsConfigureWindow(pWin, XCBConfigWindowStackMode);
|
xsConfigureWindow(pWin, XCB_CONFIG_WINDOW_STACK_MODE);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
extern int xsWindowPrivateIndex;
|
extern int xsWindowPrivateIndex;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
XCBWINDOW window;
|
xcb_window_t window;
|
||||||
XSOwnership owned;
|
XSOwnership owned;
|
||||||
} XscreenPrivWindow;
|
} XscreenPrivWindow;
|
||||||
|
|
||||||
|
|
@ -29,7 +29,7 @@ Bool xsUnrealizeWindow(WindowPtr pWin);
|
||||||
Bool xsPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what);
|
Bool xsPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what);
|
||||||
void xsPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what);
|
void xsPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what);
|
||||||
Bool xsPositionWindow(WindowPtr pWin, int x, int y);
|
Bool xsPositionWindow(WindowPtr pWin, int x, int y);
|
||||||
void xsConfigureWindow(WindowPtr pWin, CARD32 mask);
|
void xsConfigureWindow(WindowPtr pWin, uint32_t mask);
|
||||||
|
|
||||||
void xsWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr pOther);
|
void xsWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr pOther);
|
||||||
void xsCopyWindow(WindowPtr pWin, xPoint old_orig, RegionPtr old_rgn);
|
void xsCopyWindow(WindowPtr pWin, xPoint old_orig, RegionPtr old_rgn);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue