2000-03-19 13:08:09 +01:00
|
|
|
/*
|
|
|
|
* TTYDRV initialization code
|
|
|
|
*/
|
2000-03-28 21:30:06 +02:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2000-03-19 13:08:09 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "winbase.h"
|
2000-06-03 23:35:35 +02:00
|
|
|
#include "wine/winbase16.h"
|
2000-03-20 19:21:19 +01:00
|
|
|
#include "clipboard.h"
|
2000-03-19 13:08:09 +01:00
|
|
|
#include "gdi.h"
|
2000-03-20 19:21:19 +01:00
|
|
|
#include "message.h"
|
|
|
|
#include "user.h"
|
|
|
|
#include "win.h"
|
2000-03-25 18:30:13 +01:00
|
|
|
#include "debugtools.h"
|
2000-03-30 21:26:44 +02:00
|
|
|
#include "ttydrv.h"
|
2000-03-25 18:30:13 +01:00
|
|
|
|
|
|
|
DEFAULT_DEBUG_CHANNEL(ttydrv);
|
2000-03-20 19:21:19 +01:00
|
|
|
|
|
|
|
static USER_DRIVER user_driver =
|
|
|
|
{
|
|
|
|
/* event functions */
|
|
|
|
TTYDRV_EVENT_Synchronize,
|
|
|
|
TTYDRV_EVENT_CheckFocus,
|
|
|
|
TTYDRV_EVENT_UserRepaintDisable,
|
|
|
|
/* keyboard functions */
|
|
|
|
TTYDRV_KEYBOARD_Init,
|
|
|
|
TTYDRV_KEYBOARD_VkKeyScan,
|
|
|
|
TTYDRV_KEYBOARD_MapVirtualKey,
|
|
|
|
TTYDRV_KEYBOARD_GetKeyNameText,
|
|
|
|
TTYDRV_KEYBOARD_ToAscii,
|
|
|
|
TTYDRV_KEYBOARD_GetBeepActive,
|
|
|
|
TTYDRV_KEYBOARD_SetBeepActive,
|
|
|
|
TTYDRV_KEYBOARD_Beep,
|
|
|
|
TTYDRV_KEYBOARD_GetDIState,
|
|
|
|
TTYDRV_KEYBOARD_GetDIData,
|
|
|
|
TTYDRV_KEYBOARD_GetKeyboardConfig,
|
|
|
|
TTYDRV_KEYBOARD_SetKeyboardConfig,
|
|
|
|
/* mouse functions */
|
|
|
|
TTYDRV_MOUSE_Init,
|
|
|
|
TTYDRV_MOUSE_SetCursor,
|
|
|
|
TTYDRV_MOUSE_MoveCursor,
|
2000-03-25 18:30:13 +01:00
|
|
|
/* screen saver functions */
|
|
|
|
TTYDRV_GetScreenSaveActive,
|
|
|
|
TTYDRV_SetScreenSaveActive,
|
|
|
|
TTYDRV_GetScreenSaveTimeout,
|
|
|
|
TTYDRV_SetScreenSaveTimeout,
|
2000-08-04 06:18:04 +02:00
|
|
|
/* resource functions */
|
|
|
|
TTYDRV_LoadOEMResource,
|
2000-03-25 18:30:13 +01:00
|
|
|
/* windowing functions */
|
|
|
|
TTYDRV_IsSingleWindow
|
2000-03-20 19:21:19 +01:00
|
|
|
};
|
|
|
|
|
2000-03-25 18:30:13 +01:00
|
|
|
int cell_width = 8;
|
|
|
|
int cell_height = 8;
|
2000-08-01 01:32:47 +02:00
|
|
|
int screen_rows = 50; /* default value */
|
|
|
|
int screen_cols = 80; /* default value */
|
2000-03-25 18:30:13 +01:00
|
|
|
WINDOW *root_window;
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV process initialisation routine
|
|
|
|
*/
|
|
|
|
static void process_attach(void)
|
|
|
|
{
|
|
|
|
USER_Driver = &user_driver;
|
|
|
|
CLIPBOARD_Driver = &TTYDRV_CLIPBOARD_Driver;
|
|
|
|
WND_Driver = &TTYDRV_WND_Driver;
|
|
|
|
|
2000-03-30 21:26:44 +02:00
|
|
|
#ifdef WINE_CURSES
|
2000-03-25 18:30:13 +01:00
|
|
|
if ((root_window = initscr()))
|
|
|
|
{
|
|
|
|
werase(root_window);
|
|
|
|
wrefresh(root_window);
|
|
|
|
}
|
2000-08-01 01:32:47 +02:00
|
|
|
getmaxyx(root_window, screen_rows, screen_cols);
|
2000-03-30 21:26:44 +02:00
|
|
|
#endif /* WINE_CURSES */
|
2000-03-25 18:30:13 +01:00
|
|
|
|
|
|
|
TTYDRV_GDI_Initialize();
|
2000-06-03 06:49:40 +02:00
|
|
|
|
|
|
|
/* load display.dll */
|
|
|
|
LoadLibrary16( "display" );
|
2000-03-25 18:30:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV process termination routine
|
|
|
|
*/
|
|
|
|
static void process_detach(void)
|
|
|
|
{
|
|
|
|
TTYDRV_GDI_Finalize();
|
|
|
|
|
2000-03-30 21:26:44 +02:00
|
|
|
#ifdef WINE_CURSES
|
2000-03-25 18:30:13 +01:00
|
|
|
if (root_window) endwin();
|
2000-03-30 21:26:44 +02:00
|
|
|
#endif /* WINE_CURSES */
|
2000-03-25 18:30:13 +01:00
|
|
|
|
|
|
|
USER_Driver = NULL;
|
|
|
|
CLIPBOARD_Driver = NULL;
|
|
|
|
WND_Driver = NULL;
|
|
|
|
}
|
|
|
|
|
2000-03-19 13:08:09 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV initialisation routine
|
|
|
|
*/
|
|
|
|
BOOL WINAPI TTYDRV_Init( HINSTANCE hinst, DWORD reason, LPVOID reserved )
|
|
|
|
{
|
2000-03-25 18:30:13 +01:00
|
|
|
static int process_count;
|
|
|
|
|
2000-03-20 19:21:19 +01:00
|
|
|
switch(reason)
|
2000-03-19 13:08:09 +01:00
|
|
|
{
|
2000-03-20 19:21:19 +01:00
|
|
|
case DLL_PROCESS_ATTACH:
|
2000-03-25 18:30:13 +01:00
|
|
|
if (!process_count++) process_attach();
|
2000-03-20 19:21:19 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DLL_PROCESS_DETACH:
|
2000-03-25 18:30:13 +01:00
|
|
|
if (!--process_count) process_detach();
|
2000-03-20 19:21:19 +01:00
|
|
|
break;
|
2000-03-19 13:08:09 +01:00
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
2000-03-25 18:30:13 +01:00
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_GetScreenSaveActive
|
|
|
|
*
|
|
|
|
* Returns the active status of the screen saver
|
|
|
|
*/
|
|
|
|
BOOL TTYDRV_GetScreenSaveActive(void)
|
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_SetScreenSaveActive
|
|
|
|
*
|
|
|
|
* Activate/Deactivate the screen saver
|
|
|
|
*/
|
|
|
|
void TTYDRV_SetScreenSaveActive(BOOL bActivate)
|
|
|
|
{
|
|
|
|
FIXME("(%d): stub\n", bActivate);
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_GetScreenSaveTimeout
|
|
|
|
*
|
|
|
|
* Return the screen saver timeout
|
|
|
|
*/
|
|
|
|
int TTYDRV_GetScreenSaveTimeout(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_SetScreenSaveTimeout
|
|
|
|
*
|
|
|
|
* Set the screen saver timeout
|
|
|
|
*/
|
|
|
|
void TTYDRV_SetScreenSaveTimeout(int nTimeout)
|
|
|
|
{
|
|
|
|
FIXME("(%d): stub\n", nTimeout);
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_IsSingleWindow
|
|
|
|
*/
|
|
|
|
BOOL TTYDRV_IsSingleWindow(void)
|
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|