comparison src/macterm.c @ 53475:283b5fbf4d02

(emacs_options, x_initialized, same_x_server): Remove unused (and duplicated) definitions.
author Andreas Schwab <schwab@suse.de>
date Fri, 02 Jan 2004 22:17:07 +0000
parents bac3029f6282
children 862b91168878 c16b10dde3f2
comparison
equal deleted inserted replaced
53474:dc7da3850335 53475:283b5fbf4d02
1 /* Implementation of GUI terminal on the Mac OS. 1 /* Implementation of GUI terminal on the Mac OS.
2 Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. 2 Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
3 3
4 This file is part of GNU Emacs. 4 This file is part of GNU Emacs.
5 5
6 GNU Emacs is free software; you can redistribute it and/or modify 6 GNU Emacs is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
6370 } 6370 }
6371 } 6371 }
6372 6372
6373 6373
6374 6374
6375 /***********************************************************************
6376 Initialization
6377 ***********************************************************************/
6378
6379 #ifdef USE_X_TOOLKIT
6380 static XrmOptionDescRec emacs_options[] = {
6381 {"-geometry", ".geometry", XrmoptionSepArg, NULL},
6382 {"-iconic", ".iconic", XrmoptionNoArg, (XtPointer) "yes"},
6383
6384 {"-internal-border-width", "*EmacsScreen.internalBorderWidth",
6385 XrmoptionSepArg, NULL},
6386 {"-ib", "*EmacsScreen.internalBorderWidth", XrmoptionSepArg, NULL},
6387
6388 {"-T", "*EmacsShell.title", XrmoptionSepArg, (XtPointer) NULL},
6389 {"-wn", "*EmacsShell.title", XrmoptionSepArg, (XtPointer) NULL},
6390 {"-title", "*EmacsShell.title", XrmoptionSepArg, (XtPointer) NULL},
6391 {"-iconname", "*EmacsShell.iconName", XrmoptionSepArg, (XtPointer) NULL},
6392 {"-in", "*EmacsShell.iconName", XrmoptionSepArg, (XtPointer) NULL},
6393 {"-mc", "*pointerColor", XrmoptionSepArg, (XtPointer) NULL},
6394 {"-cr", "*cursorColor", XrmoptionSepArg, (XtPointer) NULL}
6395 };
6396 #endif /* USE_X_TOOLKIT */
6397
6398 static int x_initialized;
6399
6400 #ifdef MULTI_KBOARD
6401 /* Test whether two display-name strings agree up to the dot that separates
6402 the screen number from the server number. */
6403 static int
6404 same_x_server (name1, name2)
6405 char *name1, *name2;
6406 {
6407 int seen_colon = 0;
6408 unsigned char *system_name = SDATA (Vsystem_name);
6409 int system_name_length = strlen (system_name);
6410 int length_until_period = 0;
6411
6412 while (system_name[length_until_period] != 0
6413 && system_name[length_until_period] != '.')
6414 length_until_period++;
6415
6416 /* Treat `unix' like an empty host name. */
6417 if (! strncmp (name1, "unix:", 5))
6418 name1 += 4;
6419 if (! strncmp (name2, "unix:", 5))
6420 name2 += 4;
6421 /* Treat this host's name like an empty host name. */
6422 if (! strncmp (name1, system_name, system_name_length)
6423 && name1[system_name_length] == ':')
6424 name1 += system_name_length;
6425 if (! strncmp (name2, system_name, system_name_length)
6426 && name2[system_name_length] == ':')
6427 name2 += system_name_length;
6428 /* Treat this host's domainless name like an empty host name. */
6429 if (! strncmp (name1, system_name, length_until_period)
6430 && name1[length_until_period] == ':')
6431 name1 += length_until_period;
6432 if (! strncmp (name2, system_name, length_until_period)
6433 && name2[length_until_period] == ':')
6434 name2 += length_until_period;
6435
6436 for (; *name1 != '\0' && *name1 == *name2; name1++, name2++)
6437 {
6438 if (*name1 == ':')
6439 seen_colon++;
6440 if (seen_colon && *name1 == '.')
6441 return 1;
6442 }
6443 return (seen_colon
6444 && (*name1 == '.' || *name1 == '\0')
6445 && (*name2 == '.' || *name2 == '\0'));
6446 }
6447 #endif
6448
6449
6450 /* The Mac Event loop code */ 6375 /* The Mac Event loop code */
6451 6376
6452 #ifndef MAC_OSX 6377 #ifndef MAC_OSX
6453 #include <Events.h> 6378 #include <Events.h>
6454 #include <Quickdraw.h> 6379 #include <Quickdraw.h>
8328 8253
8329 /*********************************************************************** 8254 /***********************************************************************
8330 Initialization 8255 Initialization
8331 ***********************************************************************/ 8256 ***********************************************************************/
8332 8257
8333 #ifdef USE_X_TOOLKIT
8334 static XrmOptionDescRec emacs_options[] = {
8335 {"-geometry", ".geometry", XrmoptionSepArg, NULL},
8336 {"-iconic", ".iconic", XrmoptionNoArg, (XtPointer) "yes"},
8337
8338 {"-internal-border-width", "*EmacsScreen.internalBorderWidth",
8339 XrmoptionSepArg, NULL},
8340 {"-ib", "*EmacsScreen.internalBorderWidth", XrmoptionSepArg, NULL},
8341
8342 {"-T", "*EmacsShell.title", XrmoptionSepArg, (XtPointer) NULL},
8343 {"-wn", "*EmacsShell.title", XrmoptionSepArg, (XtPointer) NULL},
8344 {"-title", "*EmacsShell.title", XrmoptionSepArg, (XtPointer) NULL},
8345 {"-iconname", "*EmacsShell.iconName", XrmoptionSepArg, (XtPointer) NULL},
8346 {"-in", "*EmacsShell.iconName", XrmoptionSepArg, (XtPointer) NULL},
8347 {"-mc", "*pointerColor", XrmoptionSepArg, (XtPointer) NULL},
8348 {"-cr", "*cursorColor", XrmoptionSepArg, (XtPointer) NULL}
8349 };
8350 #endif /* USE_X_TOOLKIT */
8351
8352 #ifdef MULTI_KBOARD
8353 /* Test whether two display-name strings agree up to the dot that separates
8354 the screen number from the server number. */
8355 static int
8356 same_x_server (name1, name2)
8357 char *name1, *name2;
8358 {
8359 int seen_colon = 0;
8360 unsigned char *system_name = SDATA (Vsystem_name);
8361 int system_name_length = strlen (system_name);
8362 int length_until_period = 0;
8363
8364 while (system_name[length_until_period] != 0
8365 && system_name[length_until_period] != '.')
8366 length_until_period++;
8367
8368 /* Treat `unix' like an empty host name. */
8369 if (! strncmp (name1, "unix:", 5))
8370 name1 += 4;
8371 if (! strncmp (name2, "unix:", 5))
8372 name2 += 4;
8373 /* Treat this host's name like an empty host name. */
8374 if (! strncmp (name1, system_name, system_name_length)
8375 && name1[system_name_length] == ':')
8376 name1 += system_name_length;
8377 if (! strncmp (name2, system_name, system_name_length)
8378 && name2[system_name_length] == ':')
8379 name2 += system_name_length;
8380 /* Treat this host's domainless name like an empty host name. */
8381 if (! strncmp (name1, system_name, length_until_period)
8382 && name1[length_until_period] == ':')
8383 name1 += length_until_period;
8384 if (! strncmp (name2, system_name, length_until_period)
8385 && name2[length_until_period] == ':')
8386 name2 += length_until_period;
8387
8388 for (; *name1 != '\0' && *name1 == *name2; name1++, name2++)
8389 {
8390 if (*name1 == ':')
8391 seen_colon++;
8392 if (seen_colon && *name1 == '.')
8393 return 1;
8394 }
8395 return (seen_colon
8396 && (*name1 == '.' || *name1 == '\0')
8397 && (*name2 == '.' || *name2 == '\0'));
8398 }
8399 #endif
8400
8401 int mac_initialized = 0; 8258 int mac_initialized = 0;
8402 8259
8403 void 8260 void
8404 mac_initialize_display_info () 8261 mac_initialize_display_info ()
8405 { 8262 {