Mercurial > hg > xemacs-beta
comparison src/balloon_help.c @ 203:850242ba4a81 r20-3b28
Import from CVS: tag r20-3b28
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:02:21 +0200 |
parents | 15872534500d |
children | 41ff10fd062f |
comparison
equal
deleted
inserted
replaced
202:61eefc8fc970 | 203:850242ba4a81 |
---|---|
81 | 81 |
82 static Pixmap b_mask; | 82 static Pixmap b_mask; |
83 static int b_maskWidth, b_maskHeight; | 83 static int b_maskWidth, b_maskHeight; |
84 static GC b_maskGC; | 84 static GC b_maskGC; |
85 | 85 |
86 static const char* b_text; | 86 static CONST char* b_text; |
87 static int b_width, b_height; | 87 static int b_width, b_height; |
88 | 88 |
89 static int b_lastX, b_lastY; | 89 static int b_lastX, b_lastY; |
90 | 90 |
91 static XtIntervalId b_timer; | 91 static XtIntervalId b_timer; |
214 /*============================================================================ | 214 /*============================================================================ |
215 | 215 |
216 ============================================================================*/ | 216 ============================================================================*/ |
217 | 217 |
218 static void | 218 static void |
219 text_extent (XFontStruct* fontStruct, const char* text, int len, | 219 text_extent (XFontStruct* fontStruct, CONST char* text, int len, |
220 int* width, int* height) | 220 int* width, int* height) |
221 { | 221 { |
222 XCharStruct extent; | 222 XCharStruct extent; |
223 int dummy; | 223 int dummy; |
224 | 224 |
227 *width = extent.width; | 227 *width = extent.width; |
228 *height = fontStruct->ascent + fontStruct->descent; | 228 *height = fontStruct->ascent + fontStruct->descent; |
229 } | 229 } |
230 | 230 |
231 static void | 231 static void |
232 get_text_size (Display* dpy, XFontStruct* fontStruct, const char* text, | 232 get_text_size (Display* dpy, XFontStruct* fontStruct, CONST char* text, |
233 int* max_width, int* max_height) | 233 int* max_width, int* max_height) |
234 { | 234 { |
235 int width; | 235 int width; |
236 int height; | 236 int height; |
237 const char* start; | 237 CONST char* start; |
238 const char* end; | 238 CONST char* end; |
239 | 239 |
240 *max_width = *max_height = 0; | 240 *max_width = *max_height = 0; |
241 | 241 |
242 start = text; | 242 start = text; |
243 while ((end = strchr(start, '\n'))) | 243 while ((end = strchr(start, '\n'))) |
257 | 257 |
258 } | 258 } |
259 | 259 |
260 static void | 260 static void |
261 draw_text (Display* dpy, Window win, GC gc, XFontStruct* fontStruct, | 261 draw_text (Display* dpy, Window win, GC gc, XFontStruct* fontStruct, |
262 int x, int y, const char* text) | 262 int x, int y, CONST char* text) |
263 { | 263 { |
264 const char* start; | 264 CONST char* start; |
265 const char* end; | 265 CONST char* end; |
266 int font_height; | 266 int font_height; |
267 | 267 |
268 y += fontStruct->ascent; | 268 y += fontStruct->ascent; |
269 | 269 |
270 font_height = fontStruct->ascent + fontStruct->descent; | 270 font_height = fontStruct->ascent + fontStruct->descent; |
541 { | 541 { |
542 b_delay = milliseconds; | 542 b_delay = milliseconds; |
543 } | 543 } |
544 | 544 |
545 void | 545 void |
546 balloon_help_show (const char* text) | 546 balloon_help_show (CONST char* text) |
547 { | 547 { |
548 assert (b_dpy != NULL); | 548 assert (b_dpy != NULL); |
549 | 549 |
550 /* We don't copy the text */ | 550 /* We don't copy the text */ |
551 b_text = text; | 551 b_text = text; |