2 * TTYDRV initialization code
10 #include "clipboard.h"
17 #include "debugtools.h"
20 DEFAULT_DEBUG_CHANNEL(ttydrv
);
22 static USER_DRIVER user_driver
=
25 TTYDRV_EVENT_Synchronize
,
26 TTYDRV_EVENT_CheckFocus
,
27 TTYDRV_EVENT_UserRepaintDisable
,
28 /* keyboard functions */
30 TTYDRV_KEYBOARD_VkKeyScan
,
31 TTYDRV_KEYBOARD_MapVirtualKey
,
32 TTYDRV_KEYBOARD_GetKeyNameText
,
33 TTYDRV_KEYBOARD_ToAscii
,
34 TTYDRV_KEYBOARD_GetBeepActive
,
35 TTYDRV_KEYBOARD_SetBeepActive
,
37 TTYDRV_KEYBOARD_GetDIState
,
38 TTYDRV_KEYBOARD_GetDIData
,
39 TTYDRV_KEYBOARD_GetKeyboardConfig
,
40 TTYDRV_KEYBOARD_SetKeyboardConfig
,
43 TTYDRV_MOUSE_SetCursor
,
44 TTYDRV_MOUSE_MoveCursor
,
45 TTYDRV_MOUSE_EnableWarpPointer
,
46 /* screen saver functions */
47 TTYDRV_GetScreenSaveActive
,
48 TTYDRV_SetScreenSaveActive
,
49 TTYDRV_GetScreenSaveTimeout
,
50 TTYDRV_SetScreenSaveTimeout
,
51 /* windowing functions */
60 /***********************************************************************
61 * TTYDRV process initialisation routine
63 static void process_attach(void)
67 USER_Driver
= &user_driver
;
68 CLIPBOARD_Driver
= &TTYDRV_CLIPBOARD_Driver
;
69 WND_Driver
= &TTYDRV_WND_Driver
;
72 if ((root_window
= initscr()))
75 wrefresh(root_window
);
77 getmaxyx(root_window
, rows
, cols
);
78 #else /* WINE_CURSES */
79 rows
= 60; /* FIXME: Hardcoded */
80 cols
= 80; /* FIXME: Hardcoded */
81 #endif /* WINE_CURSES */
83 MONITOR_PrimaryMonitor
.rect
.left
= 0;
84 MONITOR_PrimaryMonitor
.rect
.top
= 0;
85 MONITOR_PrimaryMonitor
.rect
.right
= cell_width
* cols
;
86 MONITOR_PrimaryMonitor
.rect
.bottom
= cell_height
* rows
;
87 MONITOR_PrimaryMonitor
.depth
= 1;
89 TTYDRV_GDI_Initialize();
93 /***********************************************************************
94 * TTYDRV process termination routine
96 static void process_detach(void)
98 TTYDRV_GDI_Finalize();
101 if (root_window
) endwin();
102 #endif /* WINE_CURSES */
105 CLIPBOARD_Driver
= NULL
;
110 /***********************************************************************
111 * TTYDRV initialisation routine
113 BOOL WINAPI
TTYDRV_Init( HINSTANCE hinst
, DWORD reason
, LPVOID reserved
)
115 static int process_count
;
119 case DLL_PROCESS_ATTACH
:
120 if (!process_count
++) process_attach();
123 case DLL_PROCESS_DETACH
:
124 if (!--process_count
) process_detach();
131 /***********************************************************************
132 * TTYDRV_GetScreenSaveActive
134 * Returns the active status of the screen saver
136 BOOL
TTYDRV_GetScreenSaveActive(void)
141 /***********************************************************************
142 * TTYDRV_SetScreenSaveActive
144 * Activate/Deactivate the screen saver
146 void TTYDRV_SetScreenSaveActive(BOOL bActivate
)
148 FIXME("(%d): stub\n", bActivate
);
151 /***********************************************************************
152 * TTYDRV_GetScreenSaveTimeout
154 * Return the screen saver timeout
156 int TTYDRV_GetScreenSaveTimeout(void)
161 /***********************************************************************
162 * TTYDRV_SetScreenSaveTimeout
164 * Set the screen saver timeout
166 void TTYDRV_SetScreenSaveTimeout(int nTimeout
)
168 FIXME("(%d): stub\n", nTimeout
);
171 /***********************************************************************
172 * TTYDRV_IsSingleWindow
174 BOOL
TTYDRV_IsSingleWindow(void)