Mercurial > emacs
comparison src/xsmfns.c @ 109141:fa173b9bd9ce
Fix some bad prototypes and formatting after conversion from K&R declaration.
* lwlib/lwlib-Xaw.c: Include <ctype.h> for isdigit.
(fill_xft_data, set_text): Remove unused variable screen.
(draw_text): Cast bp to FcChar8*.
(find_xft_data): Return 0 if inst or xft_data is not set.
(wm_delete_window): Correct prototype. Initialize widget to 0
and return if widget is still 0 after loop.
* lwlib/xlwmenu.c (XlwMenuSetValues, XlwMenuInitialize): Correct prototype.
(display_menu_item): Remove unused variable gi.
(make_windows_if_needed): Remove unused variable screen.
(XlwMenuRedisplay): Remove unused variable i.
* src/gtkutil.c (xg_get_pixbuf_from_pix_and_mask)
(xg_get_image_for_pixmap, create_dialog)
(xg_get_file_with_selection, xg_get_file_name, update_cl_data)
(menuitem_highlight_callback, make_menu_item)
(xg_create_one_menuitem, create_menus, xg_update_menu_item)
(xg_create_scroll_bar, xg_update_scrollbar_pos)
(xg_set_toolkit_scroll_bar_thumb, xg_tool_bar_button_cb)
(xg_tool_bar_proxy_help_callback, xg_tool_bar_detach_callback)
(xg_tool_bar_attach_callback, xg_tool_bar_help_callback)
(xg_tool_bar_item_expose_callback): Reformat prototype.
(xg_update_menubar): GList *group => GSList *group.
(xg_modify_menubar_widgets): Initialize witem to 0, check witem != 0
before use.
(update_frame_tool_bar): 4:th param to xg_get_image_for_pixmap changed
to GTK_IMAGE (wimage).
* src/xsettings.c (something_changedCB, parse_settings)
(apply_xft_settings): Reformat prototype.
(something_changedCB, init_gconf): Remove unused variable i.
(read_settings): Remove unused variable long_len.
* src/xsmfns.c (SSDATA): New macro.
(smc_save_yourself_CB, x_session_initialize): Use SSDATA for strings
passed to strlen/strcpy/strcat.
(create_client_leader_window): Surround with #ifndef USE_GTK. Cast
7:th arg to XChangeProperty to (unsigned char *)
author | Jan D <jan.h.d@swipnet.se> |
---|---|
date | Mon, 05 Jul 2010 11:17:12 +0200 |
parents | c25c24812fb1 |
children | 750db9f3e6d8 |
comparison
equal
deleted
inserted
replaced
109140:3e48102ba93a | 109141:fa173b9bd9ce |
---|---|
39 #include "sysselect.h" | 39 #include "sysselect.h" |
40 #include "frame.h" | 40 #include "frame.h" |
41 #include "termhooks.h" | 41 #include "termhooks.h" |
42 #include "termopts.h" | 42 #include "termopts.h" |
43 #include "xterm.h" | 43 #include "xterm.h" |
44 | |
45 /* Avoid "differ in sign" warnings */ | |
46 #define SSDATA(x) ((char *) SDATA (x)) | |
44 | 47 |
45 /* The user login name. */ | 48 /* The user login name. */ |
46 | 49 |
47 extern Lisp_Object Vuser_login_name; | 50 extern Lisp_Object Vuser_login_name; |
48 | 51 |
217 props[props_idx] = &prop_ptr[props_idx]; | 220 props[props_idx] = &prop_ptr[props_idx]; |
218 props[props_idx]->name = SmProgram; | 221 props[props_idx]->name = SmProgram; |
219 props[props_idx]->type = SmARRAY8; | 222 props[props_idx]->type = SmARRAY8; |
220 props[props_idx]->num_vals = 1; | 223 props[props_idx]->num_vals = 1; |
221 props[props_idx]->vals = &values[val_idx++]; | 224 props[props_idx]->vals = &values[val_idx++]; |
222 props[props_idx]->vals[0].length = strlen (SDATA (Vinvocation_name)); | 225 props[props_idx]->vals[0].length = strlen (SSDATA (Vinvocation_name)); |
223 props[props_idx]->vals[0].value = SDATA (Vinvocation_name); | 226 props[props_idx]->vals[0].value = SDATA (Vinvocation_name); |
224 ++props_idx; | 227 ++props_idx; |
225 | 228 |
226 /* How to restart Emacs. */ | 229 /* How to restart Emacs. */ |
227 props[props_idx] = &prop_ptr[props_idx]; | 230 props[props_idx] = &prop_ptr[props_idx]; |
261 props[props_idx] = &prop_ptr[props_idx]; | 264 props[props_idx] = &prop_ptr[props_idx]; |
262 props[props_idx]->name = SmUserID; | 265 props[props_idx]->name = SmUserID; |
263 props[props_idx]->type = SmARRAY8; | 266 props[props_idx]->type = SmARRAY8; |
264 props[props_idx]->num_vals = 1; | 267 props[props_idx]->num_vals = 1; |
265 props[props_idx]->vals = &values[val_idx++]; | 268 props[props_idx]->vals = &values[val_idx++]; |
266 props[props_idx]->vals[0].length = strlen (SDATA (Vuser_login_name)); | 269 props[props_idx]->vals[0].length = strlen (SSDATA (Vuser_login_name)); |
267 props[props_idx]->vals[0].value = SDATA (Vuser_login_name); | 270 props[props_idx]->vals[0].value = SDATA (Vuser_login_name); |
268 ++props_idx; | 271 ++props_idx; |
269 | 272 |
270 | 273 |
271 if (cwd) | 274 if (cwd) |
386 add_keyboard_wait_descriptor (ice_fd); | 389 add_keyboard_wait_descriptor (ice_fd); |
387 } | 390 } |
388 | 391 |
389 /* Create the client leader window. */ | 392 /* Create the client leader window. */ |
390 | 393 |
394 #ifndef USE_GTK | |
391 static void | 395 static void |
392 create_client_leader_window (struct x_display_info *dpyinfo, char *client_id) | 396 create_client_leader_window (struct x_display_info *dpyinfo, char *client_id) |
393 { | 397 { |
394 Window w; | 398 Window w; |
395 XClassHint class_hints; | 399 XClassHint class_hints; |
405 XSetClassHint (dpyinfo->display, w, &class_hints); | 409 XSetClassHint (dpyinfo->display, w, &class_hints); |
406 XStoreName (dpyinfo->display, w, class_hints.res_name); | 410 XStoreName (dpyinfo->display, w, class_hints.res_name); |
407 | 411 |
408 sm_id = XInternAtom (dpyinfo->display, "SM_CLIENT_ID", False); | 412 sm_id = XInternAtom (dpyinfo->display, "SM_CLIENT_ID", False); |
409 XChangeProperty (dpyinfo->display, w, sm_id, XA_STRING, 8, PropModeReplace, | 413 XChangeProperty (dpyinfo->display, w, sm_id, XA_STRING, 8, PropModeReplace, |
410 client_id, strlen (client_id)); | 414 (unsigned char *)client_id, strlen (client_id)); |
411 | 415 |
412 dpyinfo->client_leader_window = w; | 416 dpyinfo->client_leader_window = w; |
413 } | 417 } |
418 #endif /* ! USE_GTK */ | |
419 | |
414 | 420 |
415 /* Try to open a connection to the session manager. */ | 421 /* Try to open a connection to the session manager. */ |
416 | 422 |
417 void | 423 void |
418 x_session_initialize (struct x_display_info *dpyinfo) | 424 x_session_initialize (struct x_display_info *dpyinfo) |
427 doing_interact = False; | 433 doing_interact = False; |
428 | 434 |
429 /* Check if we where started by the session manager. If so, we will | 435 /* Check if we where started by the session manager. If so, we will |
430 have a previous id. */ | 436 have a previous id. */ |
431 if (! EQ (Vx_session_previous_id, Qnil) && STRINGP (Vx_session_previous_id)) | 437 if (! EQ (Vx_session_previous_id, Qnil) && STRINGP (Vx_session_previous_id)) |
432 previous_id = SDATA (Vx_session_previous_id); | 438 previous_id = SSDATA (Vx_session_previous_id); |
433 | 439 |
434 /* Construct the path to the Emacs program. */ | 440 /* Construct the path to the Emacs program. */ |
435 if (! EQ (Vinvocation_directory, Qnil)) | 441 if (! EQ (Vinvocation_directory, Qnil)) |
436 name_len += strlen (SDATA (Vinvocation_directory)); | 442 name_len += strlen (SSDATA (Vinvocation_directory)); |
437 name_len += strlen (SDATA (Vinvocation_name)); | 443 name_len += strlen (SSDATA (Vinvocation_name)); |
438 | 444 |
439 /* This malloc will not be freed, but it is only done once, and hopefully | 445 /* This malloc will not be freed, but it is only done once, and hopefully |
440 not very large */ | 446 not very large */ |
441 emacs_program = xmalloc (name_len + 1); | 447 emacs_program = xmalloc (name_len + 1); |
442 emacs_program[0] = '\0'; | 448 emacs_program[0] = '\0'; |
443 | 449 |
444 if (! EQ (Vinvocation_directory, Qnil)) | 450 if (! EQ (Vinvocation_directory, Qnil)) |
445 strcpy (emacs_program, SDATA (Vinvocation_directory)); | 451 strcpy (emacs_program, SSDATA (Vinvocation_directory)); |
446 strcat (emacs_program, SDATA (Vinvocation_name)); | 452 strcat (emacs_program, SSDATA (Vinvocation_name)); |
447 | 453 |
448 /* The SM protocol says all callbacks are mandatory, so set up all | 454 /* The SM protocol says all callbacks are mandatory, so set up all |
449 here and in the mask passed to SmcOpenConnection. */ | 455 here and in the mask passed to SmcOpenConnection. */ |
450 callbacks.save_yourself.callback = smc_save_yourself_CB; | 456 callbacks.save_yourself.callback = smc_save_yourself_CB; |
451 callbacks.save_yourself.client_data = 0; | 457 callbacks.save_yourself.client_data = 0; |