2000-03-19 12:08:09 +00:00
|
|
|
/*
|
|
|
|
* TTYDRV initialization code
|
2002-03-09 23:29:33 +00:00
|
|
|
*
|
|
|
|
* Copyright 2000 Alexandre Julliard
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2000-03-19 12:08:09 +00:00
|
|
|
*/
|
2000-03-28 19:30:06 +00:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2003-09-05 23:08:26 +00:00
|
|
|
#include <stdarg.h>
|
2000-03-19 12:08:09 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2003-09-05 23:08:26 +00:00
|
|
|
#include "windef.h"
|
2000-03-19 12:08:09 +00:00
|
|
|
#include "winbase.h"
|
2000-06-03 21:35:35 +00:00
|
|
|
#include "wine/winbase16.h"
|
2002-03-09 23:29:33 +00:00
|
|
|
#include "wine/debug.h"
|
2000-03-30 19:26:44 +00:00
|
|
|
#include "ttydrv.h"
|
2000-03-25 17:30:13 +00:00
|
|
|
|
2002-03-09 23:29:33 +00:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(ttydrv);
|
2000-03-20 18:21:19 +00:00
|
|
|
|
2000-03-25 17:30:13 +00:00
|
|
|
int cell_width = 8;
|
|
|
|
int cell_height = 8;
|
2000-07-31 23:32:47 +00:00
|
|
|
int screen_rows = 50; /* default value */
|
|
|
|
int screen_cols = 80; /* default value */
|
2000-03-25 17:30:13 +00:00
|
|
|
WINDOW *root_window;
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV process initialisation routine
|
|
|
|
*/
|
|
|
|
static void process_attach(void)
|
|
|
|
{
|
2000-03-30 19:26:44 +00:00
|
|
|
#ifdef WINE_CURSES
|
2000-03-25 17:30:13 +00:00
|
|
|
if ((root_window = initscr()))
|
|
|
|
{
|
|
|
|
werase(root_window);
|
|
|
|
wrefresh(root_window);
|
|
|
|
}
|
2000-07-31 23:32:47 +00:00
|
|
|
getmaxyx(root_window, screen_rows, screen_cols);
|
2000-03-30 19:26:44 +00:00
|
|
|
#endif /* WINE_CURSES */
|
2000-03-25 17:30:13 +00:00
|
|
|
|
|
|
|
TTYDRV_GDI_Initialize();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV process termination routine
|
|
|
|
*/
|
|
|
|
static void process_detach(void)
|
|
|
|
{
|
2000-03-30 19:26:44 +00:00
|
|
|
#ifdef WINE_CURSES
|
2000-03-25 17:30:13 +00:00
|
|
|
if (root_window) endwin();
|
2000-03-30 19:26:44 +00:00
|
|
|
#endif /* WINE_CURSES */
|
2000-03-25 17:30:13 +00:00
|
|
|
}
|
|
|
|
|
2000-03-19 12:08:09 +00:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV initialisation routine
|
|
|
|
*/
|
2002-11-04 23:53:41 +00:00
|
|
|
BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
|
2000-03-19 12:08:09 +00:00
|
|
|
{
|
2000-03-20 18:21:19 +00:00
|
|
|
switch(reason)
|
2000-03-19 12:08:09 +00:00
|
|
|
{
|
2000-03-20 18:21:19 +00:00
|
|
|
case DLL_PROCESS_ATTACH:
|
2003-06-30 20:53:48 +00:00
|
|
|
DisableThreadLibraryCalls(hinst);
|
2001-01-17 22:03:18 +00:00
|
|
|
process_attach();
|
2000-03-20 18:21:19 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DLL_PROCESS_DETACH:
|
2001-01-17 22:03:18 +00:00
|
|
|
process_detach();
|
2000-03-20 18:21:19 +00:00
|
|
|
break;
|
2000-03-19 12:08:09 +00:00
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|