[xorg-commit-diffs] xc/programs/Xserver/hw/xwin winrandr.c, NONE, 1.1.2.1 Imakefile, 1.1.4.1.2.12, 1.1.4.1.2.13 win.h, 1.1.4.1.2.25, 1.1.4.1.2.26 winscrinit.c, 1.1.4.1.2.14, 1.1.4.1.2.15 winlayer.c, 1.1.6.3, NONE

Harold L Hunt II xorg-commit at pdx.freedesktop.org
Mon Mar 29 16:31:32 PST 2004


Committed by: harold


--- NEW FILE: winrandr.c ---
/*
 *Copyright (C) 2001-2004 Harold L Hunt II All Rights Reserved.
 *
 *Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 *"Software"), to deal in the Software without restriction, including
 *without limitation the rights to use, copy, modify, merge, publish,
 *distribute, sublicense, and/or sell copies of the Software, and to
 *permit persons to whom the Software is furnished to do so, subject to
 *the following conditions:
 *
 *The above copyright notice and this permission notice shall be
 *included in all copies or substantial portions of the Software.
 *
 *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR
 *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 *Except as contained in this notice, the name of Harold L Hunt II
 *shall not be used in advertising or otherwise to promote the sale, use
 *or other dealings in this Software without prior written authorization
 *from Harold L Hunt II.
 *
 * Authors:	Harold L Hunt II
 */

#include "win.h"


/*
 * Answer queries about the RandR features supported.
 */

Bool
winRandRGetInfo (ScreenPtr pScreen, Rotation *pRotations)
{
  winScreenPriv(pScreen);
  winScreenInfo			*pScreenInfo = pScreenPriv->pScreenInfo;
  int				n;
  Rotation			rotateKind;
  RRScreenSizePtr		pSize;

  ErrorF ("winRandRGetInfo ()\n");

  /* Don't support rotations, yet */
  *pRotations = RR_Rotate_0;

  /* Bail if no depth has a visual associated with it */
  for (n = 0; n < pScreen->numDepths; n++)
    if (pScreen->allowedDepths[n].numVids)
      break;
  if (n == pScreen->numDepths)
    return FALSE;

  /* Only one allowed rotation for now */
  rotateKind = RR_Rotate_0;

  /*
   * Register supported sizes.  This can be called many times, but
   * we only support one size for now.
   */
  pSize = RRRegisterSize (pScreen,
			  pScreenInfo->dwWidth,
			  pScreenInfo->dwHeight,
			  pScreenInfo->dwWidth_mm,
			  pScreenInfo->dwHeight_mm);

  /* Tell RandR what the current config is */
  RRSetCurrentConfig (pScreen,
		      rotateKind,
		      0, /* refresh rate, not needed */
		      pSize);
  
  return TRUE;
}


/*
 * Respond to resize/rotate request from either X Server or X client app
 */

Bool
winRandRSetConfig (ScreenPtr		pScreen,
		   Rotation		rotateKind,
		   int			rate,
		   RRScreenSizePtr	pSize)
{
  ErrorF ("winRandRSetConfig ()\n");

  return TRUE;
}


/*
 * Initialize the RandR layer.
 */

Bool
winRandRInit (ScreenPtr pScreen)
{
  rrScrPrivPtr		pRRScrPriv;

  ErrorF ("winRandRInit ()\n");

  if (!RRScreenInit (pScreen))
    {
      ErrorF ("winRandRInit () - RRScreenInit () failed\n");
      return FALSE;
    }

  /* Set some RandR function pointers */
  pRRScrPriv = rrGetScrPriv (pScreen);
  pRRScrPriv->rrGetInfo = winRandRGetInfo;
  pRRScrPriv->rrSetConfig = winRandRSetConfig;

  return TRUE;
}

Index: Imakefile
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/Imakefile,v
retrieving revision 1.1.4.1.2.12
retrieving revision 1.1.4.1.2.13
diff -u -d -r1.1.4.1.2.12 -r1.1.4.1.2.13
--- a/Imakefile	20 Mar 2004 07:25:47 -0000	1.1.4.1.2.12
+++ b/Imakefile	30 Mar 2004 00:31:28 -0000	1.1.4.1.2.13
@@ -24,11 +24,6 @@
 	winpriv.c
 #endif
 
