2 * TTYDRV initialization code
10 #include "wine/winbase16.h"
11 #include "clipboard.h"
18 #include "debugtools.h"
21 DEFAULT_DEBUG_CHANNEL(ttydrv
);
23 static USER_DRIVER user_driver
=
26 TTYDRV_EVENT_Synchronize
,
27 TTYDRV_EVENT_CheckFocus
,
28 TTYDRV_EVENT_UserRepaintDisable
,
29 /* keyboard functions */
31 TTYDRV_KEYBOARD_VkKeyScan
,
32 TTYDRV_KEYBOARD_MapVirtualKey
,
33 TTYDRV_KEYBOARD_GetKeyNameText
,
34 TTYDRV_KEYBOARD_ToAscii
,
35 TTYDRV_KEYBOARD_GetBeepActive
,
36 TTYDRV_KEYBOARD_SetBeepActive
,
38 TTYDRV_KEYBOARD_GetDIState
,
39 TTYDRV_KEYBOARD_GetDIData
,
40 TTYDRV_KEYBOARD_GetKeyboardConfig
,
41 TTYDRV_KEYBOARD_SetKeyboardConfig
,
44 TTYDRV_MOUSE_SetCursor
,
45 TTYDRV_MOUSE_MoveCursor
,
46 TTYDRV_MOUSE_EnableWarpPointer
,
47 /* screen saver functions */
48 TTYDRV_GetScreenSaveActive
,
49 TTYDRV_SetScreenSaveActive
,
50 TTYDRV_GetScreenSaveTimeout
,
51 TTYDRV_SetScreenSaveTimeout
,
52 /* windowing functions */
61 /***********************************************************************
62 * TTYDRV process initialisation routine
64 static void process_attach(void)
68 USER_Driver
= &user_driver
;
69 CLIPBOARD_Driver
= &TTYDRV_CLIPBOARD_Driver
;
70 WND_Driver
= &TTYDRV_WND_Driver
;
73 if ((root_window
= initscr()))
76 wrefresh(root_window
);
78 getmaxyx(root_window
, rows
, cols
);
79 #else /* WINE_CURSES */
80 rows
= 60; /* FIXME: Hardcoded */
81 cols
= 80; /* FIXME: Hardcoded */
82 #endif /* WINE_CURSES */
84 MONITOR_PrimaryMonitor
.rect
.left
= 0;
85 MONITOR_PrimaryMonitor
.rect
.top
= 0;
86 MONITOR_PrimaryMonitor
.rect
.right
= cell_width
* cols
;
87 MONITOR_PrimaryMonitor
.rect
.bottom
= cell_height
* rows
;
88 MONITOR_PrimaryMonitor
.depth
= 1;
90 TTYDRV_GDI_Initialize();
92 /* load display.dll */
93 LoadLibrary16( "display" );
97 /***********************************************************************
98 * TTYDRV process termination routine
100 static void process_detach(void)
102 TTYDRV_GDI_Finalize();
105 if (root_window
) endwin();
106 #endif /* WINE_CURSES */
109 CLIPBOARD_Driver
= NULL
;
114 /***********************************************************************
115 * TTYDRV initialisation routine
117 BOOL WINAPI
TTYDRV_Init( HINSTANCE hinst
, DWORD reason
, LPVOID reserved
)
119 static int process_count
;
123 case DLL_PROCESS_ATTACH
:
124 if (!process_count
++) process_attach();
127 case DLL_PROCESS_DETACH
:
128 if (!--process_count
) process_detach();
135 /***********************************************************************
136 * TTYDRV_GetScreenSaveActive
138 * Returns the active status of the screen saver
140 BOOL
TTYDRV_GetScreenSaveActive(void)
145 /***********************************************************************
146 * TTYDRV_SetScreenSaveActive
148 * Activate/Deactivate the screen saver
150 void TTYDRV_SetScreenSaveActive(BOOL bActivate
)
152 FIXME("(%d): stub\n", bActivate
);
155 /***********************************************************************
156 * TTYDRV_GetScreenSaveTimeout
158 * Return the screen saver timeout
160 int TTYDRV_GetScreenSaveTimeout(void)
165 /***********************************************************************
166 * TTYDRV_SetScreenSaveTimeout
168 * Set the screen saver timeout
170 void TTYDRV_SetScreenSaveTimeout(int nTimeout
)
172 FIXME("(%d): stub\n", nTimeout
);
175 /***********************************************************************
176 * TTYDRV_IsSingleWindow
178 BOOL
TTYDRV_IsSingleWindow(void)