Changeset 22107
- Timestamp:
- Dec 4, 2015, 2:12:34 PM (10 years ago)
- Location:
- branches/swt/testapp/apitest
- Files:
-
- 4 added
- 6 edited
-
ApiTest.properties (added)
-
GNUmakefile (modified) (3 diffs)
-
README (modified) (1 diff)
-
doc (added)
-
doc/ApiTest.txt (added)
-
fc.mnu (added)
-
src/PmApiTest.cpp (modified) (10 diffs)
-
src/PmApiTest.def (modified) (1 diff)
-
src/ids.h (modified) (1 diff)
-
src/resource.rc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/swt/testapp/apitest/GNUmakefile
r22106 r22107 3 3 # --------------------------------------------------------------------------- # 4 4 # For this initial version we start with a PM version because, well, we are # 5 # on OS/2! However, this is not the module of focus since it is not directl #5 # on OS/2! However, this is not the module of focus since it is not directly # 6 6 # connected to the SWT for OS/2 project. Upcoming commits will bring the # 7 7 # Odin32 based and Native Win32 variants. # … … 20 20 out=out 21 21 22 # While this is the first target, the default target is23 # specified in .DEFAULT_GOAL above. 24 all: 25 @echo [$@]22 # While this is the first target, the true default target is 23 # specified in .DEFAULT_GOAL above. Here we'll redirect to target 'default'. 24 all: default 25 # @echo [$@] 26 26 27 # PM version of ApiTest 27 28 $(out)/PmApiTest.exe: $(src)/PmApiTest.cpp $(src)/PmApiTest.def 28 29 @echo [$@] … … 32 33 # The default target 33 34 default: $(out)/PmApiTest.exe 34 @echo [$@]35 # @echo [$@] 35 36 36 build: 37 @echo [$@] 37 # Redirect to target 'default' 38 build: default 39 # @echo [$@] 38 40 41 # Cleanup files 39 42 clean: 40 43 @echo [$@] 41 44 rm -f -v $(out)/*.exe $(out)/*.res 42 45 46 # Run the program 47 run: build 48 @echo [$@] 49 $(out)/PmApiTest.exe 50 51 # Distribute to somewhere (NI) 43 52 dist: 44 53 @echo [$@] -
branches/swt/testapp/apitest/README
r22106 r22107 7 7 level. This is to determine if issues with SWT applications are caused at the 8 8 SWT-JNI layer or are caused by Odin32. 9 10 To investigate Odin32 functionality, the ApiTest Program uses several different 11 perspectives, which include an Odin Based version, a Native Win32 version and 12 the use of different toolchains. It is a complement to the test-part of the 13 SwtOs2Demo, which is an SWT-Application. More info is in the 'doc' directory. -
branches/swt/testapp/apitest/src/PmApiTest.cpp
r22106 r22107 3 3 * PmApiTest.cpp * 4 4 * --------------------------------------------------------------------------- * 5 * This file is generated from an xmind-file ! * 6 * It uses the newly designed transformation-sheet. * 7 * While this sheet is still file-based, it will be moved to an Ant Property * 8 * later so it can be constructed from parts. * 5 * This is the PM version of the ApiTest program. * 6 * It is used as a casco to construct the basic structure. * 7 * Note that this is not the program of focus, that would be the Odin32 and * 8 * Win32 variants which will use the Odin32-API and will be added in upcoming * 9 * commits. * 9 10 \*****************************************************************************/ 10 11 … … 18 19 19 20 /* 20 // Include the Platform headers .21 // Include the Platform headers for OS/2. 21 22 */ 22 23 #define INCL_DOS … … 26 27 27 28 /* 29 // Module related include-files. 30 */ 31 #include "ids.h" 32 33 /* 28 34 // Minimal Window Procedure. 29 35 */ 30 MRESULT EXPENTRY MyWindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) {36 MRESULT EXPENTRY PmWindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) { 31 37 /* 32 38 // Local Variables follow here. … … 67 73 hwnd, // Owner (client-window) 68 74 HWND_TOP, // Z-order 69 123,// Window ID75 ID_EXIT, // Window ID 70 76 NULL, // Control Data (none) 71 77 NULL // Presentation Parameters (none) … … 81 87 case WM_COMMAND: 82 88 switch (SHORT1FROMMP(mp1)) { 83 /* This is a message from our button, we post a message to close the window */ 84 case 123: 89 90 /* Message from the button, we post a message to close the window */ 91 case ID_EXIT: 85 92 WinPostMsg(hwnd, WM_CLOSE, NULL, NULL); 86 93 break; 94 95 /* Exit Message from the File Menu, forward it to ID_EXIT */ 96 case ID_FILE_EXIT: 97 WinPostMsg(hwnd, WM_COMMAND, (MPARAM) ID_EXIT, NULL); 98 break; 99 100 /* Messages from the Test Menu */ 101 case ID_TEST1: 102 printf("WM_COMMAND received, id: %04d\n", SHORT1FROMMP(mp1)); 103 break; 104 case ID_TEST2: 105 printf("WM_COMMAND received, id: %04d\n", SHORT1FROMMP(mp1)); 106 break; 107 case ID_TEST3: 108 printf("WM_COMMAND received, id: %04d\n", SHORT1FROMMP(mp1)); 109 break; 110 case ID_TEST4: 111 printf("WM_COMMAND received, id: %04d\n", SHORT1FROMMP(mp1)); 112 break; 113 case ID_TEST5: 114 printf("WM_COMMAND received, id: %04d\n", SHORT1FROMMP(mp1)); 115 break; 116 case ID_TEST6: 117 printf("WM_COMMAND received, id: %04d\n", SHORT1FROMMP(mp1)); 118 break; 119 case ID_TEST7: 120 printf("WM_COMMAND received, id: %04d\n", SHORT1FROMMP(mp1)); 121 break; 122 87 123 } 88 break; 124 break; /*WM_COMMAND*/ 89 125 90 126 /* … … 157 193 158 194 159 /* Initialize the Graphics System */ 195 /* 196 // Switch the process type to PM so the command line app can create PM 197 // windows. This makes it possible to use printf() to stdout. 198 */ 199 do { 200 PTIB ptib; 201 PPIB ppib; 202 //break; 203 if(DosGetInfoBlocks(&ptib, &ppib) == 0) { 204 ppib->pib_ultype = 3; 205 } 206 } while (0); 207 208 209 210 /* Initialize the PM Graphics System */ 160 211 hab = WinInitialize(NULL); 161 212 … … 164 215 165 216 /* Register the class of the Main Window */ 166 brc = WinRegisterClass(hab, pszClassClient, MyWindowProc, CS_SIZEREDRAW, 0);217 brc = WinRegisterClass(hab, pszClassClient, PmWindowProc, CS_SIZEREDRAW, 0); 167 218 168 219 /* Create the Main Window */ … … 178 229 &hwndClient // Storage for Client Handle 179 230 ); 231 232 233 234 /* 235 // Show the handles of the windows created. 236 // The application has to be built as WINDOWCOMPAT and the code to change 237 // the application-type to PM has to be active. 238 */ 239 do { 240 int delay = 1000; 241 int i = 0; 242 //break; 243 printf("hwndFrame=%08X\n", hwndFrame); 244 printf("hwndClient=%08X\n", hwndClient); 245 break; 246 for (i=5; i>0; i--) { 247 i > 1 ? printf("Pausing for %d seconds...\n", i) : printf("Pausing for %d second...\n", i); 248 DosSleep(delay); 249 } 250 printf("Continuing program...\n"); 251 } while (0); 180 252 181 253 … … 206 278 brc = WinTerminate(hab); 207 279 280 /* App is terminating */ 281 printf("PmApiTest is terminating...\n"); 282 208 283 /* Return our reply-code */ 209 284 return 0; … … 217 292 printf("\n"); 218 293 printf("%s\n","###############################################################################"); 219 printf("%s\n","# This is the PM version of ApiTest version.20151 1231348#");294 printf("%s\n","# This is the PM version of ApiTest version.201512030711 #"); 220 295 printf("%s\n","###############################################################################"); 221 296 printf("\n"); 297 printf("%s\n","Switching to Graphical Mode with this Window as a Console Log..."); 222 298 223 299 /* -
branches/swt/testapp/apitest/src/PmApiTest.def
r22106 r22107 6 6 ;# which is to test Odin32 from Native PM. # 7 7 ;# This version has low development priority since it does not directly # 8 ;# connect ion to SWT-OS2, which is the project depending on Odin32.#8 ;# connect to SWT-OS2, which is the project depending on Odin32. # 9 9 ;############################################################################## 10 10 11 NAME PmApiTest WINDOWAPI 11 12 NAME PmApiTest WINDOWCOMPAT 12 13 DESCRIPTION 'A Program to test the Odin32 API from Native PM' 13 14 -
branches/swt/testapp/apitest/src/ids.h
r22106 r22107 5 5 \*****************************************************************************/ 6 6 7 #ifndef __IDS_H__8 #define __IDS_H__7 #ifndef __IDS_H__ 8 #define __IDS_H__ 9 9 10 #define IDR_MAINMENU110 #define IDR_MAINMENU 1 11 11 12 #define IDM_FILE100013 #define ID_FILE_EXIT100112 #define IDM_FILE 1000 13 #define ID_FILE_EXIT 1001 14 14 15 #define IDM_TESTING110016 #define ID_TEST1110117 #define ID_TEST2110218 #define ID_TEST3110319 #define ID_TEST4110420 #define ID_TEST5110521 #define ID_TEST6110622 #define ID_TEST7110715 #define IDM_TESTING 1100 16 #define ID_TEST1 1101 17 #define ID_TEST2 1102 18 #define ID_TEST3 1103 19 #define ID_TEST4 1104 20 #define ID_TEST5 1105 21 #define ID_TEST6 1106 22 #define ID_TEST7 1107 23 23 24 #define IDM_HELP120025 #define ID_HELP_ABOUT120124 #define IDM_HELP 1200 25 #define ID_HELP_ABOUT 1201 26 26 27 #endif 27 #define ID_EXIT 123 28 29 #endif /*__IDS_H__*/ -
branches/swt/testapp/apitest/src/resource.rc
r22106 r22107 11 11 MENU IDR_MAINMENU PRELOAD 12 12 BEGIN 13 SUBMENU "~File", IDM_FILE13 SUBMENU "~File", IDM_FILE 14 14 BEGIN 15 MENUITEM "E~xit", ID_FILE_EXIT15 MENUITEM "E~xit", ID_FILE_EXIT 16 16 END 17 SUBMENU "~Testing", IDM_TESTING17 SUBMENU "~Testing", IDM_TESTING 18 18 BEGIN 19 19 MENUITEM "Test ~1", ID_TEST1
Note:
See TracChangeset
for help on using the changeset viewer.
