< prev index next >

src/java.desktop/macosx/native/libsplashscreen/splashscreen_sys.m

Print this page


   1 /*
   2  * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 377                 case SPLASHCTL_UPDATE:
 378                     if (splash->isVisible>0) {
 379                         SplashRedrawWindow(splash);
 380                     }
 381                     break;
 382                 case SPLASHCTL_RECONFIGURE:
 383                     if (splash->isVisible>0) {
 384                         SplashReconfigureNow(splash);
 385                     }
 386                     break;
 387                 case SPLASHCTL_QUIT:
 388                     return;
 389                 }
 390             }
 391         }
 392     }
 393 }
 394 
 395 void *
 396 SplashScreenThread(void *param) {
 397     objc_registerThreadWithCollector();
 398 
 399     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 400     Splash *splash = (Splash *) param;
 401 
 402     SplashLock(splash);
 403     pipe(splash->controlpipe);
 404     fcntl(splash->controlpipe[0], F_SETFL,
 405         fcntl(splash->controlpipe[0], F_GETFL, 0) | O_NONBLOCK);
 406     splash->time = SplashTime();
 407     splash->currentFrame = 0;
 408     [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
 409         SplashCenter(splash);
 410 
 411         splash->window = (void*) [[NSWindow alloc]
 412             initWithContentRect: NSMakeRect(splash->x, splash->y, splash->width, splash->height)
 413                       styleMask: NSBorderlessWindowMask
 414                         backing: NSBackingStoreBuffered
 415                           defer: NO
 416                          screen: SplashNSScreen()];
 417 
 418         [splash->window setOpaque: NO];


   1 /*
   2  * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 377                 case SPLASHCTL_UPDATE:
 378                     if (splash->isVisible>0) {
 379                         SplashRedrawWindow(splash);
 380                     }
 381                     break;
 382                 case SPLASHCTL_RECONFIGURE:
 383                     if (splash->isVisible>0) {
 384                         SplashReconfigureNow(splash);
 385                     }
 386                     break;
 387                 case SPLASHCTL_QUIT:
 388                     return;
 389                 }
 390             }
 391         }
 392     }
 393 }
 394 
 395 void *
 396 SplashScreenThread(void *param) {


 397     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 398     Splash *splash = (Splash *) param;
 399 
 400     SplashLock(splash);
 401     pipe(splash->controlpipe);
 402     fcntl(splash->controlpipe[0], F_SETFL,
 403         fcntl(splash->controlpipe[0], F_GETFL, 0) | O_NONBLOCK);
 404     splash->time = SplashTime();
 405     splash->currentFrame = 0;
 406     [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
 407         SplashCenter(splash);
 408 
 409         splash->window = (void*) [[NSWindow alloc]
 410             initWithContentRect: NSMakeRect(splash->x, splash->y, splash->width, splash->height)
 411                       styleMask: NSBorderlessWindowMask
 412                         backing: NSBackingStoreBuffered
 413                           defer: NO
 414                          screen: SplashNSScreen()];
 415 
 416         [splash->window setOpaque: NO];


< prev index next >