fdopen: don't rewind the file after creating the FILE* handle. Added
[wine] / dlls / gdi / win16drv / objects.c
1 /*
2  * GDI objects
3  *
4  * Copyright 1993 Alexandre Julliard
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #include "config.h"
22
23 #include <stdlib.h>
24 #include <stdio.h>
25
26 #include "win16drv/win16drv.h"
27 #include "wownt32.h"
28
29 #include "wine/debug.h"
30
31 WINE_DEFAULT_DEBUG_CHANNEL(gdi);
32
33
34 /***********************************************************************
35  *           WIN16DRV_SelectBitmap
36  */
37 HBITMAP WIN16DRV_SelectBitmap( PHYSDEV dev, HBITMAP bitmap )
38 {
39     FIXME("BITMAP not implemented\n");
40     return (HBITMAP)1;
41 }
42
43
44 /***********************************************************************
45  *           WIN16DRV_SelectBrush
46  */
47 HBRUSH WIN16DRV_SelectBrush( PHYSDEV dev, HBRUSH hbrush )
48 {
49     WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dev;
50     int          nSize;
51     LOGBRUSH16 lBrush16;
52
53     if (!GetObject16( HBRUSH_16(hbrush), sizeof(lBrush16), &lBrush16 )) return 0;
54
55     if ( physDev->BrushInfo )
56     {
57         TRACE("UnRealizing BrushInfo\n");
58         nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, -DRVOBJ_BRUSH,
59                                       physDev->BrushInfo,
60                                       physDev->BrushInfo, 0);
61     }
62     else
63     {
64         nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, DRVOBJ_BRUSH, &lBrush16, 0, 0);
65         physDev->BrushInfo = HeapAlloc( GetProcessHeap(), 0, nSize );
66     }
67
68     nSize = PRTDRV_RealizeObject(physDev->segptrPDEVICE, DRVOBJ_BRUSH,
69                                  &lBrush16, physDev->BrushInfo, win16drv_SegPtr_TextXForm);
70     return hbrush;
71 }
72
73
74 /***********************************************************************
75  *           WIN16DRV_SelectPen
76  */
77 HPEN WIN16DRV_SelectPen( PHYSDEV dev, HPEN hpen )
78 {
79     WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dev;
80     int          nSize;
81     LOGPEN16     lPen16;
82
83     if (!GetObject16( HPEN_16(hpen), sizeof(lPen16), &lPen16 )) return 0;
84
85     if ( physDev->PenInfo )
86     {
87         TRACE("UnRealizing PenInfo\n");
88         nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, -DRVOBJ_PEN,
89                                       physDev->PenInfo,
90                                       physDev->PenInfo, 0);
91     }
92     else
93     {
94         nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, DRVOBJ_PEN, &lPen16, 0, 0);
95         physDev->PenInfo = HeapAlloc( GetProcessHeap(), 0, nSize );
96     }
97
98     nSize = PRTDRV_RealizeObject(physDev->segptrPDEVICE, DRVOBJ_PEN,
99                                  &lPen16, physDev->PenInfo, 0);
100     return hpen;
101 }