Release 980301
[wine] / include / resource.h
1 /*
2  * Resource definitions
3  *
4  * Copyright 1995 Alexandre Julliard
5  */
6
7 #ifndef __WINE_RESOURCE_H
8 #define __WINE_RESOURCE_H
9
10 #include "windows.h"
11
12 struct resource
13 {
14     int id;
15     int type;
16     const char *name;
17     const unsigned char* bytes;
18     unsigned size;
19 };
20
21 /* Built-in resources */
22 typedef enum
23 {
24     SYSRES_MENU_SYSMENU,
25     SYSRES_MENU_EDITMENU,
26     SYSRES_DIALOG_MSGBOX,
27     SYSRES_DIALOG_SHELL_ABOUT_MSGBOX,
28     SYSRES_DIALOG_OPEN_FILE,
29     SYSRES_DIALOG_SAVE_FILE,
30     SYSRES_DIALOG_PRINT,
31     SYSRES_DIALOG_PRINT_SETUP,
32     SYSRES_DIALOG_CHOOSE_FONT,
33     SYSRES_DIALOG_CHOOSE_COLOR,
34     SYSRES_DIALOG_FIND_TEXT,
35     SYSRES_DIALOG_REPLACE_TEXT
36 } SYSTEM_RESOURCE;
37
38 extern void LIBRES_RegisterResources(const struct resource* const * Res);
39
40 #if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ >= 7)
41 #define WINE_CONSTRUCTOR  __attribute__((constructor))
42 #define HAVE_WINE_CONSTRUCTOR
43 #else
44 #define WINE_CONSTRUCTOR
45 #undef HAVE_WINE_CONSTRUCTOR
46 #endif
47
48 typedef HGLOBAL16 (CALLBACK *RESOURCEHANDLER16)(HGLOBAL16, HMODULE16, HRSRC16 );
49
50 /* FIXME: convert all NE_ functions to accept NE_MODULE pointer instead
51  * of redundant hModule (which is always verified prior to calling these).
52  */
53
54 extern int NE_AccessResource( HMODULE16 hModule, HRSRC16 hRsrc );
55 extern BOOL32 NE_FreeResource( HMODULE16 hModule, HGLOBAL16 handle );
56 extern HRSRC16 NE_FindResource(HMODULE16 hModule, SEGPTR typeId, SEGPTR resId);
57 extern DWORD NE_SizeofResource( HMODULE16 hModule, HRSRC16 hRsrc );
58 extern SEGPTR NE_LockResource( HMODULE16 hModule, HGLOBAL16 handle );
59 extern HGLOBAL16 NE_AllocResource( HMODULE16 hModule, HRSRC16 hRsrc, DWORD size );
60 extern HGLOBAL16 NE_LoadResource( HMODULE16 hModule,  HRSRC16 hRsrc );
61 extern BOOL32 NE_InitResourceHandler( HMODULE16 hModule );
62 extern FARPROC32 NE_SetResourceHandler( HMODULE16 hModule, SEGPTR typeId, FARPROC32 handler);
63
64 extern HGLOBAL16 SYSRES_LoadResource( SYSTEM_RESOURCE id );
65 extern void SYSRES_FreeResource( HGLOBAL16 handle );
66 extern LPCVOID SYSRES_GetResPtr( SYSTEM_RESOURCE id );
67
68 #endif /* __WINE_RESOURCE_H */