| 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 | #ifdef HAVE_CONFIG_H1 |
| 54 | #include <config.h> |
| 55 | #endif |
| 56 | #include "Xlibint.h" |
| 57 | #include "Xlcint.h" |
| 58 | |
| 59 | void |
| 60 | XmbDrawText( |
| 61 | Display *dpy, |
| 62 | Drawable d, |
| 63 | GC gc, |
| 64 | int x, |
| 65 | int y, |
| 66 | XmbTextItem *text_items, |
| 67 | int nitems) |
| 68 | { |
| 69 | register XFontSet fs = NULL((void*)0); |
| 1 | 'fs' initialized to a null pointer value | |
|
| 70 | register XmbTextItem *p = text_items; |
| 71 | register int i = nitems; |
| 72 | register int esc; |
| 73 | |
| 74 | |
| 75 | while (i && !p->font_set) { |
| 2 | | Loop condition is true. Entering loop body | |
|
| 3 | | Loop condition is false. Execution continues on line 80 | |
|
| 76 | i--; |
| 77 | p++; |
| 78 | } |
| 79 | |
| 80 | for (; --i >= 0; p++) { |
| 4 | | Loop condition is true. Entering loop body | |
|
| 81 | if (p->font_set) |
| |
| 82 | fs = p->font_set; |
| 83 | x += p->delta; |
| 84 | esc = (*fs->methods->mb_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') |
|
| 85 | p->chars, p->nchars); |
| 86 | if (!esc) |
| 87 | esc = fs->methods->mb_escapement (fs, p->chars, p->nchars); |
| 88 | x += esc; |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | void |
| 93 | XmbDrawString( |
| 94 | Display *dpy, |
| 95 | Drawable d, |
| 96 | XFontSet font_set, |
| 97 | GC gc, |
| 98 | int x, |
| 99 | int y, |
| 100 | _Xconstconst char *text, |
| 101 | int text_len) |
| 102 | { |
| 103 | (void)(*font_set->methods->mb_draw_string) (dpy, d, font_set, gc, x, y, |
| 104 | text, text_len); |
| 105 | } |
| 106 | |
| 107 | |
| 108 | void |
| 109 | XmbDrawImageString( |
| 110 | Display *dpy, |
| 111 | Drawable d, |
| 112 | XFontSet font_set, |
| 113 | GC gc, |
| 114 | int x, |
| 115 | int y, |
| 116 | _Xconstconst char *text, |
| 117 | int text_len) |
| 118 | { |
| 119 | (*font_set->methods->mb_draw_image_string) (dpy, d, font_set, gc, x, y, |
| 120 | text, text_len); |
| 121 | } |
| 122 | |
| 123 | int |
| 124 | XmbTextEscapement( |
| 125 | XFontSet font_set, |
| 126 | _Xconstconst char *text, |
| 127 | int text_len) |
| 128 | { |
| 129 | return (*font_set->methods->mb_escapement) (font_set, text, text_len); |
| 130 | } |
| 131 | |
| 132 | int |
| 133 | XmbTextExtents( |
| 134 | XFontSet font_set, |
| 135 | _Xconstconst char *text, |
| 136 | int text_len, |
| 137 | XRectangle *overall_ink_extents, |
| 138 | XRectangle *overall_logical_extents) |
| 139 | { |
| 140 | return (*font_set->methods->mb_extents) (font_set, text, text_len, |
| 141 | overall_ink_extents, |
| 142 | overall_logical_extents); |
| 143 | } |
| 144 | |
| 145 | Statusint |
| 146 | XmbTextPerCharExtents( |
| 147 | XFontSet font_set, |
| 148 | _Xconstconst char *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->mb_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 | } |