From 34269a90ea2087f883f5dc8805894fc4998e4b81 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Tue, 2 Feb 2010 16:21:44 +0000 Subject: Cygwin/X: Update resources file and About dialog Use the configured vendor web address in the About dialog Update resources file: rework About dialog, use 'MS Shell Dlg 2' logical font for all dialogs, add ellipsis to exit option in tray menu as it (may) trigger another dialog. Get short vendor name from xwin-config.h, like other configuration data presented in the About dialog box, rather than creating the PROJECT_NAME define Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- include/xwin-config.h.in | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/xwin-config.h.in b/include/xwin-config.h.in index c8de11073..932f2e861 100644 --- a/include/xwin-config.h.in +++ b/include/xwin-config.h.in @@ -12,7 +12,7 @@ /* Cygwin has /dev/windows for signaling new win32 messages */ #undef HAS_DEVWINDOWS -/* Switch on debug messages */ +/* Switch on debug messages */ #undef CYGDEBUG #undef CYGWINDOWING_DEBUG #undef CYGMULTIWINDOW_DEBUG @@ -22,3 +22,9 @@ /* Do we require our own snprintf? */ #undef NEED_SNPRINTF + +/* Short vendor name */ +#undef XVENDORNAMESHORT + +/* Vendor web address for support */ +#undef __VENDORDWEBSUPPORT__ -- cgit v1.2.3 From 11252ed82e1f361b99e86521ac9314f868bd1a3a Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Mon, 1 Feb 2010 17:11:54 +0000 Subject: Cygwin/X: Look for system.Xwinrc in SYSCONFDIR/X11 Look for system.Xwinrc in SYSCONFDIR/X11 (usually /etc/X11) Rename sample system.Xwinrc file not to have a X11R6 path in it's name Add makefile install rule for system.XWinrc Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- configure.ac | 1 + hw/xwin/Makefile.am | 4 +- hw/xwin/_usr_X11R6_lib_X11_system.XWinrc | 125 ------------------------------- hw/xwin/system.XWinrc | 125 +++++++++++++++++++++++++++++++ hw/xwin/winprefs.c | 4 +- include/xwin-config.h.in | 4 + 6 files changed, 135 insertions(+), 128 deletions(-) delete mode 100644 hw/xwin/_usr_X11R6_lib_X11_system.XWinrc create mode 100644 hw/xwin/system.XWinrc (limited to 'include') diff --git a/configure.ac b/configure.ac index 2546e8352..ef441dad3 100644 --- a/configure.ac +++ b/configure.ac @@ -1825,6 +1825,7 @@ AC_MSG_RESULT([$XWIN]) if test "x$XWIN" = xyes; then PKG_CHECK_EXISTS($WINDOWSWMPROTO, [WINDOWSWM=yes], [WINDOWSWM=no]) + AC_DEFINE_DIR(SYSCONFDIR, sysconfdir, [Location of system.XWinrc]) AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version]) AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support]) AC_CHECK_TOOL(WINDRES, windres) diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am index 3324157c7..8b1897235 100644 --- a/hw/xwin/Makefile.am +++ b/hw/xwin/Makefile.am @@ -190,12 +190,14 @@ XWinrc.$(FILE_MAN_SUFFIX): XWinrc.man EXTRAMANDEFS = -D__logdir__=$(logdir) -D__sysconfdir__=$(sysconfdir) -D__datadir__=$(datadir) +xwinconfigdir = $(sysconfdir)/X11 +xwinconfig_DATA = system.XWinrc + include $(top_srcdir)/cpprules.in EXTRA_DIST = \ $(GLX_EXTRAS) \ $(MAN_SRCS) \ - _usr_X11R6_lib_X11_system.XWinrc \ X.ico \ XWin.rc \ xlaunch/config.cc \ diff --git a/hw/xwin/_usr_X11R6_lib_X11_system.XWinrc b/hw/xwin/_usr_X11R6_lib_X11_system.XWinrc deleted file mode 100644 index 1de6e2ab0..000000000 --- a/hw/xwin/_usr_X11R6_lib_X11_system.XWinrc +++ /dev/null @@ -1,125 +0,0 @@ -# XWin Server Resource File - EXAMPLE -# Earle F. Philhower, III - -# Place in ~/.XWinrc or in /usr/X11R6/lib/X11/system.XWinrc - -# Keywords are case insensitive, comments legal pretty much anywhere -# you can have an end-of-line - -# Comments begin with "#" or "//" and go to the end-of-line - -# Paths to commands are **cygwin** based (i.e. /usr/local/bin/xcalc) - -# Paths to icons are **WINDOWS** based (i.e. c:\windows\icons) - -# Menus are defined as... -# MENU { -# EXEC -# ^^ This command will have any "%display%" -# string replaced with the proper display -# variable (i.e. 127.0.0.1:.0) -# or MENU -# or ALWAYSONTOP -# ^^ Sets the window to display above all others -# or RELOAD -# ^^ Causes ~/.XWinrc or the system.XWinrc file -# to be reloaded and icons and menus regenerated -# or SEPARATOR -# ... -# } - -# Set the taskmar menu with -# ROOTMENU - -# If you want a menu to be applied to all popup window's system menu -# DEFAULTSYSMENU - -# To choose a specific menu for a specific WM_CLASS or WM_NAME use ... -# SYSMENU { -# -# ... -# } - -# When specifying an ICONFILE in the following commands several different -# formats are allowed: -# 1. Name of a regular Windows .ico format file -# (ex: "cygwin.ico", "apple.ico") -# 2. Name and index into a Windows .DLL -# (ex: "c:\windows\system32\shell32.dll,4" gives the default folder icon -# "c:\windows\system32\shell32.dll,5" gives the floppy drive icon) -# 3. Index into XWin.EXE internal ICON resource -# (ex: ",101" is the 1st icon inside XWin.exe) - -# To define where ICO files live (** Windows path**) -# ICONDIRECTORY -# NOTE: If you specify a fully qualified path to an ICON below -# (i.e. "c:\xxx" or "d:\xxxx") -# this ICONDIRECTORY will not be prepended - -# To change the taskbar icon use... -# TRAYICON - -# To define a replacement for the standard X icon for apps w/o specified icons -# DEFAULTICON - -# To define substitute icons on a per-window basis use... -# ICONS { -# -# ... -# } -# In the case where multiple matches occur, the first listed in the ICONS -# section will be chosen. - -# To disable exit confirmation dialog add the line containing SilentExit - -# DEBUG prints out the string to the XWin.log file - -// Below are just some silly menus to demonstrate writing your -// own configuration file. - -// Make some menus... -menu apps { - xterm exec "xterm" - "Emacs" exec "emacs" - notepad exec notepad - xload exec "xload -display %display%" # Comment -} - -menu root { -// Comments fit here, too... - "Reload .XWinrc" RELOAD - "Applications" menu apps - SEParATOR -} - -menu aot { - Separator - "Always on Top" alwaysontop -} - -menu xtermspecial { - "Emacs" exec "emacs" - "Always on Top" alwaysontop - SepArAtor -} - -RootMenu root - -DefaultSysMenu aot atend - -SysMenu { - "xterm" xtermspecial atstart -} - -# IconDirectory "c:\winnt\" - -# DefaultIcon "reinstall.ico" - -# Icons { -# "xterm" "uninstall.ico" -# } - -SilentExit - -DEBUG "Done parsing the configuration file..." - diff --git a/hw/xwin/system.XWinrc b/hw/xwin/system.XWinrc new file mode 100644 index 000000000..37ac00859 --- /dev/null +++ b/hw/xwin/system.XWinrc @@ -0,0 +1,125 @@ +# XWin Server Resource File - EXAMPLE +# Earle F. Philhower, III + +# Place in ~/.XWinrc or in /etc/X11/system.XWinrc + +# Keywords are case insensitive, comments legal pretty much anywhere +# you can have an end-of-line + +# Comments begin with "#" or "//" and go to the end-of-line + +# Paths to commands are **cygwin** based (i.e. /usr/local/bin/xcalc) + +# Paths to icons are **WINDOWS** based (i.e. c:\windows\icons) + +# Menus are defined as... +# MENU { +# EXEC +# ^^ This command will have any "%display%" +# string replaced with the proper display +# variable (i.e. 127.0.0.1:.0) +# or MENU +# or ALWAYSONTOP +# ^^ Sets the window to display above all others +# or RELOAD +# ^^ Causes ~/.XWinrc or the system.XWinrc file +# to be reloaded and icons and menus regenerated +# or SEPARATOR +# ... +# } + +# Set the taskmar menu with +# ROOTMENU + +# If you want a menu to be applied to all popup window's system menu +# DEFAULTSYSMENU + +# To choose a specific menu for a specific WM_CLASS or WM_NAME use ... +# SYSMENU { +# +# ... +# } + +# When specifying an ICONFILE in the following commands several different +# formats are allowed: +# 1. Name of a regular Windows .ico format file +# (ex: "cygwin.ico", "apple.ico") +# 2. Name and index into a Windows .DLL +# (ex: "c:\windows\system32\shell32.dll,4" gives the default folder icon +# "c:\windows\system32\shell32.dll,5" gives the floppy drive icon) +# 3. Index into XWin.EXE internal ICON resource +# (ex: ",101" is the 1st icon inside XWin.exe) + +# To define where ICO files live (** Windows path**) +# ICONDIRECTORY +# NOTE: If you specify a fully qualified path to an ICON below +# (i.e. "c:\xxx" or "d:\xxxx") +# this ICONDIRECTORY will not be prepended + +# To change the taskbar icon use... +# TRAYICON + +# To define a replacement for the standard X icon for apps w/o specified icons +# DEFAULTICON + +# To define substitute icons on a per-window basis use... +# ICONS { +# +# ... +# } +# In the case where multiple matches occur, the first listed in the ICONS +# section will be chosen. + +# To disable exit confirmation dialog add the line containing SilentExit + +# DEBUG prints out the string to the XWin.log file + +// Below are just some silly menus to demonstrate writing your +// own configuration file. + +// Make some menus... +menu apps { + xterm exec "xterm" + "Emacs" exec "emacs" + notepad exec notepad + xload exec "xload -display %display%" # Comment +} + +menu root { +// Comments fit here, too... + "Reload .XWinrc" RELOAD + "Applications" menu apps + SEParATOR +} + +menu aot { + Separator + "Always on Top" alwaysontop +} + +menu xtermspecial { + "Emacs" exec "emacs" + "Always on Top" alwaysontop + SepArAtor +} + +RootMenu root + +DefaultSysMenu aot atend + +SysMenu { + "xterm" xtermspecial atstart +} + +# IconDirectory "c:\winnt\" + +# DefaultIcon "reinstall.ico" + +# Icons { +# "xterm" "uninstall.ico" +# } + +SilentExit + +DEBUG "Done parsing the configuration file..." + diff --git a/hw/xwin/winprefs.c b/hw/xwin/winprefs.c index d5bceb928..93901cac7 100644 --- a/hw/xwin/winprefs.c +++ b/hw/xwin/winprefs.c @@ -723,7 +723,7 @@ winIconIsOverride(unsigned hiconIn) /* - * Try and open ~/.XWinrc and /usr/X11R6/lib/X11/system.XWinrc + * Try and open ~/.XWinrc and system.XWinrc * Load it into prefs structure for use by other functions */ void @@ -763,7 +763,7 @@ LoadPreferences (void) #ifdef RELOCATE_PROJECTROOT snprintf(buffer, sizeof(buffer), "%s\\system.XWinrc", winGetBaseDir()); #else - strncpy(buffer, PROJECTROOT"/lib/X11/system.XWinrc", sizeof(buffer)); + strncpy(buffer, SYSCONFDIR"/X11/system.XWinrc", sizeof(buffer)); #endif buffer[sizeof(buffer)-1] = 0; prefFile = fopen (buffer, "r"); diff --git a/include/xwin-config.h.in b/include/xwin-config.h.in index 932f2e861..21ceb29cf 100644 --- a/include/xwin-config.h.in +++ b/include/xwin-config.h.in @@ -28,3 +28,7 @@ /* Vendor web address for support */ #undef __VENDORDWEBSUPPORT__ + +/* Location of system.XWinrc */ +#undef SYSCONFDIR + -- cgit v1.2.3