Added server_abort_thread to replace SYSDEPS_AbortThread.
[wine/hacks.git] / dlls / comctl32 / nativefont.c
bloba8ecff2b3a87cee86c54c81a195dfc58a940c9e9
1 /*
2 * Native Font control
4 * Copyright 1998, 1999 Eric Kohl
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.
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.
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
20 * NOTES
21 * This is just a dummy control. An author is needed! Any volunteers?
22 * I will only improve this control once in a while.
23 * Eric <ekohl@abo.rhein-zeitung.de>
25 * TODO:
26 * - All messages.
27 * - All notifications.
30 #include <stdarg.h>
31 #include <string.h>
32 #include "windef.h"
33 #include "winbase.h"
34 #include "wingdi.h"
35 #include "winuser.h"
36 #include "winnls.h"
37 #include "commctrl.h"
38 #include "comctl32.h"
39 #include "wine/debug.h"
41 WINE_DEFAULT_DEBUG_CHANNEL(nativefont);
43 typedef struct
45 DWORD dwDummy; /* just to keep the compiler happy ;-) */
46 } NATIVEFONT_INFO;
48 #define NATIVEFONT_GetInfoPtr(hwnd) ((NATIVEFONT_INFO *)GetWindowLongA (hwnd, 0))
51 static LRESULT
52 NATIVEFONT_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
54 NATIVEFONT_INFO *infoPtr;
56 /* allocate memory for info structure */
57 infoPtr = (NATIVEFONT_INFO *)Alloc (sizeof(NATIVEFONT_INFO));
58 SetWindowLongA (hwnd, 0, (DWORD)infoPtr);
61 /* initialize info structure */
64 return 0;
68 static LRESULT
69 NATIVEFONT_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
71 NATIVEFONT_INFO *infoPtr = NATIVEFONT_GetInfoPtr (hwnd);
76 /* free comboex info data */
77 Free (infoPtr);
78 SetWindowLongA( hwnd, 0, 0 );
80 return 0;
85 static LRESULT WINAPI
86 NATIVEFONT_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
88 if (!NATIVEFONT_GetInfoPtr(hwnd) && (uMsg != WM_CREATE))
89 return DefWindowProcA( hwnd, uMsg, wParam, lParam );
91 switch (uMsg)
94 case WM_CREATE:
95 return NATIVEFONT_Create (hwnd, wParam, lParam);
97 case WM_DESTROY:
98 return NATIVEFONT_Destroy (hwnd, wParam, lParam);
100 case WM_MOVE:
101 case WM_SIZE:
102 case WM_SHOWWINDOW:
103 case WM_WINDOWPOSCHANGING:
104 case WM_WINDOWPOSCHANGED:
105 case WM_SETFONT:
106 case WM_GETDLGCODE:
107 /* FIXME("message %04x seen but stubbed\n", uMsg); */
108 return DefWindowProcA (hwnd, uMsg, wParam, lParam);
110 default:
111 ERR("unknown msg %04x wp=%08x lp=%08lx\n",
112 uMsg, wParam, lParam);
113 return DefWindowProcA (hwnd, uMsg, wParam, lParam);
115 return 0;
119 VOID
120 NATIVEFONT_Register (void)
122 WNDCLASSA wndClass;
124 ZeroMemory (&wndClass, sizeof(WNDCLASSA));
125 wndClass.style = CS_GLOBALCLASS;
126 wndClass.lpfnWndProc = (WNDPROC)NATIVEFONT_WindowProc;
127 wndClass.cbClsExtra = 0;
128 wndClass.cbWndExtra = sizeof(NATIVEFONT_INFO *);
129 wndClass.hCursor = LoadCursorA (0, (LPSTR)IDC_ARROW);
130 wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
131 wndClass.lpszClassName = WC_NATIVEFONTCTLA;
133 RegisterClassA (&wndClass);
137 VOID
138 NATIVEFONT_Unregister (void)
140 UnregisterClassA (WC_NATIVEFONTCTLA, NULL);