{
ULONG i;
LONG mouse_cx = 0, mouse_cy = 0;
- HDC hDC = RetrieveDisplayHDC();
+/* HDC hDC = RetrieveDisplayHDC();
PDC dc = DC_HandleToPtr(hDC);
PSURFOBJ SurfObj = (PSURFOBJ)AccessUserObject(dc->Surface);
PSURFGDI SurfGDI = (PSURFGDI)AccessInternalObject(dc->Surface);
- RECTL MouseRect;
+ RECTL MouseRect; */
PDEVICE_OBJECT ClassDeviceObject = NULL;
PFILE_OBJECT FileObject = NULL;
if(mouse_x > 620) mouse_x = 620;
if(mouse_y > 460) mouse_y = 460;
- if((SafetySwitch == FALSE) && (SafetySwitch2 == FALSE))
- SurfGDI->MovePointer(SurfObj, mouse_x, mouse_y, &MouseRect);
+ if((SafetySwitch == FALSE) && (SafetySwitch2 == FALSE)) ;
+/* SurfGDI->MovePointer(SurfObj, mouse_x, mouse_y, &MouseRect); */
}
}
KeInitializeEvent(&event, NotificationEvent, FALSE);
- GDIInformation.CallBack = MouseGDICallBack;
+ GDIInformation.CallBack = MouseGDICallBack;
irp = IoBuildDeviceIoControlRequest(IOCTL_INTERNAL_MOUSE_CONNECT,
ClassDeviceObject, &GDIInformation, sizeof(CLASS_INFORMATION), NULL, 0, TRUE, &event, &ioStatus);
return ioStatus.Status;
}
-
+/*
void TestMouse()
{
HDC hDC = RetrieveDisplayHDC();
RECTL MouseRect;
// Draw a test mouse cursor
-/* Brush.iSolidColor = 1;
- EngLineTo(SurfObj, NULL, &Brush, 0, 0, 15, 0, NULL, 0);
- EngLineTo(SurfObj, NULL, &Brush, 0, 0, 0, 15, NULL, 0);
- EngLineTo(SurfObj, NULL, &Brush, 0, 15, 15, 0, NULL, 0);
- Brush.iSolidColor = 15;
- EngLineTo(SurfObj, NULL, &Brush, 1, 1, 13, 1, NULL, 0);
- EngLineTo(SurfObj, NULL, &Brush, 1, 1, 1, 13, NULL, 0);
- EngLineTo(SurfObj, NULL, &Brush, 1, 13, 13, 1, NULL, 0); */
-
mouse_width = 16;
mouse_height = 16;
ConnectMouseClassDriver();
MouseEnabled = TRUE;
}
+*/
-/* $Id: window.c,v 1.2 2001/07/06 00:05:05 rex Exp $
+/* $Id: window.c,v 1.3 2001/08/28 18:16:32 jfilby Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
HWND hWnd,
LONG nCmdShow)
{
- UNIMPLEMENTED
+ PWINDOW_OBJECT WindowObject;
- return 0;
+ GuiCheck();
+
+ WindowObject = USEROBJ_HandleToPtr (hWnd, UO_WINDOW_MAGIC);
+
+
+ return TRUE;
}
DWORD
-/* $Id: dc.c,v 1.25 2001/06/30 17:43:05 jfilby Exp $
+/* $Id: dc.c,v 1.26 2001/08/28 18:16:32 jfilby Exp $
*
* DC.C - Device context functions
*
// --------------------------------------------------------- File Statics
-static HDC hDISPLAY_DC = NULL; // handle to the DISPLAY HDC
static void W32kSetDCState16(HDC hDC, HDC hDCSave);
// ----------------------------------------------------- Public Functions
-HDC RetrieveDisplayHDC(VOID)
-{
- return hDISPLAY_DC;
-}
-
BOOL STDCALL W32kCancelDC(HDC hDC)
{
UNIMPLEMENTED;
PDC NewDC, OrigDC = NULL;
HBITMAP hBitmap;
- if(hDC == NULL)
+ OrigDC = DC_HandleToPtr(hDC);
+ if (OrigDC == NULL)
{
- // The OrigDC is one the DC created to reference the DISPLAY (we assume such a DC exists)
- if(hDISPLAY_DC != NULL)
- OrigDC = DC_HandleToPtr(hDISPLAY_DC);
- } else {
- OrigDC = DC_HandleToPtr(hDC);
- if (OrigDC == NULL)
- {
- return 0;
- }
+ return 0;
}
/* Allocate a new DC based on the original DC's device */
W32kSetTextColor(hNewDC, RGB(0xff, 0xff, 0xff));
W32kSetTextAlign(hNewDC, TA_BASELINE);
- // If we've created a DC for the DISPLAY, save the reference for later CreateCompatibleDC(NULL... usage
- if(wcscmp(Driver, L"DISPLAY") == 0)
- {
- hDISPLAY_DC = hNewDC;
- }
-
- TestMouse();
-
return hNewDC;
Failure:
PDC DC_FindOpenDC(LPCWSTR Driver)
{
- /* FIXME: This is just a hack to return the pointer to the DISPLAY DC.. must cater for others too! */
-
- if(wcscmp(Driver, L"DISPLAY"))
- {
- return DC_HandleToPtr(hDISPLAY_DC);
- }
-
return NULL;
-
}
void DC_InitDC(PDC DCToInit)
if (DIB_GetBitmapInfo( header, &width, &height, &bpp, &compr ) == -1) return 0;
if (height < 0) height = -height;
- // Check if we should create a monochrome or color bitmap.
- // We create a monochrome bitmap only if it has exactly 2
- // colors, which are black followed by white, nothing else.
- // In all other cases, we create a color bitmap.
+ // Check if we should create a monochrome or color bitmap. We create a monochrome bitmap only if it has exactly 2
+ // colors, which are black followed by white, nothing else. In all other cases, we create a color bitmap.
if (bpp != 1) fColor = TRUE;
else if ((coloruse != DIB_RGB_COLORS) ||
{
rgb++;
col = RGB( rgb->rgbRed, rgb->rgbGreen, rgb->rgbBlue );
+
// If the second color is white, create a monochrome bitmap
fColor = (col != RGB(0xff,0xff,0xff));
}
- // Note : If the first color of the colormap is white
- // followed by black, we have to create a color bitmap.
- // If we don't the white will be displayed in black later on!
else fColor = TRUE;
}
else if (data->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
{
RGBTRIPLE *rgb = ((BITMAPCOREINFO *)data)->bmciColors;
- DWORD col = RGB( rgb->rgbtRed, rgb->rgbtGreen, rgb->rgbtBlue);
+ DWORD col = RGB( rgb->rgbtRed, rgb->rgbtGreen, rgb->rgbtBlue);
if ((col == RGB(0,0,0)))
{
// Now create the bitmap
- if (fColor)
+ if(fColor)
{
- handle = W32kCreateCompatibleBitmap(RetrieveDisplayHDC(), width, height);
+ // If we are using indexed colors, then we need to create a bitmap that is compatible with the palette
+ if(coloruse == DIB_PAL_COLORS)
+ {
+ handle = W32kCreateCompatibleBitmap(hdc, width, height);
+ }
+ else if(coloruse == DIB_RGB_COLORS) {
+ handle = W32kCreateBitmap(width, height, 1, 24, NULL);
+ }
}
else handle = W32kCreateBitmap(width, height, 1, 1, NULL);