2362N/A * Copyright (c) 1996, 2005, 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 * These routines are used for display string with multi font. 547N/A//extern struct MComponentPeerIDs mComponentPeerIDs; 547N/A//extern struct MMenuItemPeerIDs mMenuItemPeerIDs; 0N/A * make string with str + string representation of num 0N/A * This string is used as tag string of Motif Compound String and FontList. 0N/A * This function is called by components that 0N/A * are being disposed. It used to invalidate 0N/A * the global ref immediately, but the awt is 0N/A * rather full of thread race conditions involving 0N/A * component disposal and outstanding events. 0N/A * Now we queue up 'to be deleted' global refs 0N/A * as they come in, and don't invalidate them 0N/A * until the X event queue is empty. Callers of 0N/A * either of these functions _must_ have AWT_LOCK'd 0N/A * before using them! 0N/A * Verra handy for tracking down race conditions. If you 0N/A * have a peer getting called after its been disposed... 0N/A /* jio_fprintf(stderr,"%p\n",(void *)gRef); */ 547N/A //JNU_GetLongFieldAsPtr(env, this, mMenuItemPeerIDs.jniGlobalRef); 547N/A //JNU_SetLongFieldFromPtr(env, this, mMenuItemPeerIDs.jniGlobalRef, NULL); 0N/A * Verra handy for tracking down race conditions. If you 0N/A * have a peer getting called after its been disposed... 0N/A /* jio_fprintf(stderr,"%p\n",(void *)gRef); */ 0N/A /* initialize to NULL so that DeleteLocalRef will work. */ 0N/A // SECURITY: Must call _NoClientCode() methods to ensure that we 0N/A // are not invoking client code on the privileged thread 0N/A "getFont_NoClientCode",
0N/A * Unicode to Motif Multi Font Compound String converter 0N/A * ASSUMES: We are not running on a privileged thread 0N/A /* Bail if we've finished */ 0N/A /* Motif XmStringCreate() API requests "text must be a NULL-terminated 0N/A string" and its implementation uses "strlen()" to calculate the length 0N/A of the text string. Unfortunately when we deal with iso10646 font 0N/A on linux, the "text" is requested to be encoded in UTF16, which has the 0N/A posibility of including code points like "0xYY00" ("0xYY" + "0x00") that 0N/A causes problem when XmStringCreate() calls _XmStringNCreate() without 0N/A specifying a specific text lenth (see Motif XmString.c). The workaround is 0N/A to call _XmStringNCreate() directly with specific text length at this 0N/A * Find the character encoding for a given font and register that encoding 0N/A * with the given tag. The encoding is the last two fields of the XLFD of 0N/A * the font (converted to uppercase). 0N/A do { --e; }
while (e !=
xlfd && *e !=
'-');
0N/A do { --e; }
while (e !=
xlfd && *e !=
'-');
0N/A * Motif will core dump on or otherwise mishandle unknown (or 0N/A * non-standard) character encodings (in conversion to compound 0N/A * text, bug 4122785). Register Sun private encodings for 0N/A * Symbol or dingbat fonts as ISO8859-1, which is a lie, 0N/A * but produces predictable results. 0N/A /* printf("Cannot load font: %s\n", fdata->list[0].xlfd); */ 0N/A * Some versions of motif have a bug in 0N/A * XmFontListEntryFree() which causes it to free more than it 0N/A * should. Use XtFree() is used instead. See O'Reilly's 0N/A * Motif Reference Manual for more information. 0N/A /* printf("Cannot load font: %s\n", fdata->flist[0].xlfd); */ 0N/A * Some versions of motif have a bug in 0N/A * XmFontListEntryFree() which causes it to free more than it 0N/A * should. Use XtFree() instead. See O'Reilly's 0N/A * Motif Reference Manual for more information. 0N/A/* #define FONT_DEBUG 2 */ 0N/A * get multi font string width with multiple X11 font 0N/A * ASSUMES: We are not running on a privileged thread 0N/A /* Bail if we've finished */