Mercurial > hg > xemacs-beta
comparison src/objects-gtk.c @ 4990:8f0cf4fd3d2c
Automatic merge
| author | Ben Wing <ben@xemacs.org> |
|---|---|
| date | Sat, 06 Feb 2010 04:01:46 -0600 |
| parents | 3c3c1d139863 |
| children |
comparison
equal
deleted
inserted
replaced
| 4989:d2ec55325515 | 4990:8f0cf4fd3d2c |
|---|---|
| 166 gdk_colormap_free_colors (DEVICE_GTK_COLORMAP (XDEVICE (c->device)), | 166 gdk_colormap_free_colors (DEVICE_GTK_COLORMAP (XDEVICE (c->device)), |
| 167 COLOR_INSTANCE_GTK_COLOR (c), 1); | 167 COLOR_INSTANCE_GTK_COLOR (c), 1); |
| 168 } | 168 } |
| 169 gdk_color_free (COLOR_INSTANCE_GTK_COLOR (c)); | 169 gdk_color_free (COLOR_INSTANCE_GTK_COLOR (c)); |
| 170 } | 170 } |
| 171 xfree (c->data, void *); | 171 xfree (c->data); |
| 172 c->data = 0; | 172 c->data = 0; |
| 173 } | 173 } |
| 174 } | 174 } |
| 175 | 175 |
| 176 /* Color instances are equal if they resolve to the same color on the | 176 /* Color instances are equal if they resolve to the same color on the |
| 206 gtk_valid_color_name_p (struct device *UNUSED (d), Lisp_Object color) | 206 gtk_valid_color_name_p (struct device *UNUSED (d), Lisp_Object color) |
| 207 { | 207 { |
| 208 GdkColor c; | 208 GdkColor c; |
| 209 const char *extname; | 209 const char *extname; |
| 210 | 210 |
| 211 TO_EXTERNAL_FORMAT (LISP_STRING, color, C_STRING_ALLOCA, extname, Qctext); | 211 extname = LISP_STRING_TO_EXTERNAL (color, Qctext); |
| 212 | 212 |
| 213 if (gdk_color_parse (extname, &c) != TRUE) | 213 if (gdk_color_parse (extname, &c) != TRUE) |
| 214 return(0); | 214 return(0); |
| 215 return (1); | 215 return (1); |
| 216 } | 216 } |
| 235 { | 235 { |
| 236 GdkFont *gf; | 236 GdkFont *gf; |
| 237 XFontStruct *xf; | 237 XFontStruct *xf; |
| 238 const char *extname; | 238 const char *extname; |
| 239 | 239 |
| 240 TO_EXTERNAL_FORMAT (LISP_STRING, f->name, C_STRING_ALLOCA, extname, Qctext); | 240 extname = LISP_STRING_TO_EXTERNAL (f->name, Qctext); |
| 241 | 241 |
| 242 gf = gdk_font_load (extname); | 242 gf = gdk_font_load (extname); |
| 243 | 243 |
| 244 if (!gf) | 244 if (!gf) |
| 245 { | 245 { |
| 338 { | 338 { |
| 339 if (DEVICE_LIVE_P (XDEVICE (f->device))) | 339 if (DEVICE_LIVE_P (XDEVICE (f->device))) |
| 340 { | 340 { |
| 341 gdk_font_unref (FONT_INSTANCE_GTK_FONT (f)); | 341 gdk_font_unref (FONT_INSTANCE_GTK_FONT (f)); |
| 342 } | 342 } |
| 343 xfree (f->data, void *); | 343 xfree (f->data); |
| 344 f->data = 0; | 344 f->data = 0; |
| 345 } | 345 } |
| 346 } | 346 } |
| 347 | 347 |
| 348 /* Forward declarations for X specific functions at the end of the file */ | 348 /* Forward declarations for X specific functions at the end of the file */ |
| 381 gtk_font_list (Lisp_Object pattern, Lisp_Object UNUSED (device), | 381 gtk_font_list (Lisp_Object pattern, Lisp_Object UNUSED (device), |
| 382 Lisp_Object UNUSED (maxnumber)) | 382 Lisp_Object UNUSED (maxnumber)) |
| 383 { | 383 { |
| 384 const char *patternext; | 384 const char *patternext; |
| 385 | 385 |
| 386 TO_EXTERNAL_FORMAT (LISP_STRING, pattern, C_STRING_ALLOCA, patternext, Qbinary); | 386 patternext = LISP_STRING_TO_EXTERNAL (pattern, Qbinary); |
| 387 | 387 |
| 388 return (__gtk_font_list_internal (patternext)); | 388 return (__gtk_font_list_internal (patternext)); |
| 389 } | 389 } |
| 390 | 390 |
| 391 /* Include the charset support, shared, for the moment, with X11. */ | 391 /* Include the charset support, shared, for the moment, with X11. */ |
| 470 if (valid_font_name_p (dpy, (char*) names->data)) | 470 if (valid_font_name_p (dpy, (char*) names->data)) |
| 471 { | 471 { |
| 472 if (!expandp) | 472 if (!expandp) |
| 473 { | 473 { |
| 474 /* They want the wildcarded version */ | 474 /* They want the wildcarded version */ |
| 475 font_name = build_string ((char*) names->data); | 475 font_name = build_cistring ((char*) names->data); |
| 476 } | 476 } |
| 477 else | 477 else |
| 478 { | 478 { |
| 479 /* Need to expand out */ | 479 /* Need to expand out */ |
| 480 int nnames = 0; | 480 int nnames = 0; |
| 481 char **x_font_names = 0; | 481 char **x_font_names = 0; |
| 482 | 482 |
| 483 x_font_names = XListFonts (dpy, (char*) names->data, 1, &nnames); | 483 x_font_names = XListFonts (dpy, (char*) names->data, 1, &nnames); |
| 484 if (x_font_names) | 484 if (x_font_names) |
| 485 { | 485 { |
| 486 font_name = build_string (x_font_names[0]); | 486 font_name = build_cistring (x_font_names[0]); |
| 487 XFreeFontNames (x_font_names); | 487 XFreeFontNames (x_font_names); |
| 488 } | 488 } |
| 489 } | 489 } |
| 490 break; | 490 break; |
| 491 } | 491 } |
| 501 int count = 0; | 501 int count = 0; |
| 502 Lisp_Object result = Qnil; | 502 Lisp_Object result = Qnil; |
| 503 | 503 |
| 504 names = XListFonts (GDK_DISPLAY (), pattern, MAX_FONT_COUNT, &count); | 504 names = XListFonts (GDK_DISPLAY (), pattern, MAX_FONT_COUNT, &count); |
| 505 while (count--) | 505 while (count--) |
| 506 result = Fcons (build_ext_string (names [count], Qbinary), result); | 506 result = Fcons (build_extstring (names [count], Qbinary), result); |
| 507 if (names) | 507 if (names) |
| 508 XFreeFontNames (names); | 508 XFreeFontNames (names); |
| 509 | 509 |
| 510 return result; | 510 return result; |
| 511 } | 511 } |
