comparison src/xfaces.c @ 109555:05e7e7c46ff0

Use const, move declarations to header files. * src/buffer.c (Fset_buffer_multibyte): Remove local extern declaration. * src/character.c (strwidth, parse_str_to_multibyte): Add const. * src/character.h (strwidth, parse_str_to_multibyte): Likewise. * src/charset.c (add_to_log): Remove declaration. * src/composite.c (syms_of_composite): Remove local extern declarations. * src/data.c (Finteractive_form): Use const. * src/dired.c (scmp): Add const. (directory_files_internal): Remove local extern declaration. * src/dispextern.h (add_to_log): Remove declaration. (x_get_arg, x_frame_get_arg, x_frame_get_and_record_arg) (x_frame_get_and_record_arg, x_default_parameter): Add const. * src/dispnew.c: Remove duplicate #include <unistd.h>. (update_window, update_frame_1, init_display): Remove local extern declarations. * src/editfns.c (region_limit, syms_of_editfns): Remove local extern declarations. * src/emacs.c (main): Remove local extern declaration. * src/font.c (Qnormal, QCtype, QCfamily, QCweight, QCslant, QCwidth) (QCheight, QCsize, QCname): Remove declarations. * src/frame.c (x_get_resource_string, x_get_string_resource) (x_get_arg, x_frame_get_arg, x_frame_get_and_record_arg) (x_default_parameter): Use const. * src/image.c (QCwidth, QCheight, QCforeground, QCbackground, QCfile) (QCdata, QCtype, Qcenter): Remove declarations. * src/keyboard.h (do_mouse_tracking): Add declaration. * src/minibuf.c (Qmouse_face): Remove declaration. * src/msdos.c (IT_note_mouse_highlight): Remove local extern declaration. * src/xdisp.c (do_mouse_tracking): Remove declaration. (add_to_log): Use const. * src/xfaces.c (Qmouse_face): Remove declaration. (face_color_gray_p, tty_defined_color, defined_color) (face_color_gray_p, face_color_supported_p). Add const. * src/xfns.c: Include xlwmenu.h when USE_LUCID. (x_defined_color, xic_set_xfontset): Use const. (Fx_hide_tip): Remove local extern declaration. * src/xselect.c (selection_data_to_lisp_data) (x_property_data_to_lisp): * src/xrdb.c (x_get_string_resource, file_p) (x_get_customization_string, magic_file_p, search_magic_path) (get_system_app, get_user_app, x_load_resources, x_get_resource) (x_get_string_resource): Use const. * src/xterm.c (xlwmenu_window_p, xlwmenu_redisplay): Remove declarations. (x_text_icon, x_check_errors, x_connection_closed): Use const. * src/xterm.h (x_get_customization_string, x_load_resources) (x_get_resource, x_text_icon, x_text_icon, x_check_errors) (x_check_errors, x_property_data_to_lisp, defined_color) (xic_set_xfontset, x_defined_color): Use const.
author Dan Nicolaescu <dann@ics.uci.edu>
date Mon, 26 Jul 2010 20:52:35 -0700
parents 2dbdaf17fcfa
children 228a5fa4eda0
comparison
equal deleted inserted replaced
109554:b22b609d1fa7 109555:05e7e7c46ff0
409 Lisp_Object Qforeground_color, Qbackground_color; 409 Lisp_Object Qforeground_color, Qbackground_color;
410 410
411 /* The symbols `face' and `mouse-face' used as text properties. */ 411 /* The symbols `face' and `mouse-face' used as text properties. */
412 412
413 Lisp_Object Qface; 413 Lisp_Object Qface;
414 extern Lisp_Object Qmouse_face;
415 414
416 /* Property for basic faces which other faces cannot inherit. */ 415 /* Property for basic faces which other faces cannot inherit. */
417 416
418 Lisp_Object Qface_no_inherit; 417 Lisp_Object Qface_no_inherit;
419 418
518 int, struct named_merge_point *); 517 int, struct named_merge_point *);
519 static int load_pixmap (struct frame *, Lisp_Object, unsigned *, unsigned *); 518 static int load_pixmap (struct frame *, Lisp_Object, unsigned *, unsigned *);
520 static struct frame *frame_or_selected_frame (Lisp_Object, int); 519 static struct frame *frame_or_selected_frame (Lisp_Object, int);
521 static void load_face_colors (struct frame *, struct face *, Lisp_Object *); 520 static void load_face_colors (struct frame *, struct face *, Lisp_Object *);
522 static void free_face_colors (struct frame *, struct face *); 521 static void free_face_colors (struct frame *, struct face *);
523 static int face_color_gray_p (struct frame *, char *); 522 static int face_color_gray_p (struct frame *, const char *);
524 static struct face *realize_face (struct face_cache *, Lisp_Object *, 523 static struct face *realize_face (struct face_cache *, Lisp_Object *,
525 int); 524 int);
526 static struct face *realize_non_ascii_face (struct frame *, Lisp_Object, 525 static struct face *realize_non_ascii_face (struct frame *, Lisp_Object,
527 struct face *); 526 struct face *);
528 static struct face *realize_x_face (struct face_cache *, Lisp_Object *); 527 static struct face *realize_x_face (struct face_cache *, Lisp_Object *);
1169 } 1168 }
1170 1169
1171 /* A version of defined_color for non-X frames. */ 1170 /* A version of defined_color for non-X frames. */
1172 1171
1173 int 1172 int
1174 tty_defined_color (struct frame *f, char *color_name, XColor *color_def, int alloc) 1173 tty_defined_color (struct frame *f, const char *color_name,
1174 XColor *color_def, int alloc)
1175 { 1175 {
1176 int status = 1; 1176 int status = 1;
1177 1177
1178 /* Defaults. */ 1178 /* Defaults. */
1179 color_def->pixel = FACE_TTY_DEFAULT_COLOR; 1179 color_def->pixel = FACE_TTY_DEFAULT_COLOR;
1204 COLOR_DEF. If ALLOC is nonzero, allocate a new colormap cell. 1204 COLOR_DEF. If ALLOC is nonzero, allocate a new colormap cell.
1205 1205
1206 This does the right thing for any type of frame. */ 1206 This does the right thing for any type of frame. */
1207 1207
1208 int 1208 int
1209 defined_color (struct frame *f, char *color_name, XColor *color_def, int alloc) 1209 defined_color (struct frame *f, const char *color_name, XColor *color_def, int alloc)
1210 { 1210 {
1211 if (!FRAME_WINDOW_P (f)) 1211 if (!FRAME_WINDOW_P (f))
1212 return tty_defined_color (f, color_name, color_def, alloc); 1212 return tty_defined_color (f, color_name, color_def, alloc);
1213 #ifdef HAVE_X_WINDOWS 1213 #ifdef HAVE_X_WINDOWS
1214 else if (FRAME_X_P (f)) 1214 else if (FRAME_X_P (f))
1264 black) on frame F. 1264 black) on frame F.
1265 1265
1266 The criterion implemented here is not a terribly sophisticated one. */ 1266 The criterion implemented here is not a terribly sophisticated one. */
1267 1267
1268 static int 1268 static int
1269 face_color_gray_p (struct frame *f, char *color_name) 1269 face_color_gray_p (struct frame *f, const char *color_name)
1270 { 1270 {
1271 XColor color; 1271 XColor color;
1272 int gray_p; 1272 int gray_p;
1273 1273
1274 if (defined_color (f, color_name, &color, 0)) 1274 if (defined_color (f, color_name, &color, 0))
1291 /* Return non-zero if color COLOR_NAME can be displayed on frame F. 1291 /* Return non-zero if color COLOR_NAME can be displayed on frame F.
1292 BACKGROUND_P non-zero means the color will be used as background 1292 BACKGROUND_P non-zero means the color will be used as background
1293 color. */ 1293 color. */
1294 1294
1295 static int 1295 static int
1296 face_color_supported_p (struct frame *f, char *color_name, int background_p) 1296 face_color_supported_p (struct frame *f, const char *color_name, int background_p)
1297 { 1297 {
1298 Lisp_Object frame; 1298 Lisp_Object frame;
1299 XColor not_used; 1299 XColor not_used;
1300 1300
1301 XSETFRAME (frame, f); 1301 XSETFRAME (frame, f);