|
|
1.1 ! root 1: IMAGE PORTING APPLICATION ! 2: ========================= ! 3: ! 4: The purpose of the IMAGE sample is twofold :- ! 5: ! 6: i) to demonstrate how to port an existing 16-bit application which ! 7: can be run on the toolkit supplied with OS/2 1.2 to 32-bit. ! 8: ! 9: ii) to demonstrate the Image functionality of the GPI, and the standard ! 10: File Open dialog. ! 11: ! 12: Looking at each of the above statements in more detail ! 13: ! 14: GPI Image Functions/File Open Dialog ! 15: ------------------------------------ ! 16: This program displays an image using the GpiImage() call. The image ! 17: data comes from a file which the user must select using the standard ! 18: File Open dialog which is invoked by selecting 'Open...' on the ! 19: File submenu. ! 20: If the selected image is larger than the maximum picture area, any ! 21: part of the image lying off-screen can be scrolled in using the ! 22: horizontal and vertical scroll bars. Alternatively, the entire ! 23: image can be displayed by stretching or compressing it to fit the ! 24: target rectangle. This is the way the image is displayed initially. ! 25: ! 26: An image-data file comprises a file header (which contains the ! 27: image width and height in pels) and the pel data itself (which ! 28: describes the on and off settings of the pels in the image). ! 29: ! 30: An image-data file has the following format: ! 31: ! 32: IMAGE WIDTH (in BYTES) ! 33: BYTE 0 1 2 3 4 ! 34: ------------------------------------------------------- ! 35: | <space> | <space> | <space> | <space> | Comma | ! 36: | or ASCII | or ASCII | or ASCII | or ASCII | , | ! 37: | digit | digit | digit | digit | | ! 38: |(Thousands)|(Hundreds)| (Tens) | (Ones) | | ! 39: ------------------------------------------------------- ! 40: ! 41: ! 42: IMAGE HEIGHT (in PELS) ! 43: BYTE 5 6 7 8 ! 44: ---------------------------------------------- ! 45: | <space> | <space> | <space> | <space> | ! 46: | or ASCII | or ASCII | or ASCII | or ASCII | ! 47: | digit | digit | digit | digit | ! 48: |(Thousands)|(Hundreds)| (Tens) | (Ones) | ! 49: ---------------------------------------------- ! 50: ! 51: ! 52: IMAGE DATA ! 53: BYTE 10 11 End of File ! 54: -------------------------------------------------- ! 55: | | | | ! 56: | Binary | Binary | . . . . . . | ! 57: | data | data | | ! 58: | | | | ! 59: -------------------------------------------------- ! 60: ! 61: ! 62: Porting to 32-Bit ! 63: ----------------- ! 64: It details the intermediate stages to achieve ! 65: the port, and as a result there are more than one .MAK/.DEF file in order ! 66: to build all versions of the IMAGE application. Initially for the June ! 67: SDK there are the following groups of .MAK/.DEF files ! 68: ! 69: a) IMAGE16.MAK/.DEF - pure 16-bit application that can be compiled using ! 70: the OS/2 1.2 tools/headers/libraries ! 71: ! 72: b) IMAGES1.MAK/.DEF - Port to 32-bit : Stage 1 - This involves recompiling ! 73: the original source using the OS/2 2.0 headers and ! 74: the 32-bit tools/libraries for 32-bit source ! 75: files, and 16-bit tools/libraries for the 16-bit ! 76: source file. Note: the 16-bit utility routines are ! 77: primarily for demonstration purposes only, and should ! 78: not be considered for real applications in their ! 79: current form . ! 80: ! 81: c) IMAGE32.MAK/.DEF - pure 32-bit application that can be compiled using ! 82: the OS/2 2.0 tools/headers/libraries and using the ! 83: INCL_32 compiler define. ! 84: ! 85: Each of these .MAK/.DEF files will produce an executable file of the same ! 86: name (ie IMAGE16.EXE ...). ! 87: ! 88: Note: The IMAGE16.EXE/IMAGES1.EXE have a dependency on an OS/2 1.2 toolkit ! 89: being available locally since they need 16-bit compilers/linkers. ! 90: ! 91: ! 92: ! 93: ORGANIZATION OF SOURCE FILES ! 94: ============================ ! 95: ! 96: Here is list of the source files included in the image application ! 97: and their general purpose. ! 98: ! 99: img_main.h - application constants ! 100: img_xtrn.h - external variable and function declarations ! 101: img_help.h - help panel ids ! 102: img_dlg.h - dialog box constants and item ids. This file is designed ! 103: to be used with the dialog editor. ! 104: ! 105: img_main.c - main function, main window procedure ! 106: and Exit List processing routines ! 107: img_init.c - initialization ! 108: img_file.c - routines for processing File menu items ! 109: img_view.c - routines for processing View menu items ! 110: img_util.c - utility routines (ie memory allocation/de-allocation) ! 111: img_size.c - routines for sizing/scrolling ! 112: img_dlg.c - application specific dialog boxes ! 113: img_help.c - help manager functions ! 114: img_pnt.c - routines for painting the main window ! 115: img_menu.c - routines for menu handling ! 116: img_data.c - global data declarations ! 117: ! 118: img_main.rc - main resource file containing menus, stringtable, etc. ! 119: img_help.rc - resource file for help panels ! 120: ! 121: img_main.ipf - main help text file, contains the link to the others ! 122: img_file.ipf - help text file for the File menu items ! 123: img_view.ipf - help text file for the View menu items ! 124: img_help.ipf - help text file for the Help menu ! 125: img_dlg.ipf - help text file for the File Open dialog ! 126: ! 127: image16.mak - 16-bit Image sample NMAKE file ! 128: image16.def - 16-bit module definition file ! 129: imageS1.mak - Porting stage 1 NMAKE file ! 130: imageS1.def - Porting stage 1 module definition file ! 131: image32.mak - 32-bit Image sample NMAKE file ! 132: image32.def - 32-bit module definition file
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.