Documentation fixes.
[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 "message.h"
13 #include "user.h"
14 #include "win.h"
15 #include "debugtools.h"
16 #include "ttydrv.h"
17
18 DEFAULT_DEBUG_CHANNEL(ttydrv);
19
20 int cell_width = 8;
21 int cell_height = 8;
22 int screen_rows = 50;  /* default value */
23 int screen_cols = 80;  /* default value */
24 WINDOW *root_window;
25
26
27 /***********************************************************************
28  *           TTYDRV process initialisation routine
29  */
30 static void process_attach(void)
31 {
32 #ifdef WINE_CURSES
33     if ((root_window = initscr()))
34     {
35         werase(root_window);
36         wrefresh(root_window);
37     }
38     getmaxyx(root_window, screen_rows, screen_cols);
39 #endif  /* WINE_CURSES */
40
41     TTYDRV_GDI_Initialize();
42
43     /* load display.dll */
44     LoadLibrary16( "display" );
45 }
46
47
48 /***********************************************************************
49  *           TTYDRV process termination routine
50  */
51 static void process_detach(void)
52 {
53     TTYDRV_GDI_Finalize();
54
55 #ifdef WINE_CURSES
56     if (root_window) endwin();
57 #endif  /* WINE_CURSES */
58 }
59
60
61 /***********************************************************************
62  *           TTYDRV initialisation routine
63  */
64 BOOL WINAPI TTYDRV_Init( HINSTANCE hinst, DWORD reason, LPVOID reserved )
65 {
66     switch(reason)
67     {
68     case DLL_PROCESS_ATTACH:
69         process_attach();
70         break;
71
72     case DLL_PROCESS_DETACH:
73         process_detach();
74         break;
75     }
76     return TRUE;
77 }