1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
10 | |
11 | |
12 | |
13 | |
14 | |
15 | |
16 | |
17 | |
18 | |
19 | |
20 | |
21 | |
22 | |
23 | |
24 | |
25 | |
26 | |
27 | |
28 | |
29 | |
30 | |
31 | |
32 | |
33 | |
34 | |
35 | |
36 | |
37 | |
38 | |
39 | |
40 | |
41 | |
42 | |
43 | |
44 | |
45 | |
46 | |
47 | |
48 | |
49 | |
50 | |
51 | |
52 | |
53 | |
54 | #ifdef HAVE_CONFIG_H1 |
55 | #include <config.h> |
56 | #endif |
57 | #include "Xlibint.h" |
58 | #include "Xlcint.h" |
59 | |
60 | void |
61 | XwcDrawText( |
62 | Display *dpy, |
63 | Drawable d, |
64 | GC gc, |
65 | int x, |
66 | int y, |
67 | XwcTextItem *text_items, |
68 | int nitems) |
69 | { |
70 | register XFontSet fs = NULL((void*)0); |
| 1 | 'fs' initialized to a null pointer value | |
|
71 | register XwcTextItem *p = text_items; |
72 | register int i = nitems; |
73 | register int esc; |
74 | |
75 | |
76 | while (i && !p->font_set) { |
| 2 | | Loop condition is true. Entering loop body | |
|
| 3 | | Loop condition is false. Execution continues on line 81 | |
|
77 | i--; |
78 | p++; |
79 | } |
80 | |
81 | for (; --i >= 0; p++) { |
| 4 | | Loop condition is true. Entering loop body | |
|
82 | if (p->font_set) |
| |
83 | fs = p->font_set; |
84 | x += p->delta; |
85 | esc = (*fs->methods->wc_draw_string) (dpy, d, fs, gc, x, y, |
| 6 | | Access to field 'methods' results in a dereference of a null pointer (loaded from variable 'fs') |
|
86 | p->chars, p->nchars); |
87 | if (!esc) |
88 | esc = fs->methods->wc_escapement (fs, p->chars, p->nchars); |
89 | x += esc; |
90 | } |
91 | } |
92 | |
93 | void |
94 | XwcDrawString( |
95 | Display *dpy, |
96 | Drawable d, |
97 | XFontSet font_set, |
98 | GC gc, |
99 | int x, |
100 | int y, |
101 | _Xconstconst wchar_t *text, |
102 | int text_len) |
103 | { |
104 | (void)(*font_set->methods->wc_draw_string) (dpy, d, font_set, gc, x, y, |
105 | text, text_len); |
106 | } |
107 | |
108 | void |
109 | XwcDrawImageString( |
110 | Display *dpy, |
111 | Drawable d, |
112 | XFontSet font_set, |
113 | GC gc, |
114 | int x, |
115 | int y, |
116 | _Xconstconst wchar_t *text, |
117 | int text_len) |
118 | { |
119 | (*font_set->methods->wc_draw_image_string) (dpy, d, font_set, gc, x, y, |
120 | text, text_len); |
121 | } |
122 | |
123 | int |
124 | XwcTextEscapement( |
125 | XFontSet font_set, |
126 | _Xconstconst wchar_t *text, |
127 | int text_len) |
128 | { |
129 | return (*font_set->methods->wc_escapement) (font_set, text, text_len); |
130 | } |
131 | |
132 | int |
133 | XwcTextExtents( |
134 | XFontSet font_set, |
135 | _Xconstconst wchar_t *text, |
136 | int text_len, |
137 | XRectangle *overall_ink_extents, |
138 | XRectangle *overall_logical_extents) |
139 | { |
140 | return (*font_set->methods->wc_extents) (font_set, text, text_len, |
141 | overall_ink_extents, |
142 | overall_logical_extents); |
143 | } |
144 | |
145 | Statusint |
146 | XwcTextPerCharExtents( |
147 | XFontSet font_set, |
148 | _Xconstconst wchar_t *text, |
149 | int text_len, |
150 | XRectangle *ink_extents_buffer, |
151 | XRectangle *logical_extents_buffer, |
152 | int buffer_size, |
153 | int *num_chars, |
154 | XRectangle *max_ink_extents, |
155 | XRectangle *max_logical_extents) |
156 | { |
157 | return (*font_set->methods->wc_extents_per_char) |
158 | (font_set, text, text_len, |
159 | ink_extents_buffer, logical_extents_buffer, |
160 | buffer_size, num_chars, max_ink_extents, max_logical_extents); |
161 | } |