om-generic.patch revision 1064
688N/A###############################################################################
1064N/A# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
688N/A#
688N/A# Permission is hereby granted, free of charge, to any person obtaining a
919N/A# copy of this software and associated documentation files (the "Software"),
919N/A# to deal in the Software without restriction, including without limitation
919N/A# the rights to use, copy, modify, merge, publish, distribute, sublicense,
919N/A# and/or sell copies of the Software, and to permit persons to whom the
919N/A# Software is furnished to do so, subject to the following conditions:
919N/A#
919N/A# The above copyright notice and this permission notice (including the next
919N/A# paragraph) shall be included in all copies or substantial portions of the
919N/A# Software.
919N/A#
919N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
919N/A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
919N/A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
919N/A# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
919N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
919N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
919N/A# DEALINGS IN THE SOFTWARE.
688N/A#
688N/A
688N/Adiff -urp -x '*~' -x '*.orig' modules/om/generic/omGeneric.c modules/om/generic/omGeneric.c
1064N/A--- modules/om/generic/omGeneric.c 2010-11-21 18:48:04.435666511 -0800
1064N/A+++ modules/om/generic/omGeneric.c 2010-11-21 18:48:05.261723978 -0800
1064N/A@@ -175,6 +175,11 @@ init_fontset(
688N/A if((font_set->substitute = init_fontdata(data->substitute,
688N/A data->substitute_num)) == NULL)
688N/A goto err;
688N/A+
688N/A+ /*Add for load_option*/
688N/A+ font_set->delay_loading = data->delay_loading;
688N/A+ font_set->no_checking = data->no_checking;
688N/A+
688N/A font_set->substitute_num = data->substitute_num;
688N/A if((font_set->vmap = init_fontdata(data->vmap,
688N/A data->vmap_num)) == NULL)
1064N/A@@ -283,33 +288,41 @@ load_font(
688N/A if (font_set->font_name == NULL)
688N/A continue;
688N/A
688N/A- if (load_fontset_data (oc, font_set) != True)
688N/A- return False;
688N/A+ /* no font structure is requeried here. don't load font now. */
688N/A+ if (font_set->font == NULL) {
688N/A+ if (font_set->delay_loading) {
688N/A+ continue;
688N/A+ }
688N/A+
688N/A+
688N/A+ if (load_fontset_data (oc, font_set) != True)
688N/A+ return False;
688N/A #ifndef TESTVERSION
688N/A- if(load_fontdata(oc, font_set->font_data,
688N/A- font_set->font_data_count) != True)
688N/A- return False;
688N/A+ if(load_fontdata(oc, font_set->font_data,
688N/A+ font_set->font_data_count) != True)
688N/A+ return False;
688N/A
688N/A- if(load_fontdata(oc, font_set->substitute,
688N/A- font_set->substitute_num) != True)
688N/A- return False;
688N/A+ if(load_fontdata(oc, font_set->substitute,
688N/A+ font_set->substitute_num) != True)
688N/A+ return False;
688N/A #endif
688N/A
688N/A-/* Add 1996.05.20 */
688N/A- if( oc->core.orientation == XOMOrientation_TTB_RTL ||
688N/A- oc->core.orientation == XOMOrientation_TTB_LTR ){
688N/A- if (font_set->vpart_initialize == 0) {
688N/A- load_fontdata(oc, font_set->vmap, font_set->vmap_num);
688N/A- load_fontdata(oc, (FontData) font_set->vrotate,
688N/A- font_set->vrotate_num);
688N/A- font_set->vpart_initialize = 1;
688N/A- }
688N/A- }
688N/A+ /* Add 1996.05.20 */
688N/A+ if( oc->core.orientation == XOMOrientation_TTB_RTL ||
688N/A+ oc->core.orientation == XOMOrientation_TTB_LTR ) {
688N/A+ if (font_set->vpart_initialize == 0) {
688N/A+ load_fontdata(oc, font_set->vmap, font_set->vmap_num);
688N/A+ load_fontdata(oc, (FontData) font_set->vrotate,
688N/A+ font_set->vrotate_num);
688N/A+ font_set->vpart_initialize = 1;
688N/A+ }
688N/A+ }
688N/A
688N/A- if (font_set->font->min_byte1 || font_set->font->max_byte1)
688N/A- font_set->is_xchar2b = True;
688N/A- else
688N/A- font_set->is_xchar2b = False;
688N/A+ if (font_set->font->min_byte1 || font_set->font->max_byte1)
688N/A+ font_set->is_xchar2b = True;
688N/A+ else
688N/A+ font_set->is_xchar2b = False;
688N/A+ }
688N/A }
688N/A
688N/A return True;
1064N/A@@ -332,12 +345,24 @@ load_font_info(
688N/A continue;
688N/A
688N/A if (font_set->info == NULL) {
688N/A+ /*Handle for delay loading.*/
688N/A+ if (font_set->delay_loading)
688N/A+ continue;
688N/A fn_list = XListFontsWithInfo(dpy, font_set->font_name, 1, &fn_num,
688N/A &font_set->info);
688N/A if (font_set->info == NULL)
688N/A return False;
688N/A
688N/A+#ifdef sun
688N/A+ if (fn_num > 0) {
688N/A+ font_set->info->fid = XLoadFont(dpy, font_set->font_name);
688N/A+ }
688N/A+ if (fn_list) {
688N/A+ XFreeFontNames(fn_list);
688N/A+ }
688N/A+#else
688N/A XFreeFontNames(fn_list);
688N/A+#endif
688N/A }
688N/A }
688N/A
1064N/A@@ -453,7 +478,7 @@ init_core_part(
688N/A count = length = 0;
688N/A
688N/A for ( ; font_set_num-- > 0; font_set++) {
688N/A- if (font_set->font_name == NULL)
688N/A+ if (font_set->font_name == NULL || font_set->delay_loading)/*if delay_loading, continue*/
688N/A continue;
688N/A
688N/A length += strlen(font_set->font_name) + 1;
1064N/A@@ -483,7 +508,7 @@ init_core_part(
688N/A font_set_num = gen->font_set_num;
688N/A
688N/A for (count = 0; font_set_num-- > 0; font_set++) {
688N/A- if (font_set->font_name == NULL)
688N/A+ if (font_set->font_name == NULL || font_set->delay_loading) /*if delay_loading, continue*/
688N/A continue;
688N/A
688N/A font_set->id = count;
688N/A@@ -1177,7 +1202,7 @@ parse_fontname(
688N/A * a "missing_charset" will be reported to the client
688N/A * for this CharSet.
688N/A */
688N/A- font_data_return. xlfd_name = NULL;
688N/A+ font_data_return.xlfd_name = NULL;
688N/A font_data_return.side = XlcUnknown;
688N/A
688N/A ret = parse_fontdata(oc, font_set, font_set->font_data,
688N/A@@ -1275,7 +1300,7 @@ set_missing_list(
688N/A count = length = 0;
688N/A
688N/A for ( ; font_set_num-- > 0; font_set++) {
688N/A- if (font_set->info || font_set->font) {
688N/A+ if (font_set->info || font_set->font || font_set->no_checking) {
688N/A continue;
688N/A }
688N/A
688N/A@@ -1322,7 +1347,7 @@ set_missing_list(
688N/A font_set_num = gen->font_set_num;
688N/A
688N/A for ( ; font_set_num-- > 0; font_set++) {
688N/A- if (font_set->info || font_set->font) {
688N/A+ if (font_set->info || font_set->font || font_set->no_checking) {
688N/A continue;
688N/A }
688N/A
688N/A@@ -2110,6 +2135,20 @@ init_om(
688N/A }
688N/A read_vw(lcd,data,num);
688N/A length += strlen(data->font_data->name) + 1;
688N/A+
688N/A+ /* For load_option */
688N/A+ data->delay_loading = False;
688N/A+ data->no_checking = False;
688N/A+ snprintf(buf, BUFSIZ, "fs%d.font.load_option", num);
688N/A+ _XlcGetResource(lcd, "XLC_FONTSET", buf, &value, &count);
688N/A+ if (count > 0) {
688N/A+ if (!strcmp(*value, "delay_check")) {
688N/A+ data->delay_loading = True;
688N/A+ } else if (!strcmp(*value, "delay_nocheck")) {
688N/A+ data->delay_loading = True;
688N/A+ data->no_checking = True;
688N/A+ }
688N/A+ }
688N/A }
688N/A
688N/A /* required charset list */
688N/Adiff -urp -x '*~' -x '*.orig' modules/om/generic/omXChar.c modules/om/generic/omXChar.c
1064N/A--- modules/om/generic/omXChar.c 2010-09-03 22:52:38.000000000 -0700
1064N/A+++ modules/om/generic/omXChar.c 2010-11-21 18:48:05.262027476 -0800
1064N/A@@ -326,6 +326,12 @@ load_font(
688N/A XOC oc,
688N/A FontSet font_set)
688N/A {
688N/A+ /* Give up displaying any characters of this missing charset. */
688N/A+ if (font_set->delay_loading == False && font_set->font!=NULL) {
688N/A+ return False;
688N/A+ }
688N/A+
688N/A+ /*In case of delay loading, load font here.*/
688N/A font_set->font = XLoadQueryFont(oc->core.om->core.display,
688N/A oc->core.font_info.font_name_list[font_set->id]);
688N/A if (font_set->font == NULL)
1064N/A@@ -375,8 +381,10 @@ _XomConvert(
688N/A if (font_set == NULL)
688N/A return -1;
688N/A
688N/A- if (font_set->font == NULL && load_font(oc, font_set) == False)
688N/A- return -1;
688N/A+ if (font_set->font == NULL||font_set->delay_loading){
688N/A+ if (load_font(oc, font_set) == False)
688N/A+ return -1;
688N/A+ }
688N/A
688N/A length = *to_left - cs_left;
688N/A
688N/Adiff -urp -x '*~' -x '*.orig' src/XomGeneric.h src/XomGeneric.h
1064N/A--- src/XomGeneric.h 2010-09-03 22:52:39.000000000 -0700
1064N/A+++ src/XomGeneric.h 2010-11-21 18:48:05.262416597 -0800
1064N/A@@ -81,6 +81,9 @@ typedef struct _OMDataRec {
688N/A XlcCharSet *charset_list;
688N/A int font_data_count;
688N/A FontData font_data;
688N/A+ /* For load_option */
688N/A+ Bool delay_loading;
688N/A+ Bool no_checking;
688N/A /* For VW/UDC */
688N/A int substitute_num;
688N/A FontData substitute;
1064N/A@@ -120,6 +123,9 @@ typedef struct _FontSetRec {
688N/A XFontStruct *font;
688N/A XlcSide side;
688N/A Bool is_xchar2b;
688N/A+ /* For load_option */
688N/A+ Bool delay_loading;
688N/A+ Bool no_checking;
688N/A /* For VW/UDC */
688N/A int substitute_num;
688N/A FontData substitute;