home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
tvos200.zip
/
TVISION
/
PATCH.DIF
< prev
next >
Wrap
Text File
|
1995-04-25
|
211KB
|
8,258 lines
Only in .: _DEFS.H
diff --context ..\tvo/Buffers.h ./BUFFERS.H
*** ../tvo/Buffers.h Fri Jun 17 01:00:00 1994
--- ./BUFFERS.H Tue Apr 25 22:08:54 1995
***************
*** 13,18 ****
--- 13,20 ----
* All Rights Reserved.
*
*/
+ #if !defined(_NO_MEMMGR_)
+
#pragma option -Vo-
#if defined( __BCOPT__ ) && !defined (__FLAT__)
***************
*** 44,50 ****
static Boolean freeHead();
friend class TVMemMgr;
! friend void *operator new( size_t );
friend void * allocBlock( size_t );
};
--- 46,52 ----
static Boolean freeHead();
friend class TVMemMgr;
! friend void * operator new( size_t );
friend void * allocBlock( size_t );
};
***************
*** 79,81 ****
--- 81,84 ----
#endif
+ #endif
diff --context ..\tvo/Colorsel.cpp ./COLORSEL.CPP
*** ../tvo/Colorsel.cpp Fri Jun 17 01:00:00 1994
--- ./COLORSEL.CPP Tue Apr 25 22:08:46 1995
***************
*** 524,530 ****
if (g)
return g->index;
else
! return NULL;
}
TColorGroup* TColorGroupList::getGroup(uchar groupNum)
--- 524,530 ----
if (g)
return g->index;
else
! return 0;
}
TColorGroup* TColorGroupList::getGroup(uchar groupNum)
diff --context ..\tvo/Config.h ./CONFIG.H
*** ../tvo/Config.h Fri Jun 17 01:00:00 1994
--- ./CONFIG.H Tue Apr 25 22:08:54 1995
***************
*** 21,26 ****
--- 21,29 ----
#include <limits.h>
#endif // __LIMITS_H
+ // #define _NO_TEXTVIEW_ 1
+ // #define _NO_MEMMGR_ 1
+
const eventQSize = 16;
const maxCollectionSize = (int)(( (long) UINT_MAX - 16)/sizeof( void * ));
diff --context ..\tvo/Dialogs.h ./DIALOGS.H
*** ../tvo/Dialogs.h Fri Jun 17 01:00:00 1994
--- ./DIALOGS.H Tue Apr 25 22:08:56 1995
***************
*** 751,756 ****
--- 751,758 ----
#if defined( Uses_TParamText ) && !defined( __TParamText )
#define __TParamText
+ #include <stdarg.h>
+
class _FAR TRect;
class TParamText : public TStaticText
***************
*** 760,767 ****
--- 762,778 ----
TParamText( const TRect& bounds );
~TParamText();
+
virtual void getText( char *str );
+ #if 0
+ //** JAL: This cannot be supported: ... in virtual functions is not allowed.
virtual void setText( char *fmt, ... );
+ #else
+ void setText(char* fmt, ...);
+ virtual void setArgText(char* fmt, va_list args);
+ #endif
+
+
virtual int getTextLen();
protected:
diff --context ..\tvo/Drawbuf.h ./DRAWBUF.H
*** ../tvo/Drawbuf.h Fri Jun 17 01:00:00 1994
--- ./DRAWBUF.H Tue Apr 25 22:08:56 1995
***************
*** 36,41 ****
--- 36,42 ----
void moveCStr( ushort indent, const char _FAR *str, ushort attrs );
void moveBuf( ushort indent, const void _FAR *source,
ushort attr, ushort count );
+ void cpyBytes(ushort ix, const void far* src, int len, ushort attr);
void putAttribute( ushort indent, ushort attr );
void putChar( ushort indent, ushort c );
diff --context ..\tvo/Drivers.cpp ./DRIVERS.CPP
*** ../tvo/Drivers.cpp Fri Jun 17 01:00:00 1994
--- ./DRIVERS.CPP Tue Apr 25 22:08:46 1995
***************
*** 314,317 ****
--- 314,335 ----
*(uchar *)dest++ = *str++;
#endif
}
+
+ /*
+ * JAL: cpyBytes() copies a length-determined string to the buffer, thereby
+ * setting the attribute to a constant value.
+ */
+ void TDrawBuffer::cpyBytes(ushort index, const void far* src, int len, ushort attr)
+ {
+ ushort w, *p, *ep;
+ uchar *s, *es;
+
+ p = (ushort *)data + index;
+ ep = p + len;
+ s = (uchar *) src;
+ w = (ushort)attr << 8;
+ while(p < ep)
+ *p++ = *s++ | w;
+ }
+
#pragma warn .asc
diff --context ..\tvo/Editors.h ./EDITORS.H
*** ../tvo/Editors.h Fri Jun 17 01:00:00 1994
--- ./EDITORS.H Tue Apr 25 22:08:56 1995
***************
*** 14,22 ****
*
*/
! #if !defined( __DIR_H )
! #include <dir.h>
! #endif // __DIR_H
#if !defined( __STRING_H )
#include <string.h>
--- 14,22 ----
*
*/
! //#if !defined( __DIR_H )
! //#include <dir.h>
! //#endif // __DIR_H
#if !defined( __STRING_H )
#include <string.h>
***************
*** 163,168 ****
--- 163,172 ----
#if defined( Uses_TEditor ) && !defined( __TEditor )
#define __TEditor
+ #ifndef __os2asm_h
+ #include <tvision/os2asm.h>
+ #endif
+
class _FAR TRect;
class _FAR TScrollBar;
class _FAR TIndicator;
***************
*** 180,187 ****
virtual void shutDown();
! char bufChar( ushort );
! ushort bufPtr( ushort );
virtual void changeBounds( const TRect& );
virtual void convertEvent( TEvent& );
Boolean cursorVisible();
--- 184,201 ----
virtual void shutDown();
! //** Assembler implementations,
! char bufChar( ushort );
! ushort bufPtr( ushort );
! void formatLine(void *, ushort, int, ushort );
!
! ushort lineEnd( ushort );
! ushort lineStart( ushort );
! ushort nextChar( ushort );
! ushort prevChar( ushort );
!
!
!
virtual void changeBounds( const TRect& );
virtual void convertEvent( TEvent& );
Boolean cursorVisible();
***************
*** 214,234 ****
void doUpdate();
void doSearchReplace();
void drawLines( int, int, ushort );
- void formatLine(void *, ushort, int, ushort );
void find();
ushort getMousePtr( TPoint );
Boolean hasSelection();
void hideSelect();
Boolean isClipboard();
- ushort lineEnd( ushort );
ushort lineMove( ushort, int );
- ushort lineStart( ushort );
void lock();
void newLine();
- ushort nextChar( ushort );
ushort nextLine( ushort );
ushort nextWord( ushort );
- ushort prevChar( ushort );
ushort prevLine( ushort );
ushort prevWord( ushort );
void replace();
--- 228,243 ----
***************
*** 291,296 ****
--- 300,340 ----
};
+ #ifdef __FLAT__
+ /*
+ * Call assembler-versions of members..
+ */
+ inline char TEditor::bufChar( ushort v)
+ { return asmBufChar(this, v);
+ }
+
+ inline ushort TEditor::bufPtr( ushort v)
+ { return asmBufPtr(this, v);
+ }
+
+ inline void TEditor::formatLine(void *p, ushort v1, int i, ushort v2)
+ { asmFormatLine(this, p, v1, i, v2);
+ }
+
+ inline ushort TEditor::lineEnd( ushort v)
+ { return asmLineEnd(this, v);
+ }
+
+ inline ushort TEditor::lineStart(ushort v)
+ { return asmLineStart(this, v);
+ }
+
+ inline ushort TEditor::nextChar( ushort v)
+ { return asmNextChar(this, v);
+ }
+
+ inline ushort TEditor::prevChar( ushort v)
+ { return asmPrevChar(this, v);
+ }
+
+ #endif
+
+
inline ipstream& operator >> ( ipstream& is, TEditor& cl )
{ return is >> (TStreamable&)cl; }
inline ipstream& operator >> ( ipstream& is, TEditor*& cl )
***************
*** 360,368 ****
#if defined( Uses_TFileEditor ) && !defined( __TFileEditor )
#define __TFileEditor
! #if !defined( __DIR_H )
! #include <Dir.h>
! #endif // __DIR_H
class _FAR TRect;
class _FAR TScrollBar;
--- 404,412 ----
#if defined( Uses_TFileEditor ) && !defined( __TFileEditor )
#define __TFileEditor
! //#if !defined( __DIR_H )
! //#include <Dir.h>
! //#endif // __DIR_H
class _FAR TRect;
class _FAR TScrollBar;
***************
*** 374,380 ****
public:
! char fileName[MAXPATH];
TFileEditor( const TRect&,
TScrollBar *,
TScrollBar *,
--- 418,424 ----
public:
! char fileName[OS_MAXPATH];
TFileEditor( const TRect&,
TScrollBar *,
TScrollBar *,
diff --context ..\tvo/Edits.asm ./Edits.asm
*** ../tvo/Edits.asm Fri Jun 17 01:00:00 1994
--- ./Edits.asm Wed Apr 19 11:46:24 1995
***************
*** 1,507 ****
;/*------------------------------------------------------------*/
! ;/* filename - edits.asm */
! ;/* */
! ;/* function(s) */
! ;/* TEditor member functions */
;/*------------------------------------------------------------*/
;
! ; Turbo Vision - Version 2.0
! ;
! ; Copyright (c) 1994 by Borland International
! ; All Rights Reserved.
! ;
- PUBLIC @TEditor@bufChar$qus
- PUBLIC @TEditor@bufPtr$qus
IFNDEF __FLAT__
! PUBLIC @TEditor@formatLine$qnvusius
ELSE
! PUBLIC @TEditor@formatLine$qpvusius
ENDIF
- PUBLIC @TEditor@lineEnd$qus
- PUBLIC @TEditor@lineStart$qus
- PUBLIC @TEditor@nextChar$qus
- PUBLIC @TEditor@prevChar$qus
- PUBLIC _scan, _iScan, _countLines
! INCLUDE TV.INC
CODESEG
! ;char TEditor::bufChar( ushort P )
! @TEditor@bufChar$qus PROC
- ARG thisPtr :PTR, P : WORD
- IFNDEF __FLAT__
- USES DI
-
- LES DI, [thisPtr]
- MOV BX, [P]
- CMP BX, ES:[DI+TEditorCurPtr]
- JB @@1
- ADD BX, ES:[DI+TEditorGapLen]
- @@1: LES DI, ES:[DI+TEditorBuffer]
- MOV AL, ES:[DI+BX]
- RET
ELSE
! USES EDI, EBX
! MOV EDI, [thisPtr]
! MOVZX EBX, [P]
! CMP BX, [EDI+TEditorCurPtr]
! JB @@1
! ADD BX, [EDI+TEditorGapLen]
! @@1: MOV EDI, [EDI+TEditorBuffer]
! MOV AL, [EDI+EBX]
! RET
! ENDIF
@TEditor@bufChar$qus ENDP
- ;function TEditor.bufPtr(P: Word): Word; assembler;
! @TEditor@bufPtr$qus PROC
! ARG thisPtr : PTR, P : WORD
! IFNDEF __FLAT__
! USES DI
- LES DI, [thisPtr]
- MOV AX, [P]
- CMP AX, ES:[DI+TEditorCurPtr]
- JB @@1
- ADD AX, ES:[DI+TEditorGapLen]
- @@1: RET
ELSE
- USES EBX
! MOV EBX, [thisPtr]
! MOV AX, [P]
! CMP AX, [EBX+TEditorCurPtr]
! JB @@1
! ADD AX, [EBX+TEditorGapLen]
! @@1: RET
! ENDIF
! ENDP @TEditor@bufPtr$qus
;void TEditor::formatLine( void *DrawBuf,
! ; ushort LinePtr,
! ; int Width,
! ; ushort Colors
! ; )
! IFNDEF __FLAT__
! @TEditor@formatLine$qnvusius PROC
ELSE
! @TEditor@formatLine$qpvusius PROC
ENDIF
- ARG thisPtr:PTR, DrawBuf:PTR, LinePtr:ARGINT, \
- W:ARGINT, Colors:ARGINT
- IFNDEF __FLAT__
- USES DS, SI, DI
- LDS BX, [thisPtr]
- LES DI, [DrawBuf]
- MOV SI, [LinePtr]
- XOR DX, DX
- CLD
- MOV AH, BYTE PTR [Colors]
- MOV CX, DS:[BX+TEditorSelStart]
- CALL @@10
- MOV AH, BYTE PTR [Colors+1]
- MOV CX, DS:[BX+TEditorCurPtr]
- CALL @@10
- ADD SI, DS:[BX+TEditorGapLen]
- MOV CX, DS:[BX+TEditorSelEnd]
- ADD CX, DS:[BX+TEditorGapLen]
- CALL @@10
- MOV AH, BYTE PTR [Colors]
- MOV CX, DS:[BX+TEditorBufSize]
- CALL @@10
- JMP @@31
- @@10: SUB CX, SI
- JA @@11
- RETN
- @@11: LDS BX, DS:[BX+TEditorBuffer]
- ADD SI, BX
- MOV BX, [W]
- @@12: LODSB
- CMP AL, ' '
- JB @@20
- @@13: STOSW
- INC DX
- @@14: CMP DX, BX
- JAE @@30
- LOOP @@12
- LDS BX, [thisPtr]
- SUB SI, WORD PTR DS:[BX+TEditorBuffer]
- RETN
- @@20: CMP AL, 0DH
- JE @@30
- CMP AL, 09H
- JNE @@13
- MOV AL, ' '
- @@21: STOSW
- INC DX
- TEST DL, 7
- JNE @@21
- JMP @@14
- @@30: POP CX
- @@31: MOV AL, ' '
- MOV CX, [W]
- SUB CX, DX
- JBE @@32
- REP STOSW
- @@32: RET
- ELSE ;;;;;;;;;;;;;;;;;;;;;;;;;;;; 32-bit ;;;;;;;;;;;;;;;;;;;;;;;;;;;
- USES ESI, EDI, EBX
-
- MOV EBX, DWORD PTR [thisPtr]
- MOV EDI, DWORD PTR [DrawBuf]
- MOV ESI, [LinePtr]
- XOR EDX, EDX
- CLD
- MOV AH, BYTE PTR [Colors]
- MOVZX ECX, WORD PTR [EBX+TEditorSelStart]
- CALL @@10
- MOV AH, BYTE PTR [Colors+1]
- MOVZX ECX, WORD PTR [EBX+TEditorCurPtr]
- CALL @@10
- MOVZX ECX, WORD PTR [EBX+TEditorGapLen]
- ADD ESI, ECX
- MOVZX ECX, WORD PTR [EBX+TEditorSelEnd]
- ADD CX, [EBX+TEditorGapLen]
- CALL @@10
- MOV AH, BYTE PTR [Colors]
- MOVZX ECX, WORD PTR [EBX+TEditorBufSize]
- CALL @@10
- JMP @@31
-
- @@10: SUB ECX, ESI
- JA @@11
- RETN
- @@11: MOV EBX, [EBX+TEditorBuffer]
- ADD ESI, EBX
- MOV EBX, [W]
- @@12: LODSB
- CMP AL, ' '
- JB @@20
- @@13: STOSW
- INC DX
- @@14: CMP DX, BX
- JAE @@30
- LOOP @@12
- MOV EBX, [thisPtr]
- SUB ESI, [EBX+TEditorBuffer]
- RETN
- @@20: CMP AL, 0DH
- JE @@30
- CMP AL, 09H
- JNE @@13
- MOV AL, ' '
- @@21: STOSW
- INC DX
- TEST DL, 7
- JNE @@21
- JMP @@14
-
- @@30: POP ECX
- @@31: MOV AL, ' '
- MOVZX ECX, WORD PTR [W]
- SUB CX, DX
- JBE @@32
- REP STOSW
- @@32: RET
- ENDIF
! IFNDEF __FLAT__
! ENDP @TEditor@formatLine$qnvusius
! ELSE
! ENDP @TEditor@formatLine$qpvusius
! ENDIF
! ;function TEditor.lineEnd(P: Word): Word; assembler;
@TEditor@lineEnd$qus PROC
! ARG thisPtr: PTR, P:WORD
! IFNDEF __FLAT__
! USES DS, SI, DI
!
! LDS SI, [thisPtr]
! LES BX, DS:[SI+TEditorBuffer]
! MOV DI, [P]
! MOV AL, 0DH
! CLD
! MOV CX, DS:[SI+TEditorCurPtr]
! SUB CX, DI
! JBE @@1
! ADD DI, BX
! REPNE SCASB
! JE @@2
! MOV DI, DS:[SI+TEditorCurPtr]
! @@1: MOV CX, DS:[SI+TEditorBufLen]
! SUB CX, DI
! JCXZ @@4
! ADD BX, DS:[SI+TEditorGapLen]
! ADD DI, BX
! REPNE SCASB
! JNE @@3
! @@2: DEC DI
! @@3: SUB DI, BX
! @@4: MOV AX, DI
! RET
! ELSE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;32-bit;;;;;;;;;;;;;;;;;;;;;;;;;;
! USES ESI, EDI, EBX
!
! MOV ESI, DWORD PTR [thisPtr]
! MOV EBX, [ESI+TEditorBuffer]
! MOVZX EDI, WORD PTR [P]
! MOV AL, 0DH
! CLD
! MOV CX, [ESI+TEditorCurPtr]
! SUB CX, DI
! JBE @@1
! ADD EDI, EBX
! REPNE SCASB
! JE @@2
! MOVZX EDI, WORD PTR [ESI+TEditorCurPtr]
! @@1: MOV CX, [ESI+TEditorBufLen]
! SUB CX, DI
! JCXZ @@4
! MOVZX EDX, WORD PTR [ESI+TEditorGapLen]
! ADD EBX, EDX
! ADD EDI, EBX
! REPNE SCASB
! JNE @@3
! @@2: DEC EDI
! @@3: SUB EDI, EBX
! @@4: MOV EAX, EDI
! RET
! ENDIF
@TEditor@lineEnd$qus ENDP
- ;function TEditor.lineStart(P: Word): Word; assembler;
- @TEditor@lineStart$qus PROC
! ARG thisPtr : PTR, P : WORD
! IFNDEF __FLAT__
! USES DS, SI, DI
- LDS SI, [thisPtr]
- LES BX, DS:[SI+TEditorBuffer]
- MOV DI, [P]
- MOV AL, 0DH
- STD
- MOV CX, DI
- SUB CX, DS:[SI+TEditorCurPtr]
- JBE @@1
- ADD BX, DS:[SI+TEditorGapLen]
- ADD DI, BX
- DEC DI
- REPNE SCASB
- JE @@2
- SUB BX, DS:[SI+TEditorGapLen]
- MOV DI, DS:[SI+TEditorCurPtr]
- @@1: MOV CX, DI
- JCXZ @@4
- ADD DI, BX
- DEC DI
- REPNE SCASB
- JNE @@3
- @@2: INC DI
- INC DI
- SUB DI, BX
- CMP DI, DS:[SI+TEditorCurPtr]
- JE @@4
- CMP DI, DS:[SI+TEditorBufLen]
- JE @@4
- CMP BYTE PTR ES:[BX+DI], 0AH
- JNE @@4
- INC DI
- JMP @@4
- @@3: XOR DI, DI
- @@4: MOV AX, DI
- CLD
- RET
ELSE
- USES ESI, EDI, EBX
! MOV ESI, [thisPtr]
! MOV EBX, [ESI+TEditorBuffer]
! MOVZX EDI, WORD PTR [P]
! MOV AL, 0DH
! STD
! MOV ECX, EDI
! MOVZX EDX, WORD PTR [ESI+TEditorCurPtr]
! SUB ECX, EDX
! JBE @@1
! MOVZX EDX, WORD PTR [ESI+TEditorGapLen]
! ADD EBX, EDX
! ADD EDI, EBX
! DEC EDI
! REPNE SCASB
! JE @@2
! MOVZX EDX, WORD PTR [ESI+TEditorGapLen]
! SUB EBX, EDX
! MOVZX EDI, WORD PTR [ESI+TEditorCurPtr]
! @@1: MOV ECX, EDI
! JECXZ @@4
! ADD EDI, EBX
! DEC EDI
! REPNE SCASB
! JNE @@3
! @@2: INC EDI
! INC EDI
! SUB EDI, EBX
! CMP EDI, [ESI+TEditorCurPtr]
! JE @@4
! CMP EDI, [ESI+TEditorBufLen]
! JE @@4
! CMP BYTE PTR [EBX+EDI], 0AH
! JNE @@4
! INC EDI
! JMP @@4
! @@3: XOR EDI, EDI
! @@4: MOV EAX, EDI
! CLD
! RET
! ENDIF
! @TEditor@lineStart$qus ENDP
! ;function TEditor.nextChar(P: Word): Word; assembler;
! @TEditor@nextChar$qus PROC
! ARG thisPtr : PTR, P : WORD
! IFNDEF __FLAT__
! USES DS, SI, DI
- LDS SI, [thisPtr]
- MOV DI, [P]
- CMP DI, DS:[SI+TEditorBufLen]
- JE @@2
- INC DI
- CMP DI, DS:[SI+TEditorBufLen]
- JE @@2
- LES BX, DS:[SI+TEditorBuffer]
- CMP DI, DS:[SI+TEditorCurPtr]
- JB @@1
- ADD BX, DS:[SI+TEditorGapLen]
- @@1: CMP WORD PTR ES:[BX+DI-1], 0A0DH
- JNE @@2
- INC DI
- @@2: MOV AX, DI
- RET
ELSE
- USES ESI, EDI, EBX
! MOV ESI, [thisPtr]
! MOVZX EDI, [P]
! CMP DI, [ESI+TEditorBufLen]
! JE @@2
! INC DI
! CMP DI, [ESI+TEditorBufLen]
! JE @@2
! MOV EBX, [ESI+TEditorBuffer]
! CMP DI, [ESI+TEditorCurPtr]
! JB @@1
! MOVZX EDX, WORD PTR [ESI+TEditorGapLen]
! ADD EBX, EDX
! @@1: CMP WORD PTR [EBX+EDI-1], 0A0DH
! JNE @@2
! INC DI
! @@2: MOV AX, DI
! RET
! ENDIF
@TEditor@nextChar$qus ENDP
;function TEditor.prevChar(P: Word): Word; assembler;
! @TEditor@prevChar$qus PROC
! ARG thisPtr : PTR, P : WORD
! IFNDEF __FLAT__
! USES DS, SI, DI
! LDS SI, [thisPtr]
! MOV DI, [P]
! OR DI, DI
! JE @@2
! DEC DI
! JE @@2
! LES BX, DS:[SI+TEditorBuffer]
! CMP DI, DS:[SI+TEditorCurPtr]
! JB @@1
! ADD BX, DS:[SI+TEditorGapLen]
! @@1: CMP WORD PTR ES:[BX+DI-1], 0A0DH
! JNE @@2
! DEC DI
! @@2: MOV AX, DI
! RET
! ELSE ;;;;;;;;;;;;;;;;;;;;;;;;;;;; 32-bit ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
! USES ESI, EDI, EBX
!
! MOV ESI, DWORD PTR [thisPtr]
! MOVZX EDI, [P]
! OR EDI, EDI
! JE @@2
! DEC EDI
! JE @@2
! MOV EBX, [ESI+TEditorBuffer]
! MOVZX EDX, WORD PTR [ESI+TEditorCurPtr]
! CMP EDI, EDX
! JB @@1
! MOVZX EDX, WORD PTR [ESI+TEditorGapLen]
! ADD EBX, EDX
! @@1: CMP WORD PTR [EBX+EDI-1], 0A0DH
! JNE @@2
! DEC EDI
! @@2: MOV EAX, EDI
! RET
! ENDIF
@TEditor@prevChar$qus ENDP
;-----------------------------------------------------------------------------
_countLines PROC C
! ARG buf:PTR, count:ARGINT
IFNDEF __FLAT__
! USES DI, SI
! LES DI, buf
! MOV CX, count
! XOR DX, DX
! MOV AL, 0Dh
! CLD
@@1:
! JCXZ @@2
! REPNE SCASB
! JNE @@2
! INC DX
! JMP @@1
@@2:
! MOV AX, DX
! RET
ELSE
! USES EDI, ESI
! MOV EDI, DWORD PTR [buf]
! MOV ECX, count
! XOR EDX, EDX
! MOV AL, 0Dh
! CLD
@@1:
! JECXZ @@2
! REPNE SCASB
! JNE @@2
! INC EDX
! JMP @@1
@@2:
! MOV EAX, EDX
! RET
ENDIF
ENDP
--- 1,550 ----
;/*------------------------------------------------------------*/
! ;/* filename - edits.asm */
! ;/* */
! ;/* function(s) */
! ;/* TEditor member functions */
;/*------------------------------------------------------------*/
;
! ; Turbo Vision - Version 2.0
! ;
! ; Copyright (c) 1994 by Borland International
! ; All Rights Reserved.
! ;
IFNDEF __FLAT__
! PUBLIC @TEditor@bufChar$qus
! PUBLIC @TEditor@bufPtr$qus
!
! PUBLIC @TEditor@formatLine$qnvusius
! PUBLIC @TEditor@lineEnd$qus
! PUBLIC @TEditor@lineStart$qus
! PUBLIC @TEditor@nextChar$qus
! PUBLIC @TEditor@prevChar$qus
! PUBLIC _scan, _iScan, _countLines
ELSE
! ;-- Flat model stuff: C prototypes to prevent trouble with mangling etc.
! public _asmFormatLine
! public _asmLineEnd
! public _asmLineStart
! public _asmNextChar
! public _asmPrevChar
! public _asmBufChar
! public _asmBufPtr
! public _scan, _iScan, _countLines
ENDIF
! INCLUDE TV.INC
CODESEG
! ; -----------------------------------------------------------------------------
! ; char TEditor::bufChar( ushort P )
! ; -----------------------------------------------------------------------------
! IFDEF __FLAT__
! _asmBufChar PROC
! ARG thisPtr :PTR, P : WORD
! USES EDI, EBX
!
! MOV EDI, [thisPtr]
! MOVZX EBX, [P]
! CMP BX, [EDI+TEditorCurPtr]
! JB @@1
! ADD BX, [EDI+TEditorGapLen]
! @@1: MOV EDI, [EDI+TEditorBuffer]
! MOV AL, [EDI+EBX]
! RET
! _asmBufChar ENDP
ELSE
! @TEditor@bufChar$qus PROC
! ARG thisPtr :PTR, P : WORD
! USES DI
! LES DI, [thisPtr]
! MOV BX, [P]
! CMP BX, ES:[DI+TEditorCurPtr]
! JB @@1
! ADD BX, ES:[DI+TEditorGapLen]
! @@1: LES DI, ES:[DI+TEditorBuffer]
! MOV AL, ES:[DI+BX]
! RET
@TEditor@bufChar$qus ENDP
+ ENDIF
! ; -----------------------------------------------------------------------------
! ; function TEditor.bufPtr(P: Word): Word; assembler;
! ; -----------------------------------------------------------------------------
! IFDEF __FLAT__
! _asmBufPtr PROC
! ARG thisPtr : PTR, P : WORD
! USES EBX
!
! MOV EBX, [thisPtr]
! MOV AX, [P]
! CMP AX, [EBX+TEditorCurPtr]
! JB @@1
! ADD AX, [EBX+TEditorGapLen]
! @@1: RET
! _asmBufPtr ENDP
ELSE
! @TEditor@bufPtr$qus PROC
! ARG thisPtr : PTR, P : WORD
! USES DI
! LES DI, [thisPtr]
! MOV AX, [P]
! CMP AX, ES:[DI+TEditorCurPtr]
! JB @@1
! ADD AX, ES:[DI+TEditorGapLen]
! @@1: RET
! @TEditor@bufPtr$qus ENDP
! ENDIF
+ ; -----------------------------------------------------------------------------
;void TEditor::formatLine( void *DrawBuf,
! ; ushort LinePtr,
! ; int Width,
! ; ushort Colors)
! ; -----------------------------------------------------------------------------
! ;
! IFDEF __FLAT__
! _asmFormatLine PROC
! ARG thisPtr:PTR, DrawBuf:PTR, LinePtr:ARGINT, W:ARGINT, Colors:ARGINT
! USES ESI, EDI, EBX
!
! MOV EBX, DWORD PTR [thisPtr]
! MOV EDI, DWORD PTR [DrawBuf]
! MOV ESI, [LinePtr]
! XOR EDX, EDX
! CLD
! MOV AH, BYTE PTR [Colors]
! MOVZX ECX, WORD PTR [EBX+TEditorSelStart]
! CALL @@10
! MOV AH, BYTE PTR [Colors+1]
! MOVZX ECX, WORD PTR [EBX+TEditorCurPtr]
! CALL @@10
! MOVZX ECX, WORD PTR [EBX+TEditorGapLen]
! ADD ESI, ECX
! MOVZX ECX, WORD PTR [EBX+TEditorSelEnd]
! ADD CX, [EBX+TEditorGapLen]
! CALL @@10
! MOV AH, BYTE PTR [Colors]
! MOVZX ECX, WORD PTR [EBX+TEditorBufSize]
! CALL @@10
! JMP @@31
!
! @@10: SUB ECX, ESI
! JA @@11
! RETN
! @@11: MOV EBX, [EBX+TEditorBuffer]
! ADD ESI, EBX
! MOV EBX, [W]
! @@12: LODSB
! CMP AL, ' '
! JB @@20
! @@13: STOSW
! INC DX
! @@14: CMP DX, BX
! JAE @@30
! LOOP @@12
! MOV EBX, [thisPtr]
! SUB ESI, [EBX+TEditorBuffer]
! RETN
! @@20: CMP AL, 0DH
! JE @@30
! CMP AL, 09H
! JNE @@13
! MOV AL, ' '
! @@21: STOSW
! INC DX
! TEST DL, 7
! JNE @@21
! JMP @@14
!
! @@30: POP ECX
! @@31: MOV AL, ' '
! MOVZX ECX, WORD PTR [W]
! SUB CX, DX
! JBE @@32
! REP STOSW
! @@32: RET
! _asmFormatLine ENDP
!
ELSE
! @TEditor@formatLine$qnvusius PROC
! ARG thisPtr:PTR, DrawBuf:PTR, LinePtr:ARGINT, \
! W:ARGINT, Colors:ARGINT
! USES DS, SI, DI
!
! LDS BX, [thisPtr]
! LES DI, [DrawBuf]
! MOV SI, [LinePtr]
! XOR DX, DX
! CLD
! MOV AH, BYTE PTR [Colors]
! MOV CX, DS:[BX+TEditorSelStart]
! CALL @@10
! MOV AH, BYTE PTR [Colors+1]
! MOV CX, DS:[BX+TEditorCurPtr]
! CALL @@10
! ADD SI, DS:[BX+TEditorGapLen]
! MOV CX, DS:[BX+TEditorSelEnd]
! ADD CX, DS:[BX+TEditorGapLen]
! CALL @@10
! MOV AH, BYTE PTR [Colors]
! MOV CX, DS:[BX+TEditorBufSize]
! CALL @@10
! JMP @@31
! @@10: SUB CX, SI
! JA @@11
! RETN
! @@11: LDS BX, DS:[BX+TEditorBuffer]
! ADD SI, BX
! MOV BX, [W]
! @@12: LODSB
! CMP AL, ' '
! JB @@20
! @@13: STOSW
! INC DX
! @@14: CMP DX, BX
! JAE @@30
! LOOP @@12
! LDS BX, [thisPtr]
! SUB SI, WORD PTR DS:[BX+TEditorBuffer]
! RETN
! @@20: CMP AL, 0DH
! JE @@30
! CMP AL, 09H
! JNE @@13
! MOV AL, ' '
! @@21: STOSW
! INC DX
! TEST DL, 7
! JNE @@21
! JMP @@14
! @@30: POP CX
! @@31: MOV AL, ' '
! MOV CX, [W]
! SUB CX, DX
! JBE @@32
! REP STOSW
! @@32: RET
! ENDP @TEditor@formatLine$qnvusius
ENDIF
! ; -----------------------------------------------------------------------------
! ; function TEditor.lineEnd(P: Word): Word; assembler;
! ; -----------------------------------------------------------------------------
! IFDEF __FLAT__
! _asmLineEnd PROC
! ARG thisPtr: PTR, P:WORD
! USES ESI, EDI, EBX
!
! MOV ESI, DWORD PTR [thisPtr]
! MOV EBX, [ESI+TEditorBuffer]
! MOVZX EDI, WORD PTR [P]
! MOV AL, 0DH
! CLD
! MOV CX, [ESI+TEditorCurPtr]
! SUB CX, DI
! JBE @@1
! ADD EDI, EBX
! REPNE SCASB
! JE @@2
! MOVZX EDI, WORD PTR [ESI+TEditorCurPtr]
! @@1: MOV CX, [ESI+TEditorBufLen]
! SUB CX, DI
! JCXZ @@4
! MOVZX EDX, WORD PTR [ESI+TEditorGapLen]
! ADD EBX, EDX
! ADD EDI, EBX
! REPNE SCASB
! JNE @@3
! @@2: DEC EDI
! @@3: SUB EDI, EBX
! @@4: MOV EAX, EDI
! RET
! _asmLineEnd ENDP
! ELSE
@TEditor@lineEnd$qus PROC
! ARG thisPtr: PTR, P:WORD
! USES DS, SI, DI
! LDS SI, [thisPtr]
! LES BX, DS:[SI+TEditorBuffer]
! MOV DI, [P]
! MOV AL, 0DH
! CLD
! MOV CX, DS:[SI+TEditorCurPtr]
! SUB CX, DI
! JBE @@1
! ADD DI, BX
! REPNE SCASB
! JE @@2
! MOV DI, DS:[SI+TEditorCurPtr]
! @@1: MOV CX, DS:[SI+TEditorBufLen]
! SUB CX, DI
! JCXZ @@4
! ADD BX, DS:[SI+TEditorGapLen]
! ADD DI, BX
! REPNE SCASB
! JNE @@3
! @@2: DEC DI
! @@3: SUB DI, BX
! @@4: MOV AX, DI
! RET
@TEditor@lineEnd$qus ENDP
+ ENDIF
! ; -----------------------------------------------------------------------------
! ; function TEditor.lineStart(P: Word): Word; assembler;
! ; -----------------------------------------------------------------------------
! IFDEF __FLAT__
! _asmLineStart PROC
! ARG thisPtr : PTR, P : WORD
! USES ESI, EDI, EBX
!
! MOV ESI, [thisPtr]
! MOV EBX, [ESI+TEditorBuffer]
! MOVZX EDI, WORD PTR [P]
! MOV AL, 0DH
! STD
! MOV ECX, EDI
! MOVZX EDX, WORD PTR [ESI+TEditorCurPtr]
! SUB ECX, EDX
! JBE @@1
! MOVZX EDX, WORD PTR [ESI+TEditorGapLen]
! ADD EBX, EDX
! ADD EDI, EBX
! DEC EDI
! REPNE SCASB
! JE @@2
! MOVZX EDX, WORD PTR [ESI+TEditorGapLen]
! SUB EBX, EDX
! MOVZX EDI, WORD PTR [ESI+TEditorCurPtr]
! @@1: MOV ECX, EDI
! JECXZ @@4
! ADD EDI, EBX
! DEC EDI
! REPNE SCASB
! JNE @@3
! @@2: INC EDI
! INC EDI
! SUB EDI, EBX
! CMP EDI, [ESI+TEditorCurPtr]
! JE @@4
! CMP EDI, [ESI+TEditorBufLen]
! JE @@4
! CMP BYTE PTR [EBX+EDI], 0AH
! JNE @@4
! INC EDI
! JMP @@4
! @@3: XOR EDI, EDI
! @@4: MOV EAX, EDI
! CLD
! RET
! _asmLineStart ENDP
ELSE
! @TEditor@lineStart$qus PROC
! ARG thisPtr : PTR, P : WORD
! USES DS, SI, DI
! LDS SI, [thisPtr]
! LES BX, DS:[SI+TEditorBuffer]
! MOV DI, [P]
! MOV AL, 0DH
! STD
! MOV CX, DI
! SUB CX, DS:[SI+TEditorCurPtr]
! JBE @@1
! ADD BX, DS:[SI+TEditorGapLen]
! ADD DI, BX
! DEC DI
! REPNE SCASB
! JE @@2
! SUB BX, DS:[SI+TEditorGapLen]
! MOV DI, DS:[SI+TEditorCurPtr]
! @@1: MOV CX, DI
! JCXZ @@4
! ADD DI, BX
! DEC DI
! REPNE SCASB
! JNE @@3
! @@2: INC DI
! INC DI
! SUB DI, BX
! CMP DI, DS:[SI+TEditorCurPtr]
! JE @@4
! CMP DI, DS:[SI+TEditorBufLen]
! JE @@4
! CMP BYTE PTR ES:[BX+DI], 0AH
! JNE @@4
! INC DI
! JMP @@4
! @@3: XOR DI, DI
! @@4: MOV AX, DI
! CLD
! RET
! @TEditor@lineStart$qus ENDP
! ENDIF
! ; -----------------------------------------------------------------------------
! ; function TEditor.nextChar(P: Word): Word; assembler;
! ; -----------------------------------------------------------------------------
! IFDEF __FLAT__
! _asmNextChar PROC
! ARG thisPtr : PTR, P : WORD
! USES ESI, EDI, EBX
!
! MOV ESI, [thisPtr]
! MOVZX EDI, [P]
! CMP DI, [ESI+TEditorBufLen]
! JE @@2
! INC DI
! CMP DI, [ESI+TEditorBufLen]
! JE @@2
! MOV EBX, [ESI+TEditorBuffer]
! CMP DI, [ESI+TEditorCurPtr]
! JB @@1
! MOVZX EDX, WORD PTR [ESI+TEditorGapLen]
! ADD EBX, EDX
! @@1: CMP WORD PTR [EBX+EDI-1], 0A0DH
! JNE @@2
! INC DI
! @@2: MOV AX, DI
! RET
! _asmNextChar ENDP
ELSE
! @TEditor@nextChar$qus PROC
! ARG thisPtr : PTR, P : WORD
! USES DS, SI, DI
+ LDS SI, [thisPtr]
+ MOV DI, [P]
+ CMP DI, DS:[SI+TEditorBufLen]
+ JE @@2
+ INC DI
+ CMP DI, DS:[SI+TEditorBufLen]
+ JE @@2
+ LES BX, DS:[SI+TEditorBuffer]
+ CMP DI, DS:[SI+TEditorCurPtr]
+ JB @@1
+ ADD BX, DS:[SI+TEditorGapLen]
+ @@1: CMP WORD PTR ES:[BX+DI-1], 0A0DH
+ JNE @@2
+ INC DI
+ @@2: MOV AX, DI
+ RET
@TEditor@nextChar$qus ENDP
+ ENDIF
+
+
+ ; -----------------------------------------------------------------------------
;function TEditor.prevChar(P: Word): Word; assembler;
! ; -----------------------------------------------------------------------------
! IFDEF __FLAT__
! _asmPrevChar PROC
! ARG thisPtr : PTR, P : WORD
! USES ESI, EDI, EBX
!
! MOV ESI, DWORD PTR [thisPtr]
! MOVZX EDI, [P]
! OR EDI, EDI
! JE @@2
! DEC EDI
! JE @@2
! MOV EBX, [ESI+TEditorBuffer]
! MOVZX EDX, WORD PTR [ESI+TEditorCurPtr]
! CMP EDI, EDX
! JB @@1
! MOVZX EDX, WORD PTR [ESI+TEditorGapLen]
! ADD EBX, EDX
! @@1: CMP WORD PTR [EBX+EDI-1], 0A0DH
! JNE @@2
! DEC EDI
! @@2: MOV EAX, EDI
! RET
! _asmPrevChar ENDP
! ELSE
! @TEditor@prevChar$qus PROC
! ARG thisPtr : PTR, P : WORD
! USES DS, SI, DI
!
! LDS SI, [thisPtr]
! MOV DI, [P]
! OR DI, DI
! JE @@2
! DEC DI
! JE @@2
! LES BX, DS:[SI+TEditorBuffer]
! CMP DI, DS:[SI+TEditorCurPtr]
! JB @@1
! ADD BX, DS:[SI+TEditorGapLen]
! @@1: CMP WORD PTR ES:[BX+DI-1], 0A0DH
! JNE @@2
! DEC DI
! @@2: MOV AX, DI
! RET
@TEditor@prevChar$qus ENDP
+ ENDIF
;-----------------------------------------------------------------------------
_countLines PROC C
! ARG buf:PTR, count:ARGINT
IFNDEF __FLAT__
! USES DI, SI
! LES DI, buf
! MOV CX, count
! XOR DX, DX
! MOV AL, 0Dh
! CLD
@@1:
! JCXZ @@2
! REPNE SCASB
! JNE @@2
! INC DX
! JMP @@1
@@2:
! MOV AX, DX
! RET
ELSE
! USES EDI, ESI
! MOV EDI, DWORD PTR [buf]
! MOV ECX, count
! XOR EDX, EDX
! MOV AL, 0Dh
! CLD
@@1:
! JECXZ @@2
! REPNE SCASB
! JNE @@2
! INC EDX
! JMP @@1
@@2:
! MOV EAX, EDX
! RET
ENDIF
ENDP
***************
*** 509,825 ****
_scan PROC C
! ARG block:PTR, bsize:ARGINT, pstr:PTR
! LOCAL len:ARGINT
IFNDEF __FLAT__
! USES SI, DI
! LES DI, pstr
! MOV BX, DI
! MOV CX, DI
! NOT CX
! XOR AL, AL
! CLD
! REPNE SCASB
! SUB DI, BX
! DEC DI
! MOV len, DI
!
! PUSH DS
! LES DI, block
! LDS SI, pstr
! MOV CX, bsize
! JCXZ @@3
! CLD
! MOV AX, len
! CMP AX, 1
! JB @@5
! JA @@1
! LODSB ;; searching for a single character
! REPNE SCASB
! JNE @@3
! JMP @@5
@@1:
! MOV BX, AX
! DEC BX
! MOV DX, CX
! SUB DX, AX
! JB @@3
! LODSB
! INC DX
! INC DX
@@2:
! DEC DX
! MOV CX, DX
! REPNE SCASB
! JNE @@3
! MOV DX, CX
! MOV CX, BX
! REP CMPSB
! JE @@4
! SUB CX, BX
! ADD SI, CX
! ADD DI, CX
! INC DI
! OR DX, DX
! JNE @@2
@@3:
! XOR AX, AX
! JMP @@6
@@4:
! SUB DI, BX
@@5:
! MOV AX, DI
! SUB AX, WORD PTR block
@@6:
! DEC AX
! POP DS
! RET
! ELSE ; 32-bit version
! USES ESI, EDI, EBX
!
! MOV EDI, DWORD PTR [pstr]
!
! MOV EBX, EDI
! MOV ECX, EDI
! NOT ECX
! XOR AL, AL
! CLD
! REPNE SCASB
! SUB EDI, EBX
! DEC EDI
! MOV len, EDI
!
! MOV EDI, DWORD PTR [block]
! MOV ESI, DWORD PTR [pstr]
! MOV ECX, bsize
! JECXZ @@3
! CLD
! MOV EAX, len
! CMP EAX, 1
! JB @@5
! JA @@1
! LODSB ;; searching for a single character
! REPNE SCASB
! JNE @@3
! JMP @@5
@@1:
! MOV EBX, EAX
! DEC EBX
! MOV EDX, ECX
! SUB EDX, EAX
! JB @@3
! LODSB
! INC EDX
! INC EDX
@@2:
! DEC EDX
! MOV ECX, EDX
! REPNE SCASB
! JNE @@3
! MOV EDX, ECX
! MOV ECX, EBX
! REP CMPSB
! JE @@4
! SUB ECX, EBX
! ADD ESI, ECX
! ADD EDI, ECX
! INC EDI
! OR EDX, EDX
! JNE @@2
@@3:
! XOR EAX, EAX
! JMP @@6
@@4:
! SUB EDI, EBX
@@5:
! MOV EAX, EDI
! SUB EAX, DWORD PTR [block]
@@6:
! DEC EAX
! RET
ENDIF
ENDP
_iScan PROC C
! ARG block:PTR, bsize:ARGINT, pstr:PTR
! LOCAL len:ARGINT, s:BYTE:256
IFNDEF __FLAT__
! USES SI, DI
! LES DI, pstr
! MOV BX, DI
! MOV CX, DI
! NOT CX
! XOR AL, AL
! CLD
! REPNE SCASB
! SUB DI, BX
! DEC DI
! MOV len, DI
!
! PUSH DS
! MOV AX, SS
! MOV ES, AX
! LEA DI, s
! LDS SI, pstr
! MOV AX, len;
! MOV CX, AX
! MOV BX, AX
! JCXZ @@9
@@1:
! LODSB
! CMP AL, 'a'
! JB @@2
! CMP AL, 'z'
! JA @@2
! SUB AL, 20h
@@2:
! STOSB
! LOOP @@1
! SUB DI, BX
! LDS SI, block
! MOV CX, bsize
! JCXZ @@8
! CLD
! SUB CX, BX
! JB @@8
! INC CX
@@4:
! MOV AH, ES:[DI]
! AND AH, 0DFh
@@5:
! LODSB
! AND AL, 0DFh
! CMP AL, AH
! LOOPNE @@5
! JNE @@8
! DEC SI
! MOV DX, CX
! MOV CX, BX
@@6:
! REPE CMPSB
! JE @@10
! MOV AL, DS:[SI-1]
! CMP AL, 'a'
! JB @@7
! CMP AL, 'z'
! JA @@7
! SUB AL, 20h
@@7:
! CMP AL, ES:[DI-1]
! JE @@6
! SUB CX, BX
! ADD SI, CX
! ADD DI, CX
! INC SI
! MOV CX, DX
! OR CX, DX
! JNE @@4
@@8:
! XOR AX, AX
! JMP @@11
@@9:
! MOV AX, 1
! JMP @@11
@@10:
! SUB SI, BX
! MOV AX, SI
! SUB AX, WORD PTR block
! INC AX
@@11:
! DEC AX
! POP DS
! RET
! ELSE ; 32-bit version
! USES ESI, EDI, EBX
!
! MOV EDI, DWORD PTR [pstr]
!
! MOV EBX, EDI
! MOV ECX, EDI
! NOT ECX
! XOR AL, AL
! CLD
! REPNE SCASB
! SUB EDI, EBX
! DEC EDI
! MOV len, EDI
!
! LEA EDI, s
! MOV ESI, DWORD PTR [pstr]
! MOV EAX, len;
! MOV ECX, EAX
! MOV EBX, EAX
! JECXZ @@9
@@1:
! LODSB
! CMP AL, 'a'
! JB @@2
! CMP AL, 'z'
! JA @@2
! SUB AL, 20h
@@2:
! STOSB
! LOOP @@1
! SUB EDI, EBX
! MOV ESI, DWORD PTR [block]
! MOV ECX, bsize
! JECXZ @@8
! CLD
! SUB ECX, EBX
! JB @@8
! INC ECX
@@4:
! MOV AH, ES:[EDI]
! AND AH, 0DFh
@@5:
! LODSB
! AND AL, 0DFh
! CMP AL, AH
! LOOPNE @@5
! JNE @@8
! DEC ESI
! MOV EDX, ECX
! MOV ECX, EBX
@@6:
! REPE CMPSB
! JE @@10
! MOV AL, DS:[ESI-1]
! CMP AL, 'a'
! JB @@7
! CMP AL, 'z'
! JA @@7
! SUB AL, 20h
@@7:
! CMP AL, ES:[EDI-1]
! JE @@6
! SUB ECX, EBX
! ADD ESI, ECX
! ADD EDI, ECX
! INC ESI
! MOV ECX, EDX
! OR ECX, ECX
! JNE @@4
@@8:
! XOR EAX, EAX
! JMP @@11
@@9:
! MOV EAX, 1
! JMP @@11
@@10:
! SUB ESI, EBX
! MOV EAX, ESI
! SUB EAX, DWORD PTR [block]
! INC EAX
@@11:
! DEC AX
! RET
ENDIF
ENDP
! END
--- 552,868 ----
_scan PROC C
! ARG block:PTR, bsize:ARGINT, pstr:PTR
! LOCAL len:ARGINT
IFNDEF __FLAT__
! USES SI, DI
! LES DI, pstr
! MOV BX, DI
! MOV CX, DI
! NOT CX
! XOR AL, AL
! CLD
! REPNE SCASB
! SUB DI, BX
! DEC DI
! MOV len, DI
!
! PUSH DS
! LES DI, block
! LDS SI, pstr
! MOV CX, bsize
! JCXZ @@3
! CLD
! MOV AX, len
! CMP AX, 1
! JB @@5
! JA @@1
! LODSB ;; searching for a single character
! REPNE SCASB
! JNE @@3
! JMP @@5
@@1:
! MOV BX, AX
! DEC BX
! MOV DX, CX
! SUB DX, AX
! JB @@3
! LODSB
! INC DX
! INC DX
@@2:
! DEC DX
! MOV CX, DX
! REPNE SCASB
! JNE @@3
! MOV DX, CX
! MOV CX, BX
! REP CMPSB
! JE @@4
! SUB CX, BX
! ADD SI, CX
! ADD DI, CX
! INC DI
! OR DX, DX
! JNE @@2
@@3:
! XOR AX, AX
! JMP @@6
@@4:
! SUB DI, BX
@@5:
! MOV AX, DI
! SUB AX, WORD PTR block
@@6:
! DEC AX
! POP DS
! RET
! ELSE ; 32-bit version
! USES ESI, EDI, EBX
!
! MOV EDI, DWORD PTR [pstr]
!
! MOV EBX, EDI
! MOV ECX, EDI
! NOT ECX
! XOR AL, AL
! CLD
! REPNE SCASB
! SUB EDI, EBX
! DEC EDI
! MOV len, EDI
!
! MOV EDI, DWORD PTR [block]
! MOV ESI, DWORD PTR [pstr]
! MOV ECX, bsize
! JECXZ @@3
! CLD
! MOV EAX, len
! CMP EAX, 1
! JB @@5
! JA @@1
! LODSB ;; searching for a single character
! REPNE SCASB
! JNE @@3
! JMP @@5
@@1:
! MOV EBX, EAX
! DEC EBX
! MOV EDX, ECX
! SUB EDX, EAX
! JB @@3
! LODSB
! INC EDX
! INC EDX
@@2:
! DEC EDX
! MOV ECX, EDX
! REPNE SCASB
! JNE @@3
! MOV EDX, ECX
! MOV ECX, EBX
! REP CMPSB
! JE @@4
! SUB ECX, EBX
! ADD ESI, ECX
! ADD EDI, ECX
! INC EDI
! OR EDX, EDX
! JNE @@2
@@3:
! XOR EAX, EAX
! JMP @@6
@@4:
! SUB EDI, EBX
@@5:
! MOV EAX, EDI
! SUB EAX, DWORD PTR [block]
@@6:
! DEC EAX
! RET
ENDIF
ENDP
_iScan PROC C
! ARG block:PTR, bsize:ARGINT, pstr:PTR
! LOCAL len:ARGINT, s:BYTE:256
IFNDEF __FLAT__
! USES SI, DI
! LES DI, pstr
! MOV BX, DI
! MOV CX, DI
! NOT CX
! XOR AL, AL
! CLD
! REPNE SCASB
! SUB DI, BX
! DEC DI
! MOV len, DI
!
! PUSH DS
! MOV AX, SS
! MOV ES, AX
! LEA DI, s
! LDS SI, pstr
! MOV AX, len;
! MOV CX, AX
! MOV BX, AX
! JCXZ @@9
@@1:
! LODSB
! CMP AL, 'a'
! JB @@2
! CMP AL, 'z'
! JA @@2
! SUB AL, 20h
@@2:
! STOSB
! LOOP @@1
! SUB DI, BX
! LDS SI, block
! MOV CX, bsize
! JCXZ @@8
! CLD
! SUB CX, BX
! JB @@8
! INC CX
@@4:
! MOV AH, ES:[DI]
! AND AH, 0DFh
@@5:
! LODSB
! AND AL, 0DFh
! CMP AL, AH
! LOOPNE @@5
! JNE @@8
! DEC SI
! MOV DX, CX
! MOV CX, BX
@@6:
! REPE CMPSB
! JE @@10
! MOV AL, DS:[SI-1]
! CMP AL, 'a'
! JB @@7
! CMP AL, 'z'
! JA @@7
! SUB AL, 20h
@@7:
! CMP AL, ES:[DI-1]
! JE @@6
! SUB CX, BX
! ADD SI, CX
! ADD DI, CX
! INC SI
! MOV CX, DX
! OR CX, DX
! JNE @@4
@@8:
! XOR AX, AX
! JMP @@11
@@9:
! MOV AX, 1
! JMP @@11
@@10:
! SUB SI, BX
! MOV AX, SI
! SUB AX, WORD PTR block
! INC AX
@@11:
! DEC AX
! POP DS
! RET
! ELSE ; 32-bit version
! USES ESI, EDI, EBX
!
! MOV EDI, DWORD PTR [pstr]
!
! MOV EBX, EDI
! MOV ECX, EDI
! NOT ECX
! XOR AL, AL
! CLD
! REPNE SCASB
! SUB EDI, EBX
! DEC EDI
! MOV len, EDI
!
! LEA EDI, s
! MOV ESI, DWORD PTR [pstr]
! MOV EAX, len;
! MOV ECX, EAX
! MOV EBX, EAX
! JECXZ @@9
@@1:
! LODSB
! CMP AL, 'a'
! JB @@2
! CMP AL, 'z'
! JA @@2
! SUB AL, 20h
@@2:
! STOSB
! LOOP @@1
! SUB EDI, EBX
! MOV ESI, DWORD PTR [block]
! MOV ECX, bsize
! JECXZ @@8
! CLD
! SUB ECX, EBX
! JB @@8
! INC ECX
@@4:
! MOV AH, ES:[EDI]
! AND AH, 0DFh
@@5:
! LODSB
! AND AL, 0DFh
! CMP AL, AH
! LOOPNE @@5
! JNE @@8
! DEC ESI
! MOV EDX, ECX
! MOV ECX, EBX
@@6:
! REPE CMPSB
! JE @@10
! MOV AL, DS:[ESI-1]
! CMP AL, 'a'
! JB @@7
! CMP AL, 'z'
! JA @@7
! SUB AL, 20h
@@7:
! CMP AL, ES:[EDI-1]
! JE @@6
! SUB ECX, EBX
! ADD ESI, ECX
! ADD EDI, ECX
! INC ESI
! MOV ECX, EDX
! OR ECX, ECX
! JNE @@4
@@8:
! XOR EAX, EAX
! JMP @@11
@@9:
! MOV EAX, 1
! JMP @@11
@@10:
! SUB ESI, EBX
! MOV EAX, ESI
! SUB EAX, DWORD PTR [block]
! INC EAX
@@11:
! DEC AX
! RET
ENDIF
ENDP
! END
diff --context ..\tvo/Framelin.asm ./Framelin.asm
*** ../tvo/Framelin.asm Fri Jun 17 01:00:00 1994
--- ./Framelin.asm Wed Apr 19 11:46:24 1995
***************
*** 1,214 ****
;/*------------------------------------------------------------*/
! ;/* filename - framelin.asm */
! ;/* */
! ;/* function(s) */
! ;/* TFrame frameLine member function */
;/*------------------------------------------------------------*/
;
! ; Turbo Vision - Version 2.0
! ;
! ; Copyright (c) 1994 by Borland International
! ; All Rights Reserved.
! ;
ifndef __FLAT__
! PUBLIC @TFrame@frameLine$qm11TDrawBufferssuc
else
! PUBLIC @TFrame@frameLine$qr11TDrawBufferssuc
endif
! EXTRN @TFrame@initFrame : BYTE
! EXTRN @TFrame@frameChars : BYTE
!
! INCLUDE TV.INC
! MaxViewWidth equ 132
DATASEG
! FrameMask DB MaxViewWidth dup(?)
CODESEG
ifndef __FLAT__
@TFrame@frameLine$qm11TDrawBufferssuc PROC
else
! @TFrame@frameLine$qr11TDrawBufferssuc PROC
endif
! ARG thisPtr:PTR, FrameBuf:PTR, Y:ARGINT, N:ARGINT, Color:BYTE
ifndef __FLAT__
! USES SI,DI
! LES BX, [thisPtr]
! MOV DX, ES:[BX+TFrameSizeX]
! MOV CX, DX
! DEC CX
! DEC CX
! MOV SI, OFFSET @TFrame@initFrame
! ADD SI, [N]
! LEA DI, [FrameMask]
! PUSH DS
! POP ES
! CLD
! MOVSB
! LODSB
! REP STOSB
! MOVSB
! LES BX, [thisPtr]
! LES BX, ES:[BX+TFrameOwner]
! LES BX, ES:[BX+TGroupLast]
! DEC DX
! @@1: LES BX, ES:[BX+TViewNext]
! CMP BX, WORD PTR [ thisPtr]
! JNE @@2
! MOV AX, ES
! CMP AX, WORD PTR [ thisPtr+2]
! JE @@10
! @@2: TEST WORD PTR ES:[BX+TViewOptions], ofFramed
! JE @@1
! TEST WORD PTR ES:[BX+TViewState], sfVisible
! JE @@1
! MOV AX, [Y]
! SUB AX, ES:[BX+TViewOriginY]
! JL @@3
! CMP AX, ES:[BX+TViewSizeY]
! JG @@1
! MOV AX, 0005H
! JL @@4
! MOV AX, 0A03H
! JMP @@4
! @@3: INC AX
! JNE @@1
! MOV AX, 0A06H
! @@4: MOV SI, ES:[BX+TViewOriginX]
! MOV DI, ES:[BX+TViewSizeX]
! ADD DI, SI
! CMP SI, 1
! JG @@5
! MOV SI, 1
! @@5: CMP DI, DX
! JL @@6
! MOV DI, DX
! @@6: CMP SI, DI
! JGE @@1
! OR [BYTE PTR FrameMask+SI-1], AL
! XOR AL, AH
! OR [BYTE PTR FrameMask+DI], AL
! OR AH, AH
! JE @@1
! MOV CX, DI
! SUB CX, SI
! @@8: OR [BYTE PTR FrameMask+SI], AH
! INC SI
! LOOP @@8
! JMP @@1
! @@10: INC DX
! MOV AH, [Color]
! MOV BX, OFFSET @TFrame@frameChars
! MOV CX, DX
! LEA SI, [FrameMask]
! LES DI, [FrameBuf]
! ADD DI, TDrawBufferData
! @@11: LODSB
! XLAT
! STOSW
! LOOP @@11
! RET
!
! else ;;;;;;;;;;;;;;;;;;;;;;;;;; 32-bit version ;;;;;;;;;;;;;;;;;;;;;;;;;;;
!
! USES ESI,EDI,EBX
!
! XOR EAX, EAX
! MOV WORD PTR [Y+2], AX
! MOV WORD PTR [N+2], AX
!
! MOV EBX, DWORD PTR [thisPtr]
! MOV EDX, [EBX+TFrameSizeX]
! MOV ECX, EDX
! DEC ECX
! DEC ECX
! MOV ESI, OFFSET @TFrame@initFrame
! ADD ESI, [N]
! LEA EDI, [FrameMask]
! CLD
!
! MOVSB
! LODSB
! MOV AH, AL
! MOV EBX, EAX
! SHL EAX, 16
! MOV AX, BX
! MOV EBX, ECX
! SHR ECX, 2
! REP STOSD
! MOV ECX, EBX
! AND ECX, 03H
! REP STOSB
! MOVSB
! MOV EBX, DWORD PTR [thisPtr]
! MOV EBX, [EBX+TFrameOwner]
! MOV EBX, [EBX+TGroupLast]
! DEC EDX
! @@1: MOV EBX, [EBX+TViewNext]
! CMP EBX, DWORD PTR [thisPtr]
! JE @@10
! @@2: TEST WORD PTR [EBX+TViewOptions], ofFramed
! JE @@1
! TEST WORD PTR [EBX+TViewState], sfVisible
! JE @@1
! MOV EAX, [Y]
! SUB EAX, [EBX+TViewOriginY]
! JL @@3
! CMP EAX, [EBX+TViewSizeY]
! JG @@1
! MOV EAX, 0005H
! JL @@4
! MOV EAX, 0A03H
! JMP @@4
! @@3: INC EAX
! JNE @@1
! MOV EAX, 0A06H
! @@4: MOV ESI, [EBX+TViewOriginX]
! MOV EDI, [EBX+TViewSizeX]
! ADD EDI, ESI
! CMP ESI, 1
! JG @@5
! MOV ESI, 1
! @@5: CMP EDI, EDX
! JL @@6
! MOV EDI, EDX
! @@6: CMP ESI, EDI
! JGE @@1
! OR [BYTE PTR FrameMask+ESI-1], AL
! XOR AL,AH
! OR [BYTE PTR FrameMask+EDI], AL
! OR AH,AH
! JE @@1
! MOV ECX, EDI
! SUB ECX, ESI
! @@8: OR [BYTE PTR FrameMask+ESI], AH
! INC ESI
! LOOP @@8
! JMP @@1
! @@10: INC EDX
! MOV AH, [Color]
! MOV EBX, OFFSET @TFrame@frameChars
! MOV ECX, EDX
! LEA ESI, [FrameMask]
! MOV EDI, DWORD PTR [FrameBuf]
! ADD EDI, TDrawBufferData
! @@11: LODSB
! XLAT
! STOSW
! LOOP @@11
! RET
endif
ifndef __FLAT__
@TFrame@frameLine$qm11TDrawBufferssuc ENDP
else
! @TFrame@frameLine$qr11TDrawBufferssuc ENDP
endif
END
--- 1,217 ----
;/*------------------------------------------------------------*/
! ;/* filename - framelin.asm */
! ;/* */
! ;/* function(s) */
! ;/* TFrame frameLine member function */
;/*------------------------------------------------------------*/
;
! ; Turbo Vision - Version 2.0
! ;
! ; Copyright (c) 1994 by Borland International
! ; All Rights Reserved.
! ;
ifndef __FLAT__
! PUBLIC @TFrame@frameLine$qm11TDrawBufferssuc
! EXTRN @TFrame@initFrame : BYTE
! EXTRN @TFrame@frameChars : BYTE
!
else
! ; --- Flat model entrypoint (C-callable)
! public _asmFrameLine
! extrn _asmInitFrame : byte ; from TVTEXT1
! extrn _asmFrameChars: byte ; from TVTEXT1
endif
! INCLUDE TV.INC
! MaxViewWidth equ 132
DATASEG
! FrameMask DB MaxViewWidth dup(?)
CODESEG
ifndef __FLAT__
@TFrame@frameLine$qm11TDrawBufferssuc PROC
else
! _asmFrameLine PROC
endif
! ARG thisPtr:PTR, FrameBuf:PTR, Y:ARGINT, N:ARGINT, Color:BYTE
ifndef __FLAT__
! USES SI,DI
! LES BX, [thisPtr]
! MOV DX, ES:[BX+TFrameSizeX]
! MOV CX, DX
! DEC CX
! DEC CX
! MOV SI, OFFSET @TFrame@initFrame
! ADD SI, [N]
! LEA DI, [FrameMask]
! PUSH DS
! POP ES
! CLD
! MOVSB
! LODSB
! REP STOSB
! MOVSB
! LES BX, [thisPtr]
! LES BX, ES:[BX+TFrameOwner]
! LES BX, ES:[BX+TGroupLast]
! DEC DX
! @@1: LES BX, ES:[BX+TViewNext]
! CMP BX, WORD PTR [ thisPtr]
! JNE @@2
! MOV AX, ES
! CMP AX, WORD PTR [ thisPtr+2]
! JE @@10
! @@2: TEST WORD PTR ES:[BX+TViewOptions], ofFramed
! JE @@1
! TEST WORD PTR ES:[BX+TViewState], sfVisible
! JE @@1
! MOV AX, [Y]
! SUB AX, ES:[BX+TViewOriginY]
! JL @@3
! CMP AX, ES:[BX+TViewSizeY]
! JG @@1
! MOV AX, 0005H
! JL @@4
! MOV AX, 0A03H
! JMP @@4
! @@3: INC AX
! JNE @@1
! MOV AX, 0A06H
! @@4: MOV SI, ES:[BX+TViewOriginX]
! MOV DI, ES:[BX+TViewSizeX]
! ADD DI, SI
! CMP SI, 1
! JG @@5
! MOV SI, 1
! @@5: CMP DI, DX
! JL @@6
! MOV DI, DX
! @@6: CMP SI, DI
! JGE @@1
! OR [BYTE PTR FrameMask+SI-1], AL
! XOR AL, AH
! OR [BYTE PTR FrameMask+DI], AL
! OR AH, AH
! JE @@1
! MOV CX, DI
! SUB CX, SI
! @@8: OR [BYTE PTR FrameMask+SI], AH
! INC SI
! LOOP @@8
! JMP @@1
! @@10: INC DX
! MOV AH, [Color]
! MOV BX, OFFSET @TFrame@frameChars
! MOV CX, DX
! LEA SI, [FrameMask]
! LES DI, [FrameBuf]
! ADD DI, TDrawBufferData
! @@11: LODSB
! XLAT
! STOSW
! LOOP @@11
! RET
!
! else ;;;;;;;;;;;;;;;;;;;;;;;;;; 32-bit version ;;;;;;;;;;;;;;;;;;;;;;;;;;;
!
! USES ESI,EDI,EBX
!
! XOR EAX, EAX
! MOV WORD PTR [Y+2], AX
! MOV WORD PTR [N+2], AX
!
! MOV EBX, DWORD PTR [thisPtr]
! MOV EDX, [EBX+TFrameSizeX]
! MOV ECX, EDX
! DEC ECX
! DEC ECX
! MOV ESI, OFFSET _asmInitFrame
! ADD ESI, [N]
! LEA EDI, [FrameMask]
! CLD
!
! MOVSB
! LODSB
! MOV AH, AL
! MOV EBX, EAX
! SHL EAX, 16
! MOV AX, BX
! MOV EBX, ECX
! SHR ECX, 2
! REP STOSD
! MOV ECX, EBX
! AND ECX, 03H
! REP STOSB
! MOVSB
! MOV EBX, DWORD PTR [thisPtr]
! MOV EBX, [EBX+TFrameOwner]
! MOV EBX, [EBX+TGroupLast]
! DEC EDX
! @@1: MOV EBX, [EBX+TViewNext]
! CMP EBX, DWORD PTR [thisPtr]
! JE @@10
! @@2: TEST WORD PTR [EBX+TViewOptions], ofFramed
! JE @@1
! TEST WORD PTR [EBX+TViewState], sfVisible
! JE @@1
! MOV EAX, [Y]
! SUB EAX, [EBX+TViewOriginY]
! JL @@3
! CMP EAX, [EBX+TViewSizeY]
! JG @@1
! MOV EAX, 0005H
! JL @@4
! MOV EAX, 0A03H
! JMP @@4
! @@3: INC EAX
! JNE @@1
! MOV EAX, 0A06H
! @@4: MOV ESI, [EBX+TViewOriginX]
! MOV EDI, [EBX+TViewSizeX]
! ADD EDI, ESI
! CMP ESI, 1
! JG @@5
! MOV ESI, 1
! @@5: CMP EDI, EDX
! JL @@6
! MOV EDI, EDX
! @@6: CMP ESI, EDI
! JGE @@1
! OR [BYTE PTR FrameMask+ESI-1], AL
! XOR AL,AH
! OR [BYTE PTR FrameMask+EDI], AL
! OR AH,AH
! JE @@1
! MOV ECX, EDI
! SUB ECX, ESI
! @@8: OR [BYTE PTR FrameMask+ESI], AH
! INC ESI
! LOOP @@8
! JMP @@1
! @@10: INC EDX
! MOV AH, [Color]
! MOV EBX, OFFSET _asmFrameChars
! MOV ECX, EDX
! LEA ESI, [FrameMask]
! MOV EDI, DWORD PTR [FrameBuf]
! ADD EDI, TDrawBufferData
! @@11: LODSB
! XLAT
! STOSW
! LOOP @@11
! RET
endif
ifndef __FLAT__
@TFrame@frameLine$qm11TDrawBufferssuc ENDP
else
! _asmFrameLine ENDP
endif
END
diff --context ..\tvo/Geninc.cpp ./GENINC.CPP
*** ../tvo/Geninc.cpp Fri Jun 17 01:00:00 1994
--- ./GENINC.CPP Tue Apr 25 22:08:46 1995
***************
*** 43,48 ****
--- 43,51 ----
#define gen( n, c, o ) generate( #n, offsetof( c, o ) )
+ #undef offsetof
+ #define offsetof(typ,id) (size_t)&(((typ*)0)->id)
+
void generate( const char *name, size_t offset )
{
cout << setw( 19 ) << setiosflags( ios::left )
Only in .: HARDDOS.CPP
Only in .: HARDNT.CPP
Only in .: HARDOS2.CPP
diff --context ..\tvo/Hardware.h ./HARDWARE.H
*** ../tvo/Hardware.h Fri Jun 17 01:00:00 1994
--- ./HARDWARE.H Tue Apr 25 22:08:56 1995
***************
*** 22,32 ****
#define __THardwareInfo
#if defined( __FLAT__ )
!
! #if !defined( __WINDOWS_H )
! #include <windows.h>
! #endif
!
#else
#if !defined( MAKELONG )
--- 22,36 ----
#define __THardwareInfo
#if defined( __FLAT__ )
! # if defined(__OS2__)
! # include <tvision/tvosdef.h>
! # elif defined(__NT__)
! # if !defined( __WINDOWS_H )
! # include <windows.h>
! # endif
! # else
! # error "Non-supported OS"
! # endif
#else
#if !defined( MAKELONG )
***************
*** 41,134 ****
class THardwareInfo
{
-
public:
-
THardwareInfo();
!
! static ulong getTickCount();
!
! #if defined( __FLAT__ )
!
! enum ConsoleType { cnInput = 0, cnOutput = 1 };
enum PlatformType { plDPMI32 = 1, plWinNT = 2, plOS2 = 4 };
static PlatformType getPlatform();
! // Caret functions.
!
! static void setCaretSize( ushort size );
! static ushort getCaretSize();
! static void setCaretPosition( ushort x, ushort y );
! static BOOL isCaretVisible();
! // Screen functions.
- static ushort getScreenRows();
- static ushort getScreenCols();
- static ushort getScreenMode();
- static void setScreenMode( ushort mode );
- static void clearScreen( ushort w, ushort h );
- static void screenWrite( ushort x, ushort y, ushort *buf, DWORD len );
- static ushort *allocateScreenBuffer();
- static void freeScreenBuffer( ushort *buffer );
! // Mouse functions.
! static DWORD getButtonCount();
! static void cursorOn();
! static void cursorOff();
! // Event functions.
! static BOOL getMouseEvent( MouseEventType& event );
! static BOOL getKeyEvent( TEvent& event );
! static void clearPendingEvent();
// System functions.
!
! static BOOL setCtrlBrkHandler( BOOL install );
! static BOOL setCritErrorHandler( BOOL install );
private:
! static BOOL __stdcall ctrlBreakHandler( DWORD dwCtrlType );
!
! static BOOL insertState;
! static PlatformType platform;
! static HANDLE consoleHandle[2];
! static DWORD consoleMode;
! static DWORD pendingEvent;
! static INPUT_RECORD irBuffer;
static CONSOLE_CURSOR_INFO crInfo;
static CONSOLE_SCREEN_BUFFER_INFO sbInfo;
#else
! static ushort *getColorAddr( ushort offset = 0 );
! static ushort *getMonoAddr( ushort offset = 0 );
! static uchar getShiftState();
! static uchar getBiosScreenRows();
! static uchar getBiosVideoInfo();
! static void setBiosVideoInfo( uchar info );
! static ushort getBiosEquipmentFlag();
! static ushort huge getBiosEquipmentFlag(int); // Non-inline version.
! static void setBiosEquipmentFlag( ushort flag );
! static Boolean getDPMIFlag();
private:
! static ushort huge getBiosSelector(); // For SYSINT.ASM.
!
! static Boolean dpmiFlag;
! static ushort colorSel;
! static ushort monoSel;
! static ushort biosSel;
#endif
-
};
#if defined( __FLAT__ )
inline THardwareInfo::PlatformType THardwareInfo::getPlatform()
--- 45,167 ----
class THardwareInfo
{
public:
THardwareInfo();
! static ulong getTickCount();
enum PlatformType { plDPMI32 = 1, plWinNT = 2, plOS2 = 4 };
+ /*
+ * Shared stuff for OS/2 and NT...
+ */
+ #if defined(__FLAT__)
static PlatformType getPlatform();
! //** Caret (hardware cursor) functions.
! static void setCaretSize( ushort size );
! static ushort getCaretSize();
! static void setCaretPosition( ushort x, ushort y );
! static BOOL isCaretVisible();
!
! //** Screen functions..
! static ushort getScreenRows();
! static ushort getScreenCols();
! static ushort getScreenMode();
! static void setScreenMode( ushort mode );
! static void clearScreen( ushort w, ushort h );
! static void screenWrite( ushort x, ushort y, ushort *buf, unsigned len );
!
! //** Mouse stuff,
! static ulong getButtonCount();
! static void cursorOn();
! static void cursorOff();
!
! //** Event stuff,
! static Boolean getMouseEvent( MouseEventType& event ); // Silly.
! static Boolean getKeyEvent( TEvent& event );
! static void clearPendingEvent();
! private:
! static Boolean insertState;
! static PlatformType platform;
! /*
! * NT only stuff..
! */
! # if defined(__NT__)
! public:
! enum ConsoleType { cnInput = 0, cnOutput = 1 };
! // Caret functions.
! // Screen functions.
! static ushort *allocateScreenBuffer();
! static void freeScreenBuffer( ushort *buffer );
// System functions.
! static BOOL setCtrlBrkHandler( BOOL install );
! static BOOL setCritErrorHandler( BOOL install );
private:
+ static BOOL __stdcall ctrlBreakHandler( ulong dwCtrlType );
! static HANDLE consoleHandle[2];
! static DWORD consoleMode;
! static DWORD pendingEvent;
! static INPUT_RECORD irBuffer;
static CONSOLE_CURSOR_INFO crInfo;
static CONSOLE_SCREEN_BUFFER_INFO sbInfo;
+
+ /*
+ * OS/2 only stuff...
+ */
+ # elif defined(__OS2__)
+
+
+
+ # else
+ # error "Non-supported OS"
+ # endif
+
+
+ /*
+ * MS/DOS and DOS EXTENDER interface (Stupid, stupid).
+ */
#else
! static ushort *getColorAddr( ushort offset = 0 );
! static ushort *getMonoAddr( ushort offset = 0 );
! static uchar getShiftState();
! static uchar getBiosScreenRows();
! static uchar getBiosVideoInfo();
! static void setBiosVideoInfo( uchar info );
! static ushort getBiosEquipmentFlag();
! static ushort huge getBiosEquipmentFlag(int); // Non-inline version.
! static void setBiosEquipmentFlag( ushort flag );
! static Boolean getDPMIFlag();
private:
+ static ushort huge getBiosSelector(); // For SYSINT.ASM.
! static Boolean dpmiFlag;
! static ushort colorSel;
! static ushort monoSel;
! static ushort biosSel;
#endif
};
+
+ /****************************************************************************/
+ /* */
+ /* CODING: Inline functions... */
+ /* */
+ /****************************************************************************/
+ /*
+ * Inlines: shared for all __FLAT__s..
+ */
#if defined( __FLAT__ )
inline THardwareInfo::PlatformType THardwareInfo::getPlatform()
***************
*** 136,141 ****
--- 169,198 ----
return platform;
}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ # if defined(__NT__)
+
// Caret functions.
inline ushort THardwareInfo::getCaretSize()
***************
*** 230,235 ****
--- 287,308 ----
{
return TRUE; // Handled by NT or DPMI32..
}
+
+
+ /*
+ * Inlines: OS/2 only functions..
+ */
+ # elif defined(__OS2__)
+
+ inline void THardwareInfo::clearPendingEvent()
+ {
+ }
+
+
+ # else
+ # error "Bad OS"
+ # endif
+
#else
diff --context ..\tvo/Hardwrvr.cpp ./HARDWRVR.CPP
*** ../tvo/Hardwrvr.cpp Fri Jun 17 01:00:00 1994
--- ./HARDWRVR.CPP Tue Apr 25 22:08:46 1995
***************
*** 20,293 ****
#define Uses_TSystemError
#include <tvision\tv.h>
- #if defined( __FLAT__ )
- BOOL THardwareInfo::insertState = True;
- THardwareInfo::PlatformType THardwareInfo::platform = THardwareInfo::plDPMI32;
- HANDLE THardwareInfo::consoleHandle[2];
- DWORD THardwareInfo::consoleMode;
- DWORD THardwareInfo::pendingEvent;
- INPUT_RECORD THardwareInfo::irBuffer;
- CONSOLE_CURSOR_INFO THardwareInfo::crInfo;
- CONSOLE_SCREEN_BUFFER_INFO THardwareInfo::sbInfo;
- static ushort ShiftCvt[89] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0x5400, 0x5500, 0x5600, 0x5700, 0x5800,
- 0x5900, 0x5A00, 0x5B00, 0x5C00, 0x5D00, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0x0500, 0x0700, 0, 0, 0, 0x8700,
- 0x8800
- };
-
- static ushort CtrlCvt[89] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0x0011, 0x0017, 0x0005, 0x0012, 0x0014, 0x0019, 0x0015, 0x0009,
- 0x000F, 0x0010, 0, 0, 0, 0, 0x0001, 0x0013,
- 0x0004, 0x0006, 0x0007, 0x0008, 0x000A, 0x000B, 0x000C, 0,
- 0, 0, 0, 0, 0x001A, 0x0018, 0x0003, 0x0016,
- 0x0002, 0x000E, 0x000D, 0, 0, 0, 0, 0,
- 0, 0, 0, 0x5E00, 0x5F00, 0x6000, 0x6100, 0x6200,
- 0x6300, 0x6400, 0x6500, 0x6600, 0x6700, 0, 0, 0x7700,
- 0, 0x8400, 0, 0x7300, 0, 0x7400, 0, 0x7500,
- 0, 0x7600, 0x0400, 0x0600, 0, 0, 0, 0x8900,
- 0x8A00
- };
-
- static ushort AltCvt[89] = {
- 0, 0, 0x7800, 0x7900, 0x7A00, 0x7B00, 0x7C00, 0x7D00,
- 0x7E00, 0x7F00, 0x8000, 0x8100, 0x8200, 0x8300, 0x0800, 0,
- 0x1000, 0x1100, 0x1200, 0x1300, 0x1400, 0x1500, 0x1600, 0x1700,
- 0x1800, 0x1900, 0, 0, 0, 0, 0x1E00, 0x1F00,
- 0x2000, 0x2100, 0x2200, 0x2300, 0x2400, 0x2500, 0x2600, 0,
- 0, 0, 0, 0, 0x2C00, 0x2D00, 0x2E00, 0x2F00,
- 0x3000, 0x3100, 0x3200, 0, 0, 0, 0, 0,
- 0, 0x0200, 0, 0x6800, 0x6900, 0x6A00, 0x6B00, 0x6C00,
- 0x6D00, 0x6E00, 0x6F00, 0x7000, 0x7100, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0x8B00,
- 0x8C00
- };
-
-
- #else
-
- Boolean THardwareInfo::dpmiFlag;
- ushort THardwareInfo::colorSel;
- ushort THardwareInfo::monoSel;
- ushort THardwareInfo::biosSel;
-
- #endif
-
- #if defined( __FLAT__ )
-
- #define INT10 { __emit__( 0xCD ); __emit__( 0x10 ); }
-
- // Constructor for 16-bit version is in HARDWARE.ASM
-
- THardwareInfo::THardwareInfo()
- {
- HMODULE mod;
-
- if( (mod = GetModuleHandle( "KERNEL32" )) != 0 &&
- GetProcAddress( mod, "Borland32" ) != 0
- )
- platform = plDPMI32;
- else
- platform = plWinNT;
-
- consoleHandle[cnInput] = GetStdHandle( STD_INPUT_HANDLE );
- consoleHandle[cnOutput] = GetStdHandle( STD_OUTPUT_HANDLE );
- GetConsoleMode( consoleHandle[cnInput], &consoleMode );
- GetConsoleCursorInfo( consoleHandle[cnOutput], &crInfo );
- GetConsoleScreenBufferInfo( consoleHandle[cnOutput], &sbInfo );
- }
-
- ushort THardwareInfo::getScreenMode()
- {
- ushort mode;
-
- if( platform != plDPMI32 ) // B/W, mono not supported if running on
- mode = TDisplay::smCO80; // NT. Would have to use the registry.
- else
- {
- _AH = 0x0F;
- INT10; // Emit CD, 10. Supported by DPMI server.
- mode = _AL;
- }
-
- if( getScreenRows() > 25 )
- mode |= TDisplay::smFont8x8;
- return mode;
- }
-
- void THardwareInfo::setScreenMode( ushort mode )
- {
- COORD newSize = { 80, 25 };
- SMALL_RECT rect = { 0, 0, 79, 24 };
-
- if( mode & TDisplay::smFont8x8 )
- {
- newSize.Y = 50;
- rect.Bottom = 49;
- }
-
- if( platform != plDPMI32 )
- {
- COORD maxSize = GetLargestConsoleWindowSize( consoleHandle[cnOutput] );
- if( newSize.Y > maxSize.Y )
- {
- newSize.Y = maxSize.Y;
- rect.Bottom = newSize.Y-1;
- }
- }
-
- if( mode & TDisplay::smFont8x8 )
- {
- SetConsoleScreenBufferSize( consoleHandle[cnOutput], newSize );
- SetConsoleWindowInfo( consoleHandle[cnOutput], True, &rect );
- }
- else
- {
- SetConsoleWindowInfo( consoleHandle[cnOutput], True, &rect );
- SetConsoleScreenBufferSize( consoleHandle[cnOutput], newSize );
- }
-
- GetConsoleScreenBufferInfo( consoleHandle[cnOutput], &sbInfo );
- }
-
- void THardwareInfo::setCaretPosition( ushort x, ushort y )
- {
- COORD coord = { x, y };
- SetConsoleCursorPosition( consoleHandle[cnOutput], coord );
- }
-
- void THardwareInfo::setCaretSize( ushort size )
- {
- if( size == 0 )
- {
- crInfo.bVisible = False;
- crInfo.dwSize = 1;
- }
- else
- {
- crInfo.bVisible = True;
- crInfo.dwSize = size;
- }
-
- SetConsoleCursorInfo( consoleHandle[cnOutput], &crInfo );
- }
-
- void THardwareInfo::screenWrite( ushort x, ushort y, ushort *buf, DWORD len )
- {
- COORD size = {len,1};
- COORD from = {0,0};
- SMALL_RECT to = {x,y,x+len,y+1};
-
- WriteConsoleOutput( consoleHandle[cnOutput], (CHAR_INFO *) buf, size, from, &to);
- }
-
- // Event functions.
-
- BOOL THardwareInfo::getMouseEvent( MouseEventType& event )
- {
- if( !pendingEvent )
- {
- GetNumberOfConsoleInputEvents( consoleHandle[cnInput], &pendingEvent );
- if( pendingEvent )
- ReadConsoleInput( consoleHandle[cnInput], &irBuffer, 1, &pendingEvent );
- }
-
- if( pendingEvent && irBuffer.EventType == MOUSE_EVENT)
- {
- event.where.x = irBuffer.Event.MouseEvent.dwMousePosition.X;
- event.where.y = irBuffer.Event.MouseEvent.dwMousePosition.Y;
- event.buttons = irBuffer.Event.MouseEvent.dwButtonState;
- event.eventFlags = irBuffer.Event.MouseEvent.dwEventFlags;
- event.controlKeyState = irBuffer.Event.MouseEvent.dwControlKeyState;
-
- pendingEvent = 0;
- return True;
- }
- return False;
- }
-
-
- BOOL THardwareInfo::getKeyEvent( TEvent& event )
- {
- if( !pendingEvent )
- {
- GetNumberOfConsoleInputEvents( consoleHandle[cnInput], &pendingEvent );
- if( pendingEvent )
- ReadConsoleInput( consoleHandle[cnInput], &irBuffer, 1, &pendingEvent );
- }
-
- if( pendingEvent )
- {
- if( irBuffer.EventType == KEY_EVENT && irBuffer.Event.KeyEvent.bKeyDown )
- {
- event.what = evKeyDown;
- event.keyDown.charScan.scanCode = irBuffer.Event.KeyEvent.wVirtualScanCode;
- event.keyDown.charScan.charCode = irBuffer.Event.KeyEvent.uChar.AsciiChar;
- event.keyDown.controlKeyState = irBuffer.Event.KeyEvent.dwControlKeyState;
-
- /* Convert NT style virtual scan codes to PC BIOS codes.
- */
- if( (event.keyDown.controlKeyState & (kbShift | kbAltShift | kbCtrlShift)) != 0 )
- {
- uchar index = irBuffer.Event.KeyEvent.wVirtualScanCode;
-
- if ((event.keyDown.controlKeyState & kbShift) && ShiftCvt[index] != 0)
- event.keyDown.keyCode = ShiftCvt[index];
- else if ((event.keyDown.controlKeyState & kbCtrlShift) && CtrlCvt[index] != 0)
- event.keyDown.keyCode = CtrlCvt[index];
- else if ((event.keyDown.controlKeyState & kbAltShift) && AltCvt[index] != 0)
- event.keyDown.keyCode = AltCvt[index];
- }
-
- /* Set/Reset insert flag.
- */
- if( event.keyDown.keyCode == kbIns )
- insertState = !insertState;
-
- if( insertState )
- event.keyDown.controlKeyState |= kbInsState;
-
- pendingEvent = 0;
- return True;
- }
- // Ignore all events except mouse events. Pending mouse events will
- // be read on the next polling loop.
- else if( irBuffer.EventType != MOUSE_EVENT )
- pendingEvent = 0;
- }
-
- return False;
- }
-
- BOOL __stdcall THardwareInfo::ctrlBreakHandler( DWORD dwCtrlType )
- {
- if( dwCtrlType == CTRL_C_EVENT || dwCtrlType == CTRL_BREAK_EVENT )
- {
- TSystemError::ctrlBreakHit = True;
- return TRUE;
- }
- else
- return FALSE; // Don't handle 'CLOSE', 'LOGOFF' or 'SHUTDOWN' events.
- }
-
- ulong THardwareInfo::getTickCount()
- {
- // To change units from ms to clock ticks.
- // X ms * 1s/1000ms * 18.2ticks/s = X/55 ticks, roughly.
- return GetTickCount() / 55;
- }
-
- #endif // __FLAT__
--- 20,24 ----
diff --context ..\tvo/Helpbase.cpp ./HELPBASE.CPP
*** ../tvo/Helpbase.cpp Fri Jun 17 01:00:00 1994
--- ./HELPBASE.CPP Tue Apr 25 22:08:46 1995
***************
*** 159,165 ****
if (crossRefs != 0)
{
crossRefPtr = (TCrossRef *)crossRefs;
! delete [numRefs] crossRefPtr;
}
}
--- 159,165 ----
if (crossRefs != 0)
{
crossRefPtr = (TCrossRef *)crossRefs;
! delete [] crossRefPtr;
}
}
***************
*** 173,179 ****
{
crossRefPtr = crossRefs;
memmove(p, crossRefPtr, numRefs * sizeof(TCrossRef));
! delete [numRefs] crossRefPtr;
}
crossRefs = p;
crossRefPtr = crossRefs + numRefs;
--- 173,179 ----
{
crossRefPtr = crossRefs;
memmove(p, crossRefPtr, numRefs * sizeof(TCrossRef));
! delete [] crossRefPtr;
}
crossRefs = p;
crossRefPtr = crossRefs + numRefs;
***************
*** 333,339 ****
else
memmove(p, crossRefPtr, i * sizeof(TCrossRef));
! delete [numRefs] crossRefPtr;
}
crossRefs = p;
numRefs = i;
--- 333,339 ----
else
memmove(p, crossRefPtr, i * sizeof(TCrossRef));
! delete [] crossRefPtr;
}
crossRefs = p;
numRefs = i;
***************
*** 511,517 ****
THelpIndex::~THelpIndex()
{
! delete [size] index;
}
--- 511,517 ----
THelpIndex::~THelpIndex()
{
! delete [] index;
}
***************
*** 552,558 ****
}
if (size > 0)
{
! delete [size] index;
}
index = p;
size = newSize;
--- 552,558 ----
}
if (size > 0)
{
! delete [] index;
}
index = p;
size = newSize;
diff --context ..\tvo/Histlist.cpp ./HISTLIST.CPP
*** ../tvo/Histlist.cpp Fri Jun 17 01:00:00 1994
--- ./HISTLIST.CPP Tue Apr 25 22:08:46 1995
***************
*** 109,119 ****
void deleteString()
{
! size_t len = curRec->len;
#if !defined(__FLAT__)
! movmem( next( curRec ), curRec, size_t( (char *)lastRec - (char *)curRec ) );
#else
! memcpy(curRec, next(curRec), size_t( (char *)lastRec - (char *)curRec ) );
#endif
lastRec = backup( lastRec, len );
}
--- 109,119 ----
void deleteString()
{
! size_t len = curRec->len;
#if !defined(__FLAT__)
! movmem( next( curRec ), curRec, size_t( (char *)lastRec - (char *)curRec ) );
#else
! memcpy(curRec, next(curRec), size_t( (char *)lastRec - (char *)curRec ) );
#endif
lastRec = backup( lastRec, len );
}
***************
*** 127,135 ****
HistRec *dst = historyBlock;
HistRec *src = next( historyBlock );
#if !defined(__FLAT__)
! movmem( src, dst, size_t( (char *)lastRec - (char *)src ) );
#else
! memcpy( dst, src, size_t( (char *)lastRec - (char *)src ) );
#endif
lastRec = backup( lastRec, firstLen );
}
--- 127,135 ----
HistRec *dst = historyBlock;
HistRec *src = next( historyBlock );
#if !defined(__FLAT__)
! movmem( src, dst, size_t( (char *)lastRec - (char *)src ) );
#else
! memcpy( dst, src, size_t( (char *)lastRec - (char *)src ) );
#endif
lastRec = backup( lastRec, firstLen );
}
Only in ..\tvo: Makefile
diff --context ..\tvo/Menus.h ./MENUS.H
*** ../tvo/Menus.h Fri Jun 17 01:00:00 1994
--- ./MENUS.H Tue Apr 25 22:08:56 1995
***************
*** 1,16 ****
/* ------------------------------------------------------------------------*/
! /* */
! /* MENUS.H */
! /* */
! /* defines the classes TMenuItem, TMenu, TMenuView, TSubMenu, */
! /* TMenuBar, TMenuBox, TStatusItem, TStatusDef, and TStatusLine */
! /* */
/* ------------------------------------------------------------------------*/
/*
! * Turbo Vision - Version 2.0
*
! * Copyright (c) 1994 by Borland International
! * All Rights Reserved.
*
*/
--- 1,16 ----
/* ------------------------------------------------------------------------*/
! /* */
! /* MENUS.H */
! /* */
! /* defines the classes TMenuItem, TMenu, TMenuView, TSubMenu, */
! /* TMenuBar, TMenuBox, TStatusItem, TStatusDef, and TStatusLine */
! /* */
/* ------------------------------------------------------------------------*/
/*
! * Turbo Vision - Version 2.0
*
! * Copyright (c) 1994 by Borland International
! * All Rights Reserved.
*
*/
***************
*** 40,57 ****
public:
TMenuItem( const char *aName,
! ushort aCommand,
! ushort aKeyCode,
! ushort aHelpCtx = hcNoContext,
! char *p = 0,
! TMenuItem *aNext = 0
! );
TMenuItem( const char *aName,
! ushort aKeyCode,
! TMenu *aSubMenu,
! ushort aHelpCtx = hcNoContext,
! TMenuItem *aNext = 0
! );
~TMenuItem();
--- 40,57 ----
public:
TMenuItem( const char *aName,
! ushort aCommand,
! ushort aKeyCode,
! ushort aHelpCtx = hcNoContext,
! char *p = 0,
! TMenuItem *aNext = 0
! );
TMenuItem( const char *aName,
! ushort aKeyCode,
! TMenu *aSubMenu,
! ushort aHelpCtx = hcNoContext,
! TMenuItem *aNext = 0
! );
~TMenuItem();
***************
*** 64,73 ****
ushort keyCode;
ushort helpCtx;
union
! {
! const char *param;
! TMenu *subMenu;
! };
};
inline void TMenuItem::append( TMenuItem *aNext )
--- 64,73 ----
ushort keyCode;
ushort helpCtx;
union
! {
! const char *param;
! TMenu *subMenu;
! };
};
inline void TMenuItem::append( TMenuItem *aNext )
***************
*** 106,114 ****
TMenu() : items(0), deflt(0) {};
TMenu( TMenuItem& itemList )
! { items = &itemList; deflt = &itemList; }
TMenu( TMenuItem& itemList, TMenuItem& TheDefault )
! { items = &itemList; deflt = &TheDefault; }
~TMenu();
TMenuItem *items;
--- 106,114 ----
TMenu() : items(0), deflt(0) {};
TMenu( TMenuItem& itemList )
! { items = &itemList; deflt = &itemList; }
TMenu( TMenuItem& itemList, TMenuItem& TheDefault )
! { items = &itemList; deflt = &TheDefault; }
~TMenu();
TMenuItem *items;
***************
*** 119,133 ****
#endif // Uses_TMenu
/* ---------------------------------------------------------------------- */
! /* class TMenuView */
! /* */
! /* Palette layout */
! /* 1 = Normal text */
! /* 2 = Disabled text */
! /* 3 = Shortcut text */
! /* 4 = Normal selection */
! /* 5 = Disabled selection */
! /* 6 = Shortcut selection */
/* ---------------------------------------------------------------------- */
#if defined( Uses_TMenuView ) && !defined( __TMenuView )
--- 119,133 ----
#endif // Uses_TMenu
/* ---------------------------------------------------------------------- */
! /* class TMenuView */
! /* */
! /* Palette layout */
! /* 1 = Normal text */
! /* 2 = Disabled text */
! /* 3 = Shortcut text */
! /* 4 = Normal selection */
! /* 5 = Disabled selection */
! /* 6 = Shortcut selection */
/* ---------------------------------------------------------------------- */
#if defined( Uses_TMenuView ) && !defined( __TMenuView )
***************
*** 154,162 ****
virtual void handleEvent( TEvent& event );
TMenuItem *hotKey( ushort keyCode );
TMenuView *newSubView( const TRect& bounds,
! TMenu *aMenu,
! TMenuView *aParentMenu
! );
protected:
--- 154,162 ----
virtual void handleEvent( TEvent& event );
TMenuItem *hotKey( ushort keyCode );
TMenuView *newSubView( const TRect& bounds,
! TMenu *aMenu,
! TMenuView *aParentMenu
! );
protected:
***************
*** 180,186 ****
private:
virtual const char *streamableName() const
! { return name; }
static void writeMenu( opstream&, TMenu * );
static TMenu *readMenu( ipstream& );
--- 180,186 ----
private:
virtual const char *streamableName() const
! { return name; }
static void writeMenu( opstream&, TMenu * );
static TMenu *readMenu( ipstream& );
***************
*** 208,216 ****
{ return os << (TStreamable *)cl; }
inline TMenuView::TMenuView( const TRect& bounds,
! TMenu *aMenu,
! TMenuView *aParent
! ) :
TView(bounds), current( 0 ), menu( aMenu ), parentMenu( aParent )
{
eventMask |= evBroadcast;
--- 208,216 ----
{ return os << (TStreamable *)cl; }
inline TMenuView::TMenuView( const TRect& bounds,
! TMenu *aMenu,
! TMenuView *aParent
! ) :
TView(bounds), current( 0 ), menu( aMenu ), parentMenu( aParent )
{
eventMask |= evBroadcast;
***************
*** 225,239 ****
#endif // Uses_TMenuView
/* ---------------------------------------------------------------------- */
! /* class TMenuBar */
! /* */
! /* Palette layout */
! /* 1 = Normal text */
! /* 2 = Disabled text */
! /* 3 = Shortcut text */
! /* 4 = Normal selection */
! /* 5 = Disabled selection */
! /* 6 = Shortcut selection */
/* ---------------------------------------------------------------------- */
#if defined( Uses_TMenuBar ) && !defined( __TMenuBar )
--- 225,239 ----
#endif // Uses_TMenuView
/* ---------------------------------------------------------------------- */
! /* class TMenuBar */
! /* */
! /* Palette layout */
! /* 1 = Normal text */
! /* 2 = Disabled text */
! /* 3 = Shortcut text */
! /* 4 = Normal selection */
! /* 5 = Disabled selection */
! /* 6 = Shortcut selection */
/* ---------------------------------------------------------------------- */
#if defined( Uses_TMenuBar ) && !defined( __TMenuBar )
***************
*** 257,263 ****
private:
virtual const char *streamableName() const
! { return name; }
protected:
--- 257,263 ----
private:
virtual const char *streamableName() const
! { return name; }
protected:
***************
*** 283,297 ****
#endif // Uses_TMenuBar
/* ---------------------------------------------------------------------- */
! /* class TMenuBox */
! /* */
! /* Palette layout */
! /* 1 = Normal text */
! /* 2 = Disabled text */
! /* 3 = Shortcut text */
! /* 4 = Normal selection */
! /* 5 = Disabled selection */
! /* 6 = Shortcut selection */
/* ---------------------------------------------------------------------- */
#if defined( Uses_TMenuBox ) && !defined( __TMenuBox )
--- 283,297 ----
#endif // Uses_TMenuBar
/* ---------------------------------------------------------------------- */
! /* class TMenuBox */
! /* */
! /* Palette layout */
! /* 1 = Normal text */
! /* 2 = Disabled text */
! /* 3 = Shortcut text */
! /* 4 = Normal selection */
! /* 5 = Disabled selection */
! /* 6 = Shortcut selection */
/* ---------------------------------------------------------------------- */
#if defined( Uses_TMenuBox ) && !defined( __TMenuBox )
***************
*** 319,325 ****
static const char * _NEAR frameChars;
virtual const char *streamableName() const
! { return name; }
protected:
--- 319,325 ----
static const char * _NEAR frameChars;
virtual const char *streamableName() const
! { return name; }
protected:
***************
*** 350,370 ****
#define __TMenuPopup
/* ---------------------------------------------------------------------- */
! /* class TMenuPopup */
! /* */
! /* Palette layout */
! /* 1 = Normal text */
! /* 2 = Disabled text */
! /* 3 = Shortcut text */
! /* 4 = Normal selection */
! /* 5 = Disabled selection */
! /* 6 = Shortcut selection */
/* ---------------------------------------------------------------------- */
class TMenuPopup : TMenuBox
{
TMenuPopup(TRect&, TMenu*);
virtual void handleEvent(TEvent&);
};
--- 350,375 ----
#define __TMenuPopup
/* ---------------------------------------------------------------------- */
! /* class TMenuPopup */
! /* */
! /* Palette layout */
! /* 1 = Normal text */
! /* 2 = Disabled text */
! /* 3 = Shortcut text */
! /* 4 = Normal selection */
! /* 5 = Disabled selection */
! /* 6 = Shortcut selection */
/* ---------------------------------------------------------------------- */
class TMenuPopup : TMenuBox
{
TMenuPopup(TRect&, TMenu*);
virtual void handleEvent(TEvent&);
+
+ //** JAL: Seems to be forgotten?
+ public:
+ static const char * const _NEAR name;
+ static TStreamable *build();
};
***************
*** 382,391 ****
public:
TStatusItem( const char *aText,
! ushort key,
! ushort cmd,
! TStatusItem *aNext = 0
! );
~TStatusItem();
TStatusItem *next;
--- 387,396 ----
public:
TStatusItem( const char *aText,
! ushort key,
! ushort cmd,
! TStatusItem *aNext = 0
! );
~TStatusItem();
TStatusItem *next;
***************
*** 396,405 ****
};
inline TStatusItem::TStatusItem( const char *aText,
! ushort key,
! ushort cmd,
! TStatusItem *aNext
! ) :
text( newStr(aText) ), keyCode( key ), command( cmd ), next( aNext )
{
}
--- 401,410 ----
};
inline TStatusItem::TStatusItem( const char *aText,
! ushort key,
! ushort cmd,
! TStatusItem *aNext
! ) :
text( newStr(aText) ), keyCode( key ), command( cmd ), next( aNext )
{
}
***************
*** 420,429 ****
public:
TStatusDef( ushort aMin,
! ushort aMax,
! TStatusItem *someItems = 0,
! TStatusDef *aNext = 0
! );
TStatusDef *next;
ushort min;
--- 425,434 ----
public:
TStatusDef( ushort aMin,
! ushort aMax,
! TStatusItem *someItems = 0,
! TStatusDef *aNext = 0
! );
TStatusDef *next;
ushort min;
***************
*** 432,441 ****
};
inline TStatusDef::TStatusDef( ushort aMin,
! ushort aMax,
! TStatusItem *someItems,
! TStatusDef *aNext
! ) :
min( aMin ), max( aMax ), items( someItems ), next( aNext )
{
}
--- 437,446 ----
};
inline TStatusDef::TStatusDef( ushort aMin,
! ushort aMax,
! TStatusItem *someItems,
! TStatusDef *aNext
! ) :
min( aMin ), max( aMax ), items( someItems ), next( aNext )
{
}
***************
*** 443,457 ****
#endif // Uses_TStatusDef
/* ---------------------------------------------------------------------- */
! /* class TStatusLine */
! /* */
! /* Palette layout */
! /* 1 = Normal text */
! /* 2 = Disabled text */
! /* 3 = Shortcut text */
! /* 4 = Normal selection */
! /* 5 = Disabled selection */
! /* 6 = Shortcut selection */
/* ---------------------------------------------------------------------- */
#if defined( Uses_TStatusLine ) && !defined( __TStatusLine )
--- 448,462 ----
#endif // Uses_TStatusDef
/* ---------------------------------------------------------------------- */
! /* class TStatusLine */
! /* */
! /* Palette layout */
! /* 1 = Normal text */
! /* 2 = Disabled text */
! /* 3 = Shortcut text */
! /* 4 = Normal selection */
! /* 5 = Disabled selection */
! /* 6 = Shortcut selection */
/* ---------------------------------------------------------------------- */
#if defined( Uses_TStatusLine ) && !defined( __TStatusLine )
***************
*** 490,496 ****
static const char * _NEAR hintSeparator;
virtual const char *streamableName() const
! { return name; }
static void writeItems( opstream&, TStatusItem * );
static void writeDefs( opstream&, TStatusDef * );
--- 495,501 ----
static const char * _NEAR hintSeparator;
virtual const char *streamableName() const
! { return name; }
static void writeItems( opstream&, TStatusItem * );
static void writeDefs( opstream&, TStatusDef * );
diff --context ..\tvo/Misc.cpp ./MISC.CPP
*** ../tvo/Misc.cpp Fri Jun 17 01:00:00 1994
--- ./MISC.CPP Tue Apr 25 22:08:46 1995
***************
*** 34,41 ****
--- 34,53 ----
return 0;
}
+
+ #if !defined(_NO_MEMMGR_)
+
Boolean lowMemory()
{
return Boolean(TVMemMgr::safetyPoolExhausted());
}
+
+ #else
+ Boolean lowMemory()
+ {
+ return False;
+ }
+
+ #endif
+
diff --context ..\tvo/New.cpp ./NEW.CPP
*** ../tvo/New.cpp Fri Jun 17 01:00:00 1994
--- ./NEW.CPP Tue Apr 25 22:08:46 1995
***************
*** 8,13 ****
--- 8,15 ----
* All Rights Reserved.
*
*/
+ #if !defined(_NO_MEMMGR_)
+
#define NDEBUG
#include <assert.h>
***************
*** 16,25 ****
#include <Mem.h>
#endif // __MEM_H
- #if !defined( __ALLOC_H )
! #include <Alloc.h>
! #endif // __ALLOC_H
#if !defined( __STDLIB_H )
#include <StdLib.h>
--- 18,29 ----
#include <Mem.h>
#endif // __MEM_H
!
! #if !defined( __MALLOC_H )
!
! #include <mAlloc.h>
! #endif // __MALLOC_H
#if !defined( __STDLIB_H )
#include <StdLib.h>
***************
*** 199,201 ****
--- 203,207 ----
{
deleteBlock(blk);
}
+
+ #endif
Only in .: OS2ASM.H
Only in .: OS2STUFF.CPP
Only in .: OS2STUFF.H
diff --context ..\tvo/Sdesktop.cpp ./SDESKTOP.CPP
*** ../tvo/Sdesktop.cpp Fri Jun 17 01:00:00 1994
--- ./SDESKTOP.CPP Tue Apr 25 22:08:48 1995
***************
*** 15,21 ****
#define Uses_TDeskTop
#define Uses_TStreamableClass
#include <tvision\tv.h>
! __link( RBackGround )
TStreamableClass RDeskTop( TDeskTop::name,
TDeskTop::build,
--- 15,21 ----
#define Uses_TDeskTop
#define Uses_TStreamableClass
#include <tvision\tv.h>
! __link( RBackground )
TStreamableClass RDeskTop( TDeskTop::name,
TDeskTop::build,
diff --context ..\tvo/Stddlg.cpp ./STDDLG.CPP
*** ../tvo/Stddlg.cpp Fri Jun 17 01:00:00 1994
--- ./STDDLG.CPP Tue Apr 25 22:08:50 1995
***************
*** 32,40 ****
#include <dos.h>
#endif // __DOS_H
! #if !defined( __DIR_H )
! #include <Dir.h>
! #endif // __DIR_H
#if !defined( __ERRNO_H )
#include <Errno.h>
--- 32,40 ----
#include <dos.h>
#endif // __DOS_H
! //#if !defined( __DIR_H )
! //#include <Dir.h>
! //#endif // __DIR_H
#if !defined( __ERRNO_H )
#include <Errno.h>
***************
*** 64,70 ****
--- 64,74 ----
#include <Limits.h>
#endif // __LIMITS_H
+
+
#if __STDC__
+ // This is *S*T*U*P*I*D*!
+ #if 0
extern "C"
{
char _FAR * _CType _FARFUNC ltoa(long __value, char _FAR *__string, int );
***************
*** 74,79 ****
--- 78,85 ----
};
#endif
+ #endif
+
void fexpand( char * );
#define cpInfoPane "\x1E"
***************
*** 122,131 ****
void TSortedListBox::handleEvent(TEvent& event)
{
! char curString[256], newString[256];
! void* k;
! int value;
! short oldPos, oldValue;
oldValue = focused;
TListBox::handleEvent( event );
--- 128,137 ----
void TSortedListBox::handleEvent(TEvent& event)
{
! char curString[256], newString[256];
! void* k;
! int value;
! short oldPos, oldValue;
oldValue = focused;
TListBox::handleEvent( event );
***************
*** 170,176 ****
curString[searchPos+1] = EOS;
}
k = getKey(curString);
! list()->search( k, (ccIndex) value );
if( value < range )
{
getText( newString, (short) value, 255 );
--- 176,186 ----
curString[searchPos+1] = EOS;
}
k = getKey(curString);
!
! ccIndex cix; //JAL: Can't pass reference to cast.
! list()->search( k, cix); //JAL: so use tv.
! value = cix;
!
if( value < range )
{
getText( newString, (short) value, 255 );
***************
*** 220,226 ****
TDrawBuffer b;
ushort color;
ftime *time;
! char path[MAXPATH];
strcpy( path, ((TFileDialog *)owner)->directory );
strcat( path, ((TFileDialog *)owner)->wildCard );
--- 230,236 ----
TDrawBuffer b;
ushort color;
ftime *time;
! char path[OS_MAXPATH];
strcpy( path, ((TFileDialog *)owner)->directory );
strcat( path, ((TFileDialog *)owner)->wildCard );
***************
*** 315,320 ****
--- 325,335 ----
TStreamable *TFileInfoPane::build()
{
return new TFileInfoPane( streamableInit );
+ }
+
+ TStreamable *TSortedListBox::build()
+ {
+ return new TSortedListBox( streamableInit );
}
#endif
diff --context ..\tvo/Stddlg.h ./STDDLG.H
*** ../tvo/Stddlg.h Fri Jun 17 01:00:00 1994
--- ./STDDLG.H Tue Apr 25 22:08:56 1995
***************
*** 47,62 ****
#if defined( Uses_TSearchRec ) && !defined( __TSearchRec )
#define __TSearchRec
! #if !defined( __DIR_H )
! #include <Dir.h>
! #endif // __DIR_H
struct TSearchRec
{
uchar attr;
long time;
long size;
! char name[MAXFILE+MAXEXT-1];
};
#endif // Uses_TSearchRec
--- 47,62 ----
#if defined( Uses_TSearchRec ) && !defined( __TSearchRec )
#define __TSearchRec
! //#if !defined( __DIR_H )
! //#include <Dir.h>
! //#endif // __DIR_H
struct TSearchRec
{
uchar attr;
long time;
long size;
! char name[OS_MAXFILE+OS_MAXEXT-1];
};
#endif // Uses_TSearchRec
***************
*** 386,394 ****
// WildCard by using SetData or store
// the dialog on a stream.
! #if !defined( __DIR_H )
! #include <Dir.h>
! #endif // __DIR_H
class _FAR TEvent;
class _FAR TFileInputLine;
--- 386,394 ----
// WildCard by using SetData or store
// the dialog on a stream.
! //#if !defined( __DIR_H )
! //#include <Dir.h>
! //#endif // __DIR_H
class _FAR TEvent;
class _FAR TFileInputLine;
***************
*** 412,418 ****
TFileInputLine *fileName;
TFileList *fileList;
! char wildCard[MAXPATH];
const char *directory;
private:
--- 412,418 ----
TFileInputLine *fileName;
TFileList *fileList;
! char wildCard[OS_MAXPATH];
const char *directory;
private:
***************
*** 573,581 ****
#if defined( Uses_TDirListBox ) && !defined( __TDirListBox )
#define __TDirListBox
! #if !defined( __DIR_H )
! #include <Dir.h>
! #endif // __DIR_H
class _FAR TRect;
class _FAR TScrollBar;
--- 573,581 ----
#if defined( Uses_TDirListBox ) && !defined( __TDirListBox )
#define __TDirListBox
! //#if !defined( __DIR_H )
! //#include <Dir.h>
! //#endif // __DIR_H
class _FAR TRect;
class _FAR TScrollBar;
***************
*** 604,610 ****
void showDrives( TDirCollection * );
void showDirs( TDirCollection * );
! char dir[MAXPATH];
ushort cur;
static const char * _NEAR pathDir;
--- 604,610 ----
void showDrives( TDirCollection * );
void showDirs( TDirCollection * );
! char dir[OS_MAXPATH];
ushort cur;
static const char * _NEAR pathDir;
diff --context ..\tvo/Syserr.cpp ./SYSERR.CPP
*** ../tvo/Syserr.cpp Fri Jun 17 01:00:00 1994
--- ./SYSERR.CPP Tue Apr 25 22:08:50 1995
***************
*** 90,104 ****
}
#if defined( __FLAT__ ) // 16-bit version is in SYSINT.ASM
! void TSystemError::resume()
! {
! THardwareInfo::setCtrlBrkHandler( TRUE );
! }
!
! void TSystemError::suspend()
! {
! THardwareInfo::setCtrlBrkHandler( FALSE );
! }
#endif
#if !defined( __FLAT__ )
--- 90,117 ----
}
#if defined( __FLAT__ ) // 16-bit version is in SYSINT.ASM
! # if defined(__NT__)
! void TSystemError::resume()
! {
! THardwareInfo::setCtrlBrkHandler( TRUE );
! }
!
! void TSystemError::suspend()
! {
! THardwareInfo::setCtrlBrkHandler( FALSE );
! }
!
! # elif defined(__OS2__)
! void TSystemError::resume()
! {
! // THardwareInfo::setCtrlBrkHandler( TRUE );
! }
!
! void TSystemError::suspend()
! {
! // THardwareInfo::setCtrlBrkHandler( FALSE );
! }
! # endif
#endif
#if !defined( __FLAT__ )
***************
*** 174,178 ****
--- 187,236 ----
TSystemError::inIDE = True;
oldHandler();
}
+
+
+ #ifdef __OS2__
+ /****************************************************************************/
+ /* */
+ /* CODING: TSystemError functions for OS/2 (from sysint.asm)... */
+ /* */
+ /****************************************************************************/
+ /*
+ * swapStatusLine() swaps the last line on the screen with the contents of the
+ * draw buffer passed.
+ */
+ void TSystemError::swapStatusLine( TDrawBuffer far &b )
+ {
+ ushort tmp[maxViewWidth+2];
+ ushort cb;
+
+ cb = TScreen::screenWidth * 2; // Size of line, in bytes,
+ // n = cb;
+ VioReadCellStr((PSZ)tmp, &cb, TScreen::screenHeight-1, 0, 0);
+ VioWrtCellStr((PSZ)b.data, cb, TScreen::screenHeight-1, 0, 0);
+ memcpy(b.data, tmp, cb); // Copy original contents to buffer,
+ }
+
+
+ /*
+ * resume() initializes the exception handling system so that it accepts
+ * traps (original CTRL-BRK and Critical Error).
+ */
+ void TSystemError::resume()
+ {
+ }
+
+
+ /*
+ * suspend() reestablishes normal exception handling.
+ */
+ void TSystemError::suspend()
+ {
+ }
+
+ #endif
+
+
+
#endif
diff --context ..\tvo/System.h ./SYSTEM.H
*** ../tvo/System.h Fri Jun 17 01:00:00 1994
--- ./SYSTEM.H Tue Apr 25 22:08:56 1995
***************
*** 50,60 ****
const meMouseMoved = 0x01;
const meDoubleClick = 0x02;
#else
! #if !defined( __WINDOWS_H )
! #include <windows.h>
#endif
- const meMouseMoved = MOUSE_MOVED; // NT values from WINDOWS.H
- const meDoubleClick = DOUBLE_CLICK;
#endif
#endif // __EVENT_CODES
--- 50,68 ----
const meMouseMoved = 0x01;
const meDoubleClick = 0x02;
#else
! # if defined(__OS2__)
! const meMouseMoved = 0x01; // NT values from WINDOWS.H
! const meDoubleClick = 0x02;
! # elif defined(__NT__)
! # if !defined( __WINDOWS_H )
! # include <windows.h>
! const meMouseMoved = MOUSE_MOVED; // NT values from WINDOWS.H
! const meDoubleClick = DOUBLE_CLICK;
! # else
! # error "Unsupported operating system"
! # endif
!
#endif
#endif
#endif // __EVENT_CODES
diff --context ..\tvo/Tchdrdlg.cpp ./TCHDRDLG.CPP
*** ../tvo/Tchdrdlg.cpp Fri Jun 17 01:00:00 1994
--- ./TCHDRDLG.CPP Tue Apr 25 22:08:50 1995
***************
*** 31,42 ****
#if !defined( __CTYPE_H )
#include <Ctype.h>
! #endif // __CTYPE_H
#if !defined( __STRING_H )
#include <String.h>
#endif // __STRING_H
TChDirDialog::TChDirDialog( ushort opts, ushort histId ) :
TDialog( TRect( 16, 2, 64, 20 ), changeDirTitle ),
TWindowInit( &TChDirDialog::initFrame )
--- 31,46 ----
#if !defined( __CTYPE_H )
#include <Ctype.h>
! #endif // __CTYPE_H
#if !defined( __STRING_H )
#include <String.h>
#endif // __STRING_H
+ #if !defined( __DIRECT_H )
+ # include <direct.h>
+ #endif
+
TChDirDialog::TChDirDialog( ushort opts, ushort histId ) :
TDialog( TRect( 16, 2, 64, 20 ), changeDirTitle ),
TWindowInit( &TChDirDialog::initFrame )
***************
*** 91,97 ****
{
case evCommand:
{
! char curDir[MAXPATH];
switch( event.message.command )
{
case cmRevert:
--- 95,101 ----
{
case evCommand:
{
! char curDir[OS_MAXPATH];
switch( event.message.command )
{
case cmRevert:
***************
*** 137,143 ****
{
if( dirList != 0 )
{
! char curDir[MAXPATH];
getCurDir( curDir );
dirList->newDirectory( curDir );
if( dirInput != 0 )
--- 141,147 ----
{
if( dirList != 0 )
{
! char curDir[OS_MAXPATH];
getCurDir( curDir );
dirList->newDirectory( curDir );
if( dirInput != 0 )
***************
*** 163,169 ****
if( command != cmOK )
return True;
! char path[MAXPATH];
strcpy( path, dirInput->data );
fexpand( path );
--- 167,173 ----
if( command != cmOK )
return True;
! char path[OS_MAXPATH];
strcpy( path, dirInput->data );
fexpand( path );
diff --context ..\tvo/Tcluster.cpp ./TCLUSTER.CPP
*** ../tvo/Tcluster.cpp Fri Jun 17 01:00:00 1994
--- ./TCLUSTER.CPP Tue Apr 25 22:08:50 1995
***************
*** 71,134 ****
ushort TCluster::dataSize()
{
! // value is now a long, but for compatibility with earlier TV,
! // return size of short; TMultiCheckBoxes returns sizeof(long).
return sizeof(short);
}
void TCluster::drawBox( const char *icon, char marker)
{
! char s[3];
! s[0]=' '; s[1]=marker; s[2]=0;
! drawMultiBox(icon, s);
}
void TCluster::drawMultiBox( const char *icon, const char* marker)
{
! TDrawBuffer b;
! ushort color;
! int i, j, cur;
!
! ushort cNorm = getColor( 0x0301 );
! ushort cSel = getColor( 0x0402 );
! ushort cDis = getColor( 0x0505 );
! for( i = 0; i <= size.y; i++ )
! {
! b.moveChar(0, ' ',(uchar)cNorm, size.x);
! for( j = 0; j <= (strings->getCount()-1)/size.y + 1; j++ )
! {
! cur = j * size.y + i;
! if( cur < strings->getCount() )
! {
! int col = column( cur );
!
! if ( ((col+strlen((const char*)strings->at(cur))+5) <
! (sizeof(b)/sizeof(ushort))) && (col < size.x))
! {
! if(!buttonState( cur ))
! color = cDis;
! else if( (cur == sel) && (state & sfSelected) != 0 )
! color = cSel;
! else
! color = cNorm;
! b.moveChar( col, ' ', color, size.x - col );
! b.moveCStr( col, icon, color );
!
! b.putChar(col+2, marker[multiMark(cur)]);
! b.moveCStr( col+5, (char *)(strings->at(cur)), color );
! if(showMarkers && ((state & sfSelected) != 0) && cur==sel)
! {
! b.putChar( col, specialChars[0] );
! b.putChar( column(cur+size.y)-1, specialChars[1] );
! }
!
! }
! }
! }
! writeBuf( 0, i, size.x, 1, b );
! }
! setCursor( column(sel)+2, row(sel) );
}
void TCluster::getData(void * rec)
--- 71,134 ----
ushort TCluster::dataSize()
{
! // value is now a long, but for compatibility with earlier TV,
! // return size of short; TMultiCheckBoxes returns sizeof(long).
return sizeof(short);
}
void TCluster::drawBox( const char *icon, char marker)
{
! char s[3];
! s[0]=' '; s[1]=marker; s[2]=0;
! drawMultiBox(icon, s);
}
void TCluster::drawMultiBox( const char *icon, const char* marker)
{
! TDrawBuffer b;
! ushort color;
! int i, j, cur;
!
! ushort cNorm = getColor( 0x0301 );
! ushort cSel = getColor( 0x0402 );
! ushort cDis = getColor( 0x0505 );
! for( i = 0; i <= size.y; i++ )
! {
! b.moveChar(0, ' ',(uchar)cNorm, size.x);
! for( j = 0; j <= (strings->getCount()-1)/size.y + 1; j++ )
! {
! cur = j * size.y + i;
! if( cur < strings->getCount() )
! {
! int col = column( cur );
!
! if ( ((col+strlen((const char*)strings->at(cur))+5) <
! (sizeof(b)/sizeof(ushort))) && (col < size.x))
! {
! if(!buttonState( cur ))
! color = cDis;
! else if( (cur == sel) && (state & sfSelected) != 0 )
! color = cSel;
! else
! color = cNorm;
! b.moveChar( col, ' ', color, size.x - col );
! b.moveCStr( col, icon, color );
!
! b.putChar(col+2, marker[multiMark(cur)]);
! b.moveCStr( col+5, (char *)(strings->at(cur)), color );
! if(showMarkers && ((state & sfSelected) != 0) && cur==sel)
! {
! b.putChar( col, specialChars[0] );
! b.putChar( column(cur+size.y)-1, specialChars[1] );
! }
!
! }
! }
! }
! writeBuf( 0, i, size.x, 1, b );
! }
! setCursor( column(sel)+2, row(sel) );
}
void TCluster::getData(void * rec)
***************
*** 155,163 ****
{
if (i <= strings->getCount())
{
! sel = s;
! movedTo(sel);
! drawView();
}
}
--- 155,163 ----
{
if (i <= strings->getCount())
{
! sel = s;
! movedTo(sel);
! drawView();
}
}
***************
*** 165,171 ****
{
TView::handleEvent(event);
if (!(options & ofSelectable))
! return;
if( event.what == evMouseDown )
{
TPoint mouse = makeLocal( event.mouse.where );
--- 165,171 ----
{
TView::handleEvent(event);
if (!(options & ofSelectable))
! return;
if( event.what == evMouseDown )
{
TPoint mouse = makeLocal( event.mouse.where );
***************
*** 191,259 ****
}
else if( event.what == evKeyDown )
{
! int s = sel;
switch (ctrlToArrow(event.keyDown.keyCode))
{
case kbUp:
if( (state & sfFocused) != 0 )
{
! int i = 0;
! do {
! i++; s--;
! if (s < 0)
! s = strings->getCount()-1;
! } while (!(buttonState(s) || (i > strings->getCount())));
! moveSel(i, s);
! clearEvent(event);
}
break;
case kbDown:
if( (state & sfFocused) != 0 )
{
! int i = 0;
! do {
! i++; s++;
! if (s >= strings->getCount())
! s = 0;
! } while (!(buttonState(s) || (i > strings->getCount())));
! moveSel(i, s);
! clearEvent(event);
}
break;
case kbRight:
if( (state & sfFocused) != 0 )
{
! int i = 0;
! do {
! i++; s += size.y;
! if (s >= strings->getCount() )
! s = 0;
! } while (!(buttonState(s) || (i > strings->getCount())));
clearEvent(event);
}
break;
case kbLeft:
if( (state & sfFocused) != 0 )
{
! int i = 0;
! do {
! i++;
! if ( s > 0 )
! {
! s -= size.y;
! if ( s < 0 )
! {
! s=((strings->getCount()+size.y-1)/
! size.y)*size.y + s - 1;
! if( s >= strings->getCount() )
! s = strings->getCount()-1;
! }
! }
! else
! s = strings->getCount()-1;
! } while (!(buttonState(s) || (i > strings->getCount())));
clearEvent(event);
}
--- 191,259 ----
}
else if( event.what == evKeyDown )
{
! int s = sel;
switch (ctrlToArrow(event.keyDown.keyCode))
{
case kbUp:
if( (state & sfFocused) != 0 )
{
! int i = 0;
! do {
! i++; s--;
! if (s < 0)
! s = strings->getCount()-1;
! } while (!(buttonState(s) || (i > strings->getCount())));
! moveSel(i, s);
! clearEvent(event);
}
break;
case kbDown:
if( (state & sfFocused) != 0 )
{
! int i = 0;
! do {
! i++; s++;
! if (s >= strings->getCount())
! s = 0;
! } while (!(buttonState(s) || (i > strings->getCount())));
! moveSel(i, s);
! clearEvent(event);
}
break;
case kbRight:
if( (state & sfFocused) != 0 )
{
! int i = 0;
! do {
! i++; s += size.y;
! if (s >= strings->getCount() )
! s = 0;
! } while (!(buttonState(s) || (i > strings->getCount())));
clearEvent(event);
}
break;
case kbLeft:
if( (state & sfFocused) != 0 )
{
! int i = 0;
! do {
! i++;
! if ( s > 0 )
! {
! s -= size.y;
! if ( s < 0 )
! {
! s=((strings->getCount()+size.y-1)/
! size.y)*size.y + s - 1;
! if( s >= strings->getCount() )
! s = strings->getCount()-1;
! }
! }
! else
! s = strings->getCount()-1;
! } while (!(buttonState(s) || (i > strings->getCount())));
clearEvent(event);
}
***************
*** 271,289 ****
)
)
{
! if (buttonState(i))
! {
! if ( focus())
! {
! sel = i;
! movedTo(sel);
! press(sel);
! drawView();
! }
! clearEvent(event);
! }
! return;
! }
}
if( event.keyDown.charScan.charCode == ' ' &&
(state & sfFocused) != 0
--- 271,289 ----
)
)
{
! if (buttonState(i))
! {
! if ( focus())
! {
! sel = i;
! movedTo(sel);
! press(sel);
! drawView();
! }
! clearEvent(event);
! }
! return;
! }
}
if( event.keyDown.charScan.charCode == ' ' &&
(state & sfFocused) != 0
***************
*** 300,319 ****
void TCluster::setButtonState(unsigned long aMask, Boolean enable)
{
! if (!enable)
! enableMask &= ~aMask;
! else
! enableMask |= aMask;
!
! int n = strings->getCount();
! if ( n < 32 )
! {
! unsigned long testMask = (1 << n) - 1;
! if ((enableMask & testMask) != 0)
! options |= ofSelectable;
! else
! options &= ~ofSelectable;
! }
}
--- 300,319 ----
void TCluster::setButtonState(unsigned long aMask, Boolean enable)
{
! if (!enable)
! enableMask &= ~aMask;
! else
! enableMask |= aMask;
!
! int n = strings->getCount();
! if ( n < 32 )
! {
! unsigned long testMask = (1 << n) - 1;
! if ((enableMask & testMask) != 0)
! options |= ofSelectable;
! else
! options &= ~ofSelectable;
! }
}
***************
*** 337,343 ****
uchar TCluster::multiMark( int item )
{
! return (uchar)(mark(item)==True);
}
void TCluster::movedTo( int )
--- 337,343 ----
uchar TCluster::multiMark( int item )
{
! return (uchar)(mark(item)==True);
}
void TCluster::movedTo( int )
***************
*** 400,448 ****
Boolean TCluster::buttonState(int item)
{
#if !defined(__FLAT__)
! ushort maskLo = enableMask & 0xffff;
! ushort maskHi = enableMask >> 16;
! asm {
XOR AL,AL
! MOV CX,item
CMP CX,31
JA __3
MOV AX,1
XOR DX,DX
! JCXZ __2
! }
__1:
! asm {
! SHL AX,1
RCL DX,1
! LOOP __1
! }
__2:
! asm {
AND AX,maskLo
AND DX,maskHi
! OR AX,DX
! JZ __3
! MOV AL,1
! }
__3:
! return Boolean(_AL);
#else
! if (item < 32)
! {
! unsigned long mask = 1;
!
! while (item--)
! mask <<= 1;
!
! if (enableMask & mask)
! return True;
! else
! return False;
! }
! else
! return False;
#endif
}
--- 400,448 ----
Boolean TCluster::buttonState(int item)
{
#if !defined(__FLAT__)
! ushort maskLo = enableMask & 0xffff;
! ushort maskHi = enableMask >> 16;
! asm {
XOR AL,AL
! MOV CX,item
CMP CX,31
JA __3
MOV AX,1
XOR DX,DX
! JCXZ __2
! }
__1:
! asm {
! SHL AX,1
RCL DX,1
! LOOP __1
! }
__2:
! asm {
AND AX,maskLo
AND DX,maskHi
! OR AX,DX
! JZ __3
! MOV AL,1
! }
__3:
! return Boolean(_AL);
#else
! if (item < 32)
! {
! unsigned long mask = 1;
!
! while (item--)
! mask <<= 1;
!
! if (enableMask & mask)
! return True;
! else
! return False;
! }
! else
! return False;
#endif
}
diff --context ..\tvo/Tcollect.cpp ./TCOLLECT.CPP
*** ../tvo/Tcollect.cpp Fri Jun 17 01:00:00 1994
--- ./TCOLLECT.CPP Tue Apr 25 22:08:50 1995
***************
*** 26,31 ****
--- 26,32 ----
#include <Mem.h>
#endif // __MEM_H
+ #include <assert.h>
TNSCollection::TNSCollection( ccIndex aLimit, ccIndex aDelta ) :
count( 0 ),
***************
*** 37,47 ****
setLimit( aLimit );
}
TNSCollection::TNSCollection() :
count( 0 ),
items( 0 ),
limit( 0 ),
! delta( 0 ),
shouldDelete( True )
{
}
--- 38,60 ----
setLimit( aLimit );
}
+ #if 0
+ TNSCollection::TNSCollection( short aLimit, short aDelta ) :
+ count( 0 ),
+ items( 0 ),
+ limit( 0 ),
+ delta( aDelta ),
+ shouldDelete( True )
+ {
+ setLimit( aLimit );
+ }
+ #endif
+
TNSCollection::TNSCollection() :
count( 0 ),
items( 0 ),
limit( 0 ),
! delta( 5 ), // JAL: Prevents TRAPS!
shouldDelete( True )
{
}
***************
*** 89,95 ****
--- 102,111 ----
if( index < 0 )
error(1,0);
if( count == limit )
+ {
+ assert(delta != 0);
setLimit(count + delta);
+ }
memmove( &items[index+1], &items[index], (count-index)*sizeof(void *) );
count++;
***************
*** 172,177 ****
--- 188,194 ----
return i;
error(1,0);
+ return 0;
}
#pragma warn .rvl
***************
*** 191,197 ****
{
if( *curSrc != 0 )
*curDst++ = *curSrc;
! *curSrc++;
}
}
--- 208,214 ----
{
if( *curSrc != 0 )
*curDst++ = *curSrc;
! curSrc++;
}
}
diff --context ..\tvo/Tdesktop.cpp ./TDESKTOP.CPP
*** ../tvo/Tdesktop.cpp Fri Jun 17 01:00:00 1994
--- ./TDESKTOP.CPP Tue Apr 25 22:08:50 1995
***************
*** 122,127 ****
--- 122,131 ----
return new TBackground( r, defaultBkgrnd );
}
+ #ifndef abs
+ #define abs(x) ((x) < 0 ? -(x) : (x))
+ #endif
+
short iSqr( short i )
{
short res1 = 2;
diff --context ..\tvo/Tdircoll.cpp ./TDIRCOLL.CPP
*** ../tvo/Tdircoll.cpp Fri Jun 17 01:00:00 1994
--- ./TDIRCOLL.CPP Tue Apr 25 22:08:50 1995
***************
*** 18,35 ****
#define Uses_ipstream
#include <tvision\tv.h>
! #if !defined( __DIR_H )
! #include <Dir.h>
! #endif // __DIR_H
#if !defined( __STRING_H )
#include <String.h>
#endif // __STRING_H
#if !defined( __DOS_H )
#include <Dos.h>
#endif // __DOS_H
#pragma warn -asc
Boolean driveValid( char drive )
--- 18,43 ----
#define Uses_ipstream
#include <tvision\tv.h>
! //#if !defined( __DIR_H )
! //#include <Dir.h>
! //#endif // __DIR_H
#if !defined( __STRING_H )
#include <String.h>
#endif // __STRING_H
+ #if !defined( __CTYPE_H )
+ #include <ctype.h>
+ #endif // __STRING_H
+
#if !defined( __DOS_H )
#include <Dos.h>
#endif // __DOS_H
+ #ifdef __BORLANDC__
+ #include <dir.h>
+ #endif
+
#pragma warn -asc
Boolean driveValid( char drive )
***************
*** 55,63 ****
--- 63,80 ----
I XCHG AX, CX // Put the return value into AX
return Boolean(_AX);
#else
+ # if defined(__NT__)
drive = (char) toupper( drive );
DWORD mask = 0x01 << (drive - 'A');
return (Boolean) (GetLogicalDrives() & mask);
+ # elif defined(__OS2__)
+ char tmp[OS_MAXPATH+1];
+
+ return Boolean( getcurdir(toupper(drive)-'A'+1, tmp) == 0 );
+ # else
+ # error "Non-supported OS"
+ # endif
+
#endif
}
***************
*** 72,78 ****
Boolean pathValid( const char *path )
{
! char expPath[MAXPATH];
strcpy( expPath, path );
fexpand( expPath );
int len = strlen(expPath);
--- 89,95 ----
Boolean pathValid( const char *path )
{
! char expPath[OS_MAXPATH];
strcpy( expPath, path );
fexpand( expPath );
int len = strlen(expPath);
***************
*** 89,98 ****
{
static const char * const illegalChars = ";,=+<>|\"[] \\";
! char path[MAXPATH];
! char dir[MAXDIR];
! char name[MAXFILE];
! char ext[MAXEXT];
fnsplit( fileName, path, dir, name, ext );
strcat( path, dir );
--- 106,115 ----
{
static const char * const illegalChars = ";,=+<>|\"[] \\";
! char path[OS_MAXPATH];
! char dir[OS_MAXDIR];
! char name[OS_MAXFILE];
! char ext[OS_MAXEXT];
fnsplit( fileName, path, dir, name, ext );
strcat( path, dir );
diff --context ..\tvo/Tdirlist.cpp ./TDIRLIST.CPP
*** ../tvo/Tdirlist.cpp Fri Jun 17 01:00:00 1994
--- ./TDIRLIST.CPP Tue Apr 25 22:08:50 1995
***************
*** 24,32 ****
#include <String.h>
#endif // __STRING_H
! #if !defined( __DIR_H )
#include <Dir.h>
! #endif // __DIR_H
#if !defined( __DOS_H )
#include <Dos.h>
--- 24,32 ----
#include <String.h>
#endif // __STRING_H
! #ifdef __BORLANDC__
#include <Dir.h>
! #endif
#if !defined( __DOS_H )
#include <Dos.h>
***************
*** 123,131 ****
const indentSize = 2;
int indent = indentSize;
! char buf[MAXPATH+MAXFILE+MAXEXT];
memset( buf, ' ', sizeof( buf ) );
! char *name = buf + sizeof(buf) - (MAXFILE+MAXEXT);
char *org = name - strlen(pathDir);
strcpy( org, pathDir );
--- 123,131 ----
const indentSize = 2;
int indent = indentSize;
! char buf[OS_MAXPATH+OS_MAXFILE+OS_MAXEXT];
memset( buf, ' ', sizeof( buf ) );
! char *name = buf + sizeof(buf) - (OS_MAXFILE+OS_MAXEXT);
char *org = name - strlen(pathDir);
strcpy( org, pathDir );
***************
*** 153,159 ****
cur = dirs->getCount() - 1;
end = strrchr( dir, '\\' );
! char path[MAXPATH];
strncpy( path, dir, size_t(end-dir+1) );
end = path + unsigned(end-dir)+1;
strcpy( end, "*.*" );
--- 153,159 ----
cur = dirs->getCount() - 1;
end = strrchr( dir, '\\' );
! char path[OS_MAXPATH];
strncpy( path, dir, size_t(end-dir+1) );
end = path + unsigned(end-dir)+1;
strcpy( end, "*.*" );
diff --context ..\tvo/Teditor2.cpp ./TEDITOR2.CPP
*** ../tvo/Teditor2.cpp Fri Jun 17 01:00:00 1994
--- ./TEDITOR2.CPP Tue Apr 25 22:08:50 1995
***************
*** 35,46 ****
--- 35,52 ----
#include <Dos.h>
#endif // __DOS_H
+ #if 0
+ /*
+ * This is stupid, again.
+ */
extern "C" {
int countLines( void *buf, uint count );
ushort scan( const void *block, ushort size, const char *str );
ushort iScan( const void *block, ushort size, const char *str );
};
+ #endif
+
inline int isWordChar( int ch )
{
return isalnum(ch) || ch == '_';
***************
*** 93,99 ****
if( newSize > 0xFFE0l || setBufSize(ushort(newSize)) == False )
{
editorDialog( edOutOfMemory );
! selEnd = selStart;
return False;
}
--- 99,105 ----
if( newSize > 0xFFE0l || setBufSize(ushort(newSize)) == False )
{
editorDialog( edOutOfMemory );
! selEnd = selStart;
return False;
}
diff --context ..\tvo/Tevent.cpp ./TEVENT.CPP
*** ../tvo/Tevent.cpp Fri Jun 17 01:00:00 1994
--- ./TEVENT.CPP Tue Apr 25 22:08:52 1995
***************
*** 285,287 ****
--- 285,288 ----
return;
#endif
}
+
diff --context ..\tvo/Textview.cpp ./TEXTVIEW.CPP
*** ../tvo/Textview.cpp Fri Jun 17 01:00:00 1994
--- ./TEXTVIEW.CPP Tue Apr 25 22:08:52 1995
***************
*** 11,16 ****
--- 11,18 ----
* All Rights Reserved.
*
*/
+ #if !defined(_NO_TEXTVIEW_)
+
#define Uses_TTextDevice
#define Uses_TTerminal
***************
*** 195,197 ****
--- 197,202 ----
{
ios::init( tt );
}
+
+
+ #endif // _NO_TEXTVIEW_
diff --context ..\tvo/Textview.h ./TEXTVIEW.H
*** ../tvo/Textview.h Fri Jun 17 01:00:00 1994
--- ./TEXTVIEW.H Tue Apr 25 22:08:56 1995
***************
*** 12,17 ****
--- 12,19 ----
* All Rights Reserved.
*
*/
+ #if !defined(_NO_TEXTVIEW_)
+
#pragma option -Vo-
#if defined( __BCOPT__ ) && !defined (__FLAT__)
***************
*** 30,35 ****
--- 32,38 ----
class _FAR TRect;
class _FAR TScrollBar;
+
class TTextDevice : public TScroller, public streambuf
{
***************
*** 40,46 ****
TScrollBar *aVScrollBar
);
! virtual int do_sputn( const char *s, int count ) = 0;
virtual int overflow( int = EOF );
};
--- 43,49 ----
TScrollBar *aVScrollBar
);
! virtual int do_sputn( const char _FAR *s, int count ) = 0;
virtual int overflow( int = EOF );
};
***************
*** 50,58 ****
--- 53,66 ----
#if defined( Uses_TTerminal ) && !defined( __TTerminal )
#define __TTerminal
+ #ifndef __os2asm_h
+ # include <tvision/os2asm.h>
+ #endif
+
class _FAR TRect;
class _FAR TScrollBar;
+
class TTerminal: public TTextDevice
{
***************
*** 85,90 ****
--- 93,105 ----
void bufDec(ushort& val);
};
+ #ifdef __FLAT__
+ inline ushort TTerminal::prevLines(ushort pos, ushort ct)
+ { return asmPrevLines(this, pos, ct);
+ }
+ #endif
+
+
#endif // Uses_TTerminal
#if defined( Uses_otstream ) && !defined( __otstream )
***************
*** 113,115 ****
--- 128,132 ----
#if defined( __BCOPT__ ) && !defined (__FLAT__)
#pragma option -po.
#endif
+
+ #endif // _NO_TEXTVIEW_
diff --context ..\tvo/Tfildlg.cpp ./TFILDLG.CPP
*** ../tvo/Tfildlg.cpp Fri Jun 17 01:00:00 1994
--- ./TFILDLG.CPP Tue Apr 25 22:08:52 1995
***************
*** 27,35 ****
#define Uses_ipstream
#include <tvision\tv.h>
! #if !defined( __DIR_H )
#include <Dir.h>
! #endif // __DIR_H
#if !defined( __ERRNO_H )
#include <Errno.h>
--- 27,35 ----
#define Uses_ipstream
#include <tvision\tv.h>
! #ifdef __BORLANDC__
#include <Dir.h>
! #endif
#if !defined( __ERRNO_H )
#include <Errno.h>
***************
*** 185,197 ****
void TFileDialog::getFileName( char *s )
{
! char buf[2*MAXPATH];
! char drive[MAXDRIVE];
! char path[MAXDIR];
! char name[MAXFILE];
! char ext[MAXEXT];
! char TName[MAXFILE];
! char TExt[MAXEXT];
trim( buf, fileName->data );
if( relativePath( buf ) == True )
--- 185,197 ----
void TFileDialog::getFileName( char *s )
{
! char buf[2*OS_MAXPATH];
! char drive[OS_MAXDRIVE];
! char path[OS_MAXDIR];
! char name[OS_MAXFILE];
! char ext[OS_MAXEXT];
! char TName[OS_MAXFILE];
! char TExt[OS_MAXEXT];
trim( buf, fileName->data );
if( relativePath( buf ) == True )
***************
*** 250,256 ****
void TFileDialog::readDirectory()
{
! char curDir[MAXPATH];
getCurDir( curDir );
if( directory )
delete (char *)directory;
--- 250,256 ----
void TFileDialog::readDirectory()
{
! char curDir[OS_MAXPATH];
getCurDir( curDir );
if( directory )
delete (char *)directory;
***************
*** 287,297 ****
Boolean TFileDialog::valid(ushort command)
{
! char fName[MAXPATH];
! char drive[MAXDRIVE];
! char dir[MAXDIR];
! char name[MAXFILE];
! char ext[MAXEXT];
if( command == 0 )
return True;
--- 287,297 ----
Boolean TFileDialog::valid(ushort command)
{
! char fName[OS_MAXPATH];
! char drive[OS_MAXDRIVE];
! char dir[OS_MAXDIR];
! char name[OS_MAXFILE];
! char ext[OS_MAXEXT];
if( command == 0 )
return True;
***************
*** 305,311 ****
if( isWild( fName ) )
{
fnsplit( fName, drive, dir, name, ext );
! char path[MAXPATH];
strcpy( path, drive );
strcat( path, dir );
if( checkDirectory( path ) )
--- 305,311 ----
if( isWild( fName ) )
{
fnsplit( fName, drive, dir, name, ext );
! char path[OS_MAXPATH];
strcpy( path, drive );
strcat( path, dir );
if( checkDirectory( path ) )
diff --context ..\tvo/Tfiledtr.cpp ./TFILEDTR.CPP
*** ../tvo/Tfiledtr.cpp Fri Jun 17 01:00:00 1994
--- ./TFILEDTR.CPP Tue Apr 25 22:08:52 1995
***************
*** 41,48 ****
#include <stdio.h>
#endif // __STDIO_H
! #if !defined( __STDLIB_H )
! #include <alloc.h>
#endif
inline ushort min( ushort u1, ushort u2 )
--- 41,52 ----
#include <stdio.h>
#endif // __STDIO_H
! #if !defined( __MALLOC_H )
! #include <malloc.h>
! #endif
!
! #ifdef __BORLANDC__
! # include <dir.h>
#endif
inline ushort min( ushort u1, ushort u2 )
***************
*** 179,193 ****
Boolean TFileEditor::saveFile()
{
! char drive[MAXDRIVE];
! char dir[MAXDIR];
! char file[MAXFILE];
! char ext[MAXEXT];
if( (editorFlags & efBackupFiles) != 0 )
{
fnsplit( fileName, drive, dir, file, ext );
! char backupName[MAXPATH];
fnmerge( backupName, drive, dir, file, backupExt );
unlink( backupName );
rename( fileName, backupName );
--- 183,197 ----
Boolean TFileEditor::saveFile()
{
! char drive[OS_MAXDRIVE];
! char dir[OS_MAXDIR];
! char file[OS_MAXFILE];
! char ext[OS_MAXEXT];
if( (editorFlags & efBackupFiles) != 0 )
{
fnsplit( fileName, drive, dir, file, ext );
! char backupName[OS_MAXPATH];
fnmerge( backupName, drive, dir, file, backupExt );
unlink( backupName );
rename( fileName, backupName );
***************
*** 222,228 ****
Boolean TFileEditor::setBufSize( ushort newSize )
{
if( newSize == 0)
! newSize = 0x1000;
else if( newSize > 0xF000 )
newSize = 0xFFE0;
else
--- 226,232 ----
Boolean TFileEditor::setBufSize( ushort newSize )
{
if( newSize == 0)
! newSize = 0x1000;
else if( newSize > 0xF000 )
newSize = 0xFFE0;
else
diff --context ..\tvo/Tfillist.cpp ./TFILLIST.CPP
*** ../tvo/Tfillist.cpp Fri Jun 17 01:00:00 1994
--- ./TFILLIST.CPP Tue Apr 25 22:08:52 1995
***************
*** 22,28 ****
#define Uses_TKeys
#include <tvision\tv.h>
! #if !defined( __DIR_H )
#include <Dir.h>
#endif // __DIR_H
--- 22,28 ----
#define Uses_TKeys
#include <tvision\tv.h>
! #ifdef __BORLANDC__
#include <Dir.h>
#endif // __DIR_H
***************
*** 55,64 ****
--- 55,70 ----
#endif // __STRING_H
void fexpand( char * );
+
+ #if 0
+ //** This is EXCEEDINGLY *S*T*U*P*I*D*!!!
+
#ifdef __FLAT__
extern "C" char _FAR * _CType _FARFUNC strupr(char _FAR *__s);
#endif
+ #endif
+
TFileList::TFileList( const TRect& bounds,
TScrollBar *aScrollBar) :
***************
*** 122,128 ****
void TFileList::readDirectory( const char *dir, const char *wildCard )
{
! char path[MAXPATH];
strcpy( path, dir );
strcat( path, wildCard );
readDirectory( path );
--- 128,134 ----
void TFileList::readDirectory( const char *dir, const char *wildCard )
{
! char path[OS_MAXPATH];
strcpy( path, dir );
strcat( path, wildCard );
readDirectory( path );
***************
*** 145,166 ****
void *DirSearchRec::operator new( size_t sz )
{
void *temp = ::operator new( sz );
if( TVMemMgr::safetyPoolExhausted() )
{
delete temp;
temp = 0;
}
return temp;
}
void TFileList::readDirectory( const char *aWildCard )
{
ffblk s;
! char path[MAXPATH];
! char drive[MAXDRIVE];
! char dir[MAXDIR];
! char file[MAXFILE];
! char ext[MAXEXT];
const unsigned findAttr = FA_RDONLY | FA_ARCH;
memset(&s, 0, sizeof(s));
strcpy( path, aWildCard );
--- 151,176 ----
void *DirSearchRec::operator new( size_t sz )
{
void *temp = ::operator new( sz );
+
+ #if !defined(_NO_MEMMGR_)
if( TVMemMgr::safetyPoolExhausted() )
{
delete temp;
temp = 0;
}
+ #endif
+
return temp;
}
void TFileList::readDirectory( const char *aWildCard )
{
ffblk s;
! char path[OS_MAXPATH];
! char drive[OS_MAXDRIVE];
! char dir[OS_MAXDIR];
! char file[OS_MAXFILE];
! char ext[OS_MAXEXT];
const unsigned findAttr = FA_RDONLY | FA_ARCH;
memset(&s, 0, sizeof(s));
strcpy( path, aWildCard );
***************
*** 274,284 ****
void fexpand( char *rpath )
{
! char path[MAXPATH];
! char drive[MAXDRIVE];
! char dir[MAXDIR];
! char file[MAXFILE];
! char ext[MAXEXT];
int flags = fnsplit( rpath, drive, dir, file, ext );
if( (flags & DRIVE) == 0 )
--- 284,294 ----
void fexpand( char *rpath )
{
! char path[OS_MAXPATH];
! char drive[OS_MAXDRIVE];
! char dir[OS_MAXDIR];
! char file[OS_MAXFILE];
! char ext[OS_MAXEXT];
int flags = fnsplit( rpath, drive, dir, file, ext );
if( (flags & DRIVE) == 0 )
***************
*** 290,296 ****
drive[0] = toupper(drive[0]);
if( (flags & DIRECTORY) == 0 || (dir[0] != '\\' && dir[0] != '/') )
{
! char curdir[MAXDIR];
getcurdir( drive[0] - 'A' + 1, curdir );
strcat( curdir, dir );
if( *curdir != '\\' && *curdir != '/' )
--- 300,306 ----
drive[0] = toupper(drive[0]);
if( (flags & DIRECTORY) == 0 || (dir[0] != '\\' && dir[0] != '/') )
{
! char curdir[OS_MAXDIR];
getcurdir( drive[0] - 'A' + 1, curdir );
strcat( curdir, dir );
if( *curdir != '\\' && *curdir != '/' )
diff --context ..\tvo/Tgroup.cpp ./TGROUP.CPP
*** ../tvo/Tgroup.cpp Fri Jun 17 01:00:00 1994
--- ./TGROUP.CPP Tue Apr 25 22:08:52 1995
***************
*** 20,25 ****
--- 20,26 ----
#define Uses_ipstream
#define Uses_TVMemMgr
#include <tvision\tv.h>
+ #include <stdlib.h>
TView *TheTopView = 0;
TGroup* ownerGroup = 0;
***************
*** 279,285 ****
--- 280,290 ----
{
if( (options & ofBuffered) != 0 && buffer != 0 )
{
+ #if defined(_NO_MEMMGR_)
+ free(buffer);
+ #else
TVMemMgr::freeDiscardable( buffer );
+ #endif
buffer = 0;
}
}
***************
*** 288,294 ****
{
if( (state & sfExposed) != 0 )
if( (options & ofBuffered) != 0 && (buffer == 0 ))
! TVMemMgr::allocateDiscardable( (void *)buffer, size.x * size.y * sizeof(ushort) );
}
void TGroup::getData(void *rec)
--- 293,303 ----
{
if( (state & sfExposed) != 0 )
if( (options & ofBuffered) != 0 && (buffer == 0 ))
! #if defined(_NO_MEMMGR_)
! buffer = (ushort *) malloc(size.x * size.y * sizeof(ushort));
! #else
! TVMemMgr::allocateDiscardable( (void *&)buffer, size.x * size.y * sizeof(ushort) );
! #endif
}
void TGroup::getData(void *rec)
***************
*** 574,579 ****
--- 583,630 ----
h = TView::getHelpCtx();
return h;
}
+
+
+ #ifdef __OS2__
+
+ /*
+ * removeView() removes the view spec'd from the circular LL in the group. The
+ * last ptr points to the last element inserted; because it's circular the
+ * 1st element is the next one!!
+ * $$NI$$: This sbr contains two situations where an assert is needed.
+ */
+ void TGroup::removeView(TView *p)
+ {
+ TView *curr;
+
+ if(last == NULL) return; // No members in GROUP list (bad call??)
+
+ /**** Search the LL till we meet (p) in the next ptr of a member. ****/
+ curr= last;
+ while(curr->next != p) // Loop till current node PTS to node to delete,
+ {
+ curr = curr->next; // Move to next item in list.
+ if(curr == last) // LAST node encountered AGAIN??
+ return; // Exit-> Not in list!! (Bad Call)
+ }
+
+ /*
+ * Remove from list. If this is the only node in the list we set last to
+ * NULL. This IS the only node if the previous node (curr) is the same as
+ * the node to delete (p).
+ */
+ if(p == curr)
+ last = NULL; // Delete-> no more nodes now!!
+ else
+ {
+ curr->next = p->next; // Remove p from chain,
+ if(last == p) last = curr; // If this WAS the last the new last is BEFORE it.
+ }
+ }
+
+ #endif
+
+
#if !defined(NO_STREAMABLE)
diff --context ..\tvo/Thistory.cpp ./THISTORY.CPP
*** ../tvo/Thistory.cpp Fri Jun 17 01:00:00 1994
--- ./THISTORY.CPP Tue Apr 25 22:08:52 1995
***************
*** 82,92 ****
)
{
if (!link->focus())
! {
! clearEvent(event);
! return;
! }
! recordHistory(link->data);
r = link->getBounds();
r.a.x--;
r.b.x++;
--- 82,92 ----
)
{
if (!link->focus())
! {
! clearEvent(event);
! return;
! }
! recordHistory(link->data);
r = link->getBounds();
r.a.x--;
r.b.x++;
***************
*** 129,135 ****
void THistory::recordHistory(const char* s)
{
! historyAdd(historyId, s);
}
#if !defined(NO_STREAMABLE)
--- 129,135 ----
void THistory::recordHistory(const char* s)
{
! historyAdd(historyId, s);
}
#if !defined(NO_STREAMABLE)
diff --context ..\tvo/Thstview.cpp ./THSTVIEW.CPP
*** ../tvo/Thstview.cpp Fri Jun 17 01:00:00 1994
--- ./THSTVIEW.CPP Tue Apr 25 22:08:52 1995
***************
*** 53,64 ****
void THistoryViewer::getText( char *dest, short item, short maxChars )
{
! const char *str = historyStr( historyId, item );
! if( str != 0 )
! {
! strncpy( dest, str, maxChars );
! dest[maxChars] = '\0';
! }
else
*dest = EOS;
}
--- 53,64 ----
void THistoryViewer::getText( char *dest, short item, short maxChars )
{
! const char *str = historyStr( historyId, item );
! if( str != 0 )
! {
! strncpy( dest, str, maxChars );
! dest[maxChars] = '\0';
! }
else
*dest = EOS;
}
diff --context ..\tvo/Tindictr.cpp ./TINDICTR.CPP
*** ../tvo/Tindictr.cpp Fri Jun 17 01:00:00 1994
--- ./TINDICTR.CPP Tue Apr 25 22:08:52 1995
***************
*** 22,28 ****
#if !defined( __STRSTREA_H )
#include <strstrea.h>
! #endif // __STRSTREA_H
#define cpIndicator "\x02\x03"
--- 22,28 ----
#if !defined( __STRSTREA_H )
#include <strstrea.h>
! #endif // __STRSTREA_H
#define cpIndicator "\x02\x03"
diff --context ..\tvo/Tinputli.cpp ./TINPUTLI.CPP
*** ../tvo/Tinputli.cpp Fri Jun 17 01:00:00 1994
--- ./TINPUTLI.CPP Tue Apr 25 22:08:52 1995
***************
*** 438,444 ****
oldData = new char[maxLen + 1];
is.readString(data, maxLen+1);
state |= sfCursorVis;
! is >> (void*)validator;
options |= ofSelectable | ofFirstClick;
return this;
}
--- 438,444 ----
oldData = new char[maxLen + 1];
is.readString(data, maxLen+1);
state |= sfCursorVis;
! is >> (void* &)validator;
options |= ofSelectable | ofFirstClick;
return this;
}
diff --context ..\tvo/Tkeys.h ./TKEYS.H
*** ../tvo/Tkeys.h Fri Jun 17 01:00:00 1994
--- ./TKEYS.H Tue Apr 25 22:08:56 1995
***************
*** 16,24 ****
#if !defined( __TKEYS_H )
#define __TKEYS_H
- #if defined( __FLAT__ ) && !defined( __WINDOWS_H )
- #include <windows.h>
- #endif
const ushort
--- 16,21 ----
***************
*** 97,103 ****
// there for source compatibility with the 32-bit version which does
// support this.
! #if !defined( __FLAT__ )
kbLeftShift = 0x0001,
kbRightShift = 0x0002,
kbShift = kbLeftShift | kbRightShift,
--- 94,100 ----
// there for source compatibility with the 32-bit version which does
// support this.
! # if !defined( __FLAT__ )
kbLeftShift = 0x0001,
kbRightShift = 0x0002,
kbShift = kbLeftShift | kbRightShift,
***************
*** 111,117 ****
kbNumState = 0x0020,
kbCapsState = 0x0040,
kbInsState = 0x0080;
! #else
kbLeftShift = SHIFT_PRESSED,
kbRightShift = SHIFT_PRESSED,
kbShift = kbLeftShift | kbRightShift,
--- 108,115 ----
kbNumState = 0x0020,
kbCapsState = 0x0040,
kbInsState = 0x0080;
!
! #elif defined(__NT__)
kbLeftShift = SHIFT_PRESSED,
kbRightShift = SHIFT_PRESSED,
kbShift = kbLeftShift | kbRightShift,
***************
*** 126,131 ****
kbCapsState = CAPSLOCK_ON,
kbEnhanced = ENHANCED_KEY,
kbInsState = 0x200; // Ensure this doesn't overlap above values
! #endif
#endif // __TKEYS_H
--- 124,147 ----
kbCapsState = CAPSLOCK_ON,
kbEnhanced = ENHANCED_KEY,
kbInsState = 0x200; // Ensure this doesn't overlap above values
!
! # elif defined(__OS2__)
! kbLeftShift = KBDSTF_LEFTSHIFT,
! kbRightShift = KBDSTF_RIGHTSHIFT,
! kbShift = kbLeftShift | kbRightShift,
! kbLeftCtrl = KBDSTF_LEFTCONTROL,
! kbRightCtrl = KBDSTF_RIGHTCONTROL,
! kbCtrlShift = kbLeftCtrl | kbRightCtrl,
! kbLeftAlt = KBDSTF_LEFTALT,
! kbRightAlt = KBDSTF_RIGHTALT,
! kbAltShift = kbLeftAlt | kbRightAlt,
! kbScrollState = KBDSTF_SCROLLLOCK_ON,
! kbNumState = KBDSTF_NUMLOCK_ON,
! kbCapsState = KBDSTF_CAPSLOCK_ON,
! kbInsState = KBDSTF_INSERT_ON;
!
! # else
! # error "Non-supported OS"
! # endif
#endif // __TKEYS_H
diff --context ..\tvo/Tlabel.cpp ./TLABEL.CPP
*** ../tvo/Tlabel.cpp Fri Jun 17 01:00:00 1994
--- ./TLABEL.CPP Tue Apr 25 22:08:52 1995
***************
*** 75,90 ****
void TLabel::focusLink(TEvent& event)
{
! if (link && (link->options & ofSelectable))
! link->focus();
! clearEvent(event);
}
void TLabel::handleEvent( TEvent& event )
{
TStaticText::handleEvent(event);
if( event.what == evMouseDown )
! focusLink(event);
else if( event.what == evKeyDown )
{
--- 75,90 ----
void TLabel::focusLink(TEvent& event)
{
! if (link && (link->options & ofSelectable))
! link->focus();
! clearEvent(event);
}
void TLabel::handleEvent( TEvent& event )
{
TStaticText::handleEvent(event);
if( event.what == evMouseDown )
! focusLink(event);
else if( event.what == evKeyDown )
{
***************
*** 93,99 ****
( c != 0 && owner->phase == TGroup::phPostProcess &&
toupper(event.keyDown.charScan.charCode) == c )
)
! focusLink(event);
}
else if( event.what == evBroadcast && link &&
( event.message.command == cmReceivedFocus ||
--- 93,99 ----
( c != 0 && owner->phase == TGroup::phPostProcess &&
toupper(event.keyDown.charScan.charCode) == c )
)
! focusLink(event);
}
else if( event.what == evBroadcast && link &&
( event.message.command == cmReceivedFocus ||
diff --context ..\tvo/Tlistbox.cpp ./TLISTBOX.CPP
*** ../tvo/Tlistbox.cpp Fri Jun 17 01:00:00 1994
--- ./TLISTBOX.CPP Tue Apr 25 22:08:52 1995
***************
*** 51,61 ****
void TListBox::getText( char *dest, short item, short maxChars )
{
! if (items != 0 )
! {
! strncpy( dest, (const char *)(items->at(item)), maxChars );
! dest[maxChars] = '\0';
! }
else
*dest = EOS;
}
--- 51,61 ----
void TListBox::getText( char *dest, short item, short maxChars )
{
! if (items != 0 )
! {
! strncpy( dest, (const char *)(items->at(item)), maxChars );
! dest[maxChars] = '\0';
! }
else
*dest = EOS;
}
diff --context ..\tvo/Tmouse.cpp ./TMOUSE.CPP
*** ../tvo/Tmouse.cpp Fri Jun 17 01:00:00 1994
--- ./TMOUSE.CPP Tue Apr 25 22:08:52 1995
***************
*** 27,32 ****
--- 27,36 ----
uchar _NEAR THWMouse::buttonCount = 0;
Boolean _NEAR THWMouse::handlerInstalled = False;
+ #ifdef __FLAT__
+ Boolean _NEAR THWMouse::noMouse;
+ #endif
+
THWMouse::THWMouse()
{
resume();
diff --context ..\tvo/Tobjstrm.cpp ./TOBJSTRM.CPP
*** ../tvo/Tobjstrm.cpp Fri Jun 17 01:00:00 1994
--- ./TOBJSTRM.CPP Tue Apr 25 22:08:52 1995
***************
*** 73,84 ****
--- 73,96 ----
#include <Assert.h>
#endif // __ASSERT_H
+ #if !defined( __IOSTREAM_H )
+ # include <iostream.h>
+ #endif
+
#ifdef __FLAT__
#define _HUGE
#else
#define _HUGE huge
#endif
+ #ifdef __BORLANDC__
+ # define IOS_HARDFAIL ios::hardfail
+ #else
+ # define IOS_HARDFAIL 0
+ #endif
+
+
+
const uchar nullStringLen = UCHAR_MAX;
TStreamableClass::TStreamableClass( const char *n, BUILDER b, int d ) :
***************
*** 221,232 ****
int pstream::fail() const
{
! return state & (ios::failbit | ios::badbit | ios::hardfail);
}
int pstream::bad() const
{
! return state & (ios::badbit | ios::hardfail);
}
int pstream::good() const
--- 233,244 ----
int pstream::fail() const
{
! return state & (ios::failbit | ios::badbit | IOS_HARDFAIL);
}
int pstream::bad() const
{
! return state & (ios::badbit | IOS_HARDFAIL);
}
int pstream::good() const
***************
*** 236,242 ****
void pstream::clear( int i )
{
! state = (i & 0xFF) | (state & ios::hardfail);
}
void pstream::registerType( TStreamableClass *ts )
--- 248,254 ----
void pstream::clear( int i )
{
! state = (i & 0xFF) | (state & IOS_HARDFAIL);
}
void pstream::registerType( TStreamableClass *ts )
***************
*** 307,313 ****
return *this;
}
! ipstream& ipstream::seekg( streamoff off, seek_dir dir )
{
objs.removeAll();
bp->seekoff( off, dir );
--- 319,325 ----
return *this;
}
! ipstream& ipstream::seekg( streamoff off, ios::seek_dir dir )
{
objs.removeAll();
bp->seekoff( off, dir );
***************
*** 543,549 ****
return *this;
}
! opstream& opstream::seekp( streamoff pos, seek_dir dir )
{
objs->removeAll();
bp->seekoff( pos, dir );
--- 555,561 ----
return *this;
}
! opstream& opstream::seekp( streamoff pos, ios::seek_dir dir )
{
objs->removeAll();
bp->seekoff( pos, dir );
diff --context ..\tvo/Tobjstrm.h ./TOBJSTRM.H
*** ../tvo/Tobjstrm.h Fri Jun 17 01:00:00 1994
--- ./TOBJSTRM.H Tue Apr 25 22:08:56 1995
***************
*** 34,39 ****
--- 34,43 ----
#define _FAR
#endif
+ #ifndef _TV_CDECL
+ # define _TV_CDECL
+ #endif
+
#pragma option -Vo-
#if defined( __BCOPT__ ) && !defined (__FLAT__)
#pragma option -po-
***************
*** 41,46 ****
--- 45,52 ----
#if !defined( __fLink_def )
#define __fLink_def
+ class TStreamableClass;
+
struct fLink
{
fLink _NEAR *f;
***************
*** 102,110 ****
class TStreamableClass
{
! friend TStreamableTypes;
! friend opstream;
! friend ipstream;
public:
--- 108,116 ----
class TStreamableClass
{
! friend class TStreamableTypes;
! friend class opstream;
! friend class ipstream;
public:
***************
*** 174,180 ****
class TPWrittenObjects : public TNSSortedCollection
{
! friend opstream;
public:
--- 180,186 ----
class TPWrittenObjects : public TNSSortedCollection
{
! friend class opstream;
public:
***************
*** 206,212 ****
class TPWObj
{
! friend TPWrittenObjects;
private:
--- 212,218 ----
class TPWObj
{
! friend class TPWrittenObjects;
private:
***************
*** 237,243 ****
class TPReadObjects : public TNSCollection
{
! friend ipstream;
public:
--- 243,249 ----
class TPReadObjects : public TNSCollection
{
! friend class ipstream;
public:
***************
*** 282,323 ****
class pstream
{
! friend TStreamableTypes;
public:
enum StreamableError { peNotRegistered, peInvalidType };
enum PointerTypes { ptNull, ptIndexed, ptObject };
! _Cdecl pstream( streambuf _FAR * );
! virtual _Cdecl ~pstream();
! int _Cdecl rdstate() const;
! int _Cdecl eof() const;
! int _Cdecl fail() const;
! int _Cdecl bad() const;
! int _Cdecl good() const;
! void _Cdecl clear( int = 0 );
! _Cdecl operator void *() const;
! int _Cdecl operator ! () const;
! streambuf _FAR * _Cdecl rdbuf() const;
static void initTypes();
! void _Cdecl error( StreamableError );
! void _Cdecl error( StreamableError, const TStreamable& );
static void registerType( TStreamableClass *ts );
protected:
! _Cdecl pstream();
streambuf _FAR *bp;
int state;
! void _Cdecl init( streambuf _FAR * );
! void _Cdecl setstate( int );
static TStreamableTypes * _NEAR types;
--- 288,329 ----
class pstream
{
! friend class TStreamableTypes;
public:
enum StreamableError { peNotRegistered, peInvalidType };
enum PointerTypes { ptNull, ptIndexed, ptObject };
! _TV_CDECL pstream( streambuf _FAR * );
! virtual _TV_CDECL ~pstream();
! int _TV_CDECL rdstate() const;
! int _TV_CDECL eof() const;
! int _TV_CDECL fail() const;
! int _TV_CDECL bad() const;
! int _TV_CDECL good() const;
! void _TV_CDECL clear( int = 0 );
! _TV_CDECL operator void *() const;
! int _TV_CDECL operator ! () const;
! streambuf _FAR * _TV_CDECL rdbuf() const;
static void initTypes();
! void _TV_CDECL error( StreamableError );
! void _TV_CDECL error( StreamableError, const TStreamable& );
static void registerType( TStreamableClass *ts );
protected:
! _TV_CDECL pstream();
streambuf _FAR *bp;
int state;
! void _TV_CDECL init( streambuf _FAR * );
! void _TV_CDECL setstate( int );
static TStreamableTypes * _NEAR types;
***************
*** 352,397 ****
public:
! _Cdecl ipstream( streambuf _FAR * );
! _Cdecl ~ipstream();
! streampos _Cdecl tellg();
! ipstream& _Cdecl seekg( streampos );
! ipstream& _Cdecl seekg( streamoff, ios::seek_dir );
!
! uchar _Cdecl readByte();
! void _Cdecl readBytes( void _FAR *, size_t );
! ushort _Cdecl readWord();
! char _FAR * _Cdecl readString();
! char _FAR * _Cdecl readString( char _FAR *, unsigned );
!
! friend ipstream& _Cdecl operator >> ( ipstream&, char& );
! friend ipstream& _Cdecl operator >> ( ipstream&, signed char& );
! friend ipstream& _Cdecl operator >> ( ipstream&, unsigned char& );
! friend ipstream& _Cdecl operator >> ( ipstream&, signed short& );
! friend ipstream& _Cdecl operator >> ( ipstream&, unsigned short& );
! friend ipstream& _Cdecl operator >> ( ipstream&, signed int& );
! friend ipstream& _Cdecl operator >> ( ipstream&, unsigned int& );
! friend ipstream& _Cdecl operator >> ( ipstream&, signed long& );
! friend ipstream& _Cdecl operator >> ( ipstream&, unsigned long& );
! friend ipstream& _Cdecl operator >> ( ipstream&, float& );
! friend ipstream& _Cdecl operator >> ( ipstream&, double& );
! friend ipstream& _Cdecl operator >> ( ipstream&, long double& );
! friend ipstream& _Cdecl operator >> ( ipstream&, TStreamable& );
! friend ipstream& _Cdecl operator >> ( ipstream&, void _FAR *& );
protected:
! _Cdecl ipstream();
! const TStreamableClass _FAR * _Cdecl readPrefix();
! void _FAR * _Cdecl readData( const TStreamableClass _FAR *,
TStreamable _FAR * );
! void _Cdecl readSuffix();
! const void _FAR * _Cdecl find( P_id_type );
! void _Cdecl registerObject( const void _FAR *adr );
private:
--- 358,403 ----
public:
! _TV_CDECL ipstream( streambuf _FAR * );
! _TV_CDECL ~ipstream();
! streampos _TV_CDECL tellg();
! ipstream& _TV_CDECL seekg( streampos );
! ipstream& _TV_CDECL seekg( streamoff, ios::seek_dir );
!
! uchar _TV_CDECL readByte();
! void _TV_CDECL readBytes( void _FAR *, size_t );
! ushort _TV_CDECL readWord();
! char _FAR * _TV_CDECL readString();
! char _FAR * _TV_CDECL readString( char _FAR *, unsigned );
!
! friend ipstream& _TV_CDECL operator >> ( ipstream&, char& );
! friend ipstream& _TV_CDECL operator >> ( ipstream&, signed char& );
! friend ipstream& _TV_CDECL operator >> ( ipstream&, unsigned char& );
! friend ipstream& _TV_CDECL operator >> ( ipstream&, signed short& );
! friend ipstream& _TV_CDECL operator >> ( ipstream&, unsigned short& );
! friend ipstream& _TV_CDECL operator >> ( ipstream&, signed int& );
! friend ipstream& _TV_CDECL operator >> ( ipstream&, unsigned int& );
! friend ipstream& _TV_CDECL operator >> ( ipstream&, signed long& );
! friend ipstream& _TV_CDECL operator >> ( ipstream&, unsigned long& );
! friend ipstream& _TV_CDECL operator >> ( ipstream&, float& );
! friend ipstream& _TV_CDECL operator >> ( ipstream&, double& );
! friend ipstream& _TV_CDECL operator >> ( ipstream&, long double& );
! friend ipstream& _TV_CDECL operator >> ( ipstream&, TStreamable& );
! friend ipstream& _TV_CDECL operator >> ( ipstream&, void _FAR *& );
protected:
! _TV_CDECL ipstream();
! const TStreamableClass _FAR * _TV_CDECL readPrefix();
! void _FAR * _TV_CDECL readData( const TStreamableClass _FAR *,
TStreamable _FAR * );
! void _TV_CDECL readSuffix();
! const void _FAR * _TV_CDECL find( P_id_type );
! void _TV_CDECL registerObject( const void _FAR *adr );
private:
***************
*** 429,473 ****
public:
! _Cdecl opstream( streambuf _FAR * );
! _Cdecl ~opstream();
! streampos _Cdecl tellp();
! opstream& _Cdecl seekp( streampos );
! opstream& _Cdecl seekp( streamoff, ios::seek_dir );
! opstream& _Cdecl flush();
!
! void _Cdecl writeByte( uchar );
! void _Cdecl writeBytes( const void _FAR *, size_t );
! void _Cdecl writeWord( ushort );
! void _Cdecl writeString( const char _FAR * );
!
! friend opstream& _Cdecl operator << ( opstream&, char );
! friend opstream& _Cdecl operator << ( opstream&, signed char );
! friend opstream& _Cdecl operator << ( opstream&, unsigned char );
! friend opstream& _Cdecl operator << ( opstream&, signed short );
! friend opstream& _Cdecl operator << ( opstream&, unsigned short );
! friend opstream& _Cdecl operator << ( opstream&, signed int );
! friend opstream& _Cdecl operator << ( opstream&, unsigned int );
! friend opstream& _Cdecl operator << ( opstream&, signed long );
! friend opstream& _Cdecl operator << ( opstream&, unsigned long );
! friend opstream& _Cdecl operator << ( opstream&, float );
! friend opstream& _Cdecl operator << ( opstream&, double );
! friend opstream& _Cdecl operator << ( opstream&, long double );
! friend opstream& _Cdecl operator << ( opstream&, TStreamable& );
! friend opstream& _Cdecl operator << ( opstream&, TStreamable _FAR * );
protected:
! _Cdecl opstream();
! void _Cdecl writePrefix( const TStreamable& );
! void _Cdecl writeData( TStreamable& );
! void _Cdecl writeSuffix( const TStreamable& );
! P_id_type _Cdecl find( const void _FAR *adr );
! void _Cdecl registerObject( const void _FAR *adr );
private:
--- 435,479 ----
public:
! _TV_CDECL opstream( streambuf _FAR * );
! _TV_CDECL ~opstream();
! streampos _TV_CDECL tellp();
! opstream& _TV_CDECL seekp( streampos );
! opstream& _TV_CDECL seekp( streamoff, ios::seek_dir );
! opstream& _TV_CDECL flush();
!
! void _TV_CDECL writeByte( uchar );
! void _TV_CDECL writeBytes( const void _FAR *, size_t );
! void _TV_CDECL writeWord( ushort );
! void _TV_CDECL writeString( const char _FAR * );
!
! friend opstream& _TV_CDECL operator << ( opstream&, char );
! friend opstream& _TV_CDECL operator << ( opstream&, signed char );
! friend opstream& _TV_CDECL operator << ( opstream&, unsigned char );
! friend opstream& _TV_CDECL operator << ( opstream&, signed short );
! friend opstream& _TV_CDECL operator << ( opstream&, unsigned short );
! friend opstream& _TV_CDECL operator << ( opstream&, signed int );
! friend opstream& _TV_CDECL operator << ( opstream&, unsigned int );
! friend opstream& _TV_CDECL operator << ( opstream&, signed long );
! friend opstream& _TV_CDECL operator << ( opstream&, unsigned long );
! friend opstream& _TV_CDECL operator << ( opstream&, float );
! friend opstream& _TV_CDECL operator << ( opstream&, double );
! friend opstream& _TV_CDECL operator << ( opstream&, long double );
! friend opstream& _TV_CDECL operator << ( opstream&, TStreamable& );
! friend opstream& _TV_CDECL operator << ( opstream&, TStreamable _FAR * );
protected:
! _TV_CDECL opstream();
! void _TV_CDECL writePrefix( const TStreamable& );
! void _TV_CDECL writeData( TStreamable& );
! void _TV_CDECL writeSuffix( const TStreamable& );
! P_id_type _TV_CDECL find( const void _FAR *adr );
! void _TV_CDECL registerObject( const void _FAR *adr );
private:
***************
*** 502,513 ****
public:
! _Cdecl iopstream( streambuf _FAR * );
! _Cdecl ~iopstream();
protected:
! _Cdecl iopstream();
};
--- 508,519 ----
public:
! _TV_CDECL iopstream( streambuf _FAR * );
! _TV_CDECL ~iopstream();
protected:
! _TV_CDECL iopstream();
};
***************
*** 538,554 ****
public:
! _Cdecl fpbase();
! _Cdecl fpbase( const char _FAR *, int, int = filebuf::openprot );
! _Cdecl fpbase( int );
! _Cdecl fpbase( int, char _FAR *, int );
! _Cdecl ~fpbase();
!
! void _Cdecl open( const char _FAR *, int, int = filebuf::openprot );
! void _Cdecl attach( int );
! void _Cdecl close();
! void _Cdecl setbuf( char _FAR *, int );
! filebuf _FAR * _Cdecl rdbuf();
private:
--- 544,560 ----
public:
! _TV_CDECL fpbase();
! _TV_CDECL fpbase( const char _FAR *, int, int = filebuf::openprot );
! _TV_CDECL fpbase( int );
! _TV_CDECL fpbase( int, char _FAR *, int );
! _TV_CDECL ~fpbase();
!
! void _TV_CDECL open( const char _FAR *, int, int = filebuf::openprot );
! void _TV_CDECL attach( int );
! void _TV_CDECL close();
! void _TV_CDECL setbuf( char _FAR *, int );
! filebuf _FAR * _TV_CDECL rdbuf();
private:
***************
*** 583,599 ****
public:
! _Cdecl ifpstream();
! _Cdecl ifpstream( const char _FAR *,
int = ios::in,
int = filebuf::openprot
);
! _Cdecl ifpstream( int );
! _Cdecl ifpstream( int, char _FAR *, int );
! _Cdecl ~ifpstream();
! filebuf _FAR * _Cdecl rdbuf();
! void _Cdecl open( const char _FAR *,
int = ios::in,
int = filebuf::openprot
);
--- 589,605 ----
public:
! _TV_CDECL ifpstream();
! _TV_CDECL ifpstream( const char _FAR *,
int = ios::in,
int = filebuf::openprot
);
! _TV_CDECL ifpstream( int );
! _TV_CDECL ifpstream( int, char _FAR *, int );
! _TV_CDECL ~ifpstream();
! filebuf _FAR * _TV_CDECL rdbuf();
! void _TV_CDECL open( const char _FAR *,
int = ios::in,
int = filebuf::openprot
);
***************
*** 628,644 ****
public:
! _Cdecl ofpstream();
! _Cdecl ofpstream( const char _FAR *,
int = ios::out,
int = filebuf::openprot
);
! _Cdecl ofpstream( int );
! _Cdecl ofpstream( int, char _FAR *, int );
! _Cdecl ~ofpstream();
! filebuf _FAR * _Cdecl rdbuf();
! void _Cdecl open( const char _FAR *,
int = ios::out,
int = filebuf::openprot
);
--- 634,650 ----
public:
! _TV_CDECL ofpstream();
! _TV_CDECL ofpstream( const char _FAR *,
int = ios::out,
int = filebuf::openprot
);
! _TV_CDECL ofpstream( int );
! _TV_CDECL ofpstream( int, char _FAR *, int );
! _TV_CDECL ~ofpstream();
! filebuf _FAR * _TV_CDECL rdbuf();
! void _TV_CDECL open( const char _FAR *,
int = ios::out,
int = filebuf::openprot
);
***************
*** 673,686 ****
public:
! _Cdecl fpstream();
! _Cdecl fpstream( const char _FAR *, int, int = filebuf::openprot );
! _Cdecl fpstream( int );
! _Cdecl fpstream( int, char _FAR *, int );
! _Cdecl ~fpstream();
! filebuf _FAR * _Cdecl rdbuf();
! void _Cdecl open( const char _FAR *, int, int = filebuf::openprot );
};
--- 679,692 ----
public:
! _TV_CDECL fpstream();
! _TV_CDECL fpstream( const char _FAR *, int, int = filebuf::openprot );
! _TV_CDECL fpstream( int );
! _TV_CDECL fpstream( int, char _FAR *, int );
! _TV_CDECL ~fpstream();
! filebuf _FAR * _TV_CDECL rdbuf();
! void _TV_CDECL open( const char _FAR *, int, int = filebuf::openprot );
};
diff --context ..\tvo/Tparamte.cpp ./TPARAMTE.CPP
*** ../tvo/Tparamte.cpp Fri Jun 17 01:00:00 1994
--- ./TPARAMTE.CPP Tue Apr 25 22:08:54 1995
***************
*** 52,67 ****
--- 52,98 ----
return (str != 0) ? strlen( str ) : 0;
}
+
+ #if 0
+ void TParamText::setText( char *fmt, ... )
+ {
+ va_list ap;
+
+ va_start( ap, fmt );
+ vsprintf( str, fmt, ap );
+ va_end( ap );
+
+ drawView();
+ }
+ #else
void TParamText::setText( char *fmt, ... )
{
va_list ap;
va_start( ap, fmt );
+ setArgText(fmt, ap);
+ va_end(ap);
+
+
+
vsprintf( str, fmt, ap );
va_end( ap );
drawView();
}
+
+
+ void TParamText::setArgText(char* fmt, va_list args)
+ {
+ vsprintf(str, fmt, args);
+ drawView();
+ }
+
+ #endif
+
+
+
+
#if !defined(NO_STREAMABLE)
diff --context ..\tvo/Tprogram.cpp ./TPROGRAM.CPP
*** ../tvo/Tprogram.cpp Fri Jun 17 01:00:00 1994
--- ./TPROGRAM.CPP Tue Apr 25 22:08:54 1995
***************
*** 59,65 ****
--- 59,69 ----
application = this;
initScreen();
state = sfVisible | sfSelected | sfFocused | sfModal | sfExposed;
+ #ifdef __OS2__
+ options = ofPhysical;
+ #else
options = 0;
+ #endif
buffer = TScreen::screenBuffer;
if( createDeskTop != 0 &&
***************
*** 313,317 ****
--- 317,322 ----
return p;
}
+ #pragma dump_object_model TProgram;
diff --context ..\tvo/Tresfile.cpp ./TRESFILE.CPP
*** ../tvo/Tresfile.cpp Fri Jun 17 01:00:00 1994
--- ./TRESFILE.CPP Tue Apr 25 22:08:54 1995
***************
*** 119,125 ****
void TResourceFile::remove( const char *key )
{
! int i;
if (index->search( (char *)key, i))
{
--- 119,126 ----
void TResourceFile::remove( const char *key )
{
! // int i;
! ccIndex i;
if (index->search( (char *)key, i))
{
***************
*** 148,154 ****
void *TResourceFile::get( const char *key)
{
! int i;
void *p;
if (! index->search((char *)key, i))
--- 149,155 ----
void *TResourceFile::get( const char *key)
{
! ccIndex i;
void *p;
if (! index->search((char *)key, i))
***************
*** 165,171 ****
void TResourceFile::put(TStreamable *item, const char *key)
{
! int i;
TResourceItem *p;
if (index->search( (char *)key, i))
--- 166,172 ----
void TResourceFile::put(TStreamable *item, const char *key)
{
! ccIndex i;
TResourceItem *p;
if (index->search( (char *)key, i))
***************
*** 187,218 ****
void copyStream( fpstream* dest, fpstream* src, long n)
{
! const xferSize=256;
! char *xferBuf = new char[xferSize];
! size_t thisMove;
! while (n > 0)
! {
! if (n > xferSize)
! thisMove = xferSize;
! else
! thisMove = (int)n;
!
! src->readBytes(xferBuf, thisMove);
! dest->writeBytes(xferBuf, thisMove);
! n -= thisMove;
! }
! delete xferBuf;
}
struct SwitchInfo
{
! fpstream* sourceStream;
! fpstream* destStream;
! long oldBasePos;
! long newBasePos;
};
void doCopyResource(void* item, void* arg)
--- 188,219 ----
void copyStream( fpstream* dest, fpstream* src, long n)
{
! const xferSize=256;
! char *xferBuf = new char[xferSize];
! size_t thisMove;
! while (n > 0)
! {
! if (n > xferSize)
! thisMove = xferSize;
! else
! thisMove = (int)n;
!
! src->readBytes(xferBuf, thisMove);
! dest->writeBytes(xferBuf, thisMove);
! n -= thisMove;
! }
! delete xferBuf;
}
struct SwitchInfo
{
! fpstream* sourceStream;
! fpstream* destStream;
! long oldBasePos;
! long newBasePos;
};
void doCopyResource(void* item, void* arg)
***************
*** 234,241 ****
if (pack)
{
! args.sourceStream = stream;
! args.destStream = aStream;
aStream->seekp( args.newBasePos + sizeof(long)*3);
index->forEach(doCopyResource, &args);
indexPos = aStream->tellp() - args.newBasePos;
--- 235,242 ----
if (pack)
{
! args.sourceStream = stream;
! args.destStream = aStream;
aStream->seekp( args.newBasePos + sizeof(long)*3);
index->forEach(doCopyResource, &args);
indexPos = aStream->tellp() - args.newBasePos;
***************
*** 243,249 ****
else
{
stream->seekg(basePos);
! copyStream(aStream, stream, indexPos);
}
modified = True;
--- 244,250 ----
else
{
stream->seekg(basePos);
! copyStream(aStream, stream, indexPos);
}
modified = True;
diff --context ..\tvo/Tscreen.cpp ./TSCREEN.CPP
*** ../tvo/Tscreen.cpp Fri Jun 17 01:00:00 1994
--- ./TSCREEN.CPP Tue Apr 25 22:08:54 1995
***************
*** 222,231 ****
startupMode = getCrtMode();
startupCursor = getCursorType();
! #if defined(__FLAT__)
screenBuffer = THardwareInfo::allocateScreenBuffer();
#endif
-
setCrtData();
}
--- 222,230 ----
startupMode = getCrtMode();
startupCursor = getCursorType();
! #if defined(__FLAT__) && defined(__NT__)
screenBuffer = THardwareInfo::allocateScreenBuffer();
#endif
setCrtData();
}
***************
*** 241,247 ****
TScreen::~TScreen()
{
suspend();
! #if defined( __FLAT__ )
THardwareInfo::freeScreenBuffer( screenBuffer );
#endif
}
--- 240,246 ----
TScreen::~TScreen()
{
suspend();
! #if defined( __FLAT__ ) && defined(__NT__)
THardwareInfo::freeScreenBuffer( screenBuffer );
#endif
}
***************
*** 268,277 ****
--- 267,283 ----
if( (mode & 0xFF) == smMono ) // Strip smFont8x8 if necessary.
return smMono;
+ uchar v = uchar(mode);
+ if(v != smCO80 && v != smBW80)
+ mode = (mode & 0xff00) | smCO80;
+ return mode;
+
+ #if 0 // JAL: Idiots!
_AX = mode;
if( _AL != smCO80 && _AL != smBW80 )
_AL = smCO80;
return _AX;
+ #endif
}
void TScreen::setCrtData()
diff --context ..\tvo/Tstrlist.cpp ./TSTRLIST.CPP
*** ../tvo/Tstrlist.cpp Fri Jun 17 01:00:00 1994
--- ./TSTRLIST.CPP Tue Apr 25 22:08:54 1995
***************
*** 49,55 ****
TStrListMaker::~TStrListMaker()
{
delete strings;
! delete [indexSize] index;
}
#pragma warn .dsz
--- 49,55 ----
TStrListMaker::~TStrListMaker()
{
delete strings;
! delete [] index;
}
#pragma warn .dsz
***************
*** 93,99 ****
TStringList::~TStringList()
{
! delete [indexSize] index;
}
#pragma warn .dsz
--- 93,99 ----
TStringList::~TStringList()
{
! delete [] index;
}
#pragma warn .dsz
diff --context ..\tvo/Ttprvlns.asm ./Ttprvlns.asm
*** ../tvo/Ttprvlns.asm Fri Jun 17 01:00:00 1994
--- ./Ttprvlns.asm Wed Apr 19 11:46:24 1995
***************
*** 1,156 ****
;/*------------------------------------------------------------*/
! ;/* filename - ttprvlns.asm */
! ;/* */
! ;/* function(s) */
! ;/* TTerminal prevLines member function */
;/*------------------------------------------------------------*/
;
! ; Turbo Vision - Version 2.0
! ;
! ; Copyright (c) 1994 by Borland International
! ; All Rights Reserved.
! ;
! PUBLIC @TTerminal@prevLines$qusus
! INCLUDE TV.INC
! CODESEG
! DecDI PROC
ifndef __FLAT__
! CMP DI,WORD PTR [SI+TTerminalBuffer]
! JA short @@1
! ADD DI,WORD PTR [SI+TTerminalBufSize]
! @@1: DEC DI
else
! CMP EDI,[ESI+TTerminalBuffer]
! JA short @@1
! ADD EDI,[ESI+TTerminalBufSize]
! @@1: DEC EDI
endif
! RET
ENDP
! IncDI PROC
ifndef __FLAT__
! INC DI
! MOV AX,WORD PTR [SI+TTerminalBuffer]
! ADD AX,[SI+TTerminalBufSize]
! CMP DI,AX
! JB short @@1
! MOV DI,WORD PTR [SI+TTerminalBuffer]
@@1:
! RET
else
! INC EDI
! MOV EAX,[ESI+TTerminalBuffer]
! ADD EAX,[ESI+TTerminalBufSize]
! CMP EDI,EAX
! JB short @@1
! MOV EDI,[ESI+TTerminalBuffer]
@@1:
! RET
endif
ENDP
@TTerminal@prevLines$qusus PROC
! ARG thisPtr :PTR, Pos : WORD, Lines : WORD
! LineSeparator EQU 10
ifndef __FLAT__
! USES DS,SI,DI
! LDS SI,[thisPtr]
! LES DI,[SI+TTerminalBuffer]
! ADD DI,[Pos]
! @@1: MOV CX,[Lines]
! JCXZ @@6
! MOV AX,[SI+TTerminalQueBack]
! ADD AX,WORD PTR [SI+TTerminalBuffer]
! CMP DI,AX
! JE @@7
! CALL DecDI
! @@2: MOV AX,[SI+TTerminalQueBack]
! ADD AX,WORD PTR [SI+TTerminalBuffer]
! CMP DI,AX
! JA @@3
! MOV CX,DI
! SUB CX,WORD PTR [SI+TTerminalBuffer]
! JMP @@4
! @@3: MOV CX,DI
! SUB CX,AX
! @@4: MOV AL,LineSeparator
! INC CX
! STD
! REPNE SCASB
! JE @@5
! MOV AX,DI
! SUB AX,WORD PTR [SI+TTerminalBuffer]
! INC AX
! CMP AX,[SI+TTerminalQueBack]
! JE @@8
! MOV DI,WORD PTR [SI+TTerminalBuffer]
! ADD DI,WORD PTR [SI+TTerminalBufSize]
! DEC DI
! JMP @@2
! @@5: DEC [Lines]
! JNZ @@2
! @@6: CALL IncDI
! CALL IncDI
! MOV AX,DI
! @@7: SUB AX,WORD PTR [SI+TTerminalBuffer]
@@8:
! CLD
! RET
else
! USES ESI,EDI
! MOV ESI, DWORD PTR [thisPtr]
! MOV EDI,[ESI+TTerminalBuffer]
! ADD DI,[Pos]
! @@1: XOR ECX,ECX
! MOV CX,[Lines]
! JECXZ short @@6
! MOV EAX,[ESI+TTerminalQueBack]
! ADD EAX,[ESI+TTerminalBuffer]
! CMP EDI,EAX
! JE short @@7
! CALL DecDI
! @@2: MOV EAX,[ESI+TTerminalQueBack]
! ADD EAX,[ESI+TTerminalBuffer]
! CMP EDI,EAX
! JA short @@3
! MOV ECX,EDI
! SUB ECX,[ESI+TTerminalBuffer]
! JMP short @@4
! @@3: MOV ECX,EDI
! SUB ECX,EAX
! @@4: MOV AL,LineSeparator
! INC ECX
! STD
! REPNE SCASB
! JE short @@5
! MOV EAX,EDI
! SUB EAX,[ESI+TTerminalBuffer]
! INC EAX
! CMP EAX,[ESI+TTerminalQueBack]
! JE @@8
! MOV EDI,[ESI+TTerminalBuffer]
! ADD EDI,[ESI+TTerminalBufSize]
! DEC EDI
! JMP @@2
! @@5: DEC [Lines]
! JNZ @@2
! @@6: CALL IncDI
! CALL IncDI
! MOV EAX,EDI
! @@7: SUB EAX,[ESI+TTerminalBuffer]
@@8:
! CLD
! RET
endif
! ENDP
! END
--- 1,164 ----
;/*------------------------------------------------------------*/
! ;/* filename - ttprvlns.asm */
! ;/* */
! ;/* function(s) */
! ;/* TTerminal prevLines member function */
;/*------------------------------------------------------------*/
;
! ; Turbo Vision - Version 2.0
! ;
! ; Copyright (c) 1994 by Borland International
! ; All Rights Reserved.
! ;
! IFNDEF __FLAT__
! PUBLIC @TTerminal@prevLines$qusus
! ELSE
! PUBLIC _asmPrevLines
! ENDIF
! INCLUDE TV.INC
! CODESEG
! DecDI PROC
ifndef __FLAT__
! CMP DI,WORD PTR [SI+TTerminalBuffer]
! JA short @@1
! ADD DI,WORD PTR [SI+TTerminalBufSize]
! @@1: DEC DI
else
! CMP EDI,[ESI+TTerminalBuffer]
! JA short @@1
! ADD EDI,[ESI+TTerminalBufSize]
! @@1: DEC EDI
endif
! RET
ENDP
! IncDI PROC
ifndef __FLAT__
! INC DI
! MOV AX,WORD PTR [SI+TTerminalBuffer]
! ADD AX,[SI+TTerminalBufSize]
! CMP DI,AX
! JB short @@1
! MOV DI,WORD PTR [SI+TTerminalBuffer]
@@1:
! RET
else
! INC EDI
! MOV EAX,[ESI+TTerminalBuffer]
! ADD EAX,[ESI+TTerminalBufSize]
! CMP EDI,EAX
! JB short @@1
! MOV EDI,[ESI+TTerminalBuffer]
@@1:
! RET
endif
ENDP
+ IFDEF __FLAT__
+ _asmPrevLines PROC
+ ELSE
@TTerminal@prevLines$qusus PROC
! ENDIF
! ARG thisPtr :PTR, Pos : WORD, Lines : WORD
! LineSeparator EQU 10
ifndef __FLAT__
! USES DS,SI,DI
! LDS SI,[thisPtr]
! LES DI,[SI+TTerminalBuffer]
! ADD DI,[Pos]
! @@1: MOV CX,[Lines]
! JCXZ @@6
! MOV AX,[SI+TTerminalQueBack]
! ADD AX,WORD PTR [SI+TTerminalBuffer]
! CMP DI,AX
! JE @@7
! CALL DecDI
! @@2: MOV AX,[SI+TTerminalQueBack]
! ADD AX,WORD PTR [SI+TTerminalBuffer]
! CMP DI,AX
! JA @@3
! MOV CX,DI
! SUB CX,WORD PTR [SI+TTerminalBuffer]
! JMP @@4
! @@3: MOV CX,DI
! SUB CX,AX
! @@4: MOV AL,LineSeparator
! INC CX
! STD
! REPNE SCASB
! JE @@5
! MOV AX,DI
! SUB AX,WORD PTR [SI+TTerminalBuffer]
! INC AX
! CMP AX,[SI+TTerminalQueBack]
! JE @@8
! MOV DI,WORD PTR [SI+TTerminalBuffer]
! ADD DI,WORD PTR [SI+TTerminalBufSize]
! DEC DI
! JMP @@2
! @@5: DEC [Lines]
! JNZ @@2
! @@6: CALL IncDI
! CALL IncDI
! MOV AX,DI
! @@7: SUB AX,WORD PTR [SI+TTerminalBuffer]
@@8:
! CLD
! RET
else
! USES ESI,EDI
! MOV ESI, DWORD PTR [thisPtr]
! MOV EDI,[ESI+TTerminalBuffer]
! ADD DI,[Pos]
! @@1: XOR ECX,ECX
! MOV CX,[Lines]
! JECXZ short @@6
! MOV EAX,[ESI+TTerminalQueBack]
! ADD EAX,[ESI+TTerminalBuffer]
! CMP EDI,EAX
! JE short @@7
! CALL DecDI
! @@2: MOV EAX,[ESI+TTerminalQueBack]
! ADD EAX,[ESI+TTerminalBuffer]
! CMP EDI,EAX
! JA short @@3
! MOV ECX,EDI
! SUB ECX,[ESI+TTerminalBuffer]
! JMP short @@4
! @@3: MOV ECX,EDI
! SUB ECX,EAX
! @@4: MOV AL,LineSeparator
! INC ECX
! STD
! REPNE SCASB
! JE short @@5
! MOV EAX,EDI
! SUB EAX,[ESI+TTerminalBuffer]
! INC EAX
! CMP EAX,[ESI+TTerminalQueBack]
! JE @@8
! MOV EDI,[ESI+TTerminalBuffer]
! ADD EDI,[ESI+TTerminalBufSize]
! DEC EDI
! JMP @@2
! @@5: DEC [Lines]
! JNZ @@2
! @@6: CALL IncDI
! CALL IncDI
! MOV EAX,EDI
! @@7: SUB EAX,[ESI+TTerminalBuffer]
@@8:
! CLD
! RET
endif
! ENDP
! END
diff --context ..\tvo/Ttypes.h ./TTYPES.H
*** ../tvo/Ttypes.h Fri Jun 17 01:00:00 1994
--- ./TTYPES.H Tue Apr 25 22:08:56 1995
***************
*** 20,35 ****
#define _NEAR near
#endif
! #include <_defs.h>
#define I asm
! enum Boolean { False, True };
- typedef unsigned short ushort;
- typedef unsigned char uchar;
- typedef unsigned int uint;
- typedef unsigned long ulong;
const char EOS = '\0';
--- 20,44 ----
#define _NEAR near
#endif
! #include <tvision/_defs.h>
#define I asm
! #ifndef __boolean_defined
! # define __boolean_defined
! enum Boolean { False, True };
! #endif
!
! #ifndef __ltypes_defined
! # define __ltypes_defined
! typedef unsigned short ushort;
! typedef unsigned short uword;
! typedef unsigned char uchar;
! typedef unsigned char ubyte;
! typedef unsigned int uint;
! typedef unsigned long ulong;
! #endif
const char EOS = '\0';
***************
*** 40,46 ****
--- 49,61 ----
class _FAR TStreamable;
class _FAR TStreamableTypes;
+
+ #ifdef __ORIGINAL__
typedef int ccIndex;
+ #else
+ typedef short ccIndex;
+ #endif
+
typedef Boolean (*ccTestFunc)( void *, void * );
typedef void (*ccAppFunc)( void *, void * );
diff --context ..\tvo/Tv.h ./TV.H
*** ../tvo/Tv.h Fri Jun 17 01:00:00 1994
--- ./TV.H Tue Apr 25 22:08:56 1995
***************
*** 32,37 ****
--- 32,50 ----
#endif
#endif
+
+ //** Compiler portability..
+ #ifdef __OS2__
+ # if ! defined(__cpl_compiler_h)
+ # include <cpl/compiler.h>
+ # endif
+
+ # if ! defined(__cpl_osdefs_h)
+ # include <cpl/osdefs.h>
+ # endif
+ #endif
+
+
#if defined( _RTLDLL )
#error TV must use the RTL in static form only
#endif
***************
*** 611,616 ****
--- 624,633 ----
#if defined( __INC_HARDWARE_H )
#include <tvision\hardware.h>
+ #endif
+
+ #if defined( __INC_OSDEF_H ) || defined(__INC_TKEYS_H)
+ # include <tvision/tvosdef.h>
#endif
#if defined( __INC_TKEYS_H )
diff --context ..\tvo/Tvexposd.asm ./Tvexposd.asm
*** ../tvo/Tvexposd.asm Fri Jun 17 01:00:00 1994
--- ./Tvexposd.asm Wed Apr 19 11:46:24 1995
***************
*** 1,268 ****
;/*------------------------------------------------------------*/
! ;/* filename - tvexposd.asm */
! ;/* */
! ;/* function(s) */
! ;/* TView exposed member function */
;/*------------------------------------------------------------*/
;
! ; Turbo Vision - Version 2.0
! ;
! ; Copyright (c) 1994 by Borland International
! ; All Rights Reserved.
! ;
! PUBLIC @TView@exposed$qv
! INCLUDE TV.INC
ifndef __FLAT__
Fptr STRUC
! offs DW ?
! segm DW ?
Fptr ENDS
else
Fptr STRUC
! offs DD ?
Fptr ENDS
endif
CODESEG
! @TView@exposed$qv PROC
! ARG thisPtr : DWORD
! LOCAL Target : Fptr
! ifndef __FLAT__
! USES SI,DI
!
! XOR AX,AX
! LES DI, [thisPtr]
! TEST WORD PTR ES:[DI+TViewState],sfExposed
! JE @@2
! CMP AX,ES:[DI+TViewSizeX]
! JGE @@2
! CMP AX,ES:[DI+TViewSizeY]
! JGE @@2
@@1:
! XOR BX,BX
! MOV CX,ES:[DI+TViewSizeX]
! PUSH AX
! CALL @@11
! POP AX
! JNC @@3
! LES DI,[thisPtr]
! INC AX
! CMP AX,ES:[DI+TViewSizeY]
! JL @@1
@@2:
! MOV AL,0
! JMP @@30
@@3:
! MOV AL,1
! JMP @@30
@@8:
! STC
@@9:
! RETN
@@10:
! LES DI,DWORD PTR ES:[DI+TViewOwner]
! CMP WORD PTR ES:[DI+TGroupBuffer+2],0
! JNE @@9
! @@11: MOV [Target.offs],DI
! MOV [Target.segm],ES
! ADD AX,ES:[DI+TViewOriginY]
! MOV SI,ES:[DI+TViewOriginX]
! ADD BX,SI
! ADD CX,SI
! LES DI,ES:[DI+TViewOwner]
! MOV SI,ES
! OR SI,DI
! JE @@9
! CMP AX,ES:[DI+TGroupClipAY]
! JL @@8
! CMP AX,ES:[DI+TGroupClipBY]
! JGE @@8
! CMP BX,ES:[DI+TGroupClipAX]
! JGE @@12
! MOV BX,ES:[DI+TGroupClipAX]
@@12:
! CMP CX,ES:[DI+TGroupClipBX]
! JLE @@13
! MOV CX,ES:[DI+TGroupClipBX]
@@13:
! CMP BX,CX
! JGE @@8
! LES DI,ES:[DI+TGroupLast]
@@20:
! LES DI,ES:[DI+TViewNext]
! CMP DI,[Target.offs]
! JNE @@21
! MOV SI,ES
! CMP SI,[Target.segm]
! JE @@10
@@21:
! TEST WORD PTR ES:[DI+TViewState],sfVisible
! JE @@20
! MOV SI,ES:[DI+TViewOriginY]
! CMP AX,SI
! JL @@20
! ADD SI,ES:[DI+TViewSizeY]
! CMP AX,SI
! JGE @@20
! MOV SI,ES:[DI+TViewOriginX]
! CMP BX,SI
! JL @@22
! ADD SI,ES:[DI+TViewSizeX]
! CMP BX,SI
! JGE @@20
! MOV BX,SI
! CMP BX,CX
! JL @@20
! STC
! RETN
@@22:
! CMP CX,SI
! JLE @@20
! ADD SI,ES:[DI+TViewSizeX]
! CMP CX,SI
! JG @@23
! MOV CX,ES:[DI+TViewOriginX]
! JMP @@20
@@23:
! PUSH [Target.segm]
! PUSH [Target.offs]
! PUSH ES
! PUSH DI
! PUSH SI
! PUSH CX
! PUSH AX
! MOV CX,ES:[DI+TViewOriginX]
! CALL @@20
! POP AX
! POP CX
! POP BX
! POP DI
! POP ES
! POP [Target.offs]
! POP [Target.segm]
! JC @@20
! RETN
@@30:
! RET
! else ;;;;;;;;;;;;;;;;;;;;;;;;; 32-bit version ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
! USES ESI, EDI, EBX
! MOV EDI, DWORD PTR [thisPtr]
! TEST WORD PTR [EDI+TViewState], sfExposed
! JZ @@2
! XOR EAX, EAX
! CMP AX, [EDI+TViewSizeX]
! JGE @@2
! CMP AX, [EDI+TViewSizeY]
! JGE @@2
@@1:
! XOR EBX, EBX
! MOV CX, [EDI+TViewSizeX]
! PUSH EAX
! CALL @@11
! POP EAX
! JNC @@3
! MOV EDI, [thisPtr]
! INC EAX
! CMP AX, [EDI+TViewSizeY]
! JL @@1
@@2:
! XOR EAX, EAX
! JMP @@30
@@3:
! MOV EAX, 1
! JMP @@30
@@8:
! STC
@@9:
! LocalRet
@@10:
! MOV EDI,DWORD PTR [EDI+TViewOwner]
! CMP DWORD PTR [EDI+TGroupBuffer], 0
! JNE @@9
! CMP WORD PTR [EDI+TGroupBuffer+4], 0
! JNE @@9
! @@11:
! MOV [Target.offs], EDI
! ADD AX, [EDI+TViewOriginY]
! MOV SI, [EDI+TViewOriginX]
! ADD BX, SI
! ADD CX, SI
! MOV EDI, [EDI+TViewOwner]
! OR EDI, EDI
! JZ @@9
! CMP AX, [EDI+TGroupClipAY]
! JL @@8
! CMP AX, [EDI+TGroupClipBY]
! JGE @@8
! CMP BX, [EDI+TGroupClipAX]
! JGE @@12
! MOV BX, [EDI+TGroupClipAX]
@@12:
! CMP CX, [EDI+TGroupClipBX]
! JLE @@13
! MOV CX, [EDI+TGroupClipBX]
@@13:
! CMP BX, CX
! JGE @@8
! MOV EDI, [EDI+TGroupLast]
@@20:
! MOV EDI, [EDI+TViewNext]
! CMP EDI, [Target.offs]
! JE @@10
@@21:
! TEST WORD PTR [EDI+TViewState], sfVisible
! JE @@20
! MOV SI, [EDI+TViewOriginY]
! CMP AX, SI
! JL @@20
! ADD SI, [EDI+TViewSizeY]
! CMP AX, SI
! JGE @@20
! MOV SI, [EDI+TViewOriginX]
! CMP BX, SI
! JL @@22
! ADD SI, [EDI+TViewSizeX]
! CMP BX, SI
! JGE @@20
! MOV BX, SI
! CMP BX, CX
! JL @@20
! STC
! LocalRet
@@22:
! CMP CX, SI
! JLE @@20
! ADD SI, [EDI+TViewSizeX]
! CMP CX, SI
! JG @@23
! MOV CX, [EDI+TViewOriginX]
! JMP @@20
@@23:
! PUSH [Target.offs]
! PUSH EDI
! PUSH ESI
! PUSH ECX
! PUSH EAX
! MOV CX,[EDI+TViewOriginX]
! CALL @@20
! POP EAX
! POP ECX
! POP EBX
! POP EDI
! POP [Target.offs]
! JC @@20
! LocalRet
@@30:
! RET
! endif
ENDP
END
--- 1,280 ----
;/*------------------------------------------------------------*/
! ;/* filename - tvexposd.asm */
! ;/* */
! ;/* function(s) */
! ;/* TView exposed member function */
;/*------------------------------------------------------------*/
;
! ; Turbo Vision - Version 2.0
! ;
! ; Copyright (c) 1994 by Borland International
! ; All Rights Reserved.
! ;
! IFDEF __FLAT__
! public _asmExposed
! ELSE
! PUBLIC @TView@exposed$qv
! ENDIF
!
! INCLUDE TV.INC
ifndef __FLAT__
Fptr STRUC
! offs DW ?
! segm DW ?
Fptr ENDS
else
Fptr STRUC
! offs DD ?
Fptr ENDS
endif
CODESEG
! IFDEF __FLAT__
! _asmExposed PROC
! ARG thisPtr : DWORD
! LOCAL Target : Fptr
! USES ESI, EDI, EBX
! MOV EDI, DWORD PTR [thisPtr]
! TEST WORD PTR [EDI+TViewState], sfExposed
! JZ @@2
! XOR EAX, EAX
! CMP AX, [EDI+TViewSizeX]
! JGE @@2
! CMP AX, [EDI+TViewSizeY]
! JGE @@2
@@1:
! XOR EBX, EBX
! MOV CX, [EDI+TViewSizeX]
! PUSH EAX
! CALL @@11
! POP EAX
! JNC @@3
! MOV EDI, [thisPtr]
! INC EAX
! CMP AX, [EDI+TViewSizeY]
! JL @@1
@@2:
! XOR EAX, EAX
! JMP @@30
@@3:
! MOV EAX, 1
! JMP @@30
@@8:
! STC
@@9:
! LocalRet
@@10:
! MOV EDI,DWORD PTR [EDI+TViewOwner]
! CMP DWORD PTR [EDI+TGroupBuffer], 0
! JNE @@9
! CMP WORD PTR [EDI+TGroupBuffer+4], 0
! JNE @@9
! @@11:
! MOV [Target.offs], EDI
! ADD AX, [EDI+TViewOriginY]
! MOV SI, [EDI+TViewOriginX]
! ADD BX, SI
! ADD CX, SI
! MOV EDI, [EDI+TViewOwner]
! OR EDI, EDI
! JZ @@9
! CMP AX, [EDI+TGroupClipAY]
! JL @@8
! CMP AX, [EDI+TGroupClipBY]
! JGE @@8
! CMP BX, [EDI+TGroupClipAX]
! JGE @@12
! MOV BX, [EDI+TGroupClipAX]
@@12:
! CMP CX, [EDI+TGroupClipBX]
! JLE @@13
! MOV CX, [EDI+TGroupClipBX]
@@13:
! CMP BX, CX
! JGE @@8
! MOV EDI, [EDI+TGroupLast]
@@20:
! MOV EDI, [EDI+TViewNext]
! CMP EDI, [Target.offs]
! JE @@10
@@21:
! TEST WORD PTR [EDI+TViewState], sfVisible
! JE @@20
! MOV SI, [EDI+TViewOriginY]
! CMP AX, SI
! JL @@20
! ADD SI, [EDI+TViewSizeY]
! CMP AX, SI
! JGE @@20
! MOV SI, [EDI+TViewOriginX]
! CMP BX, SI
! JL @@22
! ADD SI, [EDI+TViewSizeX]
! CMP BX, SI
! JGE @@20
! MOV BX, SI
! CMP BX, CX
! JL @@20
! STC
! LocalRet
@@22:
! CMP CX, SI
! JLE @@20
! ADD SI, [EDI+TViewSizeX]
! CMP CX, SI
! JG @@23
! MOV CX, [EDI+TViewOriginX]
! JMP @@20
@@23:
! PUSH [Target.offs]
! PUSH EDI
! PUSH ESI
! PUSH ECX
! PUSH EAX
! MOV CX,[EDI+TViewOriginX]
! CALL @@20
! POP EAX
! POP ECX
! POP EBX
! POP EDI
! POP [Target.offs]
! JC @@20
! LocalRet
@@30:
! RET
! _asmExposed ENDP
! ELSE
! @TView@exposed$qv PROC
! ARG thisPtr : DWORD
! LOCAL Target : Fptr
!
! USES SI,DI
!
! XOR AX,AX
! LES DI, [thisPtr]
! TEST WORD PTR ES:[DI+TViewState],sfExposed
! JE @@2
! CMP AX,ES:[DI+TViewSizeX]
! JGE @@2
! CMP AX,ES:[DI+TViewSizeY]
! JGE @@2
@@1:
! XOR BX,BX
! MOV CX,ES:[DI+TViewSizeX]
! PUSH AX
! CALL @@11
! POP AX
! JNC @@3
! LES DI,[thisPtr]
! INC AX
! CMP AX,ES:[DI+TViewSizeY]
! JL @@1
@@2:
! MOV AL,0
! JMP @@30
@@3:
! MOV AL,1
! JMP @@30
@@8:
! STC
@@9:
! RETN
@@10:
! LES DI,DWORD PTR ES:[DI+TViewOwner]
! CMP WORD PTR ES:[DI+TGroupBuffer+2],0
! JNE @@9
! @@11: MOV [Target.offs],DI
! MOV [Target.segm],ES
! ADD AX,ES:[DI+TViewOriginY]
! MOV SI,ES:[DI+TViewOriginX]
! ADD BX,SI
! ADD CX,SI
! LES DI,ES:[DI+TViewOwner]
! MOV SI,ES
! OR SI,DI
! JE @@9
! CMP AX,ES:[DI+TGroupClipAY]
! JL @@8
! CMP AX,ES:[DI+TGroupClipBY]
! JGE @@8
! CMP BX,ES:[DI+TGroupClipAX]
! JGE @@12
! MOV BX,ES:[DI+TGroupClipAX]
@@12:
! CMP CX,ES:[DI+TGroupClipBX]
! JLE @@13
! MOV CX,ES:[DI+TGroupClipBX]
@@13:
! CMP BX,CX
! JGE @@8
! LES DI,ES:[DI+TGroupLast]
@@20:
! LES DI,ES:[DI+TViewNext]
! CMP DI,[Target.offs]
! JNE @@21
! MOV SI,ES
! CMP SI,[Target.segm]
! JE @@10
@@21:
! TEST WORD PTR ES:[DI+TViewState],sfVisible
! JE @@20
! MOV SI,ES:[DI+TViewOriginY]
! CMP AX,SI
! JL @@20
! ADD SI,ES:[DI+TViewSizeY]
! CMP AX,SI
! JGE @@20
! MOV SI,ES:[DI+TViewOriginX]
! CMP BX,SI
! JL @@22
! ADD SI,ES:[DI+TViewSizeX]
! CMP BX,SI
! JGE @@20
! MOV BX,SI
! CMP BX,CX
! JL @@20
! STC
! RETN
@@22:
! CMP CX,SI
! JLE @@20
! ADD SI,ES:[DI+TViewSizeX]
! CMP CX,SI
! JG @@23
! MOV CX,ES:[DI+TViewOriginX]
! JMP @@20
@@23:
! PUSH [Target.segm]
! PUSH [Target.offs]
! PUSH ES
! PUSH DI
! PUSH SI
! PUSH CX
! PUSH AX
! MOV CX,ES:[DI+TViewOriginX]
! CALL @@20
! POP AX
! POP CX
! POP BX
! POP DI
! POP ES
! POP [Target.offs]
! POP [Target.segm]
! JC @@20
! RETN
@@30:
! RET
!
ENDP
+
+ ENDIF
END
diff --context ..\tvo/Tview.cpp ./TVIEW.CPP
*** ../tvo/Tview.cpp Fri Jun 17 01:00:00 1994
--- ./TVIEW.CPP Tue Apr 25 22:08:54 1995
***************
*** 639,645 ****
void TView::select()
{
if( ! (options & ofSelectable))
! return;
if( (options & ofTopSelect) != 0 )
makeFirst();
else if( owner != 0 )
--- 639,645 ----
void TView::select()
{
if( ! (options & ofSelectable))
! return;
if( (options & ofTopSelect) != 0 )
makeFirst();
else if( owner != 0 )
***************
*** 654,663 ****
void TView::setCmdState(TCommandSet& commands, Boolean enable)
{
! if (enable)
! enableCommands(commands);
! else
! disableCommands(commands);
}
void TView::setCommands( TCommandSet& commands )
--- 654,663 ----
void TView::setCmdState(TCommandSet& commands, Boolean enable)
{
! if (enable)
! enableCommands(commands);
! else
! disableCommands(commands);
}
void TView::setCommands( TCommandSet& commands )
diff --context ..\tvo/Tvobjs.h ./TVOBJS.H
*** ../tvo/Tvobjs.h Fri Jun 17 01:00:00 1994
--- ./TVOBJS.H Tue Apr 25 22:08:56 1995
***************
*** 62,67 ****
--- 62,68 ----
public:
TNSCollection( ccIndex aLimit, ccIndex aDelta );
+ TNSCollection( short aLimit, short aDelta );
~TNSCollection();
virtual void shutDown();
Only in .: TVOS2.CPP
Only in .: TVOSDEF.H
diff --context ..\tvo/Tvtext1.cpp ./TVTEXT1.CPP
*** ../tvo/Tvtext1.cpp Fri Jun 17 01:00:00 1994
--- ./TVTEXT1.CPP Tue Apr 25 22:08:54 1995
***************
*** 32,44 ****
static unsigned getCodePage()
{
#if !defined(__FLAT__)
// get version number, in the form of a normal number
unsigned ver = (_version >> 8) | (_version << 8);
if( ver < 0x30C )
return 437; // United States code page, for all versions before 3.3
! #if defined( __FLAT__ )
Regs r; r.rDS.w.wl = r.rES.w.wl = -1;
#endif
--- 32,45 ----
static unsigned getCodePage()
{
+ #if 0
#if !defined(__FLAT__)
// get version number, in the form of a normal number
unsigned ver = (_version >> 8) | (_version << 8);
if( ver < 0x30C )
return 437; // United States code page, for all versions before 3.3
! #if defined( __FLAT__ ) // ?? This sucks?? see above if?
Regs r; r.rDS.w.wl = r.rES.w.wl = -1;
#endif
***************
*** 47,52 ****
--- 48,88 ----
#endif
return _BX;
+ #else
+
+ /*
+ * New code. The old code sucks.
+ */
+ #if defined(__FLAT__)
+ # if defined(__NT__)
+ return 437;
+ # elif defined(__OS2__)
+ return 437;
+
+ # if 0
+ //** Needs checking first.
+ uword buf[40];
+ uword len;
+
+ if(DosGetCp(sizeof(buf), buf, &len) != 0) return 437;
+ return buf[0];
+
+ # endif
+ # else
+ # error "Non-supported OS"
+ # endif // __NT__, __OS2__
+
+ #else // NOT __FLAT__
+ //** DOS: get version number, in the form of a normal number
+ unsigned ver = (_version >> 8) | (_version << 8);
+ if( ver < 0x30C )
+ return 437; // United States code page, for all versions before 3.3
+ _AX = 0x6601; // get code page
+ _genInt( 0x21 );
+ return _BX;
+ #endif
+
+ #endif
}
void TDisplay::updateIntlChars()
***************
*** 69,74 ****
--- 105,127 ----
char _NEAR TFrame::frameChars[33] =
" └ │┌├ ┘─┴┐┤┬┼ ╚ ║╔╟ ╝═╧╗╢╤ "; // for UnitedStates code page
+
+
+ #ifdef __FLAT__
+
+ extern "C"
+ {
+ char asmInitFrame[19] =
+ "\x06\x0A\x0C\x05\x00\x05\x03\x0A\x09\x16\x1A\x1C\x15\x00\x15\x13\x1A\x19";
+
+ char asmFrameChars[33] =
+ " └ │┌├ ┘─┴┐┤┬┼ ╚ ║╔╟ ╝═╧╗╢╤ "; // for UnitedStates code page
+
+ };
+ #endif
+
+
+
const char * _NEAR TFrame::closeIcon = "[~\xFE~]";
const char * _NEAR TFrame::zoomIcon = "[~\x18~]";
diff --context ..\tvo/Tvtext2.cpp ./TVTEXT2.CPP
*** ../tvo/Tvtext2.cpp Fri Jun 17 01:00:00 1994
--- ./TVTEXT2.CPP Tue Apr 25 22:08:54 1995
***************
*** 82,96 ****
char getCtrlChar(ushort keyCode)
{
! if ( (lo(keyCode)!= 0) && (lo(keyCode) <= ('Z'-'A'+1)))
! return lo(keyCode) + 'A' - 1;
! else
! return 0;
}
ushort getCtrlCode(uchar ch)
{
! return getAltCode(ch)|(((('a'<=ch)&&(ch<='z'))?(ch&~0x20):ch)-'A'+1);
}
--- 82,96 ----
char getCtrlChar(ushort keyCode)
{
! if ( (lo(keyCode)!= 0) && (lo(keyCode) <= ('Z'-'A'+1)))
! return lo(keyCode) + 'A' - 1;
! else
! return 0;
}
ushort getCtrlCode(uchar ch)
{
! return getAltCode(ch)|(((('a'<=ch)&&(ch<='z'))?(ch&~0x20):ch)-'A'+1);
}
Only in .: Tvwrit32.asm
Only in .: Tvwrit32.inc
diff --context ..\tvo/Twindow.cpp ./TWINDOW.CPP
*** ../tvo/Twindow.cpp Fri Jun 17 01:00:00 1994
--- ./TWINDOW.CPP Tue Apr 25 22:08:54 1995
***************
*** 47,53 ****
TWindowInit( &TWindow::initFrame )
{
state |= sfShadow;
! options |= ofSelectable | ofTopSelect;
growMode = gfGrowAll | gfGrowRel;
if( createFrame != 0 &&
--- 47,53 ----
TWindowInit( &TWindow::initFrame )
{
state |= sfShadow;
! options |= ofSelectable | ofTopSelect | ofFirstClick;
growMode = gfGrowAll | gfGrowRel;
if( createFrame != 0 &&
***************
*** 119,125 ****
( event.message.infoPtr == 0 || event.message.infoPtr == this )
)
{
! clearEvent(event);
if( (state & sfModal) == 0 )
close();
else
--- 119,125 ----
( event.message.infoPtr == 0 || event.message.infoPtr == this )
)
{
! clearEvent(event);
if( (state & sfModal) == 0 )
close();
else
diff --context ..\tvo/Views.h ./VIEWS.H
*** ../tvo/Views.h Fri Jun 17 01:00:00 1994
--- ./VIEWS.H Tue Apr 25 22:08:58 1995
***************
*** 86,91 ****
--- 86,96 ----
ofCentered = 0x300,
ofValidate = 0x400,
+ #ifdef __OS2__
+ ofPhysical = 0x8000, // T if view is PHYSICAL screen!
+ #endif
+
+
// TView GrowMode masks
gfGrowLoX = 0x01,
***************
*** 299,304 ****
--- 304,313 ----
#if defined( Uses_TView ) && !defined( __TView )
#define __TView
+ #ifndef __os2asm_h
+ # include <tvision/os2asm.h>
+ #endif
+
struct write_args
{
void _FAR *self;
***************
*** 410,422 ****
void putInFrontOf( TView *Target );
TView *TopView();
! void writeBuf( short x, short y, short w, short h, const void _FAR* b );
void writeBuf( short x, short y, short w, short h, const TDrawBuffer& b );
void writeChar( short x, short y, char c, uchar color, short count );
void writeLine( short x, short y, short w, short h, const TDrawBuffer& b );
void writeLine( short x, short y, short w, short h, const void _FAR *b );
void writeStr( short x, short y, const char *str, uchar color );
TPoint size;
ushort options;
ushort eventMask;
--- 419,433 ----
void putInFrontOf( TView *Target );
TView *TopView();
! void writeBuf( short x, short y, short w, short h, const void _FAR * b );
void writeBuf( short x, short y, short w, short h, const TDrawBuffer& b );
void writeChar( short x, short y, char c, uchar color, short count );
void writeLine( short x, short y, short w, short h, const TDrawBuffer& b );
void writeLine( short x, short y, short w, short h, const void _FAR *b );
void writeStr( short x, short y, const char *str, uchar color );
+ void writeView(short x, short y, short count, ushort *buf);
+
TPoint size;
ushort options;
ushort eventMask;
***************
*** 468,473 ****
--- 479,490 ----
};
+ #ifdef __FLAT__
+ inline Boolean TView::exposed()
+ { return asmExposed(this);
+ }
+ #endif
+
inline ipstream& operator >> ( ipstream& is, TView& cl )
{ return is >> (TStreamable&)cl; }
inline ipstream& operator >> ( ipstream& is, TView*& cl )
***************
*** 506,511 ****
--- 523,532 ----
#if defined( Uses_TFrame ) && !defined( __TFrame )
#define __TFrame
+ #ifndef __os2asm_h
+ #include <tvision/os2asm.h>
+ #endif
+
class _FAR TRect;
class _FAR TEvent;
class _FAR TDrawBuffer;
***************
*** 548,553 ****
--- 569,580 ----
static TStreamable *build();
};
+
+ #ifdef __FLAT__
+ inline void TFrame::frameLine(TDrawBuffer& frameBuf, short y, short n, uchar color )
+ { asmFrameLine(this, frameBuf, y, n, color);
+ }
+ #endif
inline ipstream& operator >> ( ipstream& is, TFrame& cl )
{ return is >> (TStreamable&)cl; }