Changeset 40 for trunk/src/plugins/platform-launcher
- Timestamp:
- Nov 21, 2007, 1:32:50 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plugins/platform-launcher/library/pm/eclipseOs2.c
r28 r40 1 /* $Id: os2_eclipse.c,v 1.1 2002/07/10 04:28:02 phaller Exp $ */2 3 /*4 * Contributed by Mark Hale5 */6 1 7 2 #include "eclipseOS.h" … … 35 30 #define SPLASH_WINDOW_ID 100 36 31 #define MSG_BOX_ID 11 37 #define BMP_SPLASH_BITMAP 50138 32 39 33 /* Define local variables for running the JVM and detecting its exit. */ … … 52 46 static void splashTimeout(void); 53 47 static MRESULT EXPENTRY clientWndProc (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2); 54 55 48 56 49 /* … … 163 156 return (ERROR_INVALID_PARAMETER); /* Fehler signalisieren */ 164 157 165 166 158 /* Find out how big the file is, allocate that much memory, and read */ 167 159 /* in the entire bitmap. */ … … 337 329 HPS hps = WinGetScreenPS( HWND_DESKTOP ); 338 330 HBITMAP hbmp; 339 APIRET rc = BmpRead (hps,331 APIRET rc = BmpReadFile(hps, 340 332 featureImage, 341 333 &hbmp); … … 349 341 350 342 351 352 353 343 /* Display a Message */ 354 344 void displayMessage( char* message ) 355 345 { 356 WinMessageBox(HWND_DESKTOP, 357 hwndFrame, 358 message, 359 NULL, 360 MSG_BOX_ID, 361 MB_OK | MB_MOVEABLE); 346 WinMessageBox( HWND_DESKTOP, hwndFrame, message, NULL, MSG_BOX_ID, MB_OK ); 362 347 } 363 348 … … 436 421 DevQueryCaps(hDC, CAPS_COLOR_PLANES, 2, devCaps); 437 422 depth = devCaps[0] * devCaps[1]; 423 438 424 if (featureImage != NULL) 439 425 hBitmap = MMLoadBitmap(hab, featureImage); 440 441 426 /* If the bitmap could not be found, try again using the install directory. */ 442 427 if (hBitmap == NULLHANDLE) 443 hBitmap = loadSplashImage( homeDir, depth <= LO_RES_DEPTH ? loResSplash : hiResSplash ); 444 428 hBitmap = loadSplashImage( homeDir, depth <= LO_RES_DEPTH ? loResSplash : hiResSplash ); 445 429 /* If the bitmap could not be found, return an error. */ 446 430 if (hBitmap == NULLHANDLE) … … 562 546 static HBITMAP loadSplashImage(char* baseDir, char *fileName) 563 547 { 564 HBITMAP hBitmap = NULLHANDLE; 565 char *langEnvVar; 566 char lang[4] = {0}; 567 char country[4] = {0}; 568 char *splashFile; 569 570 langEnvVar = getenv("LANG"); 571 if(langEnvVar != NULL && strlen(langEnvVar) == 5) { 572 lang[0] = langEnvVar[0]; 573 lang[1] = langEnvVar[1]; 574 lang[2] = '\0'; 575 country[0] = langEnvVar[3]; 576 country[1] = langEnvVar[4]; 577 country[2] = '\0'; 578 } 579 580 splashFile = malloc ( strlen( baseDir ) + 256 ); 581 582 sprintf( splashFile, "%s\\splash\\%s_%s\\%s", baseDir, lang, country, fileName ); 583 hBitmap = MMLoadBitmap(hab, splashFile); 584 if(hBitmap == NULLHANDLE) { 585 sprintf( splashFile, "%s\\splash\\%s\\%s", baseDir, lang, fileName ); 586 hBitmap = MMLoadBitmap(hab, splashFile); 587 } 588 589 if(hBitmap == NULLHANDLE) { 590 sprintf( splashFile, "%s\\splash\\%s", baseDir, fileName ); 591 hBitmap = MMLoadBitmap(hab, splashFile); 592 } 593 594 // load bitmap from resource table 595 { 596 HPS hps = WinGetScreenPS( HWND_DESKTOP ); 597 hBitmap = GpiLoadBitmap(hps, 598 (HMODULE)NULLHANDLE, 599 BMP_SPLASH_BITMAP, 600 0, 601 0); 602 WinReleasePS( hps ); 603 } 604 605 606 free (splashFile); 607 return hBitmap; 548 HBITMAP hBitmap = NULLHANDLE; 549 char *langEnvVar; 550 char lang[4] = {0}; 551 char country[4] = {0}; 552 char *splashFile; 553 554 langEnvVar = getenv("LANG"); 555 if(langEnvVar != NULL && strlen(langEnvVar) == 5) { 556 lang[0] = langEnvVar[0]; 557 lang[1] = langEnvVar[1]; 558 lang[2] = '\0'; 559 country[0] = langEnvVar[3]; 560 country[1] = langEnvVar[4]; 561 country[2] = '\0'; 562 } 563 564 splashFile = malloc ( strlen( baseDir ) + 256 ); 565 566 sprintf( splashFile, "%s\\splash\\%s_%s\\%s", baseDir, lang, country, fileName ); 567 hBitmap = MMLoadBitmap(hab, splashFile); 568 if(hBitmap == NULLHANDLE) { 569 sprintf( splashFile, "%s\\splash\\%s\\%s", baseDir, lang, fileName ); 570 hBitmap = MMLoadBitmap(hab, splashFile); 571 } 572 573 if(hBitmap == NULLHANDLE) { 574 sprintf( splashFile, "%s\\splash\\%s", baseDir, fileName ); 575 hBitmap = MMLoadBitmap(hab, splashFile); 576 } 577 578 free (splashFile); 579 return hBitmap; 608 580 } 609 581 … … 630 602 } 631 603 632 633 /*****************************************************************************634 * Name : char* findCommandOS2635 * Purpose : Scan environment and system configuration for a given command636 * Parameter : char* pszCommand637 * Variables :638 * Result : NULL if not found,639 * fully qualified name otherwise640 * Remark : The method is mainly used to determine which javaw.exe to start,641 * Eclipse expects the following priorisation:642 * 1 - %ECLIPSE%\jre\bin\javaw.exe643 * :644 * :645 * 2 - HINIUSER\Java131\USER_HOME -> javaw.exe646 * 3 - HINIUSER\Java13\USER_HOME -> javaw.exe647 * 4 - %PATH% -> javaw.exe648 *649 * Author : Patrick Haller 2002-07-10650 *****************************************************************************/651 652 char* findCommandOS2( char* command )653 {654 // @@@PH not yet implemented655 return NULL;656 }657 658 /*659 * $Log: os2_eclipse.c,v $660 * Revision 1.1 2002/07/10 04:28:02 phaller661 * Added Mark Hale's launcher code662 *663 */
Note:
See TracChangeset
for help on using the changeset viewer.