Spelling fixes.
[wine] / win32 / struct32.c
1 /*
2  * Win32 structure conversion functions
3  *
4  * Copyright 1996 Martin von Loewis
5  */
6
7 #include "windows.h"
8 #include "winerror.h"
9 #include "struct32.h"
10 #include "debug.h"
11
12 void STRUCT32_MSG16to32(const MSG16 *msg16,MSG32 *msg32)
13 {
14         msg32->hwnd=(HWND32)msg16->hwnd;
15         msg32->message=msg16->message;
16         msg32->wParam=msg16->wParam;
17         msg32->lParam=msg16->lParam;
18         msg32->time=msg16->time;
19         msg32->pt.x=msg16->pt.x;
20         msg32->pt.y=msg16->pt.y;
21 }
22
23 void STRUCT32_MSG32to16(const MSG32 *msg32,MSG16 *msg16)
24 {
25         msg16->hwnd=(HWND16)msg32->hwnd;
26         msg16->message=msg32->message;
27         msg16->wParam=msg32->wParam;
28         msg16->lParam=msg32->lParam;
29         msg16->time=msg32->time;
30         msg16->pt.x=msg32->pt.x;
31         msg16->pt.y=msg32->pt.y;
32 }
33
34 void STRUCT32_MINMAXINFO32to16( const MINMAXINFO32 *from, MINMAXINFO16 *to )
35 {
36     CONV_POINT32TO16( &from->ptReserved,     &to->ptReserved );
37     CONV_POINT32TO16( &from->ptMaxSize,      &to->ptMaxSize );
38     CONV_POINT32TO16( &from->ptMaxPosition,  &to->ptMaxPosition );
39     CONV_POINT32TO16( &from->ptMinTrackSize, &to->ptMinTrackSize );
40     CONV_POINT32TO16( &from->ptMaxTrackSize, &to->ptMaxTrackSize );
41 }
42
43 void STRUCT32_MINMAXINFO16to32( const MINMAXINFO16 *from, MINMAXINFO32 *to )
44 {
45     CONV_POINT16TO32( &from->ptReserved,     &to->ptReserved );
46     CONV_POINT16TO32( &from->ptMaxSize,      &to->ptMaxSize );
47     CONV_POINT16TO32( &from->ptMaxPosition,  &to->ptMaxPosition );
48     CONV_POINT16TO32( &from->ptMinTrackSize, &to->ptMinTrackSize );
49     CONV_POINT16TO32( &from->ptMaxTrackSize, &to->ptMaxTrackSize );
50 }
51
52 void STRUCT32_WINDOWPOS32to16( const WINDOWPOS32* from, WINDOWPOS16* to )
53 {
54     to->hwnd            = (HWND16)from->hwnd;
55     to->hwndInsertAfter = (HWND16)from->hwndInsertAfter;
56     to->x               = (INT16)from->x;
57     to->y               = (INT16)from->y;
58     to->cx              = (INT16)from->cx;
59     to->cy              = (INT16)from->cy;
60     to->flags           = (UINT16)from->flags;
61 }
62
63 void STRUCT32_WINDOWPOS16to32( const WINDOWPOS16* from, WINDOWPOS32* to )
64 {
65     to->hwnd            = (HWND32)from->hwnd;
66     to->hwndInsertAfter = (HWND32)from->hwndInsertAfter;
67     to->x               = (INT32)from->x;
68     to->y               = (INT32)from->y;
69     to->cx              = (INT32)from->cx;
70     to->cy              = (INT32)from->cy;
71     to->flags           = (UINT32)from->flags;
72 }
73
74 void STRUCT32_NCCALCSIZE32to16Flat( const NCCALCSIZE_PARAMS32* from,
75                                     NCCALCSIZE_PARAMS16* to, int validRects )
76 {
77     CONV_RECT32TO16( &from->rgrc[0], &to->rgrc[0] );
78     if (validRects)
79     {
80         CONV_RECT32TO16( &from->rgrc[1], &to->rgrc[1] );
81         CONV_RECT32TO16( &from->rgrc[2], &to->rgrc[2] );
82     }
83 }
84
85 void STRUCT32_NCCALCSIZE16to32Flat( const NCCALCSIZE_PARAMS16* from,
86                                     NCCALCSIZE_PARAMS32* to, int validRects )
87 {
88     CONV_RECT16TO32( &from->rgrc[0], &to->rgrc[0] );
89     if (validRects)
90     {
91         CONV_RECT32TO16( &from->rgrc[1], &to->rgrc[1] );
92         CONV_RECT32TO16( &from->rgrc[2], &to->rgrc[2] );
93     }
94 }
95
96 /* The strings are not copied */
97 void STRUCT32_CREATESTRUCT32Ato16( const CREATESTRUCT32A* from,
98                                    CREATESTRUCT16* to )
99 {
100     to->lpCreateParams = from->lpCreateParams;
101     to->hInstance      = (HINSTANCE16)from->hInstance;
102     to->hMenu          = (HMENU16)from->hMenu;
103     to->hwndParent     = (HWND16)from->hwndParent;
104     to->cy             = (INT16)from->cy;
105     to->cx             = (INT16)from->cx;
106     to->y              = (INT16)from->y;
107     to->x              = (INT16)from->x;
108     to->style          = from->style;
109     to->dwExStyle      = from->dwExStyle;
110 }
111
112 void STRUCT32_CREATESTRUCT16to32A( const CREATESTRUCT16* from,
113                                    CREATESTRUCT32A *to )
114 {
115     to->lpCreateParams = from->lpCreateParams;
116     to->hInstance      = (HINSTANCE32)from->hInstance;
117     to->hMenu          = (HMENU32)from->hMenu;
118     to->hwndParent     = (HWND32)from->hwndParent;
119     to->cy             = (INT32)from->cy;
120     to->cx             = (INT32)from->cx;
121     to->y              = (INT32)from->y;
122     to->x              = (INT32)from->x;
123     to->style          = from->style;
124     to->dwExStyle      = from->dwExStyle;
125 }
126
127 /* The strings are not copied */
128 void STRUCT32_MDICREATESTRUCT32Ato16( const MDICREATESTRUCT32A* from,
129                                       MDICREATESTRUCT16* to )
130 {
131     to->hOwner = (HINSTANCE16)from->hOwner;
132     to->x      = (INT16)from->x;     
133     to->y      = (INT16)from->y;     
134     to->cx     = (INT16)from->cx;    
135     to->cy     = (INT16)from->cy;    
136     to->style  = from->style; 
137     to->lParam = from->lParam;
138 }
139
140 void STRUCT32_MDICREATESTRUCT16to32A( const MDICREATESTRUCT16* from,
141                                       MDICREATESTRUCT32A *to )
142 {
143     to->hOwner = (HINSTANCE32)from->hOwner;
144     to->x      = (INT32)from->x;     
145     to->y      = (INT32)from->y;     
146     to->cx     = (INT32)from->cx;    
147     to->cy     = (INT32)from->cy;    
148     to->style  = from->style; 
149     to->lParam = from->lParam;
150 }
151