rust/cargo-c: update to 0.10.7+cargo-0.84.0
[oi-userland.git] / components / x11 / libX11 / patches / 17.om-generic.patch
blob0c5c3aa61bc948d2b8dd8e01246d2f5abc7eff97
1 ###############################################################################
2 # Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
4 # Permission is hereby granted, free of charge, to any person obtaining a
5 # copy of this software and associated documentation files (the "Software"),
6 # to deal in the Software without restriction, including without limitation
7 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 # and/or sell copies of the Software, and to permit persons to whom the
9 # Software is furnished to do so, subject to the following conditions:
11 # The above copyright notice and this permission notice (including the next
12 # paragraph) shall be included in all copies or substantial portions of the
13 # Software.
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 # DEALINGS IN THE SOFTWARE.
24 diff --git a/modules/om/generic/omGeneric.c b/modules/om/generic/omGeneric.c
25 index 64ef7b7..7b40cb1 100644
26 --- a/modules/om/generic/omGeneric.c
27 +++ b/modules/om/generic/omGeneric.c
28 @@ -175,6 +175,11 @@ init_fontset(
29 if((font_set->substitute = init_fontdata(data->substitute,
30 data->substitute_num)) == NULL)
31 goto err;
33 + /* Add for load_option */
34 + font_set->delay_loading = data->delay_loading;
35 + font_set->no_checking = data->no_checking;
37 font_set->substitute_num = data->substitute_num;
38 if((font_set->vmap = init_fontdata(data->vmap,
39 data->vmap_num)) == NULL)
40 @@ -283,6 +288,10 @@ load_font(
41 if (font_set->font_name == NULL)
42 continue;
44 + /* no font structure is requeried here. don't load font now. */
45 + if ((font_set->font != NULL) || (font_set->delay_loading))
46 + continue;
48 if (load_fontset_data (oc, font_set) != True)
49 return False;
50 #ifndef TESTVERSION
51 @@ -332,12 +341,24 @@ load_font_info(
52 continue;
54 if (font_set->info == NULL) {
55 + /* Handle for delay loading. */
56 + if (font_set->delay_loading)
57 + continue;
58 fn_list = XListFontsWithInfo(dpy, font_set->font_name, 1, &fn_num,
59 &font_set->info);
60 if (font_set->info == NULL)
61 return False;
63 +#ifdef SUNSOFT
64 + if (fn_num > 0) {
65 + font_set->info->fid = XLoadFont(dpy, font_set->font_name);
66 + }
67 + if (fn_list) {
68 + XFreeFontNames(fn_list);
69 + }
70 +#else
71 XFreeFontNames(fn_list);
72 +#endif
76 @@ -453,7 +474,7 @@ init_core_part(
77 count = length = 0;
79 for ( ; font_set_num-- > 0; font_set++) {
80 - if (font_set->font_name == NULL)
81 + if (font_set->font_name == NULL || font_set->delay_loading) /* if delay_loading, continue */
82 continue;
84 length += strlen(font_set->font_name) + 1;
85 @@ -483,7 +504,7 @@ init_core_part(
86 font_set_num = gen->font_set_num;
88 for (count = 0; font_set_num-- > 0; font_set++) {
89 - if (font_set->font_name == NULL)
90 + if (font_set->font_name == NULL || font_set->delay_loading) /* if delay_loading, continue */
91 continue;
93 font_set->id = count;
94 @@ -1261,7 +1282,7 @@ set_missing_list(
95 count = length = 0;
97 for ( ; font_set_num-- > 0; font_set++) {
98 - if (font_set->info || font_set->font) {
99 + if (font_set->info || font_set->font || font_set->no_checking) {
100 continue;
103 @@ -1308,7 +1329,7 @@ set_missing_list(
104 font_set_num = gen->font_set_num;
106 for ( ; font_set_num-- > 0; font_set++) {
107 - if (font_set->info || font_set->font) {
108 + if (font_set->info || font_set->font || font_set->no_checking) {
109 continue;
112 @@ -2092,6 +2113,20 @@ init_om(
114 read_vw(lcd,data,num);
115 length += strlen(data->font_data->name) + 1;
117 + /* For load_option */
118 + data->delay_loading = False;
119 + data->no_checking = False;
120 + snprintf(buf, BUFSIZ, "fs%d.font.load_option", num);
121 + _XlcGetResource(lcd, "XLC_FONTSET", buf, &value, &count);
122 + if (count > 0) {
123 + if (!strcmp(*value, "delay_check")) {
124 + data->delay_loading = True;
125 + } else if (!strcmp(*value, "delay_nocheck")) {
126 + data->delay_loading = True;
127 + data->no_checking = True;
132 /* required charset list */
133 diff --git a/modules/om/generic/omXChar.c b/modules/om/generic/omXChar.c
134 index c9bbb8e..4f80ce0 100644
135 --- a/modules/om/generic/omXChar.c
136 +++ b/modules/om/generic/omXChar.c
137 @@ -285,6 +285,12 @@ load_font(
138 XOC oc,
139 FontSet font_set)
141 + /* Give up displaying any characters of this missing charset. */
142 + if (font_set->delay_loading == False && font_set->font != NULL) {
143 + return False;
146 + /* In case of delay loading, load font here. */
147 font_set->font = XLoadQueryFont(oc->core.om->core.display,
148 oc->core.font_info.font_name_list[font_set->id]);
149 if (font_set->font == NULL)
150 @@ -330,8 +336,10 @@ _XomConvert(
151 if (font_set == NULL)
152 return -1;
154 - if (font_set->font == NULL && load_font(oc, font_set) == False)
155 - return -1;
156 + if (font_set->font == NULL || font_set->delay_loading) {
157 + if (load_font(oc, font_set) == False)
158 + return -1;
161 length = *to_left - cs_left;
163 diff --git a/src/XomGeneric.h b/src/XomGeneric.h
164 index d6f182d..d8eaf89 100644
165 --- a/src/XomGeneric.h
166 +++ b/src/XomGeneric.h
167 @@ -81,6 +81,9 @@ typedef struct _OMDataRec {
168 XlcCharSet *charset_list;
169 int font_data_count;
170 FontData font_data;
171 + /* For load_option */
172 + Bool delay_loading;
173 + Bool no_checking;
174 /* For VW/UDC */
175 int substitute_num;
176 FontData substitute;
177 @@ -120,6 +123,9 @@ typedef struct _FontSetRec {
178 XFontStruct *font;
179 XlcSide side;
180 Bool is_xchar2b;
181 + /* For load_option */
182 + Bool delay_loading;
183 + Bool no_checking;
184 /* For VW/UDC */
185 int substitute_num;
186 FontData substitute;