comparison src/console-x.c @ 398:74fd4e045ea6 r21-2-29

Import from CVS: tag r21-2-29
author cvs
date Mon, 13 Aug 2007 11:13:30 +0200
parents 8626e4521993
children 697ef44129c6
comparison
equal deleted inserted replaced
397:f4aeb21a5bad 398:74fd4e045ea6
100 } 100 }
101 101
102 static Lisp_Object 102 static Lisp_Object
103 get_display_arg_connection (void) 103 get_display_arg_connection (void)
104 { 104 {
105 CONST char *disp_name; 105 const char *disp_name;
106 106
107 /* If the user didn't explicitly specify a display to use when 107 /* If the user didn't explicitly specify a display to use when
108 they called make-x-device, then we first check to see if a 108 they called make-x-device, then we first check to see if a
109 display was specified on the command line with -display. If 109 display was specified on the command line with -display. If
110 so, we set disp_name to it. Otherwise we use XDisplayName to 110 so, we set disp_name to it. Otherwise we use XDisplayName to
138 } 138 }
139 139
140 /* assert: display_arg is only set if we found the display 140 /* assert: display_arg is only set if we found the display
141 arg earlier so we can't fail to find it now. */ 141 arg earlier so we can't fail to find it now. */
142 assert (disp_name != NULL); 142 assert (disp_name != NULL);
143 conn = build_ext_string (disp_name, FORMAT_CTEXT); 143 conn = build_ext_string (disp_name, Qctext);
144 free_argc_argv (argv); 144 free_argc_argv (argv);
145 return conn; 145 return conn;
146 } 146 }
147 else 147 else
148 return build_ext_string (XDisplayName (0), FORMAT_CTEXT); 148 return build_ext_string (XDisplayName (0), Qctext);
149 } 149 }
150 150
151 /* "semi-canonicalize" means convert to a nicer form for printing, but 151 /* "semi-canonicalize" means convert to a nicer form for printing, but
152 don't completely canonicalize (into some likely ugly form) */ 152 don't completely canonicalize (into some likely ugly form) */
153 153
179 connection = x_device_to_console_connection (connection, errb); 179 connection = x_device_to_console_connection (connection, errb);
180 180
181 /* Check for a couple of standard special cases */ 181 /* Check for a couple of standard special cases */
182 if (string_byte (XSTRING (connection), 0) == ':') 182 if (string_byte (XSTRING (connection), 0) == ':')
183 connection = concat2 (build_string ("localhost"), connection); 183 connection = concat2 (build_string ("localhost"), connection);
184 else if (!strncmp ((CONST char *) XSTRING_DATA (connection), 184 else if (!strncmp ((const char *) XSTRING_DATA (connection),
185 "unix:", 5)) 185 "unix:", 5))
186 connection = concat2 (build_string ("localhost:"), 186 connection = concat2 (build_string ("localhost:"),
187 Fsubstring (connection, make_int (5), Qnil)); 187 Fsubstring (connection, make_int (5), Qnil));
188 188
189 RETURN_UNGCPRO (connection); 189 RETURN_UNGCPRO (connection);
258 RETURN_UNGCPRO (Qunbound); 258 RETURN_UNGCPRO (Qunbound);
259 259
260 split_up_display_spec (connection, &hostname_length, &display_length, 260 split_up_display_spec (connection, &hostname_length, &display_length,
261 &screen_length); 261 &screen_length);
262 262
263 screen_str = build_string ((CONST char *) XSTRING_DATA (connection) 263 screen_str = build_string ((const char *) XSTRING_DATA (connection)
264 + hostname_length + display_length); 264 + hostname_length + display_length);
265 connection = x_canonicalize_console_connection (connection, errb); 265 connection = x_canonicalize_console_connection (connection, errb);
266 266
267 RETURN_UNGCPRO (concat2 (connection, screen_str)); 267 RETURN_UNGCPRO (concat2 (connection, screen_str));
268 } 268 }
278 CONSOLE_HAS_METHOD (x, canonicalize_device_connection); 278 CONSOLE_HAS_METHOD (x, canonicalize_device_connection);
279 CONSOLE_HAS_METHOD (x, device_to_console_connection); 279 CONSOLE_HAS_METHOD (x, device_to_console_connection);
280 CONSOLE_HAS_METHOD (x, initially_selected_for_input); 280 CONSOLE_HAS_METHOD (x, initially_selected_for_input);
281 } 281 }
282 282
283
284 void
285 reinit_console_type_create_x (void)
286 {
287 REINITIALIZE_CONSOLE_TYPE (x);
288 }