Fix thinko that slipped in with the prev patch (reenables refresh).
[wine] / dlls / user / controls.h
1 /*
2  * User controls definitions
3  *
4  * Copyright 2000 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 #ifndef __WINE_CONTROLS_H
22 #define __WINE_CONTROLS_H
23
24 #include "winuser.h"
25 #include "winproc.h"
26
27 /* Built-in class names (see _Undocumented_Windows_ p.418) */
28 #define POPUPMENU_CLASS_ATOM MAKEINTATOMA(32768)  /* PopupMenu */
29 #define DESKTOP_CLASS_ATOM   MAKEINTATOMA(32769)  /* Desktop */
30 #define DIALOG_CLASS_ATOM    MAKEINTATOMA(32770)  /* Dialog */
31 #define WINSWITCH_CLASS_ATOM MAKEINTATOMA(32771)  /* WinSwitch */
32 #define ICONTITLE_CLASS_ATOM MAKEINTATOMA(32772)  /* IconTitle */
33
34 /* Built-in class descriptor */
35 struct builtin_class_descr
36 {
37     LPCSTR  name;    /* class name */
38     UINT    style;   /* class style */
39     WNDPROC procA;   /* ASCII window procedure */
40     WNDPROC procW;   /* Unicode window procedure */
41     INT     extra;   /* window extra bytes */
42     LPCSTR  cursor;  /* cursor name */
43     HBRUSH  brush;   /* brush or system color */
44 };
45
46
47 /* desktop */
48 extern BOOL DESKTOP_SetPattern( LPCSTR pattern );
49
50 /* icon title */
51 extern HWND ICONTITLE_Create( HWND hwnd );
52
53 /* menu controls */
54 extern BOOL MENU_Init(void);
55 extern BOOL MENU_IsMenuActive(void);
56 extern HMENU MENU_GetSysMenu(HWND hWndOwner, HMENU hSysPopup);
57 extern UINT MENU_GetMenuBarHeight( HWND hwnd, UINT menubarWidth,
58                                      INT orgX, INT orgY );
59 extern void MENU_TrackMouseMenuBar( HWND hwnd, INT ht, POINT pt );
60 extern void MENU_TrackKbdMenuBar( HWND hwnd, UINT wParam, INT vkey );
61 extern UINT MENU_DrawMenuBar( HDC hDC, LPRECT lprect,
62                                 HWND hwnd, BOOL suppress_draw );
63 extern UINT MENU_FindSubMenu( HMENU *hmenu, HMENU hSubTarget );
64
65 /* scrollbar */
66 extern void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar, BOOL arrows, BOOL interior );
67 extern void SCROLL_TrackScrollBar( HWND hwnd, INT scrollbar, POINT pt );
68 extern INT SCROLL_SetNCSbState( HWND hwnd, int vMin, int vMax, int vPos,
69                                 int hMin, int hMax, int hPos );
70
71 /* combo box */
72
73 #define ID_CB_LISTBOX           1000
74 #define ID_CB_EDIT              1001
75
76 /* internal flags */
77 #define CBF_DROPPED             0x0001
78 #define CBF_BUTTONDOWN          0x0002
79 #define CBF_NOROLLUP            0x0004
80 #define CBF_MEASUREITEM         0x0008
81 #define CBF_FOCUSED             0x0010
82 #define CBF_CAPTURE             0x0020
83 #define CBF_EDIT                0x0040
84 #define CBF_NORESIZE            0x0080
85 #define CBF_NOTIFY              0x0100
86 #define CBF_NOREDRAW            0x0200
87 #define CBF_SELCHANGE           0x0400
88 #define CBF_NOEDITNOTIFY        0x1000
89 #define CBF_NOLBSELECT          0x2000  /* do not change current selection */
90 #define CBF_EUI                 0x8000
91
92 /* combo state struct */
93 typedef struct
94 {
95    HWND           self;
96    HWND           owner;
97    UINT           dwStyle;
98    HWND           hWndEdit;
99    HWND           hWndLBox;
100    UINT           wState;
101    HFONT          hFont;
102    RECT           textRect;
103    RECT           buttonRect;
104    RECT           droppedRect;
105    INT            droppedIndex;
106    INT            fixedOwnerDrawHeight;
107    INT            droppedWidth;   /* last two are not used unless set */
108    INT            editHeight;     /* explicitly */
109 } HEADCOMBO,*LPHEADCOMBO;
110
111 /* Note, that CBS_DROPDOWNLIST style is actually (CBS_SIMPLE | CBS_DROPDOWN) */
112 #define CB_GETTYPE( lphc )    ((lphc)->dwStyle & (CBS_DROPDOWNLIST))
113
114 extern BOOL COMBO_FlipListbox( LPHEADCOMBO, BOOL, BOOL );
115
116 /* Dialog info structure */
117 typedef struct
118 {
119     HWND      hwndFocus;   /* Current control with focus */
120     HFONT     hUserFont;   /* Dialog font */
121     HMENU     hMenu;       /* Dialog menu */
122     UINT      xBaseUnit;   /* Dialog units (depends on the font) */
123     UINT      yBaseUnit;
124     INT       idResult;    /* EndDialog() result / default pushbutton ID */
125     UINT      flags;       /* EndDialog() called for this dialog */
126     HGLOBAL16 hDialogHeap;
127 } DIALOGINFO;
128
129 #define DF_END  0x0001
130 #define DF_OWNERENABLED 0x0002
131
132 /* offset of DIALOGINFO ptr in dialog extra bytes */
133 #define DWL_WINE_DIALOGINFO (DWL_USER+sizeof(ULONG_PTR))
134
135 inline static DIALOGINFO *DIALOG_get_info( HWND hwnd )
136 {
137     return (DIALOGINFO *)GetWindowLongW( hwnd, DWL_WINE_DIALOGINFO );
138 }
139
140 extern BOOL DIALOG_Init(void);
141
142 #endif  /* __WINE_CONTROLS_H */