4341N/A * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A/* Could use npt but decided to cut down on linked code size */ 0N/A /* we don't need BOM in output so we choose native BE or LE encoding here */ 0N/A "UCS-2BE" :
"UCS-2LE";
0N/A // 2 bytes per source byte max 0N/A /* linux iconv wants char** source and solaris wants const char**... 0N/A /* Binary search to determine the number of available cells */ 0N/A /* try centering using Xinerama hint 0N/A if there's no hint, use the center of the screen */ 0N/A/* for changing the visible shape of a window to an nonrectangular form */ 0N/A/* for reverting the visible shape of a window to an rectangular form */ 0N/A // making this method redraw a part of the image does not make 0N/A // much sense as SplashUpdateScreenData always re-generates 0N/A // the image completely, so whole window is always redrawn 0N/A// if (splash->isVisible>0) { 0N/A // silently ignore non-fatal errors 0N/A XGetErrorText(disp, err->error_code, msg, sizeof(msg)); 0N/A fprintf(stderr, "Xerror %s, XID %x, ser# %d\n", msg, err->resourceid, 0N/A sprintf(buf, "%d", err->request_code); 0N/A XGetErrorDatabaseText(disp, "XRequest", buf, "Unknown", msg, sizeof(msg)); 0N/A fprintf(stderr, "Major opcode %d (%s)\n", err->request_code, msg); 0N/A if (err->request_code > 128) { 0N/A fprintf(stderr, "Minor opcode %d\n", err->minor_code); 0N/A // for really bad errors, we should exit the thread we're on 0N/A // This setting enables the synchronous Xlib mode! 0N/A // Don't use it == 1 in production builds! 0N/A // We should not ignore any errors. 0N/A //XSetErrorHandler(HandleError); 0N/A// XSetIOErrorHandler(HandleIOError); 0N/A // TrueColor depth probably can't be less 0N/A // than 8 bits, and it's always byte padded 199N/A // Could not allocate the color cells. Most probably 199N/A // the pool got exhausted. Disable the splash screen. 199N/A fprintf(
stderr,
"Warning: unable to initialize the splashscreen. Not enough available color cells.\n");
0N/A ;
/* FIXME: should probably be fixed, but javaws splash screen doesn't support other visuals either */ 0N/A /* Different from win32 implementation - this loop 550N/A uses poll timeouts instead of a timer */ 0N/A /* we should have splash _locked_ on entry!!! */ 0N/A // we're not using "while(XPending)", processing one event 0N/A // at a time to avoid control pipe starvation 0N/A // we're doing full redraw so we just 0N/A // skip the remaining painting events in the queue 0N/A/* we can't use OverrideRedirect for the window as the window should not be 0N/A always-on-top, so we must set appropriate wm hints 0N/A this functions sets olwm, mwm and EWMH hints for undecorated window at once 0N/A It works for: mwm, openbox, wmaker, metacity, KWin (FIXME: test more wm's) 0N/A Should work for: fvwm2.5.x, blackbox, olwm 0N/A Maybe works for: enlightenment, icewm 0N/A Does not work for: twm, fvwm2.4.7 0N/A /* 32-bit property items are stored as long on the client (whether 0N/A * that means 32 bits or 64). XChangeProperty handles the conversion 0N/A * to the actual 32-bit quantities sent to the server. 0N/A /* WM_TAKE_FOCUS hint to avoid wm's transfer of focus to this window */ 0N/A /* WM_DELETE_WINDOW hint to avoid closing this window with Alt-F4. See bug 6474035 */ 0N/A /* flags for decoration and functions */ 0N/A /* generic EMWH hints 0N/A we do not set _NET_WM_WINDOW_TYPE to _NET_WM_WINDOW_TYPE_SPLASH 0N/A hint support due to gnome making this window always-on-top 0N/A so we have to set _NET_WM_STATE and _NET_WM_ALLOWED_ACTIONS correctly 0N/A _NET_WM_STATE: SKIP_TASKBAR and SKIP_PAGER 0N/A _NET_WM_ALLOWED_ACTIONS: disable all actions */ 0N/A "_NET_WM_STATE_SKIP_TASKBAR",
True);
0N/A /* this will be used in case of emergency thread exit on xlib error */ 0N/A// pthread_key_t key; 0N/A// pthread_key_create(&key, SplashPThreadDestructor); 0N/A// pthread_setspecific(key, splash);