Release 960314
[wine/multimedia.git] / controls / widgets.c
blob4ae39e3da9aa49f49e56c8a19314fa4f2e59ab42
1 /*
2 * Windows widgets (built-in window classes)
4 * Copyright 1993 Alexandre Julliard
5 */
7 #include "win.h"
8 #include "button.h"
9 #include "static.h"
10 #include "scroll.h"
11 #include "desktop.h"
12 #include "mdi.h"
13 #include "gdi.h"
14 #include "user.h"
15 #include "selectors.h"
16 #include "stackframe.h"
17 #include "alias.h"
18 #include "relay32.h"
20 static WNDCLASS WIDGETS_BuiltinClasses[] =
22 { CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
23 (WNDPROC)"ButtonWndProc", 0, sizeof(BUTTONINFO),
24 0, 0, 0, 0, 0, (SEGPTR)"BUTTON" },
25 { CS_GLOBALCLASS | CS_PARENTDC,
26 (WNDPROC)"StaticWndProc", 0, sizeof(STATICINFO),
27 0, 0, 0, 0, 0, (SEGPTR)"STATIC" },
28 { CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
29 (WNDPROC)"ScrollBarWndProc", 0, sizeof(SCROLLINFO),
30 0, 0, 0, 0, 0, (SEGPTR)"SCROLLBAR" },
31 { CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS,
32 (WNDPROC)"ListBoxWndProc", 0, 8,
33 0, 0, 0, 0, 0, (SEGPTR)"LISTBOX" },
34 { CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS,
35 (WNDPROC)"ComboBoxWndProc", 0, 8,
36 0, 0, 0, 0, 0, (SEGPTR)"COMBOBOX" },
37 { CS_GLOBALCLASS | CS_DBLCLKS | CS_SAVEBITS,
38 (WNDPROC)"ComboLBoxWndProc", 0, 8,
39 0, 0, 0, 0, 0, (SEGPTR)"COMBOLBOX" },
40 { CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS,
41 (WNDPROC)"EditWndProc", 0, sizeof(DWORD),
42 0, 0, 0, 0, 0, (SEGPTR)"EDIT" },
43 { CS_GLOBALCLASS | CS_SAVEBITS, (WNDPROC)"PopupMenuWndProc", 0, 8,
44 0, 0, 0, 0, 0, (SEGPTR)POPUPMENU_CLASS_NAME },
45 { CS_GLOBALCLASS, (WNDPROC)"DesktopWndProc", 0, sizeof(DESKTOPINFO),
46 0, 0, 0, 0, 0, (SEGPTR)DESKTOP_CLASS_NAME },
47 { CS_GLOBALCLASS | CS_SAVEBITS, (WNDPROC)"DefDlgProc", 0, DLGWINDOWEXTRA,
48 0, 0, 0, 0, 0, (SEGPTR)DIALOG_CLASS_NAME },
49 { CS_GLOBALCLASS, (WNDPROC)"MDIClientWndProc", 0, sizeof(MDICLIENTINFO),
50 0, 0, 0, STOCK_LTGRAY_BRUSH, 0, (SEGPTR)"MDICLIENT" }
53 #define NB_BUILTIN_CLASSES \
54 (sizeof(WIDGETS_BuiltinClasses)/sizeof(WIDGETS_BuiltinClasses[0]))
57 /***********************************************************************
58 * WIDGETS_Init
60 * Initialize the built-in window classes.
62 BOOL WIDGETS_Init(void)
64 int i;
65 char name[20];
66 WNDCLASS *class = WIDGETS_BuiltinClasses;
68 for (i = 0; i < NB_BUILTIN_CLASSES; i++, class++)
70 DWORD WineProc,Win16Proc,Win32Proc;
71 WIN32_builtin *dll;
72 /* currently, there is no way to get the 'real' pointer at run time */
73 WineProc=0;
74 Win16Proc = (DWORD)GetWndProcEntry16( (char *)class->lpfnWndProc );
75 dll = RELAY32_GetBuiltinDLL("WINPROCS32");
76 Win32Proc = (DWORD)RELAY32_GetEntryPoint(
77 dll,(char *)class->lpfnWndProc, 0);
78 /* Register the alias so we don't pass Win16 pointers to Win32 apps */
79 ALIAS_RegisterAlias(WineProc,Win16Proc,Win32Proc);
81 strcpy( name, (char *)class->lpszClassName );
82 class->lpszClassName = MAKE_SEGPTR(name);
83 class->hCursor = LoadCursor( 0, IDC_ARROW );
84 class->lpfnWndProc = GetWndProcEntry16( (char *)class->lpfnWndProc );
85 if (!RegisterClass( class )) return FALSE;
87 return TRUE;