2 * TTYDRV initialization code
15 #include "debugtools.h"
17 DEFAULT_DEBUG_CHANNEL(ttydrv
);
19 static USER_DRIVER user_driver
=
22 TTYDRV_EVENT_Synchronize
,
23 TTYDRV_EVENT_CheckFocus
,
24 TTYDRV_EVENT_UserRepaintDisable
,
25 /* keyboard functions */
27 TTYDRV_KEYBOARD_VkKeyScan
,
28 TTYDRV_KEYBOARD_MapVirtualKey
,
29 TTYDRV_KEYBOARD_GetKeyNameText
,
30 TTYDRV_KEYBOARD_ToAscii
,
31 TTYDRV_KEYBOARD_GetBeepActive
,
32 TTYDRV_KEYBOARD_SetBeepActive
,
34 TTYDRV_KEYBOARD_GetDIState
,
35 TTYDRV_KEYBOARD_GetDIData
,
36 TTYDRV_KEYBOARD_GetKeyboardConfig
,
37 TTYDRV_KEYBOARD_SetKeyboardConfig
,
40 TTYDRV_MOUSE_SetCursor
,
41 TTYDRV_MOUSE_MoveCursor
,
42 TTYDRV_MOUSE_EnableWarpPointer
,
43 /* screen saver functions */
44 TTYDRV_GetScreenSaveActive
,
45 TTYDRV_SetScreenSaveActive
,
46 TTYDRV_GetScreenSaveTimeout
,
47 TTYDRV_SetScreenSaveTimeout
,
48 /* windowing functions */
56 #endif /* defined(HAVE_LIBCURSES) */
59 /***********************************************************************
60 * TTYDRV process initialisation routine
62 static void process_attach(void)
66 USER_Driver
= &user_driver
;
67 CLIPBOARD_Driver
= &TTYDRV_CLIPBOARD_Driver
;
68 WND_Driver
= &TTYDRV_WND_Driver
;
71 if ((root_window
= initscr()))
74 wrefresh(root_window
);
76 getmaxyx(root_window
, rows
, cols
);
77 #else /* defined(HAVE_LIBCURSES) */
78 rows
= 60; /* FIXME: Hardcoded */
79 cols
= 80; /* FIXME: Hardcoded */
80 #endif /* defined(HAVE_LIBCURSES) */
82 MONITOR_PrimaryMonitor
.rect
.left
= 0;
83 MONITOR_PrimaryMonitor
.rect
.top
= 0;
84 MONITOR_PrimaryMonitor
.rect
.right
= cell_width
* cols
;
85 MONITOR_PrimaryMonitor
.rect
.bottom
= cell_height
* rows
;
86 MONITOR_PrimaryMonitor
.depth
= 1;
88 TTYDRV_GDI_Initialize();
92 /***********************************************************************
93 * TTYDRV process termination routine
95 static void process_detach(void)
97 TTYDRV_GDI_Finalize();
100 if (root_window
) endwin();
101 #endif /* defined(HAVE_LIBCURSES) */
104 CLIPBOARD_Driver
= NULL
;
109 /***********************************************************************
110 * TTYDRV initialisation routine
112 BOOL WINAPI
TTYDRV_Init( HINSTANCE hinst
, DWORD reason
, LPVOID reserved
)
114 static int process_count
;
118 case DLL_PROCESS_ATTACH
:
119 if (!process_count
++) process_attach();
122 case DLL_PROCESS_DETACH
:
123 if (!--process_count
) process_detach();
130 /***********************************************************************
131 * TTYDRV_GetScreenSaveActive
133 * Returns the active status of the screen saver
135 BOOL
TTYDRV_GetScreenSaveActive(void)
140 /***********************************************************************
141 * TTYDRV_SetScreenSaveActive
143 * Activate/Deactivate the screen saver
145 void TTYDRV_SetScreenSaveActive(BOOL bActivate
)
147 FIXME("(%d): stub\n", bActivate
);
150 /***********************************************************************
151 * TTYDRV_GetScreenSaveTimeout
153 * Return the screen saver timeout
155 int TTYDRV_GetScreenSaveTimeout(void)
160 /***********************************************************************
161 * TTYDRV_SetScreenSaveTimeout
163 * Set the screen saver timeout
165 void TTYDRV_SetScreenSaveTimeout(int nTimeout
)
167 FIXME("(%d): stub\n", nTimeout
);
170 /***********************************************************************
171 * TTYDRV_IsSingleWindow
173 BOOL
TTYDRV_IsSingleWindow(void)