/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* These routines are used for display string with multi font.
*/
#ifdef HEADLESS
#endif
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <jni.h>
#include <jni_util.h>
#include <jvm.h>
#ifndef XAWT
#endif
#include "awt_Font.h"
#ifndef XAWT
#include "awt_Component.h"
#endif
#include "awt_MenuItem.h"
#include "awt_p.h"
#include "multi_font.h"
//extern struct MComponentPeerIDs mComponentPeerIDs;
//extern struct MMenuItemPeerIDs mMenuItemPeerIDs;
extern struct PlatformFontIDs platformFontIDs;
extern struct MFontPeerIDs mFontPeerIDs;
/*
* make string with str + string representation of num
* This string is used as tag string of Motif Compound String and FontList.
*/
static void
{
}
#ifndef XAWT
{
return gRef;
}
struct gRefStruct
{
};
/*
* This function is called by components that
* are being disposed. It used to invalidate
* the global ref immediately, but the awt is
* rather full of thread race conditions involving
* component disposal and outstanding events.
* Now we queue up 'to be deleted' global refs
* as they come in, and don't invalidate them
* until the X event queue is empty. Callers of
* either of these functions _must_ have AWT_LOCK'd
* before using them!
*/
void
{
/*
* Verra handy for tracking down race conditions. If you
* have a peer getting called after its been disposed...
*/
/* jio_fprintf(stderr,"%p\n",(void *)gRef); */
else
{
{
}
else
{
}
}
}
void
{
//JNU_GetLongFieldAsPtr(env, this, mMenuItemPeerIDs.jniGlobalRef);
//JNU_SetLongFieldFromPtr(env, this, mMenuItemPeerIDs.jniGlobalRef, NULL);
/*
* Verra handy for tracking down race conditions. If you
* have a peer getting called after its been disposed...
*/
/* jio_fprintf(stderr,"%p\n",(void *)gRef); */
else
{
{
}
else
{
}
}
}
void awtJNI_CleanupGlobalRefs()
{
return;
}
{
count++;
}
}
#endif
static int32_t
{
/* initialize to NULL so that DeleteLocalRef will work. */
goto done;
goto done;
if (componentFonts == NULL)
goto done;
for (i = 0; i < num; i++) {
break;
}
}
done:
if (validRet)
return i;
return 0;
}
#ifndef XAWT
{
// SECURITY: Must call _NoClientCode() methods to ensure that we
// are not invoking client code on the privileged thread
NULL,
"getFont_NoClientCode",
return font;
}
#endif
{
}
{
return JNI_FALSE;
}
return JNI_FALSE;
}
return JNI_FALSE;
}
if (fontConfig == NULL) {
return JNI_FALSE;
}
return JNI_TRUE;
}
{
return JNI_FALSE;
}
return JNI_FALSE;
}
return JNI_FALSE;
}
return JNI_FALSE;
}
if (fontConfig == NULL) {
return JNI_FALSE;
}
return JNI_TRUE;
}
#ifndef XAWT
#ifdef __linux__
return ret_val;
}
#endif
/*
* Unicode to Motif Multi Font Compound String converter
*
* ASSUMES: We are not running on a privileged thread
*/
{
return NULL;
(*env)->CallObjectMethod(
env,
peer,
s);
}
}
} else {
}
for (i = 0; i < stringCount; i+=2) {
/* Bail if we've finished */
break;
if(stringData != NULL) {
int len;
char *offsetStringData;
#ifdef __linux__
/* Motif XmStringCreate() API requests "text must be a NULL-terminated
string" and its implementation uses "strlen()" to calculate the length
of the text string. Unfortunately when we deal with iso10646 font
on linux, the "text" is requested to be encoded in UTF16, which has the
posibility of including code points like "0xYY00" ("0xYY" + "0x00") that
causes problem when XmStringCreate() calls _XmStringNCreate() without
specifying a specific text lenth (see Motif XmString.c). The workaround is
to call _XmStringNCreate() directly with specific text length at this
cirsumstance.
*/
else
else {
}
#else
}
else {
}
#endif
}
}
return xmstr;
}
/*
* Find the character encoding for a given font and register that encoding
* with the given tag. The encoding is the last two fields of the XLFD of
* the font (converted to uppercase).
*/
{
do { --e; } while (e != xlfd && *e != '-');
do { --e; } while (e != xlfd && *e != '-');
if (e != xlfd) {
char *u = NULL;
for (u = encoding; *u != '\0'; ++u) {
if (islower(*u)) {
*u = toupper(*u);
}
}
/*
* Motif will core dump on or otherwise mishandle unknown (or
* non-standard) character encodings (in conversion to compound
* text, bug 4122785). Register Sun private encodings for
* Symbol or dingbat fonts as ISO8859-1, which is a lie,
* but produces predictable results.
*/
}
}
}
{
int32_t i;
/* printf("Cannot load font: %s\n", fdata->list[0].xlfd); */
} else {
else
}
}
/*
* Some versions of motif have a bug in
* XmFontListEntryFree() which causes it to free more than it
* should. Use XtFree() is used instead. See O'Reilly's
* Motif Reference Manual for more information.
*/
/* printf("Cannot load font: %s\n", fdata->flist[0].xlfd); */
continue;
}
} else {
}
}
/*
* Some versions of motif have a bug in
* XmFontListEntryFree() which causes it to free more than it
* should. Use XtFree() instead. See O'Reilly's
* Motif Reference Manual for more information.
*/
}
return fontlist;
}
#endif
/* #define FONT_DEBUG 2 */
{
#ifdef FONT_DEBUG
#endif
return 0;
xfontset = "";
else
ptr += 2;
}
#ifdef FONT_DEBUG
#endif
&missing_count, &def_string);
#if FONT_DEBUG >= 2
#endif
#if FONT_DEBUG
if (missing_count != 0) {
int32_t i;
for (i = 0; i < missing_count; ++i) {
}
#if FONT_DEBUG >= 3
exit(-1);
#endif
}
#endif
return xfs;
}
/*
* get multi font string width with multiple X11 font
*
* ASSUMES: We are not running on a privileged thread
*/
{
int32_t j;
#ifndef XAWT
#endif
return 0;
{
env,
peer,
{
}
{
return 0;
}
} else {
return 0;
}
for (i = 0; i < stringCount; i+=2)
{
/* Bail if we've finished */
break;
}
continue;
}
else
}
} else {
}
}
return width;
}