-#if BuildXWinLayer
-SRCS_LAYER = \
-	winlayer.c
-#endif
-
 #if BuildXWinMultiWindow
 SRCS_MULTIWINDOW = \
 	winmultiwindowshape.c \
@@ -67,6 +62,11 @@
 	winpfbdd.c
 #endif
 
+#if BuildRandR
+SRCS_RANDR = \
+	winrandr.c
+#endif
+
 #if BuildXvExt
 SRCS_XV = \
 	winvideo.c
@@ -108,11 +108,11 @@
 	winwndproc.c \
 	$(SRCS_CLIPBOARD) \
 	$(SRCS_GLX_WINDOWS) \
-	$(SRCS_LAYER) \
 	$(SRCS_MULTIWINDOW) \
 	$(SRCS_MULTIWINDOWEXTWM) \
 	$(SRCS_NATIVEGDI) \
 	$(SRCS_PRIMARYFB) \
+	$(SRCS_RANDR) \
 	$(SRCS_XV)
 
 winprefsyacc.c: winprefsyacc.y
@@ -144,11 +144,6 @@
 	winpriv.o
 #endif
 
-#if BuildXWinLayer
-OBJS_LAYER = \
-	winlayer.o
-#endif
-
 #if BuildXWinMultiWindow
 OBJS_MULTIWINDOW = \
 	winmultiwindowshape.o \
@@ -187,6 +182,11 @@
 	winpfbdd.o
 #endif
 
+#if BuildRandR
+OBJS_RANDR = \
+	winrandr.o
+#endif
+
 #if BuildXvExt
 OBJS_XV = \
 	winvideo.o
@@ -228,16 +228,16 @@
 	winwndproc.o \
 	$(OBJS_CLIPBOARD) \
 	$(OBJS_GLX_WINDOWS) \
-	$(OBJS_LAYER) \
 	$(OBJS_MULTIWINDOW) \
 	$(OBJS_MULTIWINDOWEXTWM) \
 	$(OBJS_NATIVEGDI) \
 	$(OBJS_PRIMARYFB) \
+	$(OBJS_RANDR) \
 	$(OBJS_XV)
 
 INCLUDES = -I. -I$(XBUILDINCDIR) -I$(FONTINCSRC) \
 	   -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi \
-	   -I$(SERVERSRC)/miext/shadow -I$(SERVERSRC)/miext/layer \
+	   -I$(SERVERSRC)/miext/shadow \
 	   -I$(SERVERSRC)/miext/rootless \
 	   -I$(SERVERSRC)/miext/rootless/safeAlpha \
 	   -I$(SERVERSRC)/include -I$(SERVERSRC)/os  \

Index: win.h
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/win.h,v
retrieving revision 1.1.4.1.2.25
retrieving revision 1.1.4.1.2.26
diff -u -d -r1.1.4.1.2.25 -r1.1.4.1.2.26
--- a/win.h	29 Mar 2004 09:59:29 -0000	1.1.4.1.2.25
+++ b/win.h	30 Mar 2004 00:31:28 -0000	1.1.4.1.2.26
@@ -165,9 +165,6 @@
 #include "miline.h"
 #include "shadow.h"
 #include "fb.h"
-#ifdef XWIN_LAYER
-#include "layer.h"
-#endif
 #include "rootless.h"
 
 #ifdef RENDER
@@ -453,12 +450,6 @@
   DWORD			dwLastWindowsHeight;
   DWORD			dwLastWindowsBitsPixel;
 
-  /* Layer support */
-#ifdef XWIN_LAYER
-  DWORD			dwLayerKind;
-  LayerPtr		pLayer;
-#endif
-
   /* Palette management */
   ColormapPtr		pcmapInstalled;
 
@@ -976,35 +967,6 @@
 winSendKeyEvent (DWORD dwKey, Bool fDown);
 
 
-#ifdef XWIN_LAYER
-/*
- * winlayer.c
- */
-
-LayerPtr
-winLayerCreate (ScreenPtr pScreen);
-
-int
-winLayerAdd (WindowPtr pWindow, pointer value);
-
-int
-winLayerRemove (WindowPtr pWindow, pointer value);
-
-# ifdef RANDR
-Bool
-winRandRGetInfo (ScreenPtr pScreen, Rotation *pRotations);
-
-Bool
-winRandRSetConfig (ScreenPtr		pScreen,
-		   Rotation		rotateKind,
-		   RRScreenSizePtr	pSize);
-
-Bool
-winRandRInit (ScreenPtr pScreen);
-# endif /* RANDR */
-#endif /* XWIN_LAYER */
-
-
 /*
  * winmisc.c
  */
@@ -1206,6 +1168,25 @@
 #endif
 
 
+#ifdef RANDR
+/*
+ * winrandr.c
+ */
+
+Bool
+winRandRGetInfo (ScreenPtr pScreen, Rotation *pRotations);
+
+Bool
+winRandRSetConfig (ScreenPtr		pScreen,
+		   Rotation		rotateKind,
+		   int			rate,
+		   RRScreenSizePtr	pSize);
+
+Bool
+winRandRInit (ScreenPtr pScreen);
+#endif /* RANDR */
+
+
 /*
  * winscrinit.c
  */

Index: winscrinit.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winscrinit.c,v
retrieving revision 1.1.4.1.2.14
retrieving revision 1.1.4.1.2.15
diff -u -d -r1.1.4.1.2.14 -r1.1.4.1.2.15
--- a/winscrinit.c	17 Mar 2004 20:31:51 -0000	1.1.4.1.2.14
+++ b/winscrinit.c	30 Mar 2004 00:31:28 -0000	1.1.4.1.2.15
@@ -243,10 +243,6 @@
   char			*pbits = NULL;
   int			iReturn;
 
-#ifdef XWIN_LAYER
-  pScreenPriv->dwLayerKind = LAYER_SHADOW;
-#endif
-
   /* Create framebuffer */
   if (!(*pScreenPriv->pwinAllocateFB) (pScreen))
     {
@@ -369,45 +365,14 @@
     }
 #endif
 
-#ifdef XWIN_LAYER
-  /* KDrive does LayerStartInit right after fbPictureInit */
-  if (!LayerStartInit (pScreen))
-    {
-      ErrorF ("winFinishScreenInitFB - LayerStartInit () failed\n");
-      return FALSE;
-    }
-
-  /* Not sure what we're adding to shadow, but add it anyway */
-  if (!shadowAdd (pScreen, 0, pScreenPriv->pwinShadowUpdate, NULL, 0, 0))
-    {
-      ErrorF ("winFinishScreenInitFB - shadowAdd () failed\n");
-      return FALSE;
-    }
-
-  /* KDrive does LayerFinishInit right after LayerStartInit */
-  if (!LayerFinishInit (pScreen))
-    {
-      ErrorF ("winFinishScreenInitFB - LayerFinishInit () failed\n");
-      return FALSE;
-    }
-
-  /* KDrive does LayerCreate right after LayerFinishInit */
-  pScreenPriv->pLayer = winLayerCreate (pScreen);
-  if (!pScreenPriv->pLayer)
-    {
-      ErrorF ("winFinishScreenInitFB - winLayerCreate () failed\n");
-      return FALSE;
-    }
-  
-  /* KDrive does RandRInit right after LayerCreate */
 #ifdef RANDR
-  if (pScreenInfo->dwDepth != 8 && !winRandRInit (pScreen))
+  /* Initialize resize and rotate support */
+  if (!winRandRInit (pScreen))
     {
       ErrorF ("winFinishScreenInitFB - winRandRInit () failed\n");
       return FALSE;
     }
 #endif
-#endif
 
   /*
    * Backing store support should reduce network traffic and increase
@@ -433,7 +398,6 @@
       return FALSE;
     }
 
-#ifndef XWIN_LAYER
   /* Initialize the shadow framebuffer layer */
   if ((pScreenInfo->dwEngine == WIN_SERVER_SHADOW_GDI
        || pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DD
@@ -454,7 +418,6 @@
 	  return FALSE;
 	}
     }
-#endif
 
 #ifdef XWIN_MULTIWINDOWEXTWM
   /* Handle multi-window external window manager mode */

--- winlayer.c DELETED ---




More information about the xorg-commit-diffs mailing list