Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude Console API code from K95G #301

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions kermit/k95/ckctel.c
Original file line number Diff line number Diff line change
Expand Up @@ -3529,7 +3529,15 @@ tn_debug(s) char *s;
if (!scrninitialized[VTERM]) {
USHORT x,y;
checkscreenmode();
#ifndef ONETERMUPD
GetCurPos(&y, &x);
#else
{
position * ppos = VscrnGetCurPos(VCMD);
x = ppos->x;
y = ppos->y;
};
#endif
SaveCmdMode(x+1,y+1);
scrninit();
RestoreCmdMode();
Expand Down
26 changes: 25 additions & 1 deletion kermit/k95/ckoco2.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,15 @@ extern vtattrib attrib, cmdattrib;
extern bool cursoron[], cursorena[],scrollflag[], scrollstatus[], flipscrnflag[] ;
extern TID tidTermScrnUpd ;

#ifndef KUI
extern
#ifdef NT
HANDLE
#else
HVIO
#endif
VioHandle;
#endif /* ! KUI */

#ifdef OS2MOUSE
extern int tt_mouse ;
Expand Down Expand Up @@ -136,6 +138,7 @@ int pwidth, pheight; /* Physical screen width, height */
int ttgcwsz(); /* ckocon.c */
int os2settitle(char *, int); /* ckotio.c */

#ifndef KUI
/*---------------------------------------------------------------------------*/
/* ReadCellStr */
/*---------------------------------------------------------------------------*/
Expand Down Expand Up @@ -270,7 +273,9 @@ ReadCellStr( viocell * CellStr, PUSHORT Length, USHORT Row, USHORT Column )
return VioReadCellStr( (PCH) CellStr, Length, Row, Column, VioHandle ) ;
#endif /* NT */
}
#endif /* KUI */

#ifndef KUI
/*---------------------------------------------------------------------------*/
/* WrtCellStr */
/*---------------------------------------------------------------------------*/
Expand Down Expand Up @@ -487,7 +492,7 @@ WrtCellStr( viocell * CellStr, USHORT Length, USHORT Row, USHORT Column )
return VioWrtCellStr( (PCH) CellStr, Length*sizeof(viocell), Row, Column, VioHandle ) ;
#endif /* NT */
}

#endif /* ! KUI */



Expand All @@ -506,6 +511,7 @@ VscrnForceFullUpdate(void)
os2settitle(NULL,1); /* Force a Title update */
}

#ifndef KUI
USHORT
WrtCellStrDiff( viocell * CellStr, USHORT Length, USHORT Row, USHORT Column,
USHORT Height, USHORT Width )
Expand Down Expand Up @@ -591,7 +597,9 @@ WrtCellStrDiff( viocell * CellStr, USHORT Length, USHORT Row, USHORT Column,
return rc ;

}
#endif /* ! KUI */

#ifndef KUI
/*---------------------------------------------------------------------------*/
/* WrtNCell */
/*---------------------------------------------------------------------------*/
Expand Down Expand Up @@ -722,7 +730,9 @@ WrtNCell( viocell Cell, USHORT Times, USHORT Row, USHORT Column )
return VioWrtNCell( (PCH) &Cell, Times, Row, Column, VioHandle ) ;
#endif /* NT */
}
#endif /* ! KUI */

#ifndef ONETERMUPD
/*---------------------------------------------------------------------------*/
/* WrtCharStrAtt */
/*---------------------------------------------------------------------------*/
Expand Down Expand Up @@ -854,6 +864,7 @@ WrtCharStrAtt( PCH CharStr, USHORT Length, USHORT Row, USHORT Column,
return VioWrtCharStrAtt( CharStr, Length, Row, Column, Attr, VioHandle ) ;
#endif /* NT */
}
#endif /* ! ONETERMUPD */

#ifndef KUI
/*---------------------------------------------------------------------------*/
Expand Down Expand Up @@ -1265,6 +1276,7 @@ SetMode( PCK_VIDEOMODEINFO ModeData )
}
#endif /* KUI */

#ifndef KUI
/*---------------------------------------------------------------------------*/
/* GetCurPos */
/*---------------------------------------------------------------------------*/
Expand Down Expand Up @@ -1294,7 +1306,9 @@ USHORT GetCurPos( PUSHORT Row, PUSHORT Column )
return VioGetCurPos( Row, Column, VioHandle ) ;
#endif /* NT */
}
#endif /* !KUI */

#ifndef KUI
/*---------------------------------------------------------------------------*/
/* SetCurPos */
/*---------------------------------------------------------------------------*/
Expand All @@ -1321,7 +1335,9 @@ USHORT SetCurPos( USHORT Row, USHORT Column )
return VioSetCurPos( Row, Column, VioHandle ) ;
#endif /* NT */
}
#endif /* ! KUI */

#ifndef KUI
/*---------------------------------------------------------------------------*/
/* GetCurType */
/*---------------------------------------------------------------------------*/
Expand Down Expand Up @@ -1399,6 +1415,7 @@ USHORT SetCurType( PCK_CURSORINFO CursorData )
#endif /* NT */
return rc ;
}
#endif /* !KUI */

BOOL
IsOS2FullScreen( void )
Expand Down Expand Up @@ -3813,11 +3830,13 @@ IsCellPartOfURL( BYTE mode, USHORT row, USHORT col )
return(retval);
}

#ifndef KUI
/*---------------------------------------------------------------------------*/
/* TermScrnUpd */
/*---------------------------------------------------------------------------*/
#define URLMINCNT 4096
#define NEW_EXCLUSIVE 1

void
TermScrnUpd( void * threadinfo)
{
Expand Down Expand Up @@ -4547,6 +4566,7 @@ TermScrnUpd( void * threadinfo)
ckThreadEnd(threadinfo) ;
#endif /* ONETERMUPD */
}
#endif /* ! KUI */

#ifdef PCFONTS
APIRET
Expand Down Expand Up @@ -4671,6 +4691,7 @@ os2ResetFont( void )
/*---------------------------------------------------------------------------*/
void
killcursor( BYTE vmode ) {
#ifndef KUI
CK_CURSORINFO crsr_info;
debug(F100,"killcursor","",0);
if (!cursoron[vmode]) /* It's already off */
Expand All @@ -4681,13 +4702,15 @@ killcursor( BYTE vmode ) {
{
cursoron[vmode] = FALSE;
}
#endif /* ! KUI */
}

/*---------------------------------------------------------------------------*/
/* newcursor */
/*---------------------------------------------------------------------------*/
void
newcursor( BYTE vmode ) {
#ifndef KUI
CK_CURSORINFO vci;

debug(F100,"newcursor","",0);
Expand Down Expand Up @@ -4729,6 +4752,7 @@ newcursor( BYTE vmode ) {
cursoron[vmode] = TRUE;
VscrnIsDirty(vmode);
}
#endif /* ! KUI */
}

void
Expand Down
19 changes: 19 additions & 0 deletions kermit/k95/ckocon.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,9 @@ RestoreCmdMode() {
#endif /* COMMENT */
debug(F101,"x_rest wherex","",commandscreen.ox);
debug(F101,"x_rest wherey","",commandscreen.oy);
#ifndef KUI
SetCurPos( commandscreen.oy-1, commandscreen.ox-1 ) ;
#endif /* ! KUI */
/* lgotoxy no longer moves */
/* the physical cursor */
vmode = VCMD ;
Expand Down Expand Up @@ -699,10 +701,15 @@ clearcmdscreen(void) {
viocell cell ;

ttgcwsz();
/* TODO: What should we do for KUI? */
#ifndef KUI
/* WrtNCell does nothing useful for KUI as we don't have a console window
* to write to */
cell.c = ' ' ;
cell.a = colorcmd ;
WrtNCell(cell, cmd_cols * (cmd_rows+1), 0, 0);
SetCurPos( 0, 0 ) ;
#endif /* ! KUI */
}

/*---------------------------------------------------------------------------*/
Expand Down Expand Up @@ -2305,6 +2312,7 @@ checkscreenmode() {

void
setcursormode() {
#ifndef KUI
#ifdef NT
CK_CURSORINFO vci={88,0,8,1};
#else
Expand Down Expand Up @@ -2354,12 +2362,15 @@ setcursormode() {
vi.fs = 1; /* 0 = blinking, 1 = hi intensity */
VioSetState((PVOID) &vi, VioHandle);
#endif /* NT */
#endif /* ! KUI */
}

void
restorecursormode() {
#ifndef KUI
debug(F100,"restorecursormode","",0);
SetCurType(&crsr_command);
#endif /* ! KUI */
}

static void
Expand Down Expand Up @@ -3308,7 +3319,15 @@ conect(int async) {

checkscreenmode(); /* Initialize terminal emulator */
setcursormode();
#ifndef ONETERMUPD
GetCurPos(&y, &x); /* Command screen cursor position */
#else
{
position * ppos = VscrnGetCurPos(VCMD);
x = ppos->x;
y = ppos->y;
};
#endif
SaveCmdMode(x+1,y+1); /* Remember Command screen */
RestoreTermMode(); /* Put up previous terminal screen */
#ifndef KUI
Expand Down
6 changes: 6 additions & 0 deletions kermit/k95/ckocon.h
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,14 @@ _PROTOTYP( int scriptwrtbuf, (unsigned short) ) ;
_PROTOTYP( void savescreen, (ascreen *,int,int) ) ;
_PROTOTYP( int restorescreen, (ascreen *) ) ;
_PROTOTYP( void reverserange, (SHORT, SHORT, SHORT, SHORT) ) ;
#ifndef KUI
_PROTOTYP( USHORT ReadCellStr, ( viocell *, PUSHORT, USHORT, USHORT ) );
#endif
_PROTOTYP( USHORT WrtCellStr, ( viocell *, USHORT, USHORT, USHORT ) );
_PROTOTYP( USHORT ReadCharStr, ( viocell *, PUSHORT, USHORT, USHORT ) );
#ifndef ONETERMUPD
_PROTOTYP( USHORT WrtCharStrAtt, ( PCH, USHORT, USHORT, USHORT, PBYTE ) );
#endif /* ONETERMUPD */
_PROTOTYP( USHORT WrtNCell, ( viocell, USHORT, USHORT, USHORT ) );
#ifndef KUI
_PROTOTYP( USHORT GetMode, ( PCK_VIDEOMODEINFO ) );
Expand All @@ -419,7 +423,9 @@ _PROTOTYP( USHORT VscrnWrtCharStrAtt, ( BYTE vmode, PCH CharStr, USHORT Length,
USHORT Row, USHORT Column, PBYTE Attr ) ) ;
_PROTOTYP( USHORT VscrnWrtUCS2StrAtt, ( BYTE vmode, PUSHORT UCS2Str, USHORT Length,
USHORT Row, USHORT Column, PBYTE Attr ) ) ;
#ifndef KUI
_PROTOTYP( void TermScrnUpd, ( void * ) ) ;
#endif /* ! KUI */

_PROTOTYP( videoline * VscrnGetLineFromTop, ( BYTE, SHORT ) ) ;
_PROTOTYP( videoline * VscrnGetLine, ( BYTE, SHORT ) ) ;
Expand Down
14 changes: 14 additions & 0 deletions kermit/k95/ckosyn.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,15 @@ UINT htimAlarm = (UINT) 0 ;
UINT htimVscrn[VNUM] = {(UINT) 0, (UINT) 0, (UINT) 0} ;

HANDLE hevVscrnTimer[VNUM] = { (HANDLE) 0, (HANDLE) 0,(HANDLE) 0 } ;

HANDLE hevVscrnDirty[VNUM] = { (HANDLE) 0, (HANDLE) 0,(HANDLE) 0 } ;

#ifndef KUI
HANDLE hevVscrnUpdate[VNUM][2] = {{(HANDLE) NULL, (HANDLE) NULL},
{(HANDLE) NULL, (HANDLE) NULL},
{(HANDLE) NULL, (HANDLE) NULL}};
#endif /* ! KUI */

HANDLE hmuxCtrlC[4][2] = { { (HANDLE) NULL, (HANDLE) NULL },
{ (HANDLE) NULL, (HANDLE) NULL },
{ (HANDLE) NULL, (HANDLE) NULL },
Expand Down Expand Up @@ -1148,6 +1152,7 @@ CreateTermScrnUpdThreadSem( BOOL posted )
#endif /* NT */
}

#ifndef KUI
APIRET
PostTermScrnUpdThreadSem( void )
{
Expand All @@ -1160,6 +1165,7 @@ PostTermScrnUpdThreadSem( void )
return DosPostEventSem( hevTermScrnUpdThread ) ;
#endif /* NT */
}
#endif /* ! KUI */

APIRET
WaitTermScrnUpdThreadSem( ULONG timo )
Expand Down Expand Up @@ -1747,6 +1753,7 @@ TimeProc(
}
#endif /* NT */

#ifndef KUI
APIRET
StartVscrnTimer( ULONG interval )
{
Expand Down Expand Up @@ -1803,6 +1810,7 @@ StopVscrnTimer( void )
}
return rc;
}
#endif /* ! KUI */

APIRET
StartAlarmTimer( ULONG interval )
Expand Down Expand Up @@ -1848,6 +1856,7 @@ StopAlarmTimer( void )
#endif /* NT */
}

#ifndef KUI
APIRET
CreateVscrnTimerSem( BOOL posted )
{
Expand Down Expand Up @@ -1875,6 +1884,7 @@ CreateVscrnTimerSem( BOOL posted )
}
return 0;
}
#endif /* ! KUI */

APIRET
PostVscrnTimerSem( int vmode )
Expand Down Expand Up @@ -1926,6 +1936,7 @@ WaitAndResetVscrnTimerSem( int vmode, ULONG timo )
#endif /* NT */
}

#ifndef KUI
APIRET
ResetVscrnTimerSem( int vmode )
{
Expand All @@ -1942,6 +1953,7 @@ ResetVscrnTimerSem( int vmode )
return semcount ;
#endif /* NT */
}
#endif /* ! KUI */

APIRET
CloseVscrnTimerSem( void )
Expand Down Expand Up @@ -2088,6 +2100,7 @@ CloseVscrnDirtySem( void )
return 0;
}

#ifndef KUI
APIRET
CreateVscrnMuxWait( int vmode )
{
Expand Down Expand Up @@ -2148,6 +2161,7 @@ CloseVscrnMuxWait( int vmode )
return rc ;
#endif /* NT */
}
#endif /* ! KUI */

/* Process and Thread management */

Expand Down
Loading