1997-03-05 09:22:35 +01:00
|
|
|
/*
|
|
|
|
* GDI objects
|
|
|
|
*
|
|
|
|
* Copyright 1993 Alexandre Julliard
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include "bitmap.h"
|
|
|
|
#include "brush.h"
|
|
|
|
#include "font.h"
|
|
|
|
#include "pen.h"
|
1999-06-26 21:09:08 +02:00
|
|
|
#include "debugtools.h"
|
1997-03-05 09:22:35 +01:00
|
|
|
|
1999-04-19 16:56:29 +02:00
|
|
|
DEFAULT_DEBUG_CHANNEL(gdi)
|
|
|
|
|
1997-03-05 09:22:35 +01:00
|
|
|
|
1999-02-26 12:11:13 +01:00
|
|
|
extern HBITMAP WIN16DRV_BITMAP_SelectObject( DC * dc, HBITMAP hbitmap,
|
1997-03-05 09:22:35 +01:00
|
|
|
BITMAPOBJ * bmp );
|
1999-02-26 12:11:13 +01:00
|
|
|
extern HBRUSH WIN16DRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush,
|
1997-03-05 09:22:35 +01:00
|
|
|
BRUSHOBJ * brush );
|
1999-02-26 12:11:13 +01:00
|
|
|
extern HFONT WIN16DRV_FONT_SelectObject( DC * dc, HFONT hfont,
|
1997-03-05 09:22:35 +01:00
|
|
|
FONTOBJ * font );
|
1999-02-26 12:11:13 +01:00
|
|
|
extern HPEN WIN16DRV_PEN_SelectObject( DC * dc, HPEN hpen, PENOBJ * pen );
|
1997-03-05 09:22:35 +01:00
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
1997-08-24 18:00:30 +02:00
|
|
|
* WIN16DRV_SelectObject
|
1997-03-05 09:22:35 +01:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
HGDIOBJ WIN16DRV_SelectObject( DC *dc, HGDIOBJ handle )
|
1997-03-05 09:22:35 +01:00
|
|
|
{
|
|
|
|
GDIOBJHDR *ptr = GDI_GetObjPtr( handle, MAGIC_DONTCARE );
|
1999-02-26 12:11:13 +01:00
|
|
|
HGDIOBJ ret = 0;
|
1997-03-05 09:22:35 +01:00
|
|
|
|
|
|
|
if (!ptr) return 0;
|
1999-06-26 21:09:08 +02:00
|
|
|
TRACE("hdc=%04x %04x\n", dc->hSelf, handle );
|
1997-03-05 09:22:35 +01:00
|
|
|
|
|
|
|
switch(ptr->wMagic)
|
|
|
|
{
|
|
|
|
case PEN_MAGIC:
|
1997-10-12 18:30:17 +02:00
|
|
|
ret = WIN16DRV_PEN_SelectObject( dc, handle, (PENOBJ *)ptr );
|
|
|
|
break;
|
1997-03-05 09:22:35 +01:00
|
|
|
case BRUSH_MAGIC:
|
1997-10-12 18:30:17 +02:00
|
|
|
ret = WIN16DRV_BRUSH_SelectObject( dc, handle, (BRUSHOBJ *)ptr );
|
|
|
|
break;
|
1997-03-05 09:22:35 +01:00
|
|
|
case BITMAP_MAGIC:
|
1999-06-26 21:09:08 +02:00
|
|
|
FIXME("WIN16DRV_SelectObject for BITMAP not implemented\n");
|
1997-10-12 18:30:17 +02:00
|
|
|
ret = 1;
|
|
|
|
break;
|
1997-03-05 09:22:35 +01:00
|
|
|
case FONT_MAGIC:
|
1997-08-24 18:00:30 +02:00
|
|
|
ret = WIN16DRV_FONT_SelectObject( dc, handle, (FONTOBJ *)ptr );
|
|
|
|
break;
|
1997-03-05 09:22:35 +01:00
|
|
|
case REGION_MAGIC:
|
1997-08-24 18:00:30 +02:00
|
|
|
ret = (HGDIOBJ16)SelectClipRgn16( dc->hSelf, handle );
|
|
|
|
break;
|
1997-03-05 09:22:35 +01:00
|
|
|
}
|
1997-08-24 18:00:30 +02:00
|
|
|
GDI_HEAP_UNLOCK( handle );
|
|
|
|
return ret;
|
1997-03-05 09:22:35 +01:00
|
|
|
}
|