| 6 int count = 1, max = 0; |
6 int count = 1, max = 0; |
| 7 int len; |
7 int len; |
| 8 |
8 |
| 9 /* XXX: ew ... everyone look away */ |
9 /* XXX: ew ... everyone look away */ |
| 10 last = s; |
10 last = s; |
| 11 while (*s) |
11 if (s) |
| 12 { |
12 { |
| 13 if (*s == '\n' || *s == '\r') |
13 while (*s) |
| 14 { |
14 { |
| 15 count++; |
15 if (*s == '\n' || *s == '\r') |
| 16 len = g_utf8_pointer_to_offset(last, s); |
16 { |
| 17 if (max < len) |
17 count++; |
| 18 max = len; |
18 len = g_utf8_pointer_to_offset(last, s); |
| 19 last = s + 1; |
19 if (max < len) |
| |
20 max = len; |
| |
21 last = s + 1; |
| |
22 } |
| |
23 s++; |
| 20 } |
24 } |
| 21 s++; |
25 |
| |
26 len = g_utf8_pointer_to_offset(last, s); |
| |
27 if (max < len) |
| |
28 max = len; |
| 22 } |
29 } |
| 23 |
|
| 24 len = g_utf8_pointer_to_offset(last, s); |
|
| 25 if (max < len) |
|
| 26 max = len; |
|
| 27 |
30 |
| 28 if (height) |
31 if (height) |
| 29 *height = count; |
32 *height = count; |
| 30 if (width) |
33 if (width) |
| 31 *width = max + (count > 1); |
34 *width = max + (count > 1); |