comparison src/device-x.c @ 4522:fc7067b7f407

Backout last patch; forgot to specify file.
author Stephen J. Turnbull <stephen@xemacs.org>
date Wed, 29 Oct 2008 03:37:16 +0900
parents 383ab474a241
children 726060ee587c
comparison
equal deleted inserted replaced
4521:383ab474a241 4522:fc7067b7f407
77 /* The application class of Emacs. */ 77 /* The application class of Emacs. */
78 Lisp_Object Vx_emacs_application_class; 78 Lisp_Object Vx_emacs_application_class;
79 79
80 Lisp_Object Vx_initial_argv_list; /* #### ugh! */ 80 Lisp_Object Vx_initial_argv_list; /* #### ugh! */
81 81
82 /* Shut up G++ 4.3. */
83 #define Xrm_ODR(option,resource,type,default) \
84 { (String) option, (String) resource, type, default }
85
86 static XrmOptionDescRec emacs_options[] = 82 static XrmOptionDescRec emacs_options[] =
87 { 83 {
88 Xrm_ODR ("-geometry", ".geometry", XrmoptionSepArg, NULL), 84 {"-geometry", ".geometry", XrmoptionSepArg, NULL},
89 Xrm_ODR ("-iconic", ".iconic", XrmoptionNoArg, (String) "yes"), 85 {"-iconic", ".iconic", XrmoptionNoArg, "yes"},
90 86
91 Xrm_ODR ("-internal-border-width", "*EmacsFrame.internalBorderWidth", XrmoptionSepArg, NULL), 87 {"-internal-border-width", "*EmacsFrame.internalBorderWidth", XrmoptionSepArg, NULL},
92 Xrm_ODR ("-ib", "*EmacsFrame.internalBorderWidth", XrmoptionSepArg, NULL), 88 {"-ib", "*EmacsFrame.internalBorderWidth", XrmoptionSepArg, NULL},
93 Xrm_ODR ("-scrollbar-width", "*EmacsFrame.scrollBarWidth", XrmoptionSepArg, NULL), 89 {"-scrollbar-width", "*EmacsFrame.scrollBarWidth", XrmoptionSepArg, NULL},
94 Xrm_ODR ("-scrollbar-height", "*EmacsFrame.scrollBarHeight", XrmoptionSepArg, NULL), 90 {"-scrollbar-height", "*EmacsFrame.scrollBarHeight", XrmoptionSepArg, NULL},
95 91
96 Xrm_ODR ("-privatecolormap", ".privateColormap", XrmoptionNoArg, (String) "yes"), 92 {"-privatecolormap", ".privateColormap", XrmoptionNoArg, "yes"},
97 Xrm_ODR ("-visual", ".EmacsVisual", XrmoptionSepArg, NULL), 93 {"-visual", ".EmacsVisual", XrmoptionSepArg, NULL},
98 94
99 /* #### Beware! If the type of the shell changes, update this. */ 95 /* #### Beware! If the type of the shell changes, update this. */
100 Xrm_ODR ("-T", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL), 96 {"-T", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL},
101 Xrm_ODR ("-wn", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL), 97 {"-wn", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL},
102 Xrm_ODR ("-title", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL), 98 {"-title", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL},
103 99
104 Xrm_ODR ("-iconname", "*TopLevelEmacsShell.iconName", XrmoptionSepArg, NULL), 100 {"-iconname", "*TopLevelEmacsShell.iconName", XrmoptionSepArg, NULL},
105 Xrm_ODR ("-in", "*TopLevelEmacsShell.iconName", XrmoptionSepArg, NULL), 101 {"-in", "*TopLevelEmacsShell.iconName", XrmoptionSepArg, NULL},
106 Xrm_ODR ("-mc", "*pointerColor", XrmoptionSepArg, NULL), 102 {"-mc", "*pointerColor", XrmoptionSepArg, NULL},
107 Xrm_ODR ("-cr", "*cursorColor", XrmoptionSepArg, NULL), 103 {"-cr", "*cursorColor", XrmoptionSepArg, NULL},
108 Xrm_ODR ("-fontset", "*FontSet", XrmoptionSepArg, NULL), 104 {"-fontset", "*FontSet", XrmoptionSepArg, NULL},
109 }; 105 };
110 106
111 static const struct memory_description x_device_data_description_1 [] = { 107 static const struct memory_description x_device_data_description_1 [] = {
112 { XD_LISP_OBJECT, offsetof (struct x_device, x_keysym_map_hash_table) }, 108 { XD_LISP_OBJECT, offsetof (struct x_device, x_keysym_map_hash_table) },
113 { XD_LISP_OBJECT, offsetof (struct x_device, WM_COMMAND_frame) }, 109 { XD_LISP_OBJECT, offsetof (struct x_device, WM_COMMAND_frame) },
331 return argv[i+1]; 327 return argv[i+1];
332 328
333 if (argc > 0 && argv[0] && *argv[0]) 329 if (argc > 0 && argv[0] && *argv[0])
334 return (ptr = strrchr (argv[0], '/')) ? ++ptr : argv[0]; 330 return (ptr = strrchr (argv[0], '/')) ? ++ptr : argv[0];
335 331
336 return (Extbyte *) "xemacs"; /* shut up g++ 4.3 */ 332 return "xemacs";
337 } 333 }
338 334
339 /* 335 /*
340 * This function figures out whether the user has any resources of the 336 * This function figures out whether the user has any resources of the
341 * form "XEmacs.foo" or "XEmacs*foo". 337 * form "XEmacs.foo" or "XEmacs*foo".
345 * xdefs = XScreenResourceString(ScreenOfDisplay(dpy, scrno)); 341 * xdefs = XScreenResourceString(ScreenOfDisplay(dpy, scrno));
346 */ 342 */
347 static int 343 static int
348 have_xemacs_resources_in_xrdb (Display *dpy) 344 have_xemacs_resources_in_xrdb (Display *dpy)
349 { 345 {
350 const char *xdefs, *key; 346 char *xdefs, *key;
351 int len; 347 int len;
352 348
353 #ifdef INFODOCK 349 #ifdef INFODOCK
354 key = "InfoDock"; 350 key = "InfoDock";
355 #else 351 #else
690 data-directory/app-defaults/$LANG/Emacs. 686 data-directory/app-defaults/$LANG/Emacs.
691 This is in addition to the standard app-defaults files, and 687 This is in addition to the standard app-defaults files, and
692 does not override resources defined elsewhere */ 688 does not override resources defined elsewhere */
693 const Extbyte *data_dir; 689 const Extbyte *data_dir;
694 Extbyte *path; 690 Extbyte *path;
695 const Extbyte *format; 691 Extbyte *format;
696 XrmDatabase db = XtDatabase (dpy); /* #### XtScreenDatabase(dpy) ? */ 692 XrmDatabase db = XtDatabase (dpy); /* #### XtScreenDatabase(dpy) ? */
697 const Extbyte *locale = xstrdup (XrmLocaleOfDatabase (db)); 693 Extbyte *locale = xstrdup (XrmLocaleOfDatabase (db));
698 Extbyte *locale_end; 694 Extbyte *locale_end;
699 695
700 if (STRINGP (Vx_app_defaults_directory) && 696 if (STRINGP (Vx_app_defaults_directory) &&
701 XSTRING_LENGTH (Vx_app_defaults_directory) > 0) 697 XSTRING_LENGTH (Vx_app_defaults_directory) > 0)
702 { 698 {
741 if (!access (path, R_OK)) 737 if (!access (path, R_OK))
742 XrmCombineFileDatabase (path, &db, False); 738 XrmCombineFileDatabase (path, &db, False);
743 } 739 }
744 740
745 no_data_directory: 741 no_data_directory:
746 { 742 xfree (locale, Extbyte*);
747 /* Cast off const for G++ 4.3. */
748 Extbyte *temp = (Extbyte *) locale;
749 xfree (temp, Extbyte*);
750 }
751 } 743 }
752 #endif /* MULE */ 744 #endif /* MULE */
753 745
754 if (NILP (DEVICE_NAME (d))) 746 if (NILP (DEVICE_NAME (d)))
755 DEVICE_NAME (d) = display; 747 DEVICE_NAME (d) = display;
867 859
868 /* #### If we're going to implement X session management, this would 860 /* #### If we're going to implement X session management, this would
869 be the place. Make sure it doesn't conflict with GNOME. */ 861 be the place. Make sure it doesn't conflict with GNOME. */
870 { 862 {
871 Arg al[3]; 863 Arg al[3];
872 Xt_SET_ARG (al[0], XtNvisual, visual); 864 XtSetArg (al[0], XtNvisual, visual);
873 Xt_SET_ARG (al[1], XtNdepth, depth); 865 XtSetArg (al[1], XtNdepth, depth);
874 Xt_SET_ARG (al[2], XtNcolormap, cmap); 866 XtSetArg (al[2], XtNcolormap, cmap);
875 867
876 app_shell = XtAppCreateShell (NULL, app_class, 868 app_shell = XtAppCreateShell (NULL, app_class,
877 applicationShellWidgetClass, 869 applicationShellWidgetClass,
878 dpy, al, countof (al)); 870 dpy, al, countof (al));
879 } 871 }
886 878
887 /* Realize the app_shell so that its window exists for GC creation purposes, 879 /* Realize the app_shell so that its window exists for GC creation purposes,
888 and set it to the size of the root window for child placement purposes */ 880 and set it to the size of the root window for child placement purposes */
889 { 881 {
890 Arg al[5]; 882 Arg al[5];
891 Xt_SET_ARG (al[0], XtNmappedWhenManaged, False); 883 XtSetArg (al[0], XtNmappedWhenManaged, False);
892 Xt_SET_ARG (al[1], XtNx, 0); 884 XtSetArg (al[1], XtNx, 0);
893 Xt_SET_ARG (al[2], XtNy, 0); 885 XtSetArg (al[2], XtNy, 0);
894 Xt_SET_ARG (al[3], XtNwidth, 886 XtSetArg (al[3], XtNwidth, WidthOfScreen (ScreenOfDisplay (dpy, screen)));
895 WidthOfScreen (ScreenOfDisplay (dpy, screen))); 887 XtSetArg (al[4], XtNheight, HeightOfScreen (ScreenOfDisplay (dpy, screen)));
896 Xt_SET_ARG (al[4], XtNheight,
897 HeightOfScreen (ScreenOfDisplay (dpy, screen)));
898 XtSetValues (app_shell, al, countof (al)); 888 XtSetValues (app_shell, al, countof (al));
899 XtRealizeWidget (app_shell); 889 XtRealizeWidget (app_shell);
900 } 890 }
901 891
902 #ifdef HAVE_WMCOMMAND 892 #ifdef HAVE_WMCOMMAND