comparison src/device-x.c @ 14:9ee227acff29 r19-15b90

Import from CVS: tag r19-15b90
author cvs
date Mon, 13 Aug 2007 08:48:42 +0200
parents 27bc7f280385
children 859a2309aef8
comparison
equal deleted inserted replaced
13:13c6d0aaafe5 14:9ee227acff29
225 allocate_x_device_struct (d); 225 allocate_x_device_struct (d);
226 226
227 make_argc_argv (Vx_initial_argv_list, &argc, &argv); 227 make_argc_argv (Vx_initial_argv_list, &argc, &argv);
228 228
229 if (STRINGP (Vx_emacs_application_class) && 229 if (STRINGP (Vx_emacs_application_class) &&
230 string_length (XSTRING (Vx_emacs_application_class)) > 0) 230 XSTRING_LENGTH (Vx_emacs_application_class) > 0)
231 GET_C_STRING_CTEXT_DATA_ALLOCA (Vx_emacs_application_class, app_class); 231 GET_C_STRING_CTEXT_DATA_ALLOCA (Vx_emacs_application_class, app_class);
232 else 232 else
233 app_class = "Emacs"; 233 app_class = "Emacs";
234 234
235 GET_C_STRING_CTEXT_DATA_ALLOCA (display, disp_name); 235 GET_C_STRING_CTEXT_DATA_ALLOCA (display, disp_name);
255 255
256 /* We're going to modify the string in-place, so be a nice XEmacs */ 256 /* We're going to modify the string in-place, so be a nice XEmacs */
257 DEVICE_NAME (d) = Fcopy_sequence (DEVICE_NAME (d)); 257 DEVICE_NAME (d) = Fcopy_sequence (DEVICE_NAME (d));
258 /* colons and periods can't appear in individual elements of resource 258 /* colons and periods can't appear in individual elements of resource
259 strings */ 259 strings */
260 validify_resource_string ((char *) string_data (XSTRING (DEVICE_NAME (d)))); 260 validify_resource_string ((char *) XSTRING_DATA (DEVICE_NAME (d)));
261 DEVICE_XT_APP_SHELL (d) = XtAppCreateShell (NULL, app_class, 261 DEVICE_XT_APP_SHELL (d) = XtAppCreateShell (NULL, app_class,
262 applicationShellWidgetClass, 262 applicationShellWidgetClass,
263 dpy, NULL, 0); 263 dpy, NULL, 0);
264 264
265 265
517 } 517 }
518 #endif /* EXTERNAL_WIDGET */ 518 #endif /* EXTERNAL_WIDGET */
519 519
520 stderr_out ("\n%s: ", 520 stderr_out ("\n%s: ",
521 (STRINGP (Vinvocation_name) 521 (STRINGP (Vinvocation_name)
522 ? (char *) string_data (XSTRING (Vinvocation_name)) 522 ? (char *) XSTRING_DATA (Vinvocation_name)
523 : "xemacs")); 523 : "xemacs"));
524 XmuPrintDefaultErrorMessage (disp, event, stderr); 524 XmuPrintDefaultErrorMessage (disp, event, stderr);
525 } 525 }
526 return 0; 526 return 0;
527 } 527 }
585 { 585 {
586 /* We're going down. */ 586 /* We're going down. */
587 stderr_out 587 stderr_out
588 ("\n%s: Fatal I/O Error %d (%s) on display connection \"%s\"\n", 588 ("\n%s: Fatal I/O Error %d (%s) on display connection \"%s\"\n",
589 (STRINGP (Vinvocation_name) ? 589 (STRINGP (Vinvocation_name) ?
590 (char *) string_data (XSTRING (Vinvocation_name)) : "xemacs"), 590 (char *) XSTRING_DATA (Vinvocation_name) : "xemacs"),
591 errno, strerror (errno), DisplayString (disp)); 591 errno, strerror (errno), DisplayString (disp));
592 stderr_out 592 stderr_out
593 (" after %lu requests (%lu known processed) with %d events remaining.\n", 593 (" after %lu requests (%lu known processed) with %d events remaining.\n",
594 NextRequest (disp) - 1, LastKnownRequestProcessed (disp), 594 NextRequest (disp) - 1, LastKnownRequestProcessed (disp),
595 QLength (disp)); 595 QLength (disp));
778 return; 778 return;
779 if (BUFFERP (locale)) 779 if (BUFFERP (locale))
780 { 780 {
781 strcat (name_out, ".buffer."); 781 strcat (name_out, ".buffer.");
782 /* we know buffer is live; otherwise we got an error above. */ 782 /* we know buffer is live; otherwise we got an error above. */
783 strcat (name_out, 783 strcat (name_out, (CONST char *) XSTRING_DATA (Fbuffer_name (locale)));
784 (CONST char *) string_data (XSTRING (Fbuffer_name (locale))));
785 strcat (class_out, ".EmacsLocaleType.EmacsBuffer"); 784 strcat (class_out, ".EmacsLocaleType.EmacsBuffer");
786 } 785 }
787 else if (FRAMEP (locale)) 786 else if (FRAMEP (locale))
788 { 787 {
789 strcat (name_out, ".frame."); 788 strcat (name_out, ".frame.");
790 /* we know frame is live; otherwise we got an error above. */ 789 /* we know frame is live; otherwise we got an error above. */
791 strcat (name_out, 790 strcat (name_out, (CONST char *) XSTRING_DATA (Fframe_name (locale)));
792 (CONST char *) string_data (XSTRING (Fframe_name (locale))));
793 strcat (class_out, ".EmacsLocaleType.EmacsFrame"); 791 strcat (class_out, ".EmacsLocaleType.EmacsFrame");
794 } 792 }
795 else 793 else
796 { 794 {
797 assert (DEVICEP (locale)); 795 assert (DEVICEP (locale));
798 strcat (name_out, ".device."); 796 strcat (name_out, ".device.");
799 /* we know device is live; otherwise we got an error above. */ 797 /* we know device is live; otherwise we got an error above. */
800 strcat (name_out, 798 strcat (name_out, (CONST char *) XSTRING_DATA (Fdevice_name (locale)));
801 (CONST char *) string_data (XSTRING (Fdevice_name (locale))));
802 strcat (class_out, ".EmacsLocaleType.EmacsDevice"); 799 strcat (class_out, ".EmacsLocaleType.EmacsDevice");
803 } 800 }
804 return; 801 return;
805 } 802 }
806 803
915 return Qnil; 912 return Qnil;
916 913
917 db = XtDatabase (display); 914 db = XtDatabase (display);
918 915
919 strcat (name_string, "."); 916 strcat (name_string, ".");
920 strcat (name_string, (CONST char *) string_data (XSTRING (name))); 917 strcat (name_string, (CONST char *) XSTRING_DATA (name));
921 strcat (class_string, "."); 918 strcat (class_string, ".");
922 strcat (class_string, (CONST char *) string_data (XSTRING (class))); 919 strcat (class_string, (CONST char *) XSTRING_DATA (class));
923 920
924 { 921 {
925 XrmValue xrm_value; 922 XrmValue xrm_value;
926 XrmName namelist[100]; 923 XrmName namelist[100];
927 XrmClass classlist[100]; 924 XrmClass classlist[100];
1022 { 1019 {
1023 struct device *d = decode_device (device); 1020 struct device *d = decode_device (device);
1024 char *str, *colon_pos; 1021 char *str, *colon_pos;
1025 1022
1026 CHECK_STRING (resource_line); 1023 CHECK_STRING (resource_line);
1027 str = (char *) string_data (XSTRING (resource_line)); 1024 str = (char *) XSTRING_DATA (resource_line);
1028 if (!(colon_pos = strchr (str, ':')) || strchr (str, '\n')) 1025 if (!(colon_pos = strchr (str, ':')) || strchr (str, '\n'))
1029 invalid: 1026 invalid:
1030 signal_simple_error ("Invalid resource line", resource_line); 1027 signal_simple_error ("Invalid resource line", resource_line);
1031 if (strspn (str, 1028 if (strspn (str,
1032 /* Only the following chars are allowed before the colon */ 1029 /* Only the following chars are allowed before the colon */