src/share/native/sun/awt/splashscreen/splashscreen_impl.c

Print this page




  42 }
  43 
  44 SPLASHEXPORT void
  45 SplashSetFileJarName(const char* fileName, const char* jarName) {
  46     Splash *splash = SplashGetInstance();
  47 
  48     free(splash->fileName);
  49     splash->fileName = SplashConvertStringAlloc(fileName, &splash->fileNameLen);
  50 
  51     free(splash->jarName);
  52     splash->jarName = SplashConvertStringAlloc(jarName, &splash->jarNameLen);
  53 }
  54 
  55 SPLASHEXPORT void
  56 SplashInit()
  57 {
  58     Splash *splash = SplashGetInstance();
  59 
  60     memset(splash, 0, sizeof(Splash));
  61     splash->currentFrame = -1;

  62     initFormat(&splash->imageFormat, QUAD_RED_MASK, QUAD_GREEN_MASK,
  63         QUAD_BLUE_MASK, QUAD_ALPHA_MASK);
  64     SplashInitPlatform(splash);
  65 }
  66 
  67 SPLASHEXPORT void
  68 SplashClose()
  69 {
  70     Splash *splash = SplashGetInstance();
  71 
  72     if (splash->isVisible > 0) {
  73         SplashLock(splash);
  74         splash->isVisible = -1;
  75         SplashClosePlatform(splash);
  76         SplashUnlock(splash);
  77     }
  78 }
  79 
  80 void
  81 SplashCleanup(Splash * splash)


  84 
  85     splash->currentFrame = -1;
  86     SplashCleanupPlatform(splash);
  87     if (splash->frames) {
  88         for (i = 0; i < splash->frameCount; i++) {
  89             if (splash->frames[i].bitmapBits) {
  90                 free(splash->frames[i].bitmapBits);
  91                 splash->frames[i].bitmapBits = NULL;
  92             }
  93         }
  94         free(splash->frames);
  95         splash->frames = NULL;
  96     }
  97     if (splash->overlayData) {
  98         free(splash->overlayData);
  99         splash->overlayData = NULL;
 100     }
 101     SplashSetFileJarName(NULL, NULL);
 102 }
 103 







 104 void
 105 SplashDone(Splash * splash)
 106 {
 107     SplashCleanup(splash);
 108     SplashDonePlatform(splash);
 109 }
 110 
 111 int
 112 SplashIsStillLooping(Splash * splash)
 113 {
 114     if (splash->currentFrame < 0) {
 115         return 0;
 116     }
 117     return splash->loopCount != 1 ||
 118         splash->currentFrame + 1 < splash->frameCount;
 119 }
 120 
 121 void
 122 SplashUpdateScreenData(Splash * splash)
 123 {




  42 }
  43 
  44 SPLASHEXPORT void
  45 SplashSetFileJarName(const char* fileName, const char* jarName) {
  46     Splash *splash = SplashGetInstance();
  47 
  48     free(splash->fileName);
  49     splash->fileName = SplashConvertStringAlloc(fileName, &splash->fileNameLen);
  50 
  51     free(splash->jarName);
  52     splash->jarName = SplashConvertStringAlloc(jarName, &splash->jarNameLen);
  53 }
  54 
  55 SPLASHEXPORT void
  56 SplashInit()
  57 {
  58     Splash *splash = SplashGetInstance();
  59 
  60     memset(splash, 0, sizeof(Splash));
  61     splash->currentFrame = -1;
  62     splash->scaleFactor = 1;
  63     initFormat(&splash->imageFormat, QUAD_RED_MASK, QUAD_GREEN_MASK,
  64         QUAD_BLUE_MASK, QUAD_ALPHA_MASK);
  65     SplashInitPlatform(splash);
  66 }
  67 
  68 SPLASHEXPORT void
  69 SplashClose()
  70 {
  71     Splash *splash = SplashGetInstance();
  72 
  73     if (splash->isVisible > 0) {
  74         SplashLock(splash);
  75         splash->isVisible = -1;
  76         SplashClosePlatform(splash);
  77         SplashUnlock(splash);
  78     }
  79 }
  80 
  81 void
  82 SplashCleanup(Splash * splash)


  85 
  86     splash->currentFrame = -1;
  87     SplashCleanupPlatform(splash);
  88     if (splash->frames) {
  89         for (i = 0; i < splash->frameCount; i++) {
  90             if (splash->frames[i].bitmapBits) {
  91                 free(splash->frames[i].bitmapBits);
  92                 splash->frames[i].bitmapBits = NULL;
  93             }
  94         }
  95         free(splash->frames);
  96         splash->frames = NULL;
  97     }
  98     if (splash->overlayData) {
  99         free(splash->overlayData);
 100         splash->overlayData = NULL;
 101     }
 102     SplashSetFileJarName(NULL, NULL);
 103 }
 104 
 105 SPLASHEXPORT void
 106 SplashSetScaleFactor(float scaleFactor)
 107 {
 108     Splash *splash = SplashGetInstance();
 109     splash->scaleFactor = scaleFactor;
 110 }
 111 
 112 void
 113 SplashDone(Splash * splash)
 114 {
 115     SplashCleanup(splash);
 116     SplashDonePlatform(splash);
 117 }
 118 
 119 int
 120 SplashIsStillLooping(Splash * splash)
 121 {
 122     if (splash->currentFrame < 0) {
 123         return 0;
 124     }
 125     return splash->loopCount != 1 ||
 126         splash->currentFrame + 1 < splash->frameCount;
 127 }
 128 
 129 void
 130 SplashUpdateScreenData(Splash * splash)
 131 {