Do not kill the animation thread with TerminateThread, let it finish
[wine] / dlls / ddraw / dsurface / user.h
1 /*
2  * Copyright 2000-2001 TransGaming Technologies Inc.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19 #ifndef DDRAW_DSURFACE_USER_H_INCLUDED
20 #define DDRAW_DSURFACE_USER_H_INCLUDED
21
22 #define USER_PRIV(surf) ((User_DirectDrawSurfaceImpl*)((surf)->private))
23
24 #define USER_PRIV_VAR(name,surf) \
25         User_DirectDrawSurfaceImpl* name = USER_PRIV(surf)
26
27 struct User_DirectDrawSurfaceImpl_Part
28 {
29     HWND window;
30     HDC cached_dc;
31     HANDLE update_thread, update_event, refresh_event;
32     volatile int wait_count, in_refresh;
33     CRITICAL_SECTION crit;
34 };
35
36 typedef struct
37 {
38     struct DIB_DirectDrawSurfaceImpl_Part dib;
39     struct User_DirectDrawSurfaceImpl_Part user;
40 } User_DirectDrawSurfaceImpl;
41
42 HRESULT
43 User_DirectDrawSurface_Construct(IDirectDrawSurfaceImpl* This,
44                                  IDirectDrawImpl* pDD,
45                                  const DDSURFACEDESC2* pDDSD);
46
47 HRESULT
48 User_DirectDrawSurface_Create(IDirectDrawImpl *pDD,
49                               const DDSURFACEDESC2 *pDDSD,
50                               LPDIRECTDRAWSURFACE7 *ppSurf,
51                               IUnknown *pUnkOuter);
52
53 void User_DirectDrawSurface_final_release(IDirectDrawSurfaceImpl* This);
54
55 void User_DirectDrawSurface_lock_update(IDirectDrawSurfaceImpl* This,
56                                         LPCRECT pRect, DWORD dwFlags);
57 void User_DirectDrawSurface_unlock_update(IDirectDrawSurfaceImpl* This,
58                                           LPCRECT pRect);
59 void User_DirectDrawSurface_set_palette(IDirectDrawSurfaceImpl* This,
60                                         IDirectDrawPaletteImpl* pal);
61 void User_DirectDrawSurface_update_palette(IDirectDrawSurfaceImpl* This,
62                                            IDirectDrawPaletteImpl* pal,
63                                            DWORD dwStart, DWORD dwCount,
64                                            LPPALETTEENTRY palent);
65 HRESULT User_DirectDrawSurface_duplicate_surface(IDirectDrawSurfaceImpl* This,
66                                                  LPDIRECTDRAWSURFACE7* ppDup);
67 BOOL User_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
68                                       IDirectDrawSurfaceImpl* back,
69                                       DWORD dwFlags);
70 void User_DirectDrawSurface_flip_update(IDirectDrawSurfaceImpl* This,
71                                         DWORD dwFlags);
72 HWND User_DirectDrawSurface_get_display_window(IDirectDrawSurfaceImpl* This);
73
74 HRESULT User_DirectDrawSurface_get_dc(IDirectDrawSurfaceImpl* This, HDC* phDC);
75 HRESULT User_DirectDrawSurface_release_dc(IDirectDrawSurfaceImpl* This,
76                                           HDC hDC);
77
78 HRESULT User_DirectDrawSurface_get_gamma_ramp(IDirectDrawSurfaceImpl* This,
79                                               DWORD dwFlags,
80                                               LPDDGAMMARAMP lpGammaRamp);
81 HRESULT User_DirectDrawSurface_set_gamma_ramp(IDirectDrawSurfaceImpl* This,
82                                               DWORD dwFlags,
83                                               LPDDGAMMARAMP lpGammaRamp);
84
85 #endif