Added mappings for a few messages.
[wine] / dlls / ttydrv / ttydrv_main.c
1 /*
2  * TTYDRV initialization code
3  */
4
5 #include "config.h"
6
7 #include <stdio.h>
8
9 #include "winbase.h"
10 #include "wine/winbase16.h"
11 #include "gdi.h"
12 #include "user.h"
13 #include "win.h"
14 #include "debugtools.h"
15 #include "ttydrv.h"
16
17 DEFAULT_DEBUG_CHANNEL(ttydrv);
18
19 int cell_width = 8;
20 int cell_height = 8;
21 int screen_rows = 50;  /* default value */
22 int screen_cols = 80;  /* default value */
23 WINDOW *root_window;
24
25
26 /***********************************************************************
27  *           TTYDRV process initialisation routine
28  */
29 static void process_attach(void)
30 {
31 #ifdef WINE_CURSES
32     if ((root_window = initscr()))
33     {
34         werase(root_window);
35         wrefresh(root_window);
36     }
37     getmaxyx(root_window, screen_rows, screen_cols);
38 #endif  /* WINE_CURSES */
39
40     TTYDRV_GDI_Initialize();
41
42     /* load display.dll */
43     LoadLibrary16( "display" );
44 }
45
46
47 /***********************************************************************
48  *           TTYDRV process termination routine
49  */
50 static void process_detach(void)
51 {
52 #ifdef WINE_CURSES
53     if (root_window) endwin();
54 #endif  /* WINE_CURSES */
55 }
56
57
58 /***********************************************************************
59  *           TTYDRV initialisation routine
60  */
61 BOOL WINAPI TTYDRV_Init( HINSTANCE hinst, DWORD reason, LPVOID reserved )
62 {
63     switch(reason)
64     {
65     case DLL_PROCESS_ATTACH:
66         process_attach();
67         break;
68
69     case DLL_PROCESS_DETACH:
70         process_detach();
71         break;
72     }
73     return TRUE;
74 }