Changeset 1717

Show
Ignore:
Timestamp:
1998年02月17日 01時45分20秒 (11 years ago)
Author:
himi
Message:

Emacs20.3.8 import

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/GNU/src/xrdb.c

    r1693 r1717  
    11/* Deal with the X Resource Manager. 
    2    Copyright (C) 1990, 1993, 1994, 2000, 2001 Free Software Foundation. 
     2   Copyright (C) 1990, 1993, 1994 Free Software Foundation. 
    33 
    44This file is part of GNU Emacs. 
     
    3939#define SYSV 
    4040#endif 
     41#include <unistd.h> 
    4142#endif /* USG5 */ 
    4243 
     
    6263#endif 
    6364 
    64 #include "lisp.h" 
    65  
    6665extern char *getenv (); 
    6766 
     
    9089#define realloc xrealloc 
    9190#define free xfree 
     91extern long *xmalloc (), *xrealloc (); 
    9292#endif 
    9393 
     
    181181    { 
    182182      /* The chunk we're about to stick on the end of result.  */ 
    183       char *next = NULL
     183      char *next
    184184      int next_len; 
    185185 
     
    227227                    return NULL; 
    228228                  } 
    229  
     229                 
    230230                next = lang; 
    231231                next_len = strlen (next); 
    232232                break; 
    233  
     233               
    234234              case 't': 
    235235              case 'c': 
     
    247247          path = (char *) realloc (path, path_size); 
    248248        } 
    249  
     249       
    250250      bcopy (next, path + path_len, next_len); 
    251251      path_len += next_len; 
     
    309309    } 
    310310 
    311   if (ptr == NULL) 
     311  if (ptr == NULL)  
    312312    return "/"; 
    313313 
     
    333333 
    334334/* Find the first element of SEARCH_PATH which exists and is readable, 
    335    after expanding the %-escapes.  Return 0 if we didn't find any, and 
     335   after expanding the %-escapes.  Return 0 if we didn't find any, and  
    336336   the path name of the one we found otherwise.  */ 
    337337 
     
    346346      for (p = s; *p && *p != ':'; p++) 
    347347        ; 
    348  
     348       
    349349      if (p > s) 
    350350        { 
     
    397397     Display *display; 
    398398{ 
     399  XrmDatabase db; 
     400 
    399401  return NULL; 
    400402} 
     
    419421          && ((file = search_magic_path (path, class, "/%L/%N", 0)) 
    420422              || (file = search_magic_path (path, class, "/%N", 0)))) 
    421  
     423       
    422424      /* Check in the home directory.  This is a bit of a hack; let's 
    423425         hope one's home directory doesn't contain any %-escapes.  */ 
     
    521523     char *xrm_string, *myname, *myclass; 
    522524{ 
     525  char *xdefs; 
    523526  XrmDatabase user_database; 
    524527  XrmDatabase rdb; 
    525528  XrmDatabase db; 
    526   char line[256]; 
    527   char *helv = "-*-helvetica-medium-r-*--*-120-*-*-*-*-iso8859-1"; 
    528 #ifdef USE_MOTIF 
    529   char *courier = "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1"; 
    530   extern Lisp_Object Vdouble_click_time; 
    531 #endif 
    532529 
    533530  x_rm_string = XrmStringToQuark (XrmStringType); 
     
    538535#endif 
    539536  rdb = XrmGetStringDatabase (""); 
    540  
    541   /* Add some font defaults.  If the font `helv' doesn't exist, widgets 
    542      will use some other default font.  */ 
    543 #ifdef USE_MOTIF 
    544  
    545   sprintf (line, "%s.pane.background: grey75", myclass); 
    546   XrmPutLineResource (&rdb, line); 
    547   sprintf (line, "%s*fontList: %s", myclass, helv); 
    548   XrmPutLineResource (&rdb, line); 
    549   sprintf (line, "%s*menu*background: grey75", myclass); 
    550   XrmPutLineResource (&rdb, line); 
    551   sprintf (line, "%s*menubar*background: grey75", myclass); 
    552   XrmPutLineResource (&rdb, line); 
    553   sprintf (line, "%s*verticalScrollBar.background: grey75", myclass); 
    554   XrmPutLineResource (&rdb, line); 
    555   sprintf (line, "%s*verticalScrollBar.troughColor: grey75", myclass); 
    556   XrmPutLineResource (&rdb, line); 
    557   sprintf (line, "%s.dialog*.background: grey75", myclass); 
    558   XrmPutLineResource (&rdb, line); 
    559   sprintf (line, "%s*fsb.Text.background: white", myclass); 
    560   XrmPutLineResource (&rdb, line); 
    561   sprintf (line, "%s*fsb.FilterText.background: white", myclass); 
    562   XrmPutLineResource (&rdb, line); 
    563   sprintf (line, "%s*fsb*DirList.background: white", myclass); 
    564   XrmPutLineResource (&rdb, line); 
    565   sprintf (line, "%s*fsb*ItemsList.background: white", myclass); 
    566   XrmPutLineResource (&rdb, line); 
    567   sprintf (line, "%s*fsb*background: grey75", myclass); 
    568   XrmPutLineResource (&rdb, line); 
    569   sprintf (line, "%s*fsb.Text.fontList: %s", myclass, courier); 
    570   XrmPutLineResource (&rdb, line); 
    571   sprintf (line, "%s*fsb.FilterText.fontList: %s", myclass, courier); 
    572   XrmPutLineResource (&rdb, line); 
    573   sprintf (line, "%s*fsb*ItemsList.fontList: %s", myclass, courier); 
    574   XrmPutLineResource (&rdb, line); 
    575   sprintf (line, "%s*fsb*DirList.fontList: %s", myclass, courier); 
    576   XrmPutLineResource (&rdb, line); 
    577  
    578   /* Set double click time of list boxes in the file selection 
    579      dialog from `double-click-time'.  */ 
    580   if (INTEGERP (Vdouble_click_time) && XINT (Vdouble_click_time) > 0) 
    581     { 
    582       sprintf (line, "%s*fsb*DirList.doubleClickInterval: %d", 
    583                myclass, XFASTINT (Vdouble_click_time)); 
    584       XrmPutLineResource (&rdb, line); 
    585       sprintf (line, "%s*fsb*ItemsList.doubleClickInterval: %d", 
    586                myclass, XFASTINT (Vdouble_click_time)); 
    587       XrmPutLineResource (&rdb, line); 
    588     } 
    589  
    590 #else /* not USE_MOTIF */ 
    591  
    592   sprintf (line, "Emacs.dialog*.font: %s", helv); 
    593   XrmPutLineResource (&rdb, line); 
    594   sprintf (line, "Emacs.dialog*.background: grey75"); 
    595   XrmPutLineResource (&rdb, line); 
    596   sprintf (line, "*XlwMenu*font: %s", helv); 
    597   XrmPutLineResource (&rdb, line); 
    598   sprintf (line, "*XlwMenu*background: grey75"); 
    599   XrmPutLineResource (&rdb, line); 
    600   sprintf (line, "Emacs*verticalScrollBar.background: grey75"); 
    601   XrmPutLineResource (&rdb, line); 
    602  
    603 #endif /* not USE_MOTIF */ 
    604537 
    605538  user_database = get_user_db (display); 
     
    635568  if (db != NULL) 
    636569    XrmMergeDatabases (db, &rdb); 
    637  
     570   
    638571  /* Last, merge in any specification from the command line. */ 
    639572  if (xrm_string != NULL)