< theÉÍÍ»ÉÍÍ»É É º Ó¶ Ó¶ º Û º º º ÉÍÍÍ» ÌÍ ÉÍÍÍ»É ÉÍÍÍ»º É ÉÍÍÍ»É ÉÍÍÍ»É ÖÄ· ÉÍÍÍ»É ÉÍ»ÉÍ»É º º º º º º º Ó¶ º Ó¶ º º Ó¶ º Ó¶ ºÖ½ º Ó¶ º Ó¶ Ó¶ º º ºÚ×ÄÄĽ º Ú¶ ºÚ¶ º ºÚ¶ ºÚ¶ º ºº Ú¶ º º º º º º º³º ÖĶ ³º Ö¶³º Ö¶ º³º Ö¶³º Ö¶ ºº ³º Ö¶ º º º ½ Ð ÓÙÈÍÍͼ È;ÈÍÍͼÓÙÈÍÍͼÓÄÐÙÈÍÍͼÓÙÈÍÍͼºÚ½ÓÄÙÈÍÍͼÓĽ Ð º ÖÄÄÄÄ×Ù º ÖÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÈÍÍÍͼÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĽ ÓÄÄÄ architecture (kernel) SNAV - demo documentation - 13.8.90 page 1 - ÚÄÄÄÄÄÄÄ¿ ÄÄÄÄÄÄÄÄÄ>³ AVNER ³ ÄÄÄÄÄÄÄÄÄ>³ BEN ³ÄÄÄÄÄÄ> Software Engineering Method ÀÄÄÄÄÄÄÄÙ 10 Dov-Hoz st. Tel-Aviv 63416 Israel tel. 972-3-221535 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ "The Screen NAVigator" ³ ³ ³ ³ THE C++ IMPLEMENTATION ³ ³ Demonstration Application ³ ³ ³ ³ Version 1.21, August 1990. ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ Copyright (c) 1990 by Avner Ben. Written by Avner Ben 12 August 1990. original written 28 November 1989. SNAV - demo documentation - 13.8.90 page 2 - EPREFACEF EÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄF SNAV version 1.20 includes a sample application, compiled and ready to run on an IBM-PC or true compatible, called "demo.exe". The source code is supplied in the file "demo.cpp", and three source files accompanied by four header files, named demo0, demo1, demo2 and demo3. The demo files are enclosed as tutorial pieces only. No compatibility with (or its very inclusion in) future releases is promised for users who wish to extend it for their applications. SNAV - demo documentation - 13.8.90 page 3 - EDEMO - SAMPLE APPLICATIONF EÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄF The demo program is a menu-driven application, showing some uses of the Snav software foundation, such as shape drawing, shape recognition, screen management, TypeWriter-Graphics conversion and a listing of the current semigraphic alphabet. The program divides the screen into three "panel" objects. The top line is occupied by a menu-bar, using an object of class "slide_menu". Lines 2 through 24 are for the drawing-board, using a plain "panel" object. It is enframed, using the panel's "enframe" facility. The bottom line is reserved for user-dialog, using an object of class "character_input". The line is also used for help messages by the bar-menu object. SNAV - demo documentation - 13.8.90 page 4 - EDEMO0 - SCREEN DRIVER ALLOCATORF EÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄF Demo0 implements (inline) the generic screen-driver allocator class, declared in snav2. This is a stub implementation, recognizing only the one driver implementation supplied with the demo - a memory-mapped PC driver, and returning it by default. The case structure is supplied as a basis for extension by the user. Class screen_driver_manager's main method - "allocate" returns a pointer to the desired screen type by number, or the implementation default. Its use frees the code of any device-specific references. SNAV - demo documentation - 13.8.90 page 5 - EDEMO - VERSION HISTORYF EÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄF 4.11.89 avner ben coded snav v1.1 8.3.90-31.3.90 avner ben: - C++ v2.0 upgrade - removed constant declaration of window coordinates - removed inclusion of - default screen and keyboard driver allocation - added rotate and color-setup options snav v1.2 13.7.90 - tested under TurboC++. snav v1.21 12.9.90 avner ben - added query function. SNAV - demo documentation - 13.8.90 page 6 - EDEMO1 - A PC SCREEN DRIVER IMPLEMENTATIONF EÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄF Demo1 is a pc implementation of the generic panel device of snav2. All virtual methods are redefined, to suit pc architecture. The programming used is straightforward, addressing the hardware in a "quick and dirty" way, resulting in "misbehaved" code that may not run properly under a windowing or other multitasking system. This is sufficient for the demonstration. The user is expected to beautify and complicate the design, as fits the application. An obvious exercise for the non-pc user is to rewrite the driver to fit the architecture of his/her machine. A good exercise is to write an ANSI driver. (However, the pc implementation of ANSI has no console reading facilities, so that must remain hardware-dependent). PC users may try writing a non-memory-mapped driver, using the bios, ANSI (partially) or the compiler vendor's screen-driver library. Modifying the enclosed driver to work with the Zortech "display" library is really trivial (do not forget to call "disp_flush()" before each important move!), and same goes for the TurboC++ library. SNAV - demo documentation - 13.8.90 page 7 - EDEMO1 - VERSION HISTORYF EÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄF 28.8.89 avner ben coded. snav v1.0 26.10.89 avner ben - adpated for snav demo. snav v1.1 13.12.89-11.4.90 avner ben: - C++ v2.0 upgrade - added class square_pos and removed to snav2 - added color and cursor processing - removed some function to generic driver - language=1 makes Hebrew screen (inverted left-right). warning - this feature is not supported by query functions! snav v1.2 13.7.90 - tested under TurboC++. - added destructor. - revised the save-buffer. SNAV - demo documentation - 13.8.90 page 8 - EDEMO2 - FORMATTED INPUT USING THE SCREEN DRIVERF EÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄF Demo2 defines some rudimentary formatted input facilities that are lacking in SNAV (being limited to formatted output). the file supplies some datatype-accepting routines, as methods of the class "character_input". Class character_input manages an object of class panel, for user dialog. This may be either supplied by the user, or allocated (and destroyed) by the class. Like class panel of snav2, character_input is a generic class, defining user-dialog facilities in general. Class pc_keyboard implements device specific attributes, such as identifying control characters and function keys. keyboard allocation is done by a "manager" class, similar to the panel_manager of demo0. This ensures that the code is free of device-specific references. Also supplied are a "slide_menu" object whose constructor chops the top line off the main window (which it receives as argument), and a "text_window" object, displaying the welcome screen succession (based upon the "enframe" facility of the panel). SNAV - demo documentation - 13.8.90 page 9 - EDEMO2 - VERSION HISTORYF EÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄF 28.10.89 avner ben coded. snav v1.1 8.3.90-7.4.90 avner ben: - C++ v2.0 upgrade - modified some functions to return by value - removed the main screen area from definition of class char_inpu - simplified class char_input using inheritance - optimized box redraw in text-window - default screen-driver allocation - made class character_input generic - removed char-set and other pc-dependant references to driver snav v1.2 13.7.90 - tested under TurboC++. - standardized use of keyboard. SNAV - demo documentation - 13.8.90 page 10 - EDEMO3 - SAMPLE SHAPESF EÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄF demo3 supplies examples for some regular shapes, a dented curve, and "spiral" self-enclosing curve, for use in the demo program. SNAV - demo documentation - 13.8.90 page 11 - EDEMO3 - VERSION HISTORYF EÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄF 2.11.89 avner ben coded. snav v1.1 8.3.90 avner ben - C++ v2.0 upgrade. snav v1.2 13.7.90 - tested under TurboC++.