Fixed TOOLBAR_DrawString() to offset button text if infoPtr->himlDef
[wine/gsoc_dplay.git] / include / callback.h
blob3ca005248355037f364f2419ad0f1351ffd70a05
1 /*
2 * Callback functions
4 * Copyright 1995 Alexandre Julliard
5 */
7 #ifndef __WINE_CALLBACK_H
8 #define __WINE_CALLBACK_H
10 #include "windef.h"
11 #include "winnt.h"
12 #include "wingdi.h"
13 #include "wine/winuser16.h"
15 extern void SYSDEPS_SwitchToThreadStack( void (*func)(void) ) WINE_NORETURN;
16 extern int SYSDEPS_CallOnLargeStack( int (*func)(void *), void *arg );
18 #define CALL_LARGE_STACK( func, arg ) \
19 SYSDEPS_CallOnLargeStack( (int (*)(void *))(func), (void *)(arg) )
21 typedef void (*RELAY)();
22 extern FARPROC THUNK_Alloc( FARPROC16 func, RELAY relay );
23 extern void THUNK_Free( FARPROC thunk );
24 extern BOOL THUNK_Init(void);
25 extern void THUNK_InitCallout(void);
27 typedef struct
29 LONG CALLBACK (*CallRegisterShortProc)( CONTEXT86 *, INT );
30 LONG CALLBACK (*CallRegisterLongProc)( CONTEXT86 *, INT );
31 INT16 CALLBACK (*CallWindowsExitProc)( FARPROC16, INT16 );
32 INT16 CALLBACK (*CallWordBreakProc)( EDITWORDBREAKPROC16, SEGPTR, INT16,
33 INT16, INT16 );
34 VOID CALLBACK (*CallBootAppProc)( FARPROC16, HANDLE16, HFILE16 );
35 WORD CALLBACK (*CallLoadAppSegProc)( FARPROC16, HANDLE16, HFILE16, WORD );
36 WORD CALLBACK (*CallLocalNotifyFunc)( FARPROC16, WORD, HLOCAL16, WORD );
37 HGLOBAL16 CALLBACK (*CallResourceHandlerProc)( FARPROC16, HGLOBAL16, HMODULE16, HRSRC16 );
38 DWORD CALLBACK (*CallUTProc)( FARPROC16, DWORD, DWORD );
39 LRESULT CALLBACK (*CallASPIPostProc)( FARPROC16, SEGPTR );
40 } CALLBACKS_TABLE;
42 extern const CALLBACKS_TABLE *Callbacks;
44 typedef struct
46 BOOL16 WINAPI (*PeekMessage16)( LPMSG16 msg, HWND16 hwnd,
47 UINT16 first, UINT16 last, UINT16 flags );
48 BOOL WINAPI (*PeekMessageA)( LPMSG lpmsg, HWND hwnd,
49 UINT min, UINT max, UINT wRemoveMsg );
50 BOOL WINAPI (*PeekMessageW)( LPMSG lpmsg, HWND hwnd,
51 UINT min, UINT max, UINT wRemoveMsg );
53 BOOL16 WINAPI (*GetMessage16)( SEGPTR msg, HWND16 hwnd,
54 UINT16 first, UINT16 last );
55 BOOL WINAPI (*GetMessageA)( MSG* lpmsg, HWND hwnd,
56 UINT min, UINT max );
57 BOOL WINAPI (*GetMessageW)( MSG* lpmsg, HWND hwnd,
58 UINT min, UINT max );
60 LRESULT WINAPI (*SendMessage16)( HWND16 hwnd, UINT16 msg,
61 WPARAM16 wParam, LPARAM lParam );
62 LRESULT WINAPI (*SendMessageA)( HWND hwnd, UINT msg,
63 WPARAM wParam, LPARAM lParam );
64 LRESULT WINAPI (*SendMessageW)( HWND hwnd, UINT msg,
65 WPARAM wParam, LPARAM lParam );
67 BOOL16 WINAPI (*PostMessage16)( HWND16 hwnd, UINT16 message,
68 WPARAM16 wParam, LPARAM lParam );
69 BOOL WINAPI (*PostMessageA)( HWND hwnd, UINT message,
70 WPARAM wParam, LPARAM lParam );
71 BOOL WINAPI (*PostMessageW)( HWND hwnd, UINT message,
72 WPARAM wParam, LPARAM lParam );
74 BOOL16 WINAPI (*PostAppMessage16)( HTASK16 hTask, UINT16 message,
75 WPARAM16 wParam, LPARAM lParam );
76 BOOL WINAPI (*PostThreadMessageA)( DWORD idThread , UINT message,
77 WPARAM wParam, LPARAM lParam );
78 BOOL WINAPI (*PostThreadMessageW)( DWORD idThread , UINT message,
79 WPARAM wParam, LPARAM lParam );
81 BOOL16 WINAPI (*TranslateMessage16)( const MSG16 *msg );
82 BOOL WINAPI (*TranslateMessage)( const MSG *msg );
84 LONG WINAPI (*DispatchMessage16)( const MSG16* msg );
85 LONG WINAPI (*DispatchMessageA)( const MSG* msg );
86 LONG WINAPI (*DispatchMessageW)( const MSG* msg );
88 BOOL16 WINAPI (*RedrawWindow16)( HWND16 hwnd, const RECT16 *rectUpdate,
89 HRGN16 hrgnUpdate, UINT16 flags );
91 BOOL WINAPI (*RedrawWindow)( HWND hwnd, const RECT *rectUpdate,
92 HRGN hrgnUpdate, UINT flags );
94 WORD WINAPI (*UserSignalProc)( UINT uCode, DWORD dwThreadOrProcessID,
95 DWORD dwFlags, HMODULE16 hModule );
96 void WINAPI (*FinalUserInit16)( void );
98 INT16 WINAPI (*InitApp16)( HINSTANCE16 hInst );
99 HQUEUE16 WINAPI (*InitThreadInput16)( WORD unknown, WORD flags );
100 void WINAPI (*UserYield16)( void );
101 WORD WINAPI (*DestroyIcon32)( HGLOBAL16 handle, UINT16 flags );
102 DWORD WINAPI (*WaitForInputIdle)( HANDLE hProcess, DWORD dwTimeOut );
104 INT WINAPI (*MessageBoxA)( HWND hWnd, LPCSTR text, LPCSTR title, UINT type );
105 INT WINAPI (*MessageBoxW)( HWND hwnd, LPCWSTR text, LPCWSTR title, UINT type );
107 } CALLOUT_TABLE;
109 extern CALLOUT_TABLE Callout;
111 #include "pshpack1.h"
113 typedef struct tagTHUNK
115 BYTE popl_eax; /* 0x58 popl %eax (return address)*/
116 BYTE pushl_func; /* 0x68 pushl $proc */
117 FARPROC16 proc WINE_PACKED;
118 BYTE pushl_eax; /* 0x50 pushl %eax */
119 BYTE jmp; /* 0xe9 jmp relay (relative jump)*/
120 RELAY relay WINE_PACKED;
121 struct tagTHUNK *next WINE_PACKED;
122 DWORD magic;
123 } THUNK;
125 #include "poppack.h"
127 #define CALLTO16_THUNK_MAGIC 0x54484e4b /* "THNK" */
129 #define DECL_THUNK(aname,aproc,arelay) \
130 THUNK aname; \
131 aname.popl_eax = 0x58; \
132 aname.pushl_func = 0x68; \
133 aname.proc = (FARPROC) (aproc); \
134 aname.pushl_eax = 0x50; \
135 aname.jmp = 0xe9; \
136 aname.relay = (RELAY)((char *)(arelay) - (char *)(&(aname).next)); \
137 aname.next = NULL; \
138 aname.magic = CALLTO16_THUNK_MAGIC;
140 #endif /* __WINE_CALLBACK_H */