diff --git a/hw/xnest/WindowFuncs.c b/hw/xnest/WindowFuncs.c index fa150a2ef..cb9ad7b4f 100644 --- a/hw/xnest/WindowFuncs.c +++ b/hw/xnest/WindowFuncs.c @@ -140,7 +140,7 @@ WindowPtr xscreenTrackWindow(XCBWINDOW w, WindowPtr pParent, int x, int y, int w pWin->optional = (WindowOptPtr)NULL; pWin->cursorIsNone = TRUE; - pWin->backingStore = NotUseful;file:///home/ori/.mozilla/firefox/eysrj7gz.default/bookmarks.html + pWin->backingStore = NotUseful; pWin->DIXsaveUnder = FALSE; pWin->backStorage = (pointer) NULL; diff --git a/hw/xscreen/Makefile.am b/hw/xscreen/Makefile.am index 6eb11a360..d6fc20e17 100644 --- a/hw/xscreen/Makefile.am +++ b/hw/xscreen/Makefile.am @@ -1,11 +1,20 @@ bin_PROGRAMS = Xscreen -Xscreen_SOURCES = xs-init.c \ - xs-input.c \ - xs-globals.h \ +Xscreen_SOURCES = xs-event.c \ + xs-event.h \ + xs-gc.c \ + xs-gcops.c \ + xs-gcops.h \ xs-globals.c \ - xs-screen.h \ + xs-globals.h \ + xs-init.c \ + xs-input.c \ + xs-pixmap.c \ + xs-pixmap.h \ xs-screen.c \ + xs-screen.h \ + xs-window.c \ + xs-window.h \ $(top_srcdir)/Xext/dpmsstubs.c \ $(top_srcdir)/Xi/stubs.c \ $(top_srcdir)/mi/miinitext.c \ diff --git a/hw/xscreen/xs-globals.c b/hw/xscreen/xs-globals.c index 919de5ef9..f6365439d 100644 --- a/hw/xscreen/xs-globals.c +++ b/hw/xscreen/xs-globals.c @@ -1,4 +1,10 @@ #include #include +#include "xs-globals.h" XCBConnection *xsConnection; +XCBDRAWABLE xsDefaultDrawables[MAXDEPTH]; +XCBDRAWABLE xsDefaultWindow; +int xsFontPrivateIndex; +int xsGCPrivateIndex; +int xsWindowPrivateIndex; diff --git a/hw/xscreen/xs-globals.h b/hw/xscreen/xs-globals.h index e6f8d0d6d..f34a2864c 100644 --- a/hw/xscreen/xs-globals.h +++ b/hw/xscreen/xs-globals.h @@ -1 +1,13 @@ +#ifndef _XS_GLOBALS_INCL_ +#define _XS_GLOBALS_INCL_ + +#define MAXDEPTH 32 + extern XCBConnection *xsConnection; +extern XCBDRAWABLE xsDefaultDrawables[MAXDEPTH]; +extern XCBDRAWABLE xsDefaultWindow; +extern int xsFontPrivateIndex; +extern int xsGCPrivateIndex; +extern int xsWindowPrivateIndex; + +#endif diff --git a/hw/xscreen/xs-init.c b/hw/xscreen/xs-init.c index 915f7195f..d39daff26 100644 --- a/hw/xscreen/xs-init.c +++ b/hw/xscreen/xs-init.c @@ -81,7 +81,8 @@ void InitOutput(ScreenInfo *si, int argc, char *argv[]) * going to be putting in barely-tested code **/ si->numScreens = 1; - AddScreen(xsOpenScreen, argc, argv); + if (AddScreen(xsOpenScreen, argc, argv) < 0) + FatalError("Failed to initialize screen 0\n"); /*si->numVideoScreens = ... what do I do with this?;*/ } diff --git a/hw/xscreen/xs-screen.c b/hw/xscreen/xs-screen.c index 0d7c7ba8b..d823a5ee0 100644 --- a/hw/xscreen/xs-screen.c +++ b/hw/xscreen/xs-screen.c @@ -1,5 +1,5 @@ #ifdef HAVE_XSCREEN_CONFIG_H -#include +#include #endif #include @@ -11,21 +11,104 @@ #include #include #include - -#include "gcstruct.h" -#include "window.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "colormapst.h" #include "scrnintstr.h" -#include "region.h" - -#include "xs-globals.h" -#include "xs-screen.h" +#include "dix.h" +#include "mi.h" +#include "mibstore.h" +#include "micmap.h" +#include "colormapst.h" +#include "resource.h" #include "mi.h" -Bool xsOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]) +#include "xs-globals.h" +#include "xs-types.h" +#include "xs-gc.h" +#include "xs-font.h" +#include "xs-gcops.h" +#include "xs-screen.h" +#include "xs-window.h" +#include "xs-pixmap.h" +#include "xs-color.h" + + +/*sets up screensaver*/ +static Bool xsSaveScreen(ScreenPtr pScreen, int action) { + /* It makes absolutely no sense to support a screensaver + * in a rootless nested X server, so I'm just returning FALSE + * here. Hopefully this is correct.*/ return FALSE; } + +/** + * Initialize the function pointers in pScreen. + * Just grouped together here for readability. + **/ +static void xsScreenSetProcs(ScreenPtr pScreen) +{ + /* Random screen procedures */ + pScreen->QueryBestSize = xsQueryBestSize; + pScreen->SaveScreen = xsSaveScreen; + pScreen->GetImage = xsGetImage; + pScreen->GetSpans = xsGetSpans; + pScreen->PointerNonInterestBox = NULL; + pScreen->SourceValidate = NULL; + + /* Window Procedures */ + pScreen->CreateWindow = xsCreateWindow; + pScreen->DestroyWindow = xsDestroyWindow; + pScreen->PositionWindow = xsPositionWindow; + pScreen->ChangeWindowAttributes = xsChangeWindowAttributes; + pScreen->RealizeWindow = xsRealizeWindow; + pScreen->UnrealizeWindow = xsUnrealizeWindow; + pScreen->PostValidateTree = NULL; + pScreen->WindowExposures = xsWindowExposures; + pScreen->PaintWindowBackground = xsPaintWindowBackground; + pScreen->PaintWindowBorder = xsPaintWindowBorder; + pScreen->CopyWindow = xsCopyWindow; + pScreen->ClipNotify = xsClipNotify; + + /* Backing store procedures */ + pScreen->SaveDoomedAreas = NULL; + pScreen->RestoreAreas = NULL; + pScreen->ExposeCopy = NULL; + pScreen->TranslateBackingStore = NULL; + pScreen->ClearBackingStore = NULL; + pScreen->DrawGuarantee = NULL; + + /* Font procedures */ + pScreen->RealizeFont = xsRealizeFont; + pScreen->UnrealizeFont = xsUnrealizeFont; + + /* GC procedures */ + pScreen->CreateGC = xsCreateGC; + + /* Colormap procedures */ + pScreen->CreateColormap = xsCreateColormap; + pScreen->DestroyColormap = xsDestroyColormap; + pScreen->InstallColormap = xsInstallColormap; + pScreen->UninstallColormap = xsUninstallColormap; + pScreen->ListInstalledColormaps = (ListInstalledColormapsProcPtr) xsListInstalledColormaps; + pScreen->StoreColors = (StoreColorsProcPtr) xsStoreColors; + pScreen->ResolveColor = xsResolveColor; + + pScreen->BitmapToRegion = xsPixmapToRegion; + + /* OS layer procedures */ + pScreen->BlockHandler = (ScreenBlockHandlerProcPtr)NoopDDA; + pScreen->WakeupHandler = (ScreenWakeupHandlerProcPtr)NoopDDA; + pScreen->blockData = NULL; + pScreen->wakeupData = NULL; + + #ifdef SHAPE + /* overwrite miSetShape with our own */ + pScreen->SetShape = xsSetShape; + #endif /* SHAPE */ +} + +Bool xsOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]) +{ + xsSetScreenProcs(pScreen); + return TRUE; +}