diff options
author | marha <marha@users.sourceforge.net> | 2009-09-09 05:23:48 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-09-09 05:23:48 +0000 |
commit | 81f91c615982e50bb62708201569c33a3cd3d973 (patch) | |
tree | 4f32ecc48a3b7b5e76642f3792338263c53879bd /xorg-server/hw/xwin | |
parent | b571a562410f565af2bdde52d9f7f9a23ffae04f (diff) | |
parent | a915739887477b28d924ecc8417ee107d125bd6c (diff) | |
download | vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.gz vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.bz2 vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.zip |
svn merge https://vcxsrv.svn.sourceforge.net/svnroot/vcxsrv/branches/released .
Diffstat (limited to 'xorg-server/hw/xwin')
47 files changed, 2332 insertions, 1692 deletions
diff --git a/xorg-server/hw/xwin/InitInput.c b/xorg-server/hw/xwin/InitInput.c index 65572ccd8..1e9bcad7a 100644 --- a/xorg-server/hw/xwin/InitInput.c +++ b/xorg-server/hw/xwin/InitInput.c @@ -49,7 +49,8 @@ DISPATCH_PROC(winProcSetSelectionOwner); * Local global declarations */ -CARD32 g_c32LastInputEventTime = 0; +DeviceIntPtr g_pwinPointer; +DeviceIntPtr g_pwinKeyboard; /* @@ -95,34 +96,24 @@ ProcessInputEvents (void) #endif mieqProcessInputEvents (); - miPointerUpdateSprite(inputInfo.pointer); #if 0 ErrorF ("ProcessInputEvents - returning\n"); #endif } + void DDXRingBell(int volume, int pitch, int duration) { /* winKeybdBell is used instead */ return; } -int -TimeSinceLastInputEvent () -{ - if (g_c32LastInputEventTime == 0) - g_c32LastInputEventTime = GetTickCount (); - return GetTickCount () - g_c32LastInputEventTime; -} - /* See Porting Layer Definition - p. 17 */ void InitInput (int argc, char *argv[]) { - DeviceIntPtr pMouse, pKeyboard; - #if CYGDEBUG winDebug ("InitInput\n"); #endif @@ -144,14 +135,14 @@ InitInput (int argc, char *argv[]) } #endif - pMouse = AddInputDevice (serverClient, winMouseProc, TRUE); - pKeyboard = AddInputDevice (serverClient, winKeybdProc, TRUE); + g_pwinPointer = AddInputDevice (serverClient, winMouseProc, TRUE); + g_pwinKeyboard = AddInputDevice (serverClient, winKeybdProc, TRUE); - RegisterPointerDevice (pMouse); - RegisterKeyboardDevice (pKeyboard); + RegisterPointerDevice (g_pwinPointer); + RegisterKeyboardDevice (g_pwinKeyboard); - pMouse->name = strdup("Windows mouse"); - pKeyboard->name = strdup("Windows keyboard"); + g_pwinPointer->name = strdup("Windows mouse"); + g_pwinKeyboard->name = strdup("Windows keyboard"); mieqInit (); diff --git a/xorg-server/hw/xwin/InitOutput.c b/xorg-server/hw/xwin/InitOutput.c index d2c6e27b7..ce5bc5f92 100644 --- a/xorg-server/hw/xwin/InitOutput.c +++ b/xorg-server/hw/xwin/InitOutput.c @@ -43,8 +43,8 @@ from The Open Group. #ifdef __CYGWIN__ #include <mntent.h> #endif -#if defined(XKB) && defined(WIN32) -#include <xkbsrv.h> +#if defined(WIN32) +#include "xkbsrv.h" #endif #ifdef RELOCATE_PROJECTROOT @@ -690,7 +690,6 @@ winFixupPaths (void) winMsg (X_DEFAULT, "Logfile set to \"%s\"\n", g_pszLogFile); } } -#ifdef XKB { static char xkbbasedir[MAX_PATH]; @@ -700,7 +699,6 @@ winFixupPaths (void) XkbBaseDirectory = xkbbasedir; XkbBinDirectory = basedir; } -#endif /* XKB */ #endif /* RELOCATE_PROJECTROOT */ } @@ -877,7 +875,6 @@ winUseMsg (void) "\tSpecify a keyboard device from the configuration file.\n"); #endif -#ifdef XKB ErrorF ("-xkbrules XKBRules\n" "\tEquivalent to XKBRules in XF86Config files.\n"); @@ -894,7 +891,6 @@ winUseMsg (void) ErrorF ("-xkboptions XKBOptions\n" "\tEquivalent to XKBOptions in XF86Config files.\n"); -#endif ErrorF ("-logfile filename\n" "\tWrite logmessages to <filename>.\n"); @@ -1075,7 +1071,7 @@ InitOutput (ScreenInfo *screenInfo, int argc, char *argv[]) */ static Bool -winCheckDisplayNumber () +winCheckDisplayNumber (void) { int nDisp; HANDLE mutex; diff --git a/xorg-server/hw/xwin/Makefile.am b/xorg-server/hw/xwin/Makefile.am index 00d425544..2c7972a7f 100644 --- a/xorg-server/hw/xwin/Makefile.am +++ b/xorg-server/hw/xwin/Makefile.am @@ -34,6 +34,7 @@ SRCS_MULTIWINDOWEXTWM = \ winwin32rootlesswndproc.c \ winwindowswm.c DEFS_MULTIWINDOWEXTWM = -DXWIN_MULTIWINDOWEXTWM +MULTIWINDOWEXTWM_LIBS = $(top_builddir)/miext/rootless/librootless.la endif if XWIN_NATIVEGDI @@ -119,8 +120,11 @@ SRCS = InitInput.c \ winpriv.h \ winresource.h \ winwindow.h \ + XWin.rc \ + $(top_srcdir)/Xext/dpmsstubs.c \ + $(top_srcdir)/Xi/stubs.c \ $(top_srcdir)/mi/miinitext.c \ - $(top_srcdir)/fb/fbcmap.c \ + $(top_srcdir)/fb/fbcmap_mi.c \ $(SRCS_CLIPBOARD) \ $(SRCS_GLX_WINDOWS) \ $(SRCS_MULTIWINDOW) \ @@ -141,15 +145,13 @@ SRCS = InitInput.c \ XWin_SOURCES = $(SRCS) -INCLUDES = -I$(top_srcdir)/miext/rootless \ - -I$(top_srcdir)/miext/rootless/safeAlpha - -XWIN_LIBS = \ - $(top_builddir)/fb/libfb.la \ - $(XSERVER_LIBS) +INCLUDES = -I$(top_srcdir)/miext/rootless XWin_DEPENDENCIES = $(XWIN_LIBS) -XWin_LDADD = $(XWIN_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) +XWin_LDADD = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) + +.rc.o: + $(WINDRES) --use-temp-file -i $< --input-format=rc -o $@ -O coff -DPROJECT_NAME=\"$(VENDOR_NAME_SHORT)\" XWin_LDFLAGS = -mwindows -static @@ -157,23 +159,42 @@ winprefsyacc.h: winprefsyacc.c winprefslex.c: winprefslex.l winprefsyacc.c winprefsyacc.h BUILT_SOURCES = winprefsyacc.h winprefsyacc.c winprefslex.c -CLEANFILES = $(BUILT_SOURCES) +CLEANFILES = $(BUILT_SOURCES) $(appman_DATA) $(fileman_DATA) XWin.man XWinrc.man AM_YFLAGS = -d AM_LFLAGS = -i AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \ - $(XWINMODULES_CFLAGS) - -dist_man1_MANS = XWin.man XWinrc.man + $(XWINMODULES_CFLAGS) \ + -DXFree86Server GLX_EXTRAS = \ - glx/ChangeLog \ glx/glwindows.h \ glx/glwrap.c \ glx/indirect.c +MAN_SRCS = XWin.man.pre XWinrc.man.pre + +appmandir = $(APP_MAN_DIR) +appman_DATA = XWin.$(APP_MAN_SUFFIX) + +filemandir = $(FILE_MAN_DIR) +fileman_DATA = XWinrc.$(FILE_MAN_SUFFIX) + +XWin.$(APP_MAN_SUFFIX): XWin.man + -rm -f XWin.$(APP_MAN_SUFFIX) + $(LN_S) XWin.man XWin.$(APP_MAN_SUFFIX) + +XWinrc.$(FILE_MAN_SUFFIX): XWinrc.man + -rm -f XWinrc.$(FILE_MAN_SUFFIX) + $(LN_S) XWinrc.man XWinrc.$(FILE_MAN_SUFFIX) + +EXTRAMANDEFS = -D__logdir__=$(logdir) -D__sysconfdir__=$(sysconfdir) -D__datadir__=$(datadir) + +include $(top_srcdir)/cpprules.in + EXTRA_DIST = \ $(GLX_EXTRAS) \ + $(MAN_SRCS) \ _usr_X11R6_lib_X11_system.XWinrc \ X-boxed.ico \ X.ico \ @@ -200,4 +221,4 @@ EXTRA_DIST = \ xlaunch/window/wizard.h relink: - rm -f XWin && $(MAKE) XWin + rm -f XWin$(EXEEXT) && $(MAKE) XWin$(EXEEXT) diff --git a/xorg-server/hw/xwin/Makefile.in b/xorg-server/hw/xwin/Makefile.in index 8b92bbdc6..24ec9f509 100644 --- a/xorg-server/hw/xwin/Makefile.in +++ b/xorg-server/hw/xwin/Makefile.in @@ -15,6 +15,11 @@ @SET_MAKE@ +# -*- Makefile -*- +# Rules for generating files using the C pre-processor +# (Replaces CppFileTarget from Imake) + + VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -35,13 +40,16 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = XWin$(EXEEXT) -subdir = hw/xwin -DIST_COMMON = README $(dist_man1_MANS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in ChangeLog winprefslex.c winprefsyacc.c \ +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/cpprules.in winprefslex.c winprefsyacc.c \ winprefsyacc.h +subdir = hw/xwin ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ + $(top_srcdir)/m4/dolt.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/shave.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -51,10 +59,12 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h + $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)" \ + "$(DESTDIR)$(filemandir)" PROGRAMS = $(bin_PROGRAMS) am__XWin_SOURCES_DIST = InitInput.c InitOutput.c winallpriv.c \ winauth.c winblock.c wincmap.c winconfig.c wincreatewnd.c \ @@ -67,8 +77,9 @@ am__XWin_SOURCES_DIST = InitInput.c InitOutput.c winallpriv.c \ winwndproc.c ddraw.h winclipboard.h winconfig.h win.h \ winkeybd.h winkeymap.h winkeynames.h winlayouts.h \ winmessages.h winmsg.h winms.h winmultiwindowclass.h \ - winprefs.h winpriv.h winresource.h winwindow.h \ - $(top_srcdir)/mi/miinitext.c $(top_srcdir)/fb/fbcmap.c \ + winprefs.h winpriv.h winresource.h winwindow.h XWin.rc \ + $(top_srcdir)/Xext/dpmsstubs.c $(top_srcdir)/Xi/stubs.c \ + $(top_srcdir)/mi/miinitext.c $(top_srcdir)/fb/fbcmap_mi.c \ winclipboardinit.c winclipboardtextconv.c winclipboardthread.c \ winclipboardunicode.c winclipboardwndproc.c \ winclipboardwrappers.c winclipboardxevents.c winpriv.c \ @@ -117,14 +128,14 @@ am__objects_9 = InitInput.$(OBJEXT) InitOutput.$(OBJEXT) \ winscrinit.$(OBJEXT) winshaddd.$(OBJEXT) winshadddnl.$(OBJEXT) \ winshadgdi.$(OBJEXT) wintrayicon.$(OBJEXT) \ winvalargs.$(OBJEXT) winwakeup.$(OBJEXT) winwindow.$(OBJEXT) \ - winwndproc.$(OBJEXT) miinitext.$(OBJEXT) fbcmap.$(OBJEXT) \ + winwndproc.$(OBJEXT) XWin.$(OBJEXT) dpmsstubs.$(OBJEXT) \ + stubs.$(OBJEXT) miinitext.$(OBJEXT) fbcmap_mi.$(OBJEXT) \ $(am__objects_1) $(am__objects_2) $(am__objects_3) \ $(am__objects_4) $(am__objects_5) $(am__objects_6) \ $(am__objects_7) $(am__objects_8) am_XWin_OBJECTS = $(am__objects_9) XWin_OBJECTS = $(am_XWin_OBJECTS) am__DEPENDENCIES_1 = -am__DEPENDENCIES_2 = $(top_builddir)/fb/libfb.la $(am__DEPENDENCIES_1) XWin_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(XWin_LDFLAGS) \ $(LDFLAGS) -o $@ @@ -170,9 +181,7 @@ am__nobase_list = $(am__nobase_strip_setup); \ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -man1dir = $(mandir)/man1 -NROFF = nroff -MANS = $(dist_man1_MANS) +DATA = $(appman_DATA) $(fileman_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -181,6 +190,7 @@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ +AM_MAKEFLAGS = @AM_MAKEFLAGS@ APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ APPLE_APPLICATION_ID = @APPLE_APPLICATION_ID@ APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ @@ -201,9 +211,12 @@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CHANGELOG_CMD = @CHANGELOG_CMD@ COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ +CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DARWIN_LIBS = @DARWIN_LIBS@ DBUS_CFLAGS = @DBUS_CFLAGS@ @@ -240,7 +253,9 @@ DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ +DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -249,9 +264,13 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +F77 = @F77@ +FC = @FC@ FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ GL_CFLAGS = @GL_CFLAGS@ @@ -290,12 +309,13 @@ LTCOMPILE = @LTCOMPILE@ LTCXXCOMPILE = @LTCXXCOMPILE@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ +MAIN_LIB = @MAIN_LIB@ +MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MAKE_HTML = @MAKE_HTML@ MAKE_PDF = @MAKE_PDF@ MAKE_PS = @MAKE_PS@ MAKE_TEXT = @MAKE_TEXT@ -MESA_SOURCE = @MESA_SOURCE@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ @@ -315,7 +335,6 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ @@ -325,10 +344,11 @@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PROJECTROOT = @PROJECTROOT@ PS2PDF = @PS2PDF@ +Q = @Q@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ -SED = @SED@ +SED = sed SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -338,11 +358,10 @@ STRIP = @STRIP@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ -VENDOR_MAN_VERSION = @VENDOR_MAN_VERSION@ -VENDOR_NAME = @VENDOR_NAME@ +V = @V@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ -VENDOR_RELEASE = @VENDOR_RELEASE@ VERSION = @VERSION@ +WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ @@ -378,6 +397,7 @@ XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ XORG_SYS_LIBS = @XORG_SYS_LIBS@ XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ XPBPROXY_LIBS = @XPBPROXY_LIBS@ +XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ XSDL_INCS = @XSDL_INCS@ @@ -394,10 +414,7 @@ XVFB_LIBS = @XVFB_LIBS@ XVFB_SYS_LIBS = @XVFB_SYS_LIBS@ XWINMODULES_CFLAGS = @XWINMODULES_CFLAGS@ XWINMODULES_LIBS = @XWINMODULES_LIBS@ -XWIN_LIBS = \ - $(top_builddir)/fb/libfb.la \ - $(XSERVER_LIBS) - +XWIN_LIBS = @XWIN_LIBS@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ YACC = @YACC@ @@ -405,7 +422,6 @@ YFLAGS = @YFLAGS@ __XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ -abi_font = @abi_font@ abi_videodrv = @abi_videodrv@ abi_xinput = @abi_xinput@ abs_builddir = @abs_builddir@ @@ -428,6 +444,7 @@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ +distcleancheck_listfiles = @distcleancheck_listfiles@ docdir = @docdir@ driverdir = @driverdir@ dvidir = @dvidir@ @@ -459,7 +476,9 @@ psdir = @psdir@ sbindir = @sbindir@ sdkdir = @sdkdir@ sharedstatedir = @sharedstatedir@ +shavedir = @shavedir@ srcdir = @srcdir@ +symbol_visibility = @symbol_visibility@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ @@ -493,6 +512,7 @@ top_srcdir = @top_srcdir@ @XWIN_MULTIWINDOWEXTWM_TRUE@ winwindowswm.c @XWIN_MULTIWINDOWEXTWM_TRUE@DEFS_MULTIWINDOWEXTWM = -DXWIN_MULTIWINDOWEXTWM +@XWIN_MULTIWINDOWEXTWM_TRUE@MULTIWINDOWEXTWM_LIBS = $(top_builddir)/miext/rootless/librootless.la @XWIN_NATIVEGDI_TRUE@SRCS_NATIVEGDI = \ @XWIN_NATIVEGDI_TRUE@ winclip.c \ @XWIN_NATIVEGDI_TRUE@ winfillsp.c \ @@ -568,8 +588,11 @@ SRCS = InitInput.c \ winpriv.h \ winresource.h \ winwindow.h \ + XWin.rc \ + $(top_srcdir)/Xext/dpmsstubs.c \ + $(top_srcdir)/Xi/stubs.c \ $(top_srcdir)/mi/miinitext.c \ - $(top_srcdir)/fb/fbcmap.c \ + $(top_srcdir)/fb/fbcmap_mi.c \ $(SRCS_CLIPBOARD) \ $(SRCS_GLX_WINDOWS) \ $(SRCS_MULTIWINDOW) \ @@ -580,28 +603,66 @@ SRCS = InitInput.c \ $(SRCS_XV) XWin_SOURCES = $(SRCS) -INCLUDES = -I$(top_srcdir)/miext/rootless \ - -I$(top_srcdir)/miext/rootless/safeAlpha - +INCLUDES = -I$(top_srcdir)/miext/rootless XWin_DEPENDENCIES = $(XWIN_LIBS) -XWin_LDADD = $(XWIN_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) +XWin_LDADD = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) XWin_LDFLAGS = -mwindows -static BUILT_SOURCES = winprefsyacc.h winprefsyacc.c winprefslex.c -CLEANFILES = $(BUILT_SOURCES) +CLEANFILES = $(BUILT_SOURCES) $(appman_DATA) $(fileman_DATA) XWin.man XWinrc.man AM_YFLAGS = -d AM_LFLAGS = -i AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \ - $(XWINMODULES_CFLAGS) + $(XWINMODULES_CFLAGS) \ + -DXFree86Server -dist_man1_MANS = XWin.man XWinrc.man GLX_EXTRAS = \ - glx/ChangeLog \ glx/glwindows.h \ glx/glwrap.c \ glx/indirect.c +MAN_SRCS = XWin.man.pre XWinrc.man.pre +appmandir = $(APP_MAN_DIR) +appman_DATA = XWin.$(APP_MAN_SUFFIX) +filemandir = $(FILE_MAN_DIR) +fileman_DATA = XWinrc.$(FILE_MAN_SUFFIX) +EXTRAMANDEFS = -D__logdir__=$(logdir) -D__sysconfdir__=$(sysconfdir) -D__datadir__=$(datadir) +SUFFIXES = .pre .man .man.pre + +# Translate XCOMM into pound sign with sed, rather than passing -DXCOMM=XCOMM +# to cpp, because that trick does not work on all ANSI C preprocessors. +# Delete line numbers from the cpp output (-P is not portable, I guess). +# Allow XCOMM to be preceded by whitespace and provide a means of generating +# output lines with trailing backslashes. +# Allow XHASH to always be substituted, even in cases where XCOMM isn't. +CPP_SED_MAGIC = $(SED) -e '/^\# *[0-9][0-9]* *.*$$/d' \ + -e '/^\#line *[0-9][0-9]* *.*$$/d' \ + -e '/^[ ]*XCOMM$$/s/XCOMM/\#/' \ + -e '/^[ ]*XCOMM[^a-zA-Z0-9_]/s/XCOMM/\#/' \ + -e '/^[ ]*XHASH/s/XHASH/\#/' \ + -e '/\@\@$$/s/\@\@$$/\\/' + + +# Strings to replace in man pages +XORGRELSTRING = @PACKAGE_STRING@ +XORGMANNAME = X Version 11 +XSERVERNAME = Xorg +MANDEFS = \ + -D__vendorversion__="\"$(XORGRELSTRING)\" \"$(XORGMANNAME)\"" \ + -D__xorgversion__="\"$(XORGRELSTRING)\" \"$(XORGMANNAME)\"" \ + -D__appmansuffix__=$(APP_MAN_SUFFIX) \ + -D__filemansuffix__=$(FILE_MAN_SUFFIX) \ + -D__libmansuffix__=$(LIB_MAN_SUFFIX) \ + -D__miscmansuffix__=$(MISC_MAN_SUFFIX) \ + -D__drivermansuffix__=$(DRIVER_MAN_SUFFIX) \ + -D__adminmansuffix__=$(ADMIN_MAN_SUFFIX) \ + -D__mandir__=$(mandir) \ + -D__projectroot__=$(prefix) \ + -D__xconfigfile__=$(__XCONFIGFILE__) -D__xconfigdir__=$(XCONFIGDIR) \ + -D__xlogfile__=$(XLOGFILE) -D__xservername__=$(XSERVERNAME) + EXTRA_DIST = \ $(GLX_EXTRAS) \ + $(MAN_SRCS) \ _usr_X11R6_lib_X11_system.XWinrc \ X-boxed.ico \ X.ico \ @@ -631,8 +692,8 @@ all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: -.SUFFIXES: .c .l .lo .o .obj .y -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +.SUFFIXES: .pre .man .man.pre .c .l .lo .o .obj .rc .y +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/cpprules.in $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -717,8 +778,10 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/InitInput.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/InitOutput.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fbcmap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dpmsstubs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fbcmap_mi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miinitext.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stubs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winallpriv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winauth.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winblock.Po@am__quote@ @@ -802,6 +865,34 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +dpmsstubs.o: $(top_srcdir)/Xext/dpmsstubs.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dpmsstubs.o -MD -MP -MF $(DEPDIR)/dpmsstubs.Tpo -c -o dpmsstubs.o `test -f '$(top_srcdir)/Xext/dpmsstubs.c' || echo '$(srcdir)/'`$(top_srcdir)/Xext/dpmsstubs.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dpmsstubs.Tpo $(DEPDIR)/dpmsstubs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/Xext/dpmsstubs.c' object='dpmsstubs.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dpmsstubs.o `test -f '$(top_srcdir)/Xext/dpmsstubs.c' || echo '$(srcdir)/'`$(top_srcdir)/Xext/dpmsstubs.c + +dpmsstubs.obj: $(top_srcdir)/Xext/dpmsstubs.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dpmsstubs.obj -MD -MP -MF $(DEPDIR)/dpmsstubs.Tpo -c -o dpmsstubs.obj `if test -f '$(top_srcdir)/Xext/dpmsstubs.c'; then $(CYGPATH_W) '$(top_srcdir)/Xext/dpmsstubs.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/Xext/dpmsstubs.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dpmsstubs.Tpo $(DEPDIR)/dpmsstubs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/Xext/dpmsstubs.c' object='dpmsstubs.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dpmsstubs.obj `if test -f '$(top_srcdir)/Xext/dpmsstubs.c'; then $(CYGPATH_W) '$(top_srcdir)/Xext/dpmsstubs.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/Xext/dpmsstubs.c'; fi` + +stubs.o: $(top_srcdir)/Xi/stubs.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stubs.o -MD -MP -MF $(DEPDIR)/stubs.Tpo -c -o stubs.o `test -f '$(top_srcdir)/Xi/stubs.c' || echo '$(srcdir)/'`$(top_srcdir)/Xi/stubs.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/stubs.Tpo $(DEPDIR)/stubs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/Xi/stubs.c' object='stubs.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stubs.o `test -f '$(top_srcdir)/Xi/stubs.c' || echo '$(srcdir)/'`$(top_srcdir)/Xi/stubs.c + +stubs.obj: $(top_srcdir)/Xi/stubs.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stubs.obj -MD -MP -MF $(DEPDIR)/stubs.Tpo -c -o stubs.obj `if test -f '$(top_srcdir)/Xi/stubs.c'; then $(CYGPATH_W) '$(top_srcdir)/Xi/stubs.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/Xi/stubs.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/stubs.Tpo $(DEPDIR)/stubs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/Xi/stubs.c' object='stubs.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stubs.obj `if test -f '$(top_srcdir)/Xi/stubs.c'; then $(CYGPATH_W) '$(top_srcdir)/Xi/stubs.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/Xi/stubs.c'; fi` + miinitext.o: $(top_srcdir)/mi/miinitext.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT miinitext.o -MD -MP -MF $(DEPDIR)/miinitext.Tpo -c -o miinitext.o `test -f '$(top_srcdir)/mi/miinitext.c' || echo '$(srcdir)/'`$(top_srcdir)/mi/miinitext.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/miinitext.Tpo $(DEPDIR)/miinitext.Po @@ -816,19 +907,19 @@ miinitext.obj: $(top_srcdir)/mi/miinitext.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o miinitext.obj `if test -f '$(top_srcdir)/mi/miinitext.c'; then $(CYGPATH_W) '$(top_srcdir)/mi/miinitext.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/mi/miinitext.c'; fi` -fbcmap.o: $(top_srcdir)/fb/fbcmap.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fbcmap.o -MD -MP -MF $(DEPDIR)/fbcmap.Tpo -c -o fbcmap.o `test -f '$(top_srcdir)/fb/fbcmap.c' || echo '$(srcdir)/'`$(top_srcdir)/fb/fbcmap.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/fbcmap.Tpo $(DEPDIR)/fbcmap.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/fb/fbcmap.c' object='fbcmap.o' libtool=no @AMDEPBACKSLASH@ +fbcmap_mi.o: $(top_srcdir)/fb/fbcmap_mi.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fbcmap_mi.o -MD -MP -MF $(DEPDIR)/fbcmap_mi.Tpo -c -o fbcmap_mi.o `test -f '$(top_srcdir)/fb/fbcmap_mi.c' || echo '$(srcdir)/'`$(top_srcdir)/fb/fbcmap_mi.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/fbcmap_mi.Tpo $(DEPDIR)/fbcmap_mi.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/fb/fbcmap_mi.c' object='fbcmap_mi.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fbcmap.o `test -f '$(top_srcdir)/fb/fbcmap.c' || echo '$(srcdir)/'`$(top_srcdir)/fb/fbcmap.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fbcmap_mi.o `test -f '$(top_srcdir)/fb/fbcmap_mi.c' || echo '$(srcdir)/'`$(top_srcdir)/fb/fbcmap_mi.c -fbcmap.obj: $(top_srcdir)/fb/fbcmap.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fbcmap.obj -MD -MP -MF $(DEPDIR)/fbcmap.Tpo -c -o fbcmap.obj `if test -f '$(top_srcdir)/fb/fbcmap.c'; then $(CYGPATH_W) '$(top_srcdir)/fb/fbcmap.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/fb/fbcmap.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/fbcmap.Tpo $(DEPDIR)/fbcmap.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/fb/fbcmap.c' object='fbcmap.obj' libtool=no @AMDEPBACKSLASH@ +fbcmap_mi.obj: $(top_srcdir)/fb/fbcmap_mi.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fbcmap_mi.obj -MD -MP -MF $(DEPDIR)/fbcmap_mi.Tpo -c -o fbcmap_mi.obj `if test -f '$(top_srcdir)/fb/fbcmap_mi.c'; then $(CYGPATH_W) '$(top_srcdir)/fb/fbcmap_mi.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/fb/fbcmap_mi.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/fbcmap_mi.Tpo $(DEPDIR)/fbcmap_mi.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/fb/fbcmap_mi.c' object='fbcmap_mi.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fbcmap.obj `if test -f '$(top_srcdir)/fb/fbcmap.c'; then $(CYGPATH_W) '$(top_srcdir)/fb/fbcmap.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/fb/fbcmap.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fbcmap_mi.obj `if test -f '$(top_srcdir)/fb/fbcmap_mi.c'; then $(CYGPATH_W) '$(top_srcdir)/fb/fbcmap_mi.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/fb/fbcmap_mi.c'; fi` .l.c: $(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) @@ -841,40 +932,46 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs -install-man1: $(dist_man1_MANS) +install-appmanDATA: $(appman_DATA) @$(NORMAL_INSTALL) - test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" - @list='$(dist_man1_MANS)'; test -n "$(man1dir)" || exit 0; \ - { for i in $$list; do echo "$$i"; done; \ - } | while read p; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; echo "$$p"; \ - done | \ - sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ - sed 'N;N;s,\n, ,g' | { \ - list=; while read file base inst; do \ - if test "$$base" = "$$inst"; then list="$$list $$file"; else \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ - fi; \ - done; \ - for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + test -z "$(appmandir)" || $(MKDIR_P) "$(DESTDIR)$(appmandir)" + @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ while read files; do \ - test -z "$$files" || { \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ - done; } + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appmandir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \ + done -uninstall-man1: +uninstall-appmanDATA: @$(NORMAL_UNINSTALL) - @list='$(dist_man1_MANS)'; test -n "$(man1dir)" || exit 0; \ - files=`{ for i in $$list; do echo "$$i"; done; \ - } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - test -z "$$files" || { \ - echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } + @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(appmandir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(appmandir)" && rm -f $$files +install-filemanDATA: $(fileman_DATA) + @$(NORMAL_INSTALL) + test -z "$(filemandir)" || $(MKDIR_P) "$(DESTDIR)$(filemandir)" + @list='$(fileman_DATA)'; test -n "$(filemandir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(filemandir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(filemandir)" || exit $$?; \ + done + +uninstall-filemanDATA: + @$(NORMAL_UNINSTALL) + @list='$(fileman_DATA)'; test -n "$(filemandir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(filemandir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(filemandir)" && rm -f $$files ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -929,19 +1026,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) - @list='$(MANS)'; if test -n "$$list"; then \ - list=`for p in $$list; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ - if test -n "$$list" && \ - grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ - echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ - grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ - echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ - echo " typically \`make maintainer-clean' will remove them" >&2; \ - exit 1; \ - else :; fi; \ - else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -974,9 +1058,9 @@ distdir: $(DISTFILES) check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am -all-am: Makefile $(PROGRAMS) $(MANS) +all-am: Makefile $(PROGRAMS) $(DATA) installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)" "$(DESTDIR)$(filemandir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) @@ -1032,7 +1116,7 @@ info: info-am info-am: -install-data-am: install-man +install-data-am: install-appmanDATA install-filemanDATA install-dvi: install-dvi-am @@ -1048,7 +1132,7 @@ install-info: install-info-am install-info-am: -install-man: install-man1 +install-man: install-pdf: install-pdf-am @@ -1078,9 +1162,8 @@ ps: ps-am ps-am: -uninstall-am: uninstall-binPROGRAMS uninstall-man - -uninstall-man: uninstall-man1 +uninstall-am: uninstall-appmanDATA uninstall-binPROGRAMS \ + uninstall-filemanDATA .MAKE: all check install install-am install-strip @@ -1088,23 +1171,41 @@ uninstall-man: uninstall-man1 clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ - install-binPROGRAMS install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ + install-appmanDATA install-binPROGRAMS install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-filemanDATA install-html \ install-html-am install-info install-info-am install-man \ - install-man1 install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-binPROGRAMS uninstall-man \ - uninstall-man1 + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-appmanDATA uninstall-binPROGRAMS \ + uninstall-filemanDATA +.rc.o: + $(WINDRES) --use-temp-file -i $< --input-format=rc -o $@ -O coff -DPROJECT_NAME=\"$(VENDOR_NAME_SHORT)\" + winprefsyacc.h: winprefsyacc.c winprefslex.c: winprefslex.l winprefsyacc.c winprefsyacc.h +XWin.$(APP_MAN_SUFFIX): XWin.man + -rm -f XWin.$(APP_MAN_SUFFIX) + $(LN_S) XWin.man XWin.$(APP_MAN_SUFFIX) + +XWinrc.$(FILE_MAN_SUFFIX): XWinrc.man + -rm -f XWinrc.$(FILE_MAN_SUFFIX) + $(LN_S) XWinrc.man XWinrc.$(FILE_MAN_SUFFIX) + +.pre: + $(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) < $< | $(CPP_SED_MAGIC) > $@ + +.man.pre.man: + $(RAWCPP) $(RAWCPPFLAGS) $(MANDEFS) $(EXTRAMANDEFS) < $< | $(CPP_SED_MAGIC) > $@ + relink: - rm -f XWin && $(MAKE) XWin + rm -f XWin$(EXEEXT) && $(MAKE) XWin$(EXEEXT) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/xorg-server/hw/xwin/XWin.man.pre b/xorg-server/hw/xwin/XWin.man.pre new file mode 100644 index 000000000..9649e2e60 --- /dev/null +++ b/xorg-server/hw/xwin/XWin.man.pre @@ -0,0 +1,288 @@ +.TH XWIN 1 __vendorversion__ +.SH NAME +XWin \- X Server for the Cygwin environment on Microsoft Windows + + +.SH SYNOPSIS +.B XWin +[ options ] ... + + +.SH DESCRIPTION +.I XWin is an X Server for the X Window System on the Cygwin environment +running on Microsoft Windows. + + +.SH MODES +\fIXWin\fP can operate in five different and incompatible modes: +.br +* \fISingle Window\fP: This is the default option. The X server +appears as a single Windows window and all X windows are contained +within this window. This mode requires an external window manager. +.br +* \fINo Decoration\fP: This mode is like single window mode except +that the X server window does not have a title bar or border, thus +maximizing the amount of space available for X windows within the X +server window. This mode requires an external window manager. +.br +* \fIFull Screen\fP: This mode is like single window mode except that +the X server window takes the full screen, covering completely the +Windows desktop. This mode requires an external window manager. +.br +* \fIRootless\fP: The X server works on a window covering the whole +screen but the root window (traditionally covered with an X hatch +pattern) is hidden from view. This mode requires an external window +manager. +.br +* \fIMulti-Window\fP: In this mode \fIXWin\fP uses its own integrated +window manager in order to handle the top-level X windows, in such a +way that they appear as normal Windows windows. +.PP +NOTE: \fIMulti-Window\fP mode will crash if an external window manager +such as \fItwm\fP or \fIfvwm\fP is launched since \fIMulti-Window\fP +uses its own internal window manager; all other modes require an +external window manager in order to move, resize, and perform other +operations on the individual X windows. + + +.SH LOG +As it runs \fIXWin\fP writes messages indicating the most relevant events +to the console +from which it was called and to a log file that by default is located at \fI +__logdir__/XWin.0.log\fP. This file is mainly for debugging purposes. + + +.SH PREFERENCES FILE +On startup \fIXWin\fP looks for the file \fI$HOME/.XWinrc\fP or, if +the previous file does not exist, \fI +__sysconfdir__/X11/system.XWinrc\fP. \fI.XWinrc\fP allows setting +preferences for the following: +.br +1- To include items into the menu associated with the \fIXWin\fP icon +which is in the \fIWindows\fP system tray. This functions in all +modes that have a tray icon. +.br +2- To include items in the menu which is associated with the Windows +window that \fIXWin -multiwindow\fP produces for each top-level X +window. That can be done both for the generic case and for particular +programs. +.br +3- To change the icon that is associated to the Windows window that +\fIXWin -multiwindow\fP produces for each top-level X-window. Again, +that can be done both for the generic case and for particular +programs. +.PP +The format of the \fI.XWinrc\fP file is given in the man page XWinrc(5). + + +.SH OPTIONS +In addition to the normal server options described in the \fIXserver(1)\fP +manual page, \fIXWin\fP accepts the following command line switches, +\fIall\fP of which are optional: +.TP 8 +.B \-clipboard +Enables the integration +between the Cygwin/X clipboard and Windows clipboard. Do not use in +conjunction with the \fIxwinclip\fP program. +.TP 8 +.B "\-clipupdates \fInum_boxes\fP" +Specify an optional threshold, above which the boxes in a shadow +update operation will be collected into a GDI clipping region. The +clipping region is then used to do a single bit block transfer that is +constrained to the updated area by the clipping region. There is some +overhead involved in creating, installing, destroying, and removing +the clipping region, thus there may not be much benefit for a small +number of boxes (less than 10). It is even possible that this +functionality does not provide a benefit at any number of boxes; we +can only determine the usefulness of this feature through testing. +This parameter works in conjunction with engines 1, 2, and 4 (Shadow +GDI, Shadow DirectDraw, and Shadow DirectDraw Non-Locking, +respectively). +.TP 8 +.B "\-emulate3buttons \fItimeout\fP" +Emulate a three button mouse; pressing both buttons within +.I timeout +milliseconds causes an emulated middle button press. The default +.I timeout +is 50 milliseconds. Note that most mice with scroll wheel have middle +button functionality, usually you will need this option only if you have +a two button mouse without scroll wheel. +.TP 8 +.B \-emulatepseudo +Create a depth 8 PseudoColor visual when running in depths 15, 16, 24, +or 32, collectively known as TrueColor depths. + At this date (April 2004) this option is not still operative. +.TP 8 +.B "\-engine \fIengine_type_id\fP" +This option, which is intended for Cygwin/X developers, +overrides the server's automatically supported engine type. This +parameter will be ignored if the specified engine type is not +supported on the current system. The supported engine type ids are 1 +- Shadow GDI, 2 - Shadow DirectDraw, and 4 - Shadow DirectDraw4. +Additionally, there is a barely functional experimental engine type id +16 - Native GDI. +.TP 8 +.B "\-fullscreen [-depth \fIdepth\fP] [-refresh \fIrate_in_Hz\fP]" +Run the server in fullscreen mode, as opposed to the default windowed +mode. +.TP 8 +.B "\-depth \fIdepth\fP" +Specify the color depth, in bits per pixel, to use when running in +fullscreen with a DirectDraw engine. This parameter is ignored if +\fB\-fullscreen\fP is not specified. +.TP 8 +.B "\-refresh \fIrate_in_Hz\fP" +Specify an optional refresh rate to use when running in +fullscreen with a DirectDraw engine. This parameter is ignored if +\fB\-fullscreen\fP is not specified. +.TP 8 +.B \-help +Write a help text to the console and to the log file. +.TP 8 +.B \-ignoreinput +Ignore keyboard and mouse input. This is usually only used for testing +and debugging purposes. +.TP 8 +.B \-[no]keyhook +Enable [disable] a low-level keyboard hook for catching +special key combinations like Alt+Tab and passing them to the X +Server instead of letting \fIWindows\fP handle them. +.TP 8 +.B \-lesspointer +Hide the Windows mouse cursor when the mouse is over any Cygwin/X +window (regardless of whether that window is active or inactive). This +prevents the Windows mouse cursor from being placed overtop of the X +cursor. +.TP 8 +.B "\-logfile \fIFile_Name\fP" +Change the log file from the default located at \fI +__logdir__/XWin.0.log\fP to the one indicated by \fIFile_Name\fP. +.TP 8 +.B "\-logverbose \fIlevel\fP" +Control the degree of verbosity of the log messages with the integer +parameter \fIlevel\fP. For \fIlevel\fP=0 only fatal errors are +reported, for \fIlevel\fP=1 (default) simple information about +configuration is also given, for \fIlevel\fP=2 a detailed log +information (including trace and debug output) is produced. Bigger +values will yield a still more detailed debug output. At this date +(April 2004) the option is still not fully operative; the default +value is 2 and the output is insensitive to the level value. +.TP 8 +.B \-multimonitors +Create a root window that covers all monitors on a system with +multiple monitors. +.TP 8 +.B \-multiwindow +Start the integrated \fIWindowsi\fP-based window manager, which launches each +top-level X window in its own \fIWindows\fP window. Not to be used together +with \fB\-rootless\fP nor \fB\-fullscreen\fP. +.TP 8 +.B \-nodecoration +Do not give the Cygwin/X window a Windows window border, title bar, +etc. This parameter only applies to windowed mode screens, i.e., this +parameter is ignored when the \fB\-fullscreen\fP parameter is specified. +.TP 8 +.B \-nounicodeclipboard +Do not use Unicode clipboard even if NT-based platform. +.TP 8 +.B \-rootless +Run the server in rootless mode. Not to be used with \fB\-multiwindow\fP +nor with \fB\-fullscreen\fP. +.TP 8 +.B "\-screen \fIscreen_number\fP \fIwidth\fP \fIheight\fP" +This parameter may be used to specify the +.I screen_number, +.I height, +and +.I width +of one or several Cygwin/X screens; each Cygwin/X screen will be +opened in its own window. When using multiple screens, be sure not to +duplicate any screen numbers. +.I XWin +default behavior is to create a single screen that is roughly +the size of the current Windows display area. +Screen specific parameters, such as \fB\-fullscreen\fP, can be applied as a +default to all screens by placing those screen specific parameters +before any \fB\-screen\fP parameter. Screen specific parameters placed after +the first \fB\-screen\fP parameter will apply only to the immediately +preceeding \fB\-screen\fP parameter. +.TP 8 +.B \-scrollbars +In windowed mode, allow screens bigger than the Windows desktop. +Moreover, if the window has decorations, one can now resize it. +.TP 8 +.B \-[no]trayicon +Do not create a tray icon. Default is to create one +icon per screen. You can globally disable tray icons with +\fB\-notrayicon\fP, then enable it for specific screens with +\fB\-trayicon\fP for those screens. +.TP 8 +.B \-[no]unixkill +Enable or disable the \fICtrl-Alt-Backspace\fP key combination as a +signal to exit the X Server. The \fICtrl-Alt-Backspace\fP key combination +is disabled by default. +.TP 8 +.B \-[no]winkill +Enable or disable the \fIAlt-F4\fP key combination as a signal to exit the +X Server. +The \fIAlt-F4\fP key combination is enabled by default. +.TP 8 +.B \-swcursor +Disable the usage of the windows cursor and use the X11 software cursor instead. +.TP 8 +.B \-silent-dup-error +If another instance of XWin is found running, exit silently and don't display +the error message. +.TP 8 +.B "\-xkblayout \fIlayout\fP" +.TP 8 +.B "\-xkbmodel \fImodel\fP" +.TP 8 +.B "\-xkboptions \fIoption\fP" +.TP 8 +.B "\-xkbrules \fIrule\fP" +.TP 8 +.B "\-xkbvariant \fIvariant\fp" +These options implement the xkeyboard extension for loading +a particular keyboard map as the X server starts. The behavior is similar +to the \fIsetxkbmap\fP program. The layout data is located at \fI +__datadir__/X11/xkb/\fP. Additional information is found in the +README files therein and in the man page of \fIsetxkbmap\fP. For example +in order to load a German layout for a pc105 keyboard one uses +the options: +.br +.I " \-xkblayout de \-xkbmodel pc105" +.PP +Alternatively one may use the \fIsetxkbmap\fP program after XWin is +running or even the \fIxmodmap\fP program for loading the old-style +keyboard maps. + + +.SH "SEE ALSO" +X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1), XWinrc(__filemansuffix__), setxkbmap(1) + + +.SH BUGS +.I XWin +and this man page still have many limitations. Some of the more obvious +ones are: +.br +- The display mode can not be changed once the X server has started. +.br +- The XWin software is developing rapidly; it is therefore likely that +this man page is not up to date. It is always prudent to +look also at the output of \fIXWin -help\fP and to the Cygwin/X User Guide +at /usr/share/doc/cygwin-x-doc-x.x.x/ug/cygwin-x-ug.xxx in order to +check the options that are operative. + + +.SH AUTHORS +This list is by no means complete, but direct contributors to the +Cygwin/X project include (in alphabetical order by last name): Stuart +Adamson, Michael Bax, Jehan Bing, Lev Bishop, Dr. Peter Busch, Biju G +C, Robert Collins, Nick Crabtree, Early Ehlinger, Christopher Faylor, +John Fortin, Brian Genisio, Fabrizio Gennari, Alexander Gottwald, Ralf +Habacker, Colin Harrison, Matthieu Herrb, Alan Hourihane, Pierre A +Humblet, Harold L Hunt II, Dakshinamurthy Karra, Kensuke Matsuzaki, +Takuma Murakami, Earle F. Philhower III, Benjamin Riefenstahl, Suhaib +Siddiqi, Jack Tanner, and Nicholas Wourms. diff --git a/xorg-server/hw/xwin/XWin.rc b/xorg-server/hw/xwin/XWin.rc index 43bbe4941..2e399634d 100644 --- a/xorg-server/hw/xwin/XWin.rc +++ b/xorg-server/hw/xwin/XWin.rc @@ -73,7 +73,7 @@ CAPTION "Exit VcXsrv?" BEGIN PUSHBUTTON "E&xit", IDOK, 55, 56, 30, 14 DEFPUSHBUTTON "&Cancel", IDCANCEL, 95, 56, 30, 14 - CTEXT "Exiting will close all screens running on this display.", IDC_STATIC, 7, 12, 166, 8 + CTEXT "E&xiting will close all screens running on this display.", IDC_STATIC, 7, 12, 166, 8 CTEXT "No information about connected clients available.", IDC_CLIENTS_CONNECTED, 7, 24, 166, 8 CTEXT "Proceed with shutdown of this display/server?", IDC_STATIC, 7, 36, 166, 8 END diff --git a/xorg-server/hw/xwin/XWinrc.man.pre b/xorg-server/hw/xwin/XWinrc.man.pre new file mode 100644 index 000000000..4fb436ddd --- /dev/null +++ b/xorg-server/hw/xwin/XWinrc.man.pre @@ -0,0 +1,248 @@ +.TH XWIN 5 __vendorversion__ + + +.SH NAME +XWinrc\- XWin Server Resource Configuration File. + + +.SH DESCRIPTION +The X Server for the X Window System on the Cygwin/X environment +running on Microsoft Windows, \fIXWin\fP can be optionally configured +with the \fIXWinrc\fP file. A system-wide configuration file should +be placed in \fI +__sysconfdir__/X11/system.XWinrc\fP, a per-user file +should be put at \fI$HOME/.XWinrc\fP. The \fIsystem.XWinrc\fP file is +read only if no \fI$HOME/.XWinrc\fP exist. +.PP +With the \fI.XWinrc\fP configuration file it is possible to do the +following: +.PP +1- To include items into the menu associated with the \fIXWin\fP icon +which is in the \fIWindows\fP system tray. This feature functions in +all XWin modes that have such tray icon. +.PP +2- To include items into the menu which is associated with the +\fIWindows\fP window that \fIXWin -multiwindow\fP produces for each +top-level X-window. That can be done both for the generic case and +for particular programs. +.PP +3- To change the icon that is associated to the \fIWindows\fP window +that \fIXWin -multiwindow\fP produces for each top-level X-window. +Again, that can be done both for the generic case and for particular +programs. The new icons associated should be \fIWindows\fP format +icons \fI.ico\fP. +.PP +4- To change the style that is associated to the \fIWindows\fP window +that \fI-multiwindow\fP produces for each top-level X window. Again, +that can be done both for the generic case and for particular programs. + + +.SH FILE FORMAT +.B Keywords +are case insensitive, but in this document they will be written +completely capitalized. +.PP +.B Comments +are legal pretty much anywhere you can have an end-of-line; they +begin with "#" or "//" and go to the end-of-line. +.PP +Quote marks in strings are optional unless the string has included spaces, +or could be parsed, ambiguously, as a misplaced keyword. +.PP +There are four kinds of instructions: miscellaneous, menu, icon and style. + + +.SH Miscellaneous instruction +.TP 8 +.B DEBUG \fIString\fP +The \fIString\fP is printed to the XWin log file. + +.TP 8 +.B TRAYICON \fIicon-specifier\fB +The \fBTRAYICON\fP keyword changes the icon \fIXWin\fP displays in the +system tray area. + +.TP 8 +.B SILENTEXIT +The \fBSILENTEXIT\fP keyword, which takes no parameters, disables the +exit confirmation dialog. + + +.SH Menu instructions +.TP 8 +.B MENU \fIMenu_Name\fP { +.br +.B \fIMenu_Item_Line\fP +.br +.B \fIMenu_Item_Line\fP +.br +.B \fI...\fP +.br +.B } +.br +This instruction defines a menu and asigns a \fIMenu_Name\fP to it. +\fIMenu_Item_Line\fP are lines of any of the following types: +.TP 8 +.B \t SEPARATOR +.TP 8 +.B \t \fIItem_Label\fP EXEC \fICommand\fP +.TP 8 +.B \t \fIItem_Label\fP MENU \fIpreviously-defined-menu-name\fP +.TP 8 +.B \t \fIItem_Label\fP ALWAYSONTOP +.TP 8 +.B \t \fIItem_Label\fP RELOAD +.br +The \fIItem_Label\fP is the string that is written in the menu item. +.br +\fICommand\fP is a string with the command that will be executed by /bin/sh. +Here paths should be \fICYGWIN\fP style (e.g. /usr/local/bin/myprogram). +A string "%display%" appearing in the \fICommand\fP will be replaced +with the proper display variable (i.e. 127.0.0.1:<display>.0). +.br +\fBALWAYSONTOP\fP sets the window to which the menu is associated to +display above all others. +.br +\fBRELOAD\fP causes the XWinrc file to be reloaded and icons and menus +regenerated. +.TP 8 +.B ROOTMENU \fIpreviously-defined-menu-name\fP +Includes the items in the indicated menu into the menu associated with +\fIXWin\fP that appears in the system tray. +.TP 8 +.B DEFAULTSYSMENU \fIpreviously-defined-menu-name\fP ATSTART|ATEND +Includes the items in the indicated menu into the menu associated with +generic top-level X-Windows in the \fIXWin\fP \fImultiwindow\fP mode. The +keywords \fBATSTART\fP and \fBATEND\fP indicate if such items should be +included at the start or at the end of the menu. +.TP 8 +.B SYSMENU { + \fIclass-or-name-of-window\fP \fIdefined-menu-name\fP \fBATSTART|ATEND\fP +.br + \fI...\fP +.br + \fB}\fP +.br +Associates a specific menu to a specified window class or name +in \fI-multiwindow\fP mode. The keywords ATSTART or ATEND indicate if +such items should be included at the start or at the end of the menu. + + +.SH Icon Instructions +When specifying an \fIicon-file\fP in the following commands several different formats are allowed: +.br +\fB"NAME.ICO"\fP\fI of an .ico format file\fP +.br +\t \t ("cygwin.ico", "apple.ico") +.br +\fB"NAME.DLL,nn"\fP\fI of a .DLL and icon index\fP +.br +\t \t ("c:\\windows\\system32\\shell32.dll,4" is the default folder icon) +.br +\fB",nnn"\fP\fI index into XWin.EXE internal ICON resources\fP +.br +\t \t (",101" is the 1st icon inside \fIXWin.EXE\fP) +.TP 8 +.B ICONDIRECTORY \fIWindows-path-to-icon-directory\fP +Defines the default directory to search for \ficon-file\fP files. +It should be a \fIWindows\fP style path (e.g. C:\\cygwin\\usr\\local\\icons). +.TP 8 +.B DEFAULTICON \fIicon-file\fP +Defines a replacement for the standard X icon for applications without +specified icons. +.TP 8 +.B ICONS { +.br + \fIclass-or-name-of-window\fP \fIicon-file\fP +.br + \fI...\fP +.br + \fB}\fP +.br +Defines icon replacements windows matching the specified window class or names. +If multiple name or class matches occur for a window, only the first one +will be used. + +.SH Style Instructions +.TP 8 +.B STYLES { +\fIclass-or-name-of-window\fP \fIstyle-keyword-1\fP \fIstyle-keyword-2\fP +.br + \fI...\fP +.br +\fB}\fP + +Associates specific styles to a specified window class or name +in \fI-multiwindow\fP mode. If multiple class or name matches occur, +for a window, only the first one will be used. + +The style keywords indicate the following: + +\fIstyle-keyword-1\fP + +\fBTOPMOST\fP +.br +Open the class or name above all NOTOPMOST Microsoft Windows +.br +\fBMAXIMIZE\fP +.br +Start the class or name fullscreen. +.br +\fBMINIMIZE\fP +.br +Start the class or name iconic. +.br +\fBBOTTOM\fP +.br +Open the class or name below all Windows windows. +.br + +\fIstyle-keyword-2\fP + +\fBNOTITLE\fP +.br +No Windows title bar, for the class or name. +.br +\fBOUTLINE\fP +.br +No Windows title bar and just a thin-line border, for the class or name. +.br +\fBNOFRAME\fP +.br +No Windows title bar or border, for the class or name. + +One keyword in \fIstyle-keyword-1\fP can be used with one keyword in \fIstyle-keyword-2\fP, +or any keyword can be used singly. + + +.SH EXAMPLE +.TP 8 +This example adds an Xterm menu item to the system tray icon +\fBMENU systray { +.br +\t xterm EXEC "xterm -display %display% -sb -sl 999" +.br +\t SEPARATOR +.br +} +.br +ROOTMENU systray +\fP + +.TP 8 +This example makes an oclock window frameless in \fI-multiwindow\fP mode +\fBSTYLES { +.br +\t oclock NOFRAME +.br +} + + + +.SH "SEE ALSO" + XWin(1) + + +.SH AUTHOR +The XWinrc feature of XWin was written primarily by Earle F. Philhower +III. Extended for style configuration by Colin Harrison. diff --git a/xorg-server/hw/xwin/win.h b/xorg-server/hw/xwin/win.h index 36987c095..bd36768ca 100644 --- a/xorg-server/hw/xwin/win.h +++ b/xorg-server/hw/xwin/win.h @@ -58,7 +58,6 @@ # define WM_XBUTTONDBLCLK 525 #endif -#define NEED_EVENTS #define WIN_DEFAULT_BPP 0 #define WIN_DEFAULT_WHITEPIXEL 255 @@ -645,12 +644,13 @@ extern DevPrivateKey g_iGCPrivateKey; extern DevPrivateKey g_iPixmapPrivateKey; extern DevPrivateKey g_iWindowPrivateKey; extern unsigned long g_ulServerGeneration; -extern CARD32 g_c32LastInputEventTime; extern DWORD g_dwEnginesSupported; extern HINSTANCE g_hInstance; extern int g_copyROP[]; extern int g_patternROP[]; extern const char * g_pszQueryHost; +extern DeviceIntPtr g_pwinPointer; +extern DeviceIntPtr g_pwinKeyboard; /* @@ -964,6 +964,11 @@ winKeybdReleaseKeys (void); void winSendKeyEvent (DWORD dwKey, Bool fDown); +BOOL +winCheckKeyPressed(WPARAM wParam, LPARAM lParam); + +void +winFixShiftKeys (int iScanCode); /* * winkeyhook.c @@ -1006,22 +1011,15 @@ int winMouseProc (DeviceIntPtr pDeviceInt, int iState); int -winMouseWheel (ScreenPtr pScreen, int iDeltaZ, int x, int y); +winMouseWheel (ScreenPtr pScreen, int iDeltaZ); void -winMouseButtonsSendEvent (int iEventType, int iButton, int x, int y); - -void winGetPtMouse(HWND hwnd, LPARAM lParam, POINT *ptMouse); -void winGetPtMouseScreen(HWND hwnd, LPARAM lParam, POINT *ptMouse); +winMouseButtonsSendEvent (int iEventType, int iButton); int winMouseButtonsHandle (ScreenPtr pScreen, int iEventType, int iButton, - WPARAM wParam, HWND hwnd, LPARAM lParam); -int -winMouseButtonsHandleScreen (ScreenPtr pScreen, - int iEventType, int iButton, - WPARAM wParam, HWND hwnd, LPARAM lParam); + WPARAM wParam); void winEnqueueMotion(int x, int y); @@ -1227,6 +1225,8 @@ winSetShapeRootless (WindowPtr pWindow); HICON winXIconToHICON (WindowPtr pWin, int iconSize); +void +winSelectIcons(WindowPtr pWin, HICON *pIcon, HICON *pSmallIcon); #ifdef XWIN_MULTIWINDOW /* diff --git a/xorg-server/hw/xwin/winclipboard.h b/xorg-server/hw/xwin/winclipboard.h index 9603b92fe..52675d45b 100644 --- a/xorg-server/hw/xwin/winclipboard.h +++ b/xorg-server/hw/xwin/winclipboard.h @@ -40,7 +40,7 @@ #ifdef __CYGWIN__ #include <sys/select.h> #else -#include "X11/Xwinsock.h" +#include <X11/Xwinsock.h> #define HAS_WINSOCK #endif #include <fcntl.h> @@ -53,29 +53,12 @@ typedef int pid_t; /* X headers */ #include <X11/X.h> #include <X11/Xatom.h> -/* NOTE: For some unknown reason, including Xproto.h solves - * tons of problems with including windows.h. Unknowns reasons - * are usually bad, so someone should investigate this. - */ #include <X11/Xproto.h> -#include "X11/Xutil.h" -#include "X11/Xlocale.h" - -/* Fixups to prevent collisions between Windows and X headers */ -#define ATOM DWORD - -#ifndef __CYGWIN__ -#ifndef sleep -#define sleep(x) Sleep (1000 * (x)) -#endif -#endif +#include <X11/Xutil.h> +#include <X11/Xlocale.h> /* Windows headers */ -#ifndef XFree86Server -#define XFree86Server -#endif -#include <windows.h> -#undef XFree86Server +#include <X11/Xwindows.h> /* Clipboard module constants */ diff --git a/xorg-server/hw/xwin/winclipboardinit.c b/xorg-server/hw/xwin/winclipboardinit.c index 6a0cbaf2c..bec63ac8e 100644 --- a/xorg-server/hw/xwin/winclipboardinit.c +++ b/xorg-server/hw/xwin/winclipboardinit.c @@ -59,7 +59,7 @@ extern HWND g_hwndClipboard; */ Bool -winInitClipboard () +winInitClipboard (void) { ErrorF ("winInitClipboard ()\n"); @@ -90,12 +90,13 @@ winInitClipboard () */ HWND -winClipboardCreateMessagingWindow () +winClipboardCreateMessagingWindow (void) { - WNDCLASS wc; + WNDCLASSEX wc; HWND hwnd; /* Setup our window class */ + wc.cbSize=sizeof(WNDCLASSEX); wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = winClipboardWindowProc; wc.cbClsExtra = 0; @@ -106,7 +107,8 @@ winClipboardCreateMessagingWindow () wc.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH); wc.lpszMenuName = NULL; wc.lpszClassName = WIN_CLIPBOARD_WINDOW_CLASS; - RegisterClass (&wc); + wc.hIconSm = 0; + RegisterClassEx (&wc); /* Create the window */ hwnd = CreateWindowExA (0, /* Extended styles */ diff --git a/xorg-server/hw/xwin/winclipboardthread.c b/xorg-server/hw/xwin/winclipboardthread.c index 6d41cbd3a..b459e81c0 100644 --- a/xorg-server/hw/xwin/winclipboardthread.c +++ b/xorg-server/hw/xwin/winclipboardthread.c @@ -39,6 +39,7 @@ #include <errno.h> #endif #include "X11/Xauth.h" +#include "misc.h" #ifdef _MSC_VER #define snprintf _snprintf diff --git a/xorg-server/hw/xwin/winclipboardwndproc.c b/xorg-server/hw/xwin/winclipboardwndproc.c index 0518e25dd..ad8e7d0a4 100644 --- a/xorg-server/hw/xwin/winclipboardwndproc.c +++ b/xorg-server/hw/xwin/winclipboardwndproc.c @@ -36,9 +36,7 @@ #include <sys/types.h> #include <sys/time.h> #include "winclipboard.h" - -extern void winFixClipboardChain(); - +#include "misc.h" /* * Constants @@ -255,15 +253,20 @@ winClipboardWindowProc (HWND hwnd, UINT message, case WM_DRAWCLIPBOARD: { - static Bool s_fProcessingDrawClipboard = FALSE; static Atom atomClipboard; + static int generation; + static Bool s_fProcessingDrawClipboard = FALSE; Display *pDisplay = g_pClipboardDisplay; Window iWindow = g_iClipboardWindow; int iReturn; winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD: Enter\n"); - if (atomClipboard == None) atomClipboard = XInternAtom (pDisplay, "CLIPBOARD", False); + if (generation != serverGeneration) + { + generation = serverGeneration; + atomClipboard = XInternAtom (pDisplay, "CLIPBOARD", False); + } /* * We've occasionally seen a loop in the clipboard chain. @@ -396,8 +399,8 @@ winClipboardWindowProc (HWND hwnd, UINT message, iWindow, CurrentTime); - if (iReturn == BadAtom || iReturn == BadWindow || - XGetSelectionOwner (pDisplay, atomClipboard) != iWindow) + if (iReturn == BadAtom || iReturn == BadWindow || + XGetSelectionOwner (pDisplay, atomClipboard) != iWindow) { winErrorFVerb (1, "winClipboardWindowProc - WM_DRAWCLIPBOARD - " "Could not reassert ownership of CLIPBOARD\n"); diff --git a/xorg-server/hw/xwin/winclipboardwrappers.c b/xorg-server/hw/xwin/winclipboardwrappers.c index 1e4f910ba..233c0489b 100644 --- a/xorg-server/hw/xwin/winclipboardwrappers.c +++ b/xorg-server/hw/xwin/winclipboardwrappers.c @@ -448,11 +448,9 @@ winProcSetSelectionOwner (ClientPtr client) * an owned to not owned transition was detected, * and we currently own the Win32 clipboard. */ - if (None == stuff->window - && (None == s_iOwners[CLIP_OWN_PRIMARY] - || g_iClipboardWindow == s_iOwners[CLIP_OWN_PRIMARY]) - && (None == s_iOwners[CLIP_OWN_CLIPBOARD] - || g_iClipboardWindow == s_iOwners[CLIP_OWN_CLIPBOARD]) + if (stuff->window == None + && s_iOwners[CLIP_OWN_PRIMARY] == None + && s_iOwners[CLIP_OWN_CLIPBOARD] == None && fOwnedToNotOwned && g_hwndClipboard != NULL && g_hwndClipboard == GetClipboardOwner ()) @@ -469,10 +467,6 @@ winProcSetSelectionOwner (ClientPtr client) EmptyClipboard (); CloseClipboard (); - /* Clear X selection ownership (might still be marked as us owning) */ - s_iOwners[CLIP_OWN_PRIMARY] = None; - s_iOwners[CLIP_OWN_CLIPBOARD] = None; - goto winProcSetSelectionOwner_Done; } diff --git a/xorg-server/hw/xwin/winclipboardxevents.c b/xorg-server/hw/xwin/winclipboardxevents.c index 09bdb7396..1d912936a 100644 --- a/xorg-server/hw/xwin/winclipboardxevents.c +++ b/xorg-server/hw/xwin/winclipboardxevents.c @@ -34,6 +34,7 @@ #include <xwin-config.h> #endif #include "winclipboard.h" +#include "misc.h" /* @@ -53,25 +54,20 @@ winClipboardFlushXEvents (HWND hwnd, Display *pDisplay, Bool fUseUnicode) { - static Atom atomLocalProperty, atomCompoundText; - static Atom atomUTF8String, atomTargets; - - if (atomLocalProperty == None) - atomLocalProperty = XInternAtom (pDisplay, - WIN_LOCAL_PROPERTY, - False); - if (atomUTF8String == None) - atomUTF8String = XInternAtom (pDisplay, - "UTF8_STRING", - False); - if (atomCompoundText == None) - atomCompoundText = XInternAtom (pDisplay, - "COMPOUND_TEXT", - False); - if (atomTargets == None) - atomTargets = XInternAtom (pDisplay, - "TARGETS", - False); + static Atom atomLocalProperty; + static Atom atomCompoundText; + static Atom atomUTF8String; + static Atom atomTargets; + static int generation; + + if (generation != serverGeneration) + { + generation = serverGeneration; + atomLocalProperty = XInternAtom (pDisplay, WIN_LOCAL_PROPERTY, False); + atomUTF8String = XInternAtom (pDisplay, "UTF8_STRING", False); + atomCompoundText = XInternAtom (pDisplay, "COMPOUND_TEXT", False); + atomTargets = XInternAtom (pDisplay, "TARGETS", False); + } /* Process all pending events */ while (XPending (pDisplay)) @@ -196,8 +192,13 @@ winClipboardFlushXEvents (HWND hwnd, if (fUseUnicode && !IsClipboardFormatAvailable (CF_UNICODETEXT)) { - ErrorF ("winClipboardFlushXEvents - CF_UNICODETEXT is not " - "available from Win32 clipboard. Aborting.\n"); + static int count; /* Hack to stop acroread spamming the log */ + static HWND lasthwnd; /* I've not seen any other client get here repeatedly? */ + if (hwnd != lasthwnd) count = 0; + count++; + if (count < 6) ErrorF ("winClipboardFlushXEvents - CF_UNICODETEXT is not " + "available from Win32 clipboard. Aborting %d.\n", count); + lasthwnd = hwnd; /* Abort */ XUnlockDisplay (pDisplay); diff --git a/xorg-server/hw/xwin/winconfig.c b/xorg-server/hw/xwin/winconfig.c index 38966bf96..3e1908c90 100644 --- a/xorg-server/hw/xwin/winconfig.c +++ b/xorg-server/hw/xwin/winconfig.c @@ -36,12 +36,7 @@ #include "winmsg.h" #include "globals.h" -#ifdef XKB -#ifndef XKB_IN_SERVER -#define XKB_IN_SERVER -#endif -#include <xkbsrv.h> -#endif +#include "xkbsrv.h" #ifdef XWIN_XF86CONFIG #ifndef CONFIGPATH @@ -67,15 +62,11 @@ WinCmdlineRec g_cmdline = { #ifdef XWIN_XF86CONFIG NULL, /* keyboard */ #endif -#ifdef XKB - FALSE, /* noXkbExtension */ - NULL, /* xkbMap */ NULL, /* xkbRules */ NULL, /* xkbModel */ NULL, /* xkbLayout */ NULL, /* xkbVariant */ NULL, /* xkbOptions */ -#endif NULL, /* screenname */ NULL, /* mousename */ FALSE, /* emulate3Buttons */ @@ -87,24 +78,14 @@ winInfoRec g_winInfo = { 0, /* leds */ 500, /* delay */ 30 /* rate */ -#ifdef XKB } , { /* xkb */ - FALSE, /* disable */ NULL, /* rules */ NULL, /* model */ NULL, /* layout */ NULL, /* variant */ NULL, /* options */ - NULL, /* initialMap */ - NULL, /* keymap */ - NULL, /* types */ - NULL, /* compat */ - NULL, /* keycodes */ - NULL, /* symbols */ - NULL /* geometry */ -#endif } , { @@ -228,11 +209,9 @@ winReadConfigfile () Bool winConfigKeyboard (DeviceIntPtr pDevice) { -#ifdef XKB char layoutName[KL_NAMELENGTH]; static unsigned int layoutNum = 0; int keyboardType; -#endif #ifdef XWIN_XF86CONFIG XF86ConfInputPtr kbd = NULL; XF86ConfInputPtr input_list = NULL; @@ -242,26 +221,10 @@ winConfigKeyboard (DeviceIntPtr pDevice) char *s = NULL; /* Setup defaults */ -#ifdef XKB - g_winInfo.xkb.disable = FALSE; -# ifdef PC98 /* japanese */ /* not implemented */ - g_winInfo.xkb.rules = "xfree98"; - g_winInfo.xkb.model = "pc98"; - g_winInfo.xkb.layout = "nex/jp"; - g_winInfo.xkb.variant = NULL; - g_winInfo.xkb.options = NULL; -# else - g_winInfo.xkb.rules = "xorg"; - g_winInfo.xkb.model = "pc101"; - g_winInfo.xkb.layout = "us"; - g_winInfo.xkb.variant = NULL; - g_winInfo.xkb.options = NULL; -# endif /* PC98 */ + XkbGetRulesDflts(&g_winInfo.xkb); /* * Query the windows autorepeat settings and change the xserver defaults. - * If XKB is disabled then windows handles the autorepeat and the special - * treatment is not needed */ { int kbd_delay; @@ -358,15 +321,6 @@ winConfigKeyboard (DeviceIntPtr pDevice) } } - g_winInfo.xkb.initialMap = NULL; - g_winInfo.xkb.keymap = NULL; - g_winInfo.xkb.types = NULL; - g_winInfo.xkb.compat = NULL; - g_winInfo.xkb.keycodes = NULL; - g_winInfo.xkb.symbols = NULL; - g_winInfo.xkb.geometry = NULL; -#endif /* XKB */ - /* parse the configuration */ #ifdef XWIN_XF86CONFIG if (g_cmdline.keyboard) @@ -418,169 +372,101 @@ winConfigKeyboard (DeviceIntPtr pDevice) } #endif -#ifdef XKB - from = X_DEFAULT; - if (g_cmdline.noXkbExtension) - { - from = X_CMDLINE; - g_winInfo.xkb.disable = TRUE; - } -#ifdef XWIN_XF86CONFIG - else if (kbd->inp_option_lst) - { - int b = winSetBoolOption (kbd->inp_option_lst, "XkbDisable", FALSE); - if (b) - { - from = X_CONFIG; - g_winInfo.xkb.disable = TRUE; - } - } -#endif - if (g_winInfo.xkb.disable) - { - winMsg (from, "XkbExtension disabled\n"); - } - else - { - s = NULL; - if (g_cmdline.xkbRules) - { - s = g_cmdline.xkbRules; - from = X_CMDLINE; - } + s = NULL; + if (g_cmdline.xkbRules) + { + s = g_cmdline.xkbRules; + from = X_CMDLINE; + } #ifdef XWIN_XF86CONFIG - else - { - s = winSetStrOption (kbd->inp_option_lst, "XkbRules", NULL); - from = X_CONFIG; - } + else + { + s = winSetStrOption (kbd->inp_option_lst, "XkbRules", NULL); + from = X_CONFIG; + } #endif - if (s) - { - g_winInfo.xkb.rules = NULL_IF_EMPTY (s); - winMsg (from, "XKB: rules: \"%s\"\n", s); - } + if (s) + { + g_winInfo.xkb.rules = NULL_IF_EMPTY (s); + winMsg (from, "XKB: rules: \"%s\"\n", s); + } - s = NULL; - if (g_cmdline.xkbModel) - { - s = g_cmdline.xkbModel; - from = X_CMDLINE; - } + s = NULL; + if (g_cmdline.xkbModel) + { + s = g_cmdline.xkbModel; + from = X_CMDLINE; + } #ifdef XWIN_XF86CONFIG - else - { - s = winSetStrOption (kbd->inp_option_lst, "XkbModel", NULL); - from = X_CONFIG; - } + else + { + s = winSetStrOption (kbd->inp_option_lst, "XkbModel", NULL); + from = X_CONFIG; + } #endif - if (s) - { - g_winInfo.xkb.model = NULL_IF_EMPTY (s); - winMsg (from, "XKB: model: \"%s\"\n", s); - } + if (s) + { + g_winInfo.xkb.model = NULL_IF_EMPTY (s); + winMsg (from, "XKB: model: \"%s\"\n", s); + } - s = NULL; - if (g_cmdline.xkbLayout) - { - s = g_cmdline.xkbLayout; - from = X_CMDLINE; - } + s = NULL; + if (g_cmdline.xkbLayout) + { + s = g_cmdline.xkbLayout; + from = X_CMDLINE; + } #ifdef XWIN_XF86CONFIG - else - { - s = winSetStrOption (kbd->inp_option_lst, "XkbLayout", NULL); - from = X_CONFIG; - } + else + { + s = winSetStrOption (kbd->inp_option_lst, "XkbLayout", NULL); + from = X_CONFIG; + } #endif - if (s) - { - g_winInfo.xkb.layout = NULL_IF_EMPTY (s); - winMsg (from, "XKB: layout: \"%s\"\n", s); - } + if (s) + { + g_winInfo.xkb.layout = NULL_IF_EMPTY (s); + winMsg (from, "XKB: layout: \"%s\"\n", s); + } - s = NULL; - if (g_cmdline.xkbVariant) - { - s = g_cmdline.xkbVariant; - from = X_CMDLINE; - } + s = NULL; + if (g_cmdline.xkbVariant) + { + s = g_cmdline.xkbVariant; + from = X_CMDLINE; + } #ifdef XWIN_XF86CONFIG - else - { - s = winSetStrOption (kbd->inp_option_lst, "XkbVariant", NULL); - from = X_CONFIG; - } + else + { + s = winSetStrOption (kbd->inp_option_lst, "XkbVariant", NULL); + from = X_CONFIG; + } #endif - if (s) - { - g_winInfo.xkb.variant = NULL_IF_EMPTY (s); - winMsg (from, "XKB: variant: \"%s\"\n", s); - } + if (s) + { + g_winInfo.xkb.variant = NULL_IF_EMPTY (s); + winMsg (from, "XKB: variant: \"%s\"\n", s); + } - s = NULL; - if (g_cmdline.xkbOptions) - { - s = g_cmdline.xkbOptions; - from = X_CMDLINE; - } + s = NULL; + if (g_cmdline.xkbOptions) + { + s = g_cmdline.xkbOptions; + from = X_CMDLINE; + } #ifdef XWIN_XF86CONFIG - else - { - s = winSetStrOption (kbd->inp_option_lst, "XkbOptions", NULL); - from = X_CONFIG; - } + else + { + s = winSetStrOption (kbd->inp_option_lst, "XkbOptions", NULL); + from = X_CONFIG; + } #endif - if (s) - { - g_winInfo.xkb.options = NULL_IF_EMPTY (s); - winMsg (from, "XKB: options: \"%s\"\n", s); - } - -#ifdef XWIN_XF86CONFIG - from = X_CMDLINE; - - if ((s = winSetStrOption (kbd->inp_option_lst, "XkbKeymap", NULL))) - { - g_winInfo.xkb.keymap = NULL_IF_EMPTY (s); - winMsg (X_CONFIG, "XKB: keymap: \"%s\" " - " (overrides other XKB settings)\n", s); - } - - if ((s = winSetStrOption (kbd->inp_option_lst, "XkbCompat", NULL))) - { - g_winInfo.xkb.compat = NULL_IF_EMPTY (s); - winMsg (X_CONFIG, "XKB: compat: \"%s\"\n", s); - } - - if ((s = winSetStrOption (kbd->inp_option_lst, "XkbTypes", NULL))) - { - g_winInfo.xkb.types = NULL_IF_EMPTY (s); - winMsg (X_CONFIG, "XKB: types: \"%s\"\n", s); - } - - if ((s = - winSetStrOption (kbd->inp_option_lst, "XkbKeycodes", NULL))) - { - g_winInfo.xkb.keycodes = NULL_IF_EMPTY (s); - winMsg (X_CONFIG, "XKB: keycodes: \"%s\"\n", s); - } - - if ((s = - winSetStrOption (kbd->inp_option_lst, "XkbGeometry", NULL))) - { - g_winInfo.xkb.geometry = NULL_IF_EMPTY (s); - winMsg (X_CONFIG, "XKB: geometry: \"%s\"\n", s); - } + if (s) + { + g_winInfo.xkb.options = NULL_IF_EMPTY (s); + winMsg (from, "XKB: options: \"%s\"\n", s); + } - if ((s = winSetStrOption (kbd->inp_option_lst, "XkbSymbols", NULL))) - { - g_winInfo.xkb.symbols = NULL_IF_EMPTY (s); - winMsg (X_CONFIG, "XKB: symbols: \"%s\"\n", s); - } -#endif -#endif - } #ifdef XWIN_XF86CONFIG } #endif @@ -675,10 +561,8 @@ winConfigFiles () } #else Bool -winConfigFiles () +winConfigFiles (void) { - MessageType from; - /* Fontpath */ if (g_cmdline.fontPath) { @@ -692,14 +576,14 @@ winConfigFiles () Bool -winConfigOptions () +winConfigOptions (void) { return TRUE; } Bool -winConfigScreens () +winConfigScreens (void) { return TRUE; } diff --git a/xorg-server/hw/xwin/winconfig.h b/xorg-server/hw/xwin/winconfig.h index 4b56d639c..63d621112 100644 --- a/xorg-server/hw/xwin/winconfig.h +++ b/xorg-server/hw/xwin/winconfig.h @@ -194,15 +194,11 @@ typedef struct #ifdef XWIN_XF86CONFIG char *keyboard; #endif -#ifdef XKB - Bool noXkbExtension; - char *xkbMap; char *xkbRules; char *xkbModel; char *xkbLayout; char *xkbVariant; char *xkbOptions; -#endif /* layout */ char *screenname; /* mouse settings */ @@ -309,25 +305,7 @@ typedef struct long rate; } keyboard; -#ifdef XKB - struct - { - Bool disable; - char *rules; - char *model; - char *layout; - char *variant; - char *options; - char *initialMap; - char *keymap; - char *types; - char *compat; - char *keycodes; - char *symbols; - char *geometry; - } - xkb; -#endif + XkbRMLVOSet xkb; struct { Bool emulate3Buttons; diff --git a/xorg-server/hw/xwin/wincreatewnd.c b/xorg-server/hw/xwin/wincreatewnd.c index 78aea0e47..06c3327da 100644 --- a/xorg-server/hw/xwin/wincreatewnd.c +++ b/xorg-server/hw/xwin/wincreatewnd.c @@ -63,7 +63,7 @@ winCreateBoundingWindowFullScreen (ScreenPtr pScreen) int iWidth = pScreenInfo->dwWidth; int iHeight = pScreenInfo->dwHeight; HWND *phwnd = &pScreenPriv->hwndScreen; - WNDCLASS wc; + WNDCLASSEX wc; char szTitle[256]; #if CYGDEBUG @@ -71,17 +71,21 @@ winCreateBoundingWindowFullScreen (ScreenPtr pScreen) #endif /* Setup our window class */ + wc.cbSize=sizeof(WNDCLASSEX); wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = winWindowProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = g_hInstance; - wc.hIcon = LoadIcon (g_hInstance, MAKEINTRESOURCE(IDI_XWIN)); + wc.hIcon = (HICON)LoadImage (g_hInstance, MAKEINTRESOURCE(IDI_XWIN), IMAGE_ICON, + GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), 0); wc.hCursor = 0; wc.hbrBackground = 0; wc.lpszMenuName = NULL; wc.lpszClassName = WINDOW_CLASS; - RegisterClass (&wc); + wc.hIconSm = (HICON)LoadImage (g_hInstance, MAKEINTRESOURCE(IDI_XWIN), IMAGE_ICON, + GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTSIZE); + RegisterClassEx (&wc); /* Set display and screen-specific tooltip text */ if (g_pszQueryHost != NULL) @@ -156,7 +160,7 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen) int iPosX; int iPosY; HWND *phwnd = &pScreenPriv->hwndScreen; - WNDCLASS wc; + WNDCLASSEX wc; RECT rcClient, rcWorkArea; DWORD dwWindowStyle; BOOL fForceShowWindow = FALSE; @@ -199,17 +203,21 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen) dwWindowStyle |= WS_POPUP; /* Setup our window class */ + wc.cbSize=sizeof(WNDCLASSEX); wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = winWindowProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = g_hInstance; - wc.hIcon = LoadIcon (g_hInstance, MAKEINTRESOURCE(IDI_XWIN)); + wc.hIcon = (HICON)LoadImage (g_hInstance, MAKEINTRESOURCE(IDI_XWIN), IMAGE_ICON, + GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), 0); wc.hCursor = 0; wc.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH); wc.lpszMenuName = NULL; wc.lpszClassName = WINDOW_CLASS; - RegisterClass (&wc); + wc.hIconSm = (HICON)LoadImage (g_hInstance, MAKEINTRESOURCE(IDI_XWIN), IMAGE_ICON, + GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTSIZE); + RegisterClassEx (&wc); /* Get size of work area */ winGetWorkArea (&rcWorkArea, pScreenInfo); diff --git a/xorg-server/hw/xwin/wincursor.c b/xorg-server/hw/xwin/wincursor.c index 4fa7c0929..58af100c6 100644 --- a/xorg-server/hw/xwin/wincursor.c +++ b/xorg-server/hw/xwin/wincursor.c @@ -39,16 +39,10 @@ #include <cursorstr.h> #include <mipointrst.h> #include <servermd.h> +#include "misc.h" extern Bool g_fSoftwareCursor; - -#ifndef MIN -#define MIN(x,y) ((x)<(y)?(x):(y)) -#endif - -#define BYTE_COUNT(x) (((x) + 7) / 8) - #define BRIGHTNESS(x) (x##Red * 0.299 + x##Green * 0.587 + x##Blue * 0.114) #if 0 @@ -57,6 +51,11 @@ extern Bool g_fSoftwareCursor; # define WIN_DEBUG_MSG(...) #endif +#ifdef _MSC_VER +#define min(a,b) (((a) < (b)) ? (a) : (b)) +#define max(a,b) (((a) > (b)) ? (a) : (b)) +#endif + /* * Local function prototypes */ @@ -203,11 +202,11 @@ winLoadCursor (ScreenPtr pScreen, CursorPtr pCursor, int screen) /* Get the number of bytes required to store the whole cursor image * This is roughly (sm_cx * sm_cy) / 8 * round up to 8 pixel boundary so we can convert whole bytes */ - nBytes = BYTE_COUNT(pScreenPriv->cursor.sm_cx) * pScreenPriv->cursor.sm_cy; + nBytes = bits_to_bytes(pScreenPriv->cursor.sm_cx) * pScreenPriv->cursor.sm_cy; /* Get the effective width and height */ - nCX = MIN(pScreenPriv->cursor.sm_cx, pCursor->bits->width); - nCY = MIN(pScreenPriv->cursor.sm_cy, pCursor->bits->height); + nCX = min(pScreenPriv->cursor.sm_cx, pCursor->bits->width); + nCY = min(pScreenPriv->cursor.sm_cy, pCursor->bits->height); /* Allocate memory for the bitmaps */ pAnd = malloc (nBytes); @@ -218,11 +217,11 @@ winLoadCursor (ScreenPtr pScreen, CursorPtr pCursor, int screen) * The first is for an empty mask */ if (pCursor->bits->emptyMask) { - int x, y, xmax = BYTE_COUNT(nCX); + int x, y, xmax = bits_to_bytes(nCX); for (y = 0; y < nCY; ++y) for (x = 0; x < xmax; ++x) { - int nWinPix = BYTE_COUNT(pScreenPriv->cursor.sm_cx) * y + x; + int nWinPix = bits_to_bytes(pScreenPriv->cursor.sm_cx) * y + x; int nXPix = BitmapBytePad(pCursor->bits->width) * y + x; pAnd[nWinPix] = 0; @@ -234,11 +233,11 @@ winLoadCursor (ScreenPtr pScreen, CursorPtr pCursor, int screen) } else { - int x, y, xmax = BYTE_COUNT(nCX); + int x, y, xmax = bits_to_bytes(nCX); for (y = 0; y < nCY; ++y) for (x = 0; x < xmax; ++x) { - int nWinPix = BYTE_COUNT(pScreenPriv->cursor.sm_cx) * y + x; + int nWinPix = bits_to_bytes(pScreenPriv->cursor.sm_cx) * y + x; int nXPix = BitmapBytePad(pCursor->bits->width) * y + x; unsigned char mask = pCursor->bits->mask[nXPix]; @@ -327,7 +326,7 @@ winLoadCursor (ScreenPtr pScreen, CursorPtr pCursor, int screen) (*pCur++) = 0; else /* Within X11 icon bounds */ { - int nWinPix = BYTE_COUNT(pScreenPriv->cursor.sm_cx) * y + (x/8); + int nWinPix = bits_to_bytes(pScreenPriv->cursor.sm_cx) * y + (x/8); bit = pAnd[nWinPix]; bit = bit & (1<<(7-(x&7))); @@ -545,7 +544,7 @@ winSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, in /* - * QuartzMoveCursor + * winMoveCursor * Move the cursor. This is a noop for us. */ static void @@ -554,13 +553,17 @@ winMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) } static Bool -winDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen) +winDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScr) { - return TRUE; + winScreenPriv(pScr); + return pScreenPriv->cursor.spriteFuncs->DeviceCursorInitialize(pDev, pScr); } + static void -winDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen) +winDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScr) { + winScreenPriv(pScr); + return pScreenPriv->cursor.spriteFuncs->DeviceCursorCleanup(pDev, pScr); } static miPointerSpriteFuncRec winSpriteFuncsRec = { @@ -568,8 +571,8 @@ static miPointerSpriteFuncRec winSpriteFuncsRec = { winUnrealizeCursor, winSetCursor, winMoveCursor, - winDeviceInitialize, - winDeviceCleanup + winDeviceCursorInitialize, + winDeviceCursorCleanup }; diff --git a/xorg-server/hw/xwin/windialogs.c b/xorg-server/hw/xwin/windialogs.c index 822941e83..94afcd989 100644 --- a/xorg-server/hw/xwin/windialogs.c +++ b/xorg-server/hw/xwin/windialogs.c @@ -150,7 +150,7 @@ winURLWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) SetCursor (cursor); return TRUE; } - origCB = (WNDPROC)GetWindowLong (hwnd, GWL_USERDATA); + origCB = (WNDPROC)GetWindowLongPtr(hwnd, GWLP_USERDATA); /* Otherwise fall through to original WndProc */ if (origCB) return CallWindowProc (origCB, hwnd, msg, wParam, lParam); @@ -167,19 +167,19 @@ static void winOverrideURLButton (HWND hwnd, int id) { WNDPROC origCB; - origCB = (WNDPROC)SetWindowLong (GetDlgItem (hwnd, id), - GWL_WNDPROC, (LONG)winURLWndProc); - SetWindowLong (GetDlgItem (hwnd, id), GWL_USERDATA, (LONG)origCB); + origCB = (WNDPROC)SetWindowLongPtr(GetDlgItem (hwnd, id), + GWLP_WNDPROC, (LONG_PTR)winURLWndProc); + SetWindowLongPtr(GetDlgItem (hwnd, id), GWLP_USERDATA, (LONG_PTR)origCB); } static void winUnoverrideURLButton (HWND hwnd, int id) { WNDPROC origCB; - origCB = (WNDPROC)SetWindowLong (GetDlgItem (hwnd, id), - GWL_USERDATA, 0); + origCB = (WNDPROC)SetWindowLongPtr(GetDlgItem (hwnd, id), + GWLP_USERDATA, 0); if (origCB) - SetWindowLong (GetDlgItem (hwnd, id), GWL_WNDPROC, (LONG)origCB); + SetWindowLongPtr(GetDlgItem (hwnd, id), GWLP_WNDPROC, (LONG_PTR)origCB); } @@ -199,38 +199,38 @@ winInitDialog (HWND hwndDlg) if (!hwndDesk || IsIconic (hwndDesk)) hwndDesk = GetDesktopWindow (); - /* Remove minimize and maximize buttons */ - SetWindowLongPtr (hwndDlg, GWL_STYLE, - GetWindowLongPtr (hwndDlg, GWL_STYLE) - & ~(WS_MAXIMIZEBOX | WS_MINIMIZEBOX)); + /* Remove minimize and maximize buttons */ + SetWindowLongPtr(hwndDlg, GWL_STYLE, + GetWindowLongPtr(hwndDlg, GWL_STYLE) + & ~(WS_MAXIMIZEBOX | WS_MINIMIZEBOX)); /* Set Window not to show in the task bar */ - SetWindowLongPtr (hwndDlg, GWL_EXSTYLE, - GetWindowLongPtr (hwndDlg, GWL_EXSTYLE) & ~WS_EX_APPWINDOW ); + SetWindowLongPtr(hwndDlg, GWL_EXSTYLE, + GetWindowLongPtr(hwndDlg, GWL_EXSTYLE) & ~WS_EX_APPWINDOW ); - /* Center dialog window in the screen. Not done for multi-monitor systems, where - * it is likely to end up split across the screens. In that case, it appears - * near the Tray icon. - */ + /* Center dialog window in the screen. Not done for multi-monitor systems, where + * it is likely to end up split across the screens. In that case, it appears + * near the Tray icon. + */ if (GetSystemMetrics(SM_CMONITORS)>1) { /* Still need to refresh the frame change. */ SetWindowPos (hwndDlg, HWND_TOP, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); } else { - GetWindowRect (hwndDesk, &rcDesk); - GetWindowRect (hwndDlg, &rcDlg); - CopyRect (&rc, &rcDesk); - - OffsetRect (&rcDlg, -rcDlg.left, -rcDlg.top); - OffsetRect (&rc, -rc.left, -rc.top); - OffsetRect (&rc, -rcDlg.right, -rcDlg.bottom); - - SetWindowPos (hwndDlg, - HWND_TOPMOST, - rcDesk.left + (rc.right / 2), - rcDesk.top + (rc.bottom / 2), - 0, 0, - SWP_NOSIZE | SWP_FRAMECHANGED); + GetWindowRect (hwndDesk, &rcDesk); + GetWindowRect (hwndDlg, &rcDlg); + CopyRect (&rc, &rcDesk); + + OffsetRect (&rcDlg, -rcDlg.left, -rcDlg.top); + OffsetRect (&rc, -rc.left, -rc.top); + OffsetRect (&rc, -rcDlg.right, -rcDlg.bottom); + + SetWindowPos (hwndDlg, + HWND_TOPMOST, + rcDesk.left + (rc.right / 2), + rcDesk.top + (rc.bottom / 2), + 0, 0, + SWP_NOSIZE | SWP_FRAMECHANGED); } #ifdef XWIN_MULTIWINDOW @@ -322,7 +322,7 @@ winDisplayExitDialog (winPrivScreenPtr pScreenPriv) /* Set focus to the Cancel button */ PostMessage (g_hDlgExit, WM_NEXTDLGCTL, - (int) GetDlgItem (g_hDlgExit, IDCANCEL), TRUE); + GetDlgItem (g_hDlgExit, IDCANCEL), TRUE); } #define CONNECTED_CLIENTS_FORMAT "There are currently %d clients connected." @@ -590,7 +590,7 @@ winDisplayAboutDialog (winPrivScreenPtr pScreenPriv) /* Set focus to the OK button */ PostMessage (g_hDlgAbout, WM_NEXTDLGCTL, - (int) GetDlgItem (g_hDlgAbout, IDOK), TRUE); + GetDlgItem (g_hDlgAbout, IDOK), TRUE); } @@ -671,7 +671,7 @@ winAboutDlgProc (HWND hwndDialog, UINT message, case ID_ABOUT_CHANGELOG: { - int iReturn; + HINSTANCE iReturn; #ifdef __CYGWIN__ const char * pszCygPath = "/usr/X11R6/share/doc/" "xorg-x11-xwin/changelog.html"; @@ -684,12 +684,12 @@ winAboutDlgProc (HWND hwndDialog, UINT message, "devel/server/changelog.html"; #endif - iReturn = (int) ShellExecute (NULL, - "open", - pszWinPath, - NULL, - NULL, - SW_MAXIMIZE); + iReturn = ShellExecute (NULL, + "open", + pszWinPath, + NULL, + NULL, + SW_MAXIMIZE); if (iReturn < 32) { ErrorF ("winAboutDlgProc - WM_COMMAND - ID_ABOUT_CHANGELOG - " @@ -704,12 +704,12 @@ winAboutDlgProc (HWND hwndDialog, UINT message, const char * pszPath = __VENDORDWEBSUPPORT__; int iReturn; - iReturn = (int) ShellExecute (NULL, - "open", - pszPath, - NULL, - NULL, - SW_MAXIMIZE); + iReturn = ShellExecute (NULL, + "open", + pszPath, + NULL, + NULL, + SW_MAXIMIZE); if (iReturn < 32) { ErrorF ("winAboutDlgProc - WM_COMMAND - ID_ABOUT_WEBSITE - " @@ -724,12 +724,12 @@ winAboutDlgProc (HWND hwndDialog, UINT message, const char * pszPath = "http://x.cygwin.com/docs/ug/"; int iReturn; - iReturn = (int) ShellExecute (NULL, - "open", - pszPath, - NULL, - NULL, - SW_MAXIMIZE); + iReturn = ShellExecute (NULL, + "open", + pszPath, + NULL, + NULL, + SW_MAXIMIZE); if (iReturn < 32) { ErrorF ("winAboutDlgProc - WM_COMMAND - ID_ABOUT_UG - " @@ -744,12 +744,12 @@ winAboutDlgProc (HWND hwndDialog, UINT message, const char * pszPath = "http://x.cygwin.com/docs/faq/"; int iReturn; - iReturn = (int) ShellExecute (NULL, - "open", - pszPath, - NULL, - NULL, - SW_MAXIMIZE); + iReturn = ShellExecute (NULL, + "open", + pszPath, + NULL, + NULL, + SW_MAXIMIZE); if (iReturn < 32) { ErrorF ("winAboutDlgProc - WM_COMMAND - ID_ABOUT_FAQ - " diff --git a/xorg-server/hw/xwin/winengine.c b/xorg-server/hw/xwin/winengine.c index f0bc671e2..fb9aed8a0 100644 --- a/xorg-server/hw/xwin/winengine.c +++ b/xorg-server/hw/xwin/winengine.c @@ -48,7 +48,7 @@ extern const GUID _IID_IDirectDraw4; */ void -winDetectSupportedEngines () +winDetectSupportedEngines (void) { OSVERSIONINFO osvi; @@ -285,7 +285,7 @@ winSetEngine (ScreenPtr pScreen) */ Bool -winGetDDProcAddresses () +winGetDDProcAddresses (void) { Bool fReturn = TRUE; diff --git a/xorg-server/hw/xwin/winerror.c b/xorg-server/hw/xwin/winerror.c index 9c5c92ccf..78ac15117 100644 --- a/xorg-server/hw/xwin/winerror.c +++ b/xorg-server/hw/xwin/winerror.c @@ -35,6 +35,7 @@ #define VENDOR_STRING XVENDORNAME #define VENDOR_CONTACT BUILDERADDR #endif + #include <../xfree86/common/xorgVersion.h> #include "win.h" @@ -146,7 +147,7 @@ winMessageBoxF (const char *pszError, UINT uType, ...) pszMsgBox = Xprintf (MESSAGEBOXF, pszErrorF, VENDOR_STRING, - XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP, BUILD_DATE, + XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP, XORG_VERSION_CURRENT, VENDOR_CONTACT, g_pszCommandLine); if (!pszMsgBox) diff --git a/xorg-server/hw/xwin/winkeybd.c b/xorg-server/hw/xwin/winkeybd.c index 84b7d8d85..13659b24d 100644 --- a/xorg-server/hw/xwin/winkeybd.c +++ b/xorg-server/hw/xwin/winkeybd.c @@ -40,12 +40,7 @@ #include "winconfig.h" #include "winmsg.h" -#ifdef XKB -#ifndef XKB_IN_SERVER -#define XKB_IN_SERVER -#endif -#include <xkbsrv.h> -#endif +#include "xkbsrv.h" static Bool g_winKeyState[NUM_KEYCODES]; @@ -230,102 +225,48 @@ winKeybdCtrl (DeviceIntPtr pDevice, KeybdCtrl *pCtrl) int winKeybdProc (DeviceIntPtr pDeviceInt, int iState) { - KeySymsRec keySyms; - CARD8 modMap[MAP_LENGTH]; DevicePtr pDevice = (DevicePtr) pDeviceInt; -#ifdef XKB - XkbComponentNamesRec names; XkbSrvInfoPtr xkbi; XkbControlsPtr ctrl; -#endif switch (iState) { case DEVICE_INIT: winConfigKeyboard (pDeviceInt); - winGetKeyMappings (&keySyms, modMap); - -#ifdef XKB /* FIXME: Maybe we should use winGetKbdLeds () here? */ defaultKeyboardControl.leds = g_winInfo.keyboard.leds; -#else - defaultKeyboardControl.leds = g_winInfo.keyboard.leds; -#endif - -#ifdef XKB - if (g_winInfo.xkb.disable) - { -#endif - InitKeyboardDeviceStruct (pDevice, - &keySyms, - modMap, - winKeybdBell, - winKeybdCtrl); -#ifdef XKB - } - else - { - - names.keymap = g_winInfo.xkb.keymap; - names.keycodes = g_winInfo.xkb.keycodes; - names.types = g_winInfo.xkb.types; - names.compat = g_winInfo.xkb.compat; - names.symbols = g_winInfo.xkb.symbols; - names.geometry = g_winInfo.xkb.geometry; - - winErrorFVerb(2, "Rules = \"%s\" Model = \"%s\" Layout = \"%s\"" - " Variant = \"%s\" Options = \"%s\"\n", - g_winInfo.xkb.rules, g_winInfo.xkb.model, - g_winInfo.xkb.layout, g_winInfo.xkb.variant, - g_winInfo.xkb.options); - - XkbSetRulesDflts (g_winInfo.xkb.rules, g_winInfo.xkb.model, - g_winInfo.xkb.layout, g_winInfo.xkb.variant, - g_winInfo.xkb.options); - XkbInitKeyboardDeviceStruct (pDeviceInt, &names, &keySyms, - modMap, winKeybdBell, winKeybdCtrl); - } -#endif -#ifdef XKB - if (!g_winInfo.xkb.disable) - { - xkbi = pDeviceInt->key->xkbInfo; - if (xkbi != NULL) - { - ctrl = xkbi->desc->ctrls; - ctrl->repeat_delay = g_winInfo.keyboard.delay; - ctrl->repeat_interval = 1000/g_winInfo.keyboard.rate; - } - else - { - winErrorFVerb (1, "winKeybdProc - Error initializing keyboard AutoRepeat (No XKB)\n"); - } + winErrorFVerb(2, "Rules = \"%s\" Model = \"%s\" Layout = \"%s\"" + " Variant = \"%s\" Options = \"%s\"\n", + g_winInfo.xkb.rules ? g_winInfo.xkb.rules : "none", + g_winInfo.xkb.model ? g_winInfo.xkb.model : "none", + g_winInfo.xkb.layout ? g_winInfo.xkb.layout : "none", + g_winInfo.xkb.variant ? g_winInfo.xkb.variant : "none", + g_winInfo.xkb.options ? g_winInfo.xkb.options : "none"); + + InitKeyboardDeviceStruct (pDeviceInt, + &g_winInfo.xkb, + winKeybdBell, + winKeybdCtrl); + + xkbi = pDeviceInt->key->xkbInfo; + if ((xkbi != NULL) && (xkbi->desc != NULL)) + { + ctrl = xkbi->desc->ctrls; + ctrl->repeat_delay = g_winInfo.keyboard.delay; + ctrl->repeat_interval = 1000/g_winInfo.keyboard.rate; + } + else + { + winErrorFVerb (1, "winKeybdProc - Error initializing keyboard AutoRepeat\n"); + } XkbSetExtension(pDeviceInt, ProcessKeyboardEvent); - } -#endif break; case DEVICE_ON: - { - DeviceIntPtr master; pDevice->on = TRUE; - - // immediately copy the state of this keyboard device to the VCK - // (which otherwise happens lazily after the first keypress) - master = (!pDeviceInt->isMaster && pDeviceInt->u.master) ? pDeviceInt->u.master : NULL; - if (master) - { - /* Force a copy of the key class into the VCK so that the layout - is transferred. */ - if (!master->key) - master = GetPairedDevice(master); - CopyKeyClass(pDeviceInt, master); - } - } - break; case DEVICE_CLOSE: @@ -385,7 +326,7 @@ winInitializeModeKeyStates (void) */ void -winRestoreModeKeyStates () +winRestoreModeKeyStates (void) { DWORD dwKeyState; BOOL processEvents = TRUE; @@ -406,7 +347,7 @@ winRestoreModeKeyStates () /* Read the mode key states of our X server */ /* (stored in the virtual core keyboard) */ - internalKeyStates = inputInfo.keyboard->key->state; + internalKeyStates = XkbStateFieldFromRec(&inputInfo.keyboard->key->xkbInfo->state); winDebug("winRestoreModeKeyStates: state %d\n", internalKeyStates); /* @@ -573,7 +514,7 @@ winIsFakeCtrl_L (UINT message, WPARAM wParam, LPARAM lParam) */ void -winKeybdReleaseKeys () +winKeybdReleaseKeys (void) { int i; @@ -605,8 +546,8 @@ winKeybdReleaseKeys () void winSendKeyEvent (DWORD dwKey, Bool fDown) { - DeviceIntPtr pDev; - xEvent xCurrentEvent; + EventListPtr events; + int i, nevents; /* * When alt-tabing between screens we can get phantom key up messages @@ -616,23 +557,17 @@ winSendKeyEvent (DWORD dwKey, Bool fDown) /* Update the keyState map */ g_winKeyState[dwKey] = fDown; - - ZeroMemory (&xCurrentEvent, sizeof (xCurrentEvent)); - xCurrentEvent.u.u.type = fDown ? DeviceKeyPress : DeviceKeyRelease; - xCurrentEvent.u.keyButtonPointer.time = - g_c32LastInputEventTime = GetTickCount (); - xCurrentEvent.u.u.detail = dwKey + MIN_KEYCODE; + GetEventList(&events); + nevents = GetKeyboardEvents(events, g_pwinKeyboard, fDown ? KeyPress : KeyRelease, dwKey + MIN_KEYCODE); + + for (i = 0; i < nevents; i++) + mieqEnqueue(g_pwinKeyboard, events[i].event); #if CYGDEBUG - ErrorF("winSendKeyEvent: xCurrentEvent.u.u.type: %d, xCurrentEvent.u.u.detail: %d\n", - xCurrentEvent.u.u.type, xCurrentEvent.u.u.detail); + ErrorF("winSendKeyEvent: dwKey: %d, fDown: %d, nEvents %d\n", + dwKey, fDown, nevents); #endif - for (pDev = inputInfo.devices; pDev; pDev = pDev->next) - if ((pDev->coreEvents && pDev != inputInfo.keyboard) && pDev->key) - { - mieqEnqueue (pDev, &xCurrentEvent); - } } BOOL winCheckKeyPressed(WPARAM wParam, LPARAM lParam) diff --git a/xorg-server/hw/xwin/winkeyhook.c b/xorg-server/hw/xwin/winkeyhook.c index 53d91e6ee..2d6ed18b7 100644 --- a/xorg-server/hw/xwin/winkeyhook.c +++ b/xorg-server/hw/xwin/winkeyhook.c @@ -149,7 +149,7 @@ winKeyboardMessageHookLL (int iCode, WPARAM wParam, LPARAM lParam) */ Bool -winInstallKeyboardHookLL () +winInstallKeyboardHookLL (void) { OSVERSIONINFO osvi = {0}; @@ -186,7 +186,7 @@ winInstallKeyboardHookLL () */ void -winRemoveKeyboardHookLL () +winRemoveKeyboardHookLL (void) { if (g_hhookKeyboardLL) UnhookWindowsHookEx (g_hhookKeyboardLL); diff --git a/xorg-server/hw/xwin/winlayouts.h b/xorg-server/hw/xwin/winlayouts.h index 336839453..193cc1a41 100644 --- a/xorg-server/hw/xwin/winlayouts.h +++ b/xorg-server/hw/xwin/winlayouts.h @@ -57,13 +57,14 @@ WinKBLayoutRec winKBLayouts[] = { 0x809, -1, "pc105", "gb", NULL, NULL, "English (United Kingdom)"}, { 0x1809, -1, "pc105", "ie", NULL, NULL, "Irish"}, { 0x40a, -1, "pc105", "es", NULL, NULL, "Spanish (Spain, Traditional Sort)"}, - { 0x80a, -1, "pc105", "la", NULL, NULL, "Latin American"}, + { 0x80a, -1, "pc105", "latam", NULL, NULL, "Latin American"}, { 0x40b, -1, "pc105", "fi", NULL, NULL, "Finnish"}, { 0x40c, -1, "pc105", "fr", NULL, NULL, "French (Standard)"}, { 0x80c, -1, "pc105", "be", NULL, NULL, "French (Belgian)"}, {0x1080c, -1, "pc105", "be", NULL, NULL, "Belgian (Comma)"}, { 0xc0c, -1, "pc105", "ca", "fr", NULL, "French (Canada)"}, { 0x100c, -1, "pc105", "ch", "fr", NULL, "French (Switzerland)"}, + { 0x40d, -1, "pc105", "il", NULL, NULL, "Hebrew"}, { 0x40e, -1, "pc105", "hu", NULL, NULL, "Hungarian"}, { 0x40f, -1, "pc105", "is", NULL, NULL, "Icelandic"}, { 0x410, -1, "pc105", "it", NULL, NULL, "Italian"}, diff --git a/xorg-server/hw/xwin/winmouse.c b/xorg-server/hw/xwin/winmouse.c index cf52bbaaf..c99e9c992 100644 --- a/xorg-server/hw/xwin/winmouse.c +++ b/xorg-server/hw/xwin/winmouse.c @@ -43,14 +43,13 @@ #include <xkbsrv.h> #endif -#if 1 #include "inputstr.h" +#include "exevents.h" /* for button/axes labels */ +#include "xserver-properties.h" /* Peek the internal button mapping */ static CARD8 const *g_winMouseButtonMap = NULL; -#endif -#include <X11/extensions/XIproto.h> /* * Local prototypes @@ -78,6 +77,8 @@ winMouseProc (DeviceIntPtr pDeviceInt, int iState) int lngWheelEvents = 2; CARD8 *map; DevicePtr pDevice = (DevicePtr) pDeviceInt; + Atom *btn_labels; + Atom axes_labels[2]; switch (iState) { @@ -105,17 +106,29 @@ winMouseProc (DeviceIntPtr pDeviceInt, int iState) map[0] = 0; for (i=1; i <= lngMouseButtons + lngWheelEvents; i++) map[i] = i; + + btn_labels = calloc((lngMouseButtons + lngWheelEvents), sizeof(Atom)); + btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT); + btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE); + btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT); + btn_labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP); + btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN); + + axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X); + axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y); + InitPointerDeviceStruct (pDevice, map, lngMouseButtons + lngWheelEvents, + btn_labels, winMouseCtrl, GetMotionHistorySize(), - 2); + 2, + axes_labels); free(map); + free(btn_labels); -#if 1 g_winMouseButtonMap = pDeviceInt->button->map; -#endif break; case DEVICE_ON: @@ -123,9 +136,7 @@ winMouseProc (DeviceIntPtr pDeviceInt, int iState) break; case DEVICE_CLOSE: -#if 1 g_winMouseButtonMap = NULL; -#endif case DEVICE_OFF: pDevice->on = FALSE; break; @@ -136,7 +147,7 @@ winMouseProc (DeviceIntPtr pDeviceInt, int iState) /* Handle the mouse wheel */ int -winMouseWheel (ScreenPtr pScreen, int iDeltaZ, int x, int y) +winMouseWheel (ScreenPtr pScreen, int iDeltaZ) { winScreenPriv(pScreen); int button; /* Button4 or Button5 */ @@ -211,10 +222,10 @@ winMouseWheel (ScreenPtr pScreen, int iDeltaZ, int x, int y) while (iDeltaZ--) { /* Push the wheel button */ - winMouseButtonsSendEvent (DeviceButtonPress, button,x,y); + winMouseButtonsSendEvent (ButtonPress, button); /* Release the wheel button */ - winMouseButtonsSendEvent (DeviceButtonRelease, button,x,y); + winMouseButtonsSendEvent (ButtonRelease, button); } return 0; @@ -226,62 +237,36 @@ winMouseWheel (ScreenPtr pScreen, int iDeltaZ, int x, int y) */ void -winMouseButtonsSendEvent (int iEventType, int iButton, int x, int y) +winMouseButtonsSendEvent (int iEventType, int iButton) { - DeviceIntPtr pDev; - deviceKeyButtonPointer xCurrentEvent; - deviceKeyButtonPointer *kbp = &xCurrentEvent; + EventListPtr events; + int i, nevents; - /* Load an xEvent and enqueue the event */ - kbp->type=iEventType; -#if 1 if (g_winMouseButtonMap) - kbp->detail = g_winMouseButtonMap[iButton]; - else -#endif - kbp->detail = iButton; - kbp->time = g_c32LastInputEventTime = GetTickCount (); - - kbp->root_x = x; - kbp->root_y = y; - - for (pDev = inputInfo.devices; pDev; pDev = pDev->next) - if ((pDev->coreEvents && pDev != inputInfo.pointer) && pDev->button) - { - kbp->deviceid = pDev->id; - mieqEnqueue (pDev, (xEventPtr)kbp); - } -} - -void winGetPtMouse(HWND hwnd, LPARAM lParam, POINT *ptMouse) -{ - /* Unpack the client area mouse coordinates */ - ptMouse->x = GET_X_LPARAM(lParam); - ptMouse->y = GET_Y_LPARAM(lParam); -} + iButton = g_winMouseButtonMap[iButton]; -void winGetPtMouseScreen(HWND hwnd, LPARAM lParam, POINT *ptMouse) -{ - /* Unpack the client area mouse coordinates */ - ptMouse->x = GET_X_LPARAM(lParam); - ptMouse->y = GET_Y_LPARAM(lParam); + GetEventList(&events); + nevents = GetPointerEvents(events, g_pwinPointer, iEventType, iButton, + POINTER_RELATIVE, 0, 0, NULL); - /* Translate the client area mouse coordinates to screen coordinates */ - ClientToScreen (hwnd, ptMouse); + for (i = 0; i < nevents; i++) + mieqEnqueue(g_pwinPointer, events[i].event); - /* Screen Coords from (-X, -Y) -> Root Window (0, 0) */ - ptMouse->x -= GetSystemMetrics (SM_XVIRTUALSCREEN); - ptMouse->y -= GetSystemMetrics (SM_YVIRTUALSCREEN); +#if CYGDEBUG + ErrorF("winMouseButtonsSendEvent: iEventType: %d, iButton: %d, nEvents %d\n", + iEventType, iButton, nevents); +#endif } + /* * Decide what to do with a Windows mouse message */ -static int -_winMouseButtonsHandle (ScreenPtr pScreen, +int +winMouseButtonsHandle (ScreenPtr pScreen, int iEventType, int iButton, - WPARAM wParam, POINT *ptMouse) + WPARAM wParam) { winScreenPriv(pScreen); winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; @@ -290,12 +275,12 @@ _winMouseButtonsHandle (ScreenPtr pScreen, if (pScreenInfo->iE3BTimeout == WIN_E3B_OFF) { /* Emulate 3 buttons is off, send the button event */ - winMouseButtonsSendEvent (iEventType, iButton, ptMouse->x, ptMouse->y); + winMouseButtonsSendEvent (iEventType, iButton); return 0; } /* Emulate 3 buttons is on, let the fun begin */ - if (iEventType == DeviceButtonPress + if (iEventType == ButtonPress && pScreenPriv->iE3BCachedPress == 0 && !pScreenPriv->fE3BFakeButton2Sent) { @@ -316,7 +301,7 @@ _winMouseButtonsHandle (ScreenPtr pScreen, pScreenInfo->iE3BTimeout, NULL); } - else if (iEventType == DeviceButtonPress + else if (iEventType == ButtonPress && pScreenPriv->iE3BCachedPress != 0 && pScreenPriv->iE3BCachedPress != iButton && !pScreenPriv->fE3BFakeButton2Sent) @@ -331,12 +316,12 @@ _winMouseButtonsHandle (ScreenPtr pScreen, pScreenPriv->iE3BCachedPress = 0; /* Send fake middle button */ - winMouseButtonsSendEvent (DeviceButtonPress, Button2, ptMouse->x, ptMouse->y); + winMouseButtonsSendEvent (ButtonPress, Button2); /* Indicate that a fake middle button event was sent */ pScreenPriv->fE3BFakeButton2Sent = TRUE; } - else if (iEventType == DeviceButtonRelease + else if (iEventType == ButtonRelease && pScreenPriv->iE3BCachedPress == iButton) { /* @@ -347,10 +332,10 @@ _winMouseButtonsHandle (ScreenPtr pScreen, pScreenPriv->iE3BCachedPress = 0; /* Send cached press, then send release */ - winMouseButtonsSendEvent (DeviceButtonPress, iButton, ptMouse->x, ptMouse->y); - winMouseButtonsSendEvent (DeviceButtonRelease, iButton, ptMouse->x, ptMouse->y); + winMouseButtonsSendEvent (ButtonPress, iButton); + winMouseButtonsSendEvent (ButtonRelease, iButton); } - else if (iEventType == DeviceButtonRelease + else if (iEventType == ButtonRelease && pScreenPriv->fE3BFakeButton2Sent && !(wParam & MK_LBUTTON) && !(wParam & MK_RBUTTON)) @@ -361,9 +346,9 @@ _winMouseButtonsHandle (ScreenPtr pScreen, pScreenPriv->fE3BFakeButton2Sent = FALSE; /* Send middle mouse button release */ - winMouseButtonsSendEvent (DeviceButtonRelease, Button2, ptMouse->x, ptMouse->y); + winMouseButtonsSendEvent (ButtonRelease, Button2); } - else if (iEventType == DeviceButtonRelease + else if (iEventType == ButtonRelease && pScreenPriv->iE3BCachedPress == 0 && !pScreenPriv->fE3BFakeButton2Sent) { @@ -371,52 +356,33 @@ _winMouseButtonsHandle (ScreenPtr pScreen, * Button was release, no button is cached, * and there is no fake button 2 release is pending. */ - winMouseButtonsSendEvent (DeviceButtonRelease, iButton, ptMouse->x, ptMouse->y); + winMouseButtonsSendEvent (ButtonRelease, iButton); } return 0; } -int -winMouseButtonsHandle (ScreenPtr pScreen, - int iEventType, int iButton, - WPARAM wParam, HWND hwnd, LPARAM lParam) -{ - POINT ptMouse; - winGetPtMouse(hwnd,lParam,&ptMouse); - return _winMouseButtonsHandle(pScreen, iEventType, iButton, wParam ,&ptMouse); -} - -int -winMouseButtonsHandleScreen (ScreenPtr pScreen, - int iEventType, int iButton, - WPARAM wParam, HWND hwnd, LPARAM lParam) -{ - POINT ptMouse; - winGetPtMouseScreen(hwnd,lParam,&ptMouse); - return _winMouseButtonsHandle(pScreen, iEventType, iButton, wParam ,&ptMouse); -} - - /** * Enqueue a motion event. + * + * XXX: miPointerMove does exactly this, but is static :-( (and uses a static buffer) + * */ void winEnqueueMotion(int x, int y) { int i, nevents; int valuators[2]; - int MaxN=GetMaximumEventsNum(); - EventListPtr events = InitEventList(MaxN); + EventListPtr events; + + miPointerSetPosition(g_pwinPointer, &x, &y); + GetEventList(&events); valuators[0] = x; valuators[1] = y; - nevents = GetPointerEvents(events, inputInfo.pointer, MotionNotify, 0, + nevents = GetPointerEvents(events, g_pwinPointer, MotionNotify, 0, POINTER_ABSOLUTE, 0, 2, valuators); for (i = 0; i < nevents; i++) - mieqEnqueue(inputInfo.pointer, events[i].event); - - FreeEventList(events,MaxN); + mieqEnqueue(g_pwinPointer, events[i].event); } -// XXX: miPointerMove does exactly this, but is static :-( (and uses a static buffer) diff --git a/xorg-server/hw/xwin/winms.h b/xorg-server/hw/xwin/winms.h index 1ad30dc0b..60f7eb906 100644 --- a/xorg-server/hw/xwin/winms.h +++ b/xorg-server/hw/xwin/winms.h @@ -35,6 +35,9 @@ #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif +#ifndef WINVER +#define WINVER 0x0500 +#endif #include <X11/Xwindows.h> #include <windowsx.h> diff --git a/xorg-server/hw/xwin/winmultiwindowicons.c b/xorg-server/hw/xwin/winmultiwindowicons.c index 0d9d87ed2..11ae40159 100644 --- a/xorg-server/hw/xwin/winmultiwindowicons.c +++ b/xorg-server/hw/xwin/winmultiwindowicons.c @@ -37,8 +37,9 @@ #include "winprefs.h" #include "propertyst.h" -#include "windowstr.h" +#include "propertyst.h" +#include "windowstr.h" /* * External global variables @@ -53,15 +54,9 @@ extern HICON g_hSmallIconX; */ static void -winScaleIconToWindows (int iconSize, - int effBPP, - unsigned char *iconData, - unsigned short width, - unsigned short height, - int xStride, - int effXBPP, - int effXDepth, - unsigned char *image); +winScaleXBitmapToWindows (int iconSize, int effBPP, + PixmapPtr pixmap, unsigned char *image); + /* * Scale an X icon bitmap into a Windoze icon bitmap @@ -73,9 +68,15 @@ winScaleXBitmapToWindows (int iconSize, PixmapPtr pixmap, unsigned char *image) { - int effXBPP, effXDepth; - int xStride; - unsigned char *iconData = 0; + int row, column, effXBPP, effXDepth; + unsigned char *outPtr; + char *iconData = 0; + int stride, xStride; + float factX, factY; + int posX, posY; + unsigned char *ptr; + unsigned int zero; + unsigned int color; effXBPP = BitsPerPixel(pixmap->drawable.depth); effXDepth = pixmap->drawable.depth; @@ -86,10 +87,12 @@ winScaleXBitmapToWindows (int iconSize, if (pixmap->drawable.depth == 15) effXDepth = 16; + /* Need 16-bit aligned rows for DDBitmaps */ + stride = ((iconSize * effBPP + 15) & (~15)) / 8; xStride = PixmapBytePad (pixmap->drawable.width, pixmap->drawable.depth); - if (xStride == 0) + if (stride == 0 || xStride == 0) { - ErrorF ("winScaleXBitmapToWindows - xStride is zero. " + ErrorF ("winScaleXBitmapToWindows - stride or xStride is zero. " "Bailing.\n"); return; } @@ -108,54 +111,9 @@ winScaleXBitmapToWindows (int iconSize, pixmap->drawable.width, pixmap->drawable.height, ZPixmap, 0xffffffff, iconData); - winScaleIconToWindows(iconSize, effBPP, - iconData, - pixmap->drawable.width, pixmap->drawable.height, - xStride, effXBPP, effXDepth, - image); - - free (iconData); -} - -/* - * Scale a drawable into a Windoze icon bitmap - */ - -static void -winScaleIconToWindows (int iconSize, - int effBPP, - unsigned char *iconData, - unsigned short width, - unsigned short height, - int xStride, - int effXBPP, - int effXDepth, - unsigned char *image) -{ - int row, column; - unsigned char *outPtr; - int stride; - float factX, factY; - int posX, posY; - unsigned char *ptr; - unsigned int zero; - unsigned int color; - - winDebug("winScaleIconToWindows: scaling from %d x %d @ %d bpp (depth %d) to %d x %d @ %d bpp\n", - width, height, effXBPP, effXDepth, iconSize, iconSize, effBPP); - - /* Need 16-bit aligned rows for DDBitmaps */ - stride = ((iconSize * effBPP + 15) & (~15)) / 8; - if (stride == 0) - { - ErrorF ("winScaleXBitmapToWindows - stride is zero. " - "Bailing.\n"); - return; - } - /* Keep aspect ratio */ - factX = ((float)width) / ((float)iconSize); - factY = ((float)height) / ((float)iconSize); + factX = ((float)pixmap->drawable.width) / ((float)iconSize); + factY = ((float)pixmap->drawable.height) / ((float)iconSize); if (factX > factY) factY = factX; else @@ -172,14 +130,14 @@ winScaleIconToWindows (int iconSize, posX = factX * column; posY = factY * row; - ptr = iconData + posY*xStride; + ptr = (unsigned char*) iconData + posY*xStride; if (effXBPP == 1) { ptr += posX / 8; /* Out of X icon bounds, leave space blank */ - if (posX >= width - || posY >= height) + if (posX >= pixmap->drawable.width + || posY >= pixmap->drawable.height) ptr = (unsigned char *) &zero; if ((*ptr) & (1 << (posX & 7))) @@ -224,8 +182,8 @@ winScaleIconToWindows (int iconSize, ptr += posX * (effXBPP / 8); /* Out of X icon bounds, leave space blank */ - if (posX >= width - || posY >= height) + if (posX >= pixmap->drawable.width + || posY >= pixmap->drawable.height) ptr = (unsigned char *) &zero; color = (((*ptr) << 16) + ((*(ptr + 1)) << 8) @@ -233,10 +191,10 @@ winScaleIconToWindows (int iconSize, switch (effBPP) { case 32: - *(outPtr++) = *(ptr++); // b - *(outPtr++) = *(ptr++); // g - *(outPtr++) = *(ptr++); // r - *(outPtr++) = (effXDepth == 32) ? *(ptr++) : 0x0; // alpha + *(outPtr++) = *(ptr++); /* b */ + *(outPtr++) = *(ptr++); /* g */ + *(outPtr++) = *(ptr++); /* r */ + *(outPtr++) = (effXDepth == 32) ? *(ptr++) : 0x0; /* alpha */ break; case 24: *(outPtr++) = *(ptr++); @@ -267,8 +225,8 @@ winScaleIconToWindows (int iconSize, ptr += posX * (effXBPP / 8); /* Out of X icon bounds, leave space blank */ - if (posX >= width - || posY >= height) + if (posX >= pixmap->drawable.width + || posY >= pixmap->drawable.height) ptr = (unsigned char *) &zero; color = ((*ptr) << 8) + (*(ptr + 1)); switch (effBPP) @@ -277,7 +235,7 @@ winScaleIconToWindows (int iconSize, *(outPtr++) = (color & 31) << 2; *(outPtr++) = ((color >> 5) & 31) << 2; *(outPtr++) = ((color >> 10) & 31) << 2; - *(outPtr++) = 0; // resvd + *(outPtr++) = 0; /* resvd */ break; case 24: *(outPtr++) = (color & 31) << 2; @@ -303,6 +261,123 @@ winScaleIconToWindows (int iconSize, } /* end if effxbpp==16) */ } /* end for column */ } /* end for row */ + free (iconData); +} + +static HICON +NetWMToWinIconAlpha(uint32_t *icon) +{ + int width = icon[0]; + int height = icon[1]; + uint32_t *pixels = &icon[2]; + HICON result; + HDC hdc = GetDC(NULL); + uint32_t *DIB_pixels; + ICONINFO ii = {TRUE}; + BITMAPV4HEADER bmh = {sizeof(bmh)}; + + /* Define an ARGB pixel format used for Color+Alpha icons */ + bmh.bV4Width = width; + bmh.bV4Height = -height; /* Invert the image */ + bmh.bV4Planes = 1; + bmh.bV4BitCount = 32; + bmh.bV4V4Compression = BI_BITFIELDS; + bmh.bV4AlphaMask = 0xFF000000; + bmh.bV4RedMask = 0x00FF0000; + bmh.bV4GreenMask = 0x0000FF00; + bmh.bV4BlueMask = 0x000000FF; + + ii.hbmColor = CreateDIBSection(hdc, (BITMAPINFO*)&bmh, + DIB_RGB_COLORS, (void**)&DIB_pixels, NULL, 0); + ReleaseDC(NULL, hdc); + ii.hbmMask = CreateBitmap(width, height, 1, 1, NULL); + memcpy(DIB_pixels, pixels, height*width*4); + + /* CreateIconIndirect() traditionally required DDBitmaps */ + /* Systems from WinXP accept 32-bit ARGB DIBitmaps with full 8-bit alpha support */ + /* The icon is created with a DIB + empty DDB mask (an MS example does the same) */ + result = CreateIconIndirect(&ii); + + DeleteObject(ii.hbmColor); + DeleteObject(ii.hbmMask); + + winDebug("NetWMToWinIconAlpha - %d x %d = %p\n", icon[0], icon[1], result); + return result; +} + +static HICON +NetWMToWinIconThreshold(uint32_t *icon) +{ + int width = icon[0]; + int height = icon[1]; + uint32_t *pixels = &icon[2]; + int row, col; + HICON result; + ICONINFO ii = {TRUE}; + + HDC hdc = GetDC(NULL); + HDC xorDC = CreateCompatibleDC(hdc); + HDC andDC = CreateCompatibleDC(hdc); + ii.hbmColor = CreateCompatibleBitmap(hdc, width, height); + ii.hbmMask = CreateCompatibleBitmap(hdc, width, height); + ReleaseDC(NULL, hdc); + SelectObject(xorDC, ii.hbmColor); + SelectObject(andDC, ii.hbmMask); + + for (row = 0; row < height; row++) { + for (col = 0; col < width; col++) { + if ((*pixels & 0xFF000000) > 31<<24) { /* 31 alpha threshold, i.e. opaque above, transparent below */ + SetPixelV(xorDC, col, row, RGB(((char*)pixels)[2], ((char*)pixels)[1], + ((char*)pixels)[0])); + SetPixelV(andDC, col, row, RGB(0, 0, 0)); /* black mask */ + } + else { + SetPixelV(xorDC, col, row, RGB(0, 0, 0)); + SetPixelV(andDC, col, row, RGB(255, 255, 255)); /* white mask */ + } + pixels++; + } + } + DeleteDC(xorDC); + DeleteDC(andDC); + + result = CreateIconIndirect(&ii); + + DeleteObject(ii.hbmColor); + DeleteObject(ii.hbmMask ); + + winDebug("NetWMToWinIconThreshold - %d x %d = %p\n", icon[0], icon[1], result); + return result; +} + +static HICON +NetWMToWinIcon(int bpp, uint32_t *icon) +{ + static Bool hasIconAlphaChannel = FALSE; + static BOOL versionChecked = FALSE; + + if (!versionChecked) + { + OSVERSIONINFOEX osvi = {0}; + ULONGLONG dwlConditionMask = 0; + + osvi.dwOSVersionInfoSize = sizeof (osvi); + osvi.dwMajorVersion = 5; + osvi.dwMinorVersion = 1; + + /* Windows versions later than XP have icon alpha channel suport, 2000 does not */ + VER_SET_CONDITION(dwlConditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL); + VER_SET_CONDITION(dwlConditionMask, VER_MINORVERSION, VER_GREATER_EQUAL); + hasIconAlphaChannel = VerifyVersionInfo(&osvi, VER_MAJORVERSION | VER_MINORVERSION, dwlConditionMask); + versionChecked = TRUE; + + ErrorF("OS has icon alpha channel support: %s\n", hasIconAlphaChannel ? "yes" : "no"); + } + + if (hasIconAlphaChannel && (bpp==32)) + return NetWMToWinIconAlpha(icon); + else + return NetWMToWinIconThreshold(icon); } static pointer @@ -312,7 +387,7 @@ GetWindowProp(WindowPtr pWin, Atom name, long int *size_return) struct _Property *prop; if (!pWin || !name) { - winDebug("GetWindowProp - pWin or name was NULL\n"); + ErrorF ("GetWindowProp - pWin or name was NULL\n"); return 0; } pwin = (struct _Window*) pWin; @@ -328,26 +403,6 @@ GetWindowProp(WindowPtr pWin, Atom name, long int *size_return) return NULL; } -static void -winScaleNetWMIconToWindows (int iconSize, - int effBPP, - uint32_t *icondata, - unsigned char *image) -{ - int height, width; - uint32_t *pixels; - - width = icondata[0]; - height = icondata[1]; - pixels = &icondata[2]; - - winScaleIconToWindows(iconSize, effBPP, - (unsigned char *)pixels, - width, height, - width*4, 32, 32, - image); -} - /* * Attempt to create a custom icon from the WM_HINTS bitmaps */ @@ -355,125 +410,98 @@ winScaleNetWMIconToWindows (int iconSize, HICON winXIconToHICON (WindowPtr pWin, int iconSize) { - unsigned char *mask, *image; + unsigned char *mask, *image, *imageMask; unsigned char *dst, *src; PixmapPtr iconPtr; PixmapPtr maskPtr; int planes, bpp, effBPP, stride, maskStride, i; + int biggest_size = 0; HDC hDC; ICONINFO ii; WinXWMHints hints; HICON hIcon = NULL; - Bool net_wm_icon_found = FALSE; + uint32_t *biggest_icon = NULL; - static Atom _XA_NET_WM_ICON = 0; - uint32_t *icon, *icon_data; + /* Try to get _NET_WM_ICON icons first */ + static Atom _XA_NET_WM_ICON; + static int generation; + uint32_t *icon, *icon_data = NULL; long int size=0; - + hDC = GetDC (GetDesktopWindow ()); planes = GetDeviceCaps (hDC, PLANES); bpp = GetDeviceCaps (hDC, BITSPIXEL); ReleaseDC (GetDesktopWindow (), hDC); - - /* 15 BPP is really 16BPP as far as we care */ - if (bpp == 15) - effBPP = 16; - else - effBPP = bpp; - - /* Need 16-bit aligned rows for DDBitmaps */ - stride = ((iconSize * effBPP + 15) & (~15)) / 8; - /* Mask is 1-bit deep */ - maskStride = ((iconSize * 1 + 15) & (~15)) / 8; + if (generation != serverGeneration) { + generation = serverGeneration; + _XA_NET_WM_ICON = MakeAtom("_NET_WM_ICON", 12, TRUE); + } - if (!_XA_NET_WM_ICON) _XA_NET_WM_ICON = MakeAtom("_NET_WM_ICON", 12, FALSE); - - /* Always prefer _NET_WM_ICON icons */ - icon_data = GetWindowProp(pWin, _XA_NET_WM_ICON, &size); + if (_XA_NET_WM_ICON) icon_data = GetWindowProp(pWin, _XA_NET_WM_ICON, &size); if (icon_data) { - uint32_t *best_icon = 0; - unsigned int best_size = 0; - - /* - For scaling to the required size, choose the smallest icon which is - bigger than or equal to the required size, failing that, the biggest - icon which is smaller than the required size - */ for(icon = icon_data; - icon < &icon_data[size] && *icon; - icon = &icon[icon[0]*icon[1]+2]) + icon < &icon_data[size] && *icon; + icon = &icon[icon[0]*icon[1]+2]) { - unsigned int candidateSize = (icon[0] + icon[1])/2; - winDebug("winXIconToHICON: pWin%x found %lu x %lu NetIcon\n",(int)pWin,icon[0],icon[1]); - - if (((best_size < iconSize) && ((candidateSize > best_size) || (candidateSize >= iconSize))) - || ((best_size > iconSize) && (candidateSize >= iconSize) && (candidateSize < best_size))) + if (icon[0]==iconSize && icon[1]==iconSize) + return NetWMToWinIcon(bpp, icon); + /* Find the biggest icon and let Windows scale the size */ + else if (biggest_size < icon[0]) { - best_icon = icon; - best_size = candidateSize; + biggest_icon = icon; + biggest_size = icon[0]; } } - - if (best_icon) - { - winDebug("winXIconToHICON: pWin%x selected %lu x %lu NetIcon for scaling to %u x %u\n", - (int)pWin, best_icon[0], best_icon[1], iconSize, iconSize ); - - image = malloc (stride * iconSize); - - /* Use a completely black mask, image has alpha */ - mask = calloc (maskStride, iconSize); - - winScaleNetWMIconToWindows(iconSize, effBPP, best_icon, image); - net_wm_icon_found = TRUE; - } - else - { - winDebug("winXIconToHICON: pWin %x no %d x %d NetIcon\n",(int)pWin,iconSize,iconSize); - } + if (biggest_icon) + return NetWMToWinIcon(bpp, biggest_icon); } + winDebug("winXIconToHICON - pWin %x: no suitable NetIcon\n",(int)pWin, iconSize); - if (!net_wm_icon_found) - { - unsigned char *imageMask; - - winMultiWindowGetWMHints (pWin, &hints); - winDebug("winXIconToHICON: pWin 0x%x icon_pixmap hint %x\n", pWin, hints.icon_pixmap); - if (!hints.icon_pixmap) return NULL; - - iconPtr = (PixmapPtr) LookupIDByType (hints.icon_pixmap, RT_PIXMAP); - winDebug("winXIconToHICON: pWin 0x%x iconPtr 0x%x\n", pWin, iconPtr); - - if (!iconPtr) return NULL; - - image = malloc (stride * iconSize); - imageMask = malloc (stride * iconSize); - /* Default to a completely black mask */ - mask = calloc (maskStride, iconSize); + winMultiWindowGetWMHints (pWin, &hints); + if (!hints.icon_pixmap) return NULL; - winScaleXBitmapToWindows (iconSize, effBPP, iconPtr, image); - maskPtr = (PixmapPtr) LookupIDByType (hints.icon_mask, RT_PIXMAP); + iconPtr = (PixmapPtr) LookupIDByType (hints.icon_pixmap, RT_PIXMAP); + + if (!iconPtr) return NULL; - if (maskPtr) - { - winScaleXBitmapToWindows (iconSize, 1, maskPtr, mask); + /* 15 BPP is really 16BPP as far as we care */ + if (bpp == 15) + effBPP = 16; + else + effBPP = bpp; + + /* Need 16-bit aligned rows for DDBitmaps */ + stride = ((iconSize * effBPP + 15) & (~15)) / 8; - winScaleXBitmapToWindows (iconSize, effBPP, maskPtr, imageMask); + /* Mask is 1-bit deep */ + maskStride = ((iconSize * 1 + 15) & (~15)) / 8; - /* Now we need to set all bits of the icon which are not masked */ - /* on to 0 because Color is really an XOR, not an OR function */ - dst = image; - src = imageMask; + image = malloc (stride * iconSize); + imageMask = malloc (stride * iconSize); + /* Default to a completely black mask */ + mask = calloc (maskStride, iconSize); + + winScaleXBitmapToWindows (iconSize, effBPP, iconPtr, image); + maskPtr = (PixmapPtr) LookupIDByType (hints.icon_mask, RT_PIXMAP); - for (i = 0; i < (stride * iconSize); i++) - if ((*(src++))) - *(dst++) = 0; - else - dst++; - } - free (imageMask); + if (maskPtr) + { + winScaleXBitmapToWindows (iconSize, 1, maskPtr, mask); + + winScaleXBitmapToWindows (iconSize, effBPP, maskPtr, imageMask); + + /* Now we need to set all bits of the icon which are not masked */ + /* on to 0 because Color is really an XOR, not an OR function */ + dst = image; + src = imageMask; + + for (i = 0; i < (stride * iconSize); i++) + if ((*(src++))) + *(dst++) = 0; + else + dst++; } ii.fIcon = TRUE; @@ -496,13 +524,15 @@ winXIconToHICON (WindowPtr pWin, int iconSize) /* Free X mask and bitmap */ free (mask); free (image); + free (imageMask); return hIcon; } + /* - * Change the Windows window icon + * Change the Windows window icon */ #ifdef XWIN_MULTIWINDOW @@ -510,44 +540,37 @@ void winUpdateIcon (Window id) { WindowPtr pWin; - HICON hIcon, hIconSmall, hiconOld; + HICON hIcon, hIconSmall=NULL, hIconOld; pWin = (WindowPtr) LookupIDByType (id, RT_WINDOW); if (!pWin) return; -{ + { winWindowPriv(pWin); - if (!pWinPriv->hWnd) return; - - hIcon = (HICON)winOverrideIcon ((unsigned long)pWin); - - if (!hIcon) - hIcon = winXIconToHICON (pWin, GetSystemMetrics(SM_CXICON)); - - if (hIcon) - { - hiconOld = (HICON) SetClassLong (pWinPriv->hWnd, - GCL_HICON, - (int) hIcon); - - /* Delete the icon if its not the default */ - if (hiconOld != g_hIconX) - winDestroyIcon(hiconOld); + if (pWinPriv->hWnd) { + hIcon = winOverrideIcon ((unsigned long)pWin); + if (!hIcon) { + hIcon = winXIconToHICON (pWin, GetSystemMetrics(SM_CXICON)); + if (!hIcon) { + hIcon = g_hIconX; + hIconSmall = g_hSmallIconX; + } else { + /* Leave undefined if not found */ + hIconSmall = winXIconToHICON (pWin, GetSystemMetrics(SM_CXSMICON)); + } } - - hIconSmall = (HICON)winOverrideIcon ((unsigned long)pWin); - if (!hIconSmall) - hIconSmall = winXIconToHICON (pWin, GetSystemMetrics(SM_CXSMICON)); + /* Set the large icon */ + hIconOld = (HICON) SendMessage (pWinPriv->hWnd, + WM_SETICON, ICON_BIG, (LPARAM) hIcon); - if (hIconSmall) - { - hiconOld = (HICON) SetClassLong (pWinPriv->hWnd, - GCL_HICONSM, - (int) hIconSmall); - if (hiconOld != g_hSmallIconX) - winDestroyIcon (hiconOld); + /* Delete the icon if its not the default */ + winDestroyIcon(hIconOld); - } + /* Same for the small icon */ + hIconOld = (HICON) SendMessage (pWinPriv->hWnd, + WM_SETICON, ICON_SMALL, (LPARAM) hIconSmall); + winDestroyIcon(hIconOld); + } } } @@ -558,8 +581,8 @@ void winInitGlobalIcons (void) /* Load default X icon in case it's not ready yet */ if (!g_hIconX) { - g_hIconX = (HICON)winOverrideDefaultIcon(sm_cx); - g_hSmallIconX = (HICON)winOverrideDefaultIcon(sm_cxsm); + g_hIconX = winOverrideDefaultIcon(sm_cx); + g_hSmallIconX = winOverrideDefaultIcon(sm_cxsm); } if (!g_hIconX) diff --git a/xorg-server/hw/xwin/winmultiwindowwindow.c b/xorg-server/hw/xwin/winmultiwindowwindow.c index 88e7700dc..e2b5ed291 100644 --- a/xorg-server/hw/xwin/winmultiwindowwindow.c +++ b/xorg-server/hw/xwin/winmultiwindowwindow.c @@ -44,9 +44,9 @@ * External global variables */ -extern HWND g_hDlgDepthChange; - -extern void winSelectIcons(WindowPtr pWin, HICON *pIcon, HICON *pSmallIcon); +extern HICON g_hIconX; +extern HICON g_hSmallIconX; +extern HWND g_hDlgDepthChange; /* * Prototypes for local functions @@ -76,6 +76,35 @@ winFindWindow (pointer value, XID id, pointer cdata); #define SubStrSend(pWin,pParent) (StrSend(pWin) || SubSend(pParent)) +static +void winInitMultiWindowClass(void) +{ + static wATOM atomXWinClass=0; + WNDCLASSEX wcx; + + if (atomXWinClass==0) + { + /* Setup our window class */ + wcx.cbSize=sizeof(WNDCLASSEX); + wcx.style = CS_HREDRAW | CS_VREDRAW; + wcx.lpfnWndProc = winTopLevelWindowProc; + wcx.cbClsExtra = 0; + wcx.cbWndExtra = 0; + wcx.hInstance = g_hInstance; + wcx.hIcon = g_hIconX; + wcx.hCursor = 0; + wcx.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH); + wcx.lpszMenuName = NULL; + wcx.lpszClassName = WINDOW_CLASS_X; + wcx.hIconSm = g_hSmallIconX; + +#if CYGMULTIWINDOW_DEBUG + ErrorF ("winCreateWindowsWindow - Creating class: %s\n", WINDOW_CLASS_X); +#endif + + atomXWinClass = RegisterClassEx (&wcx); + } +} /* * CreateWindow - See Porting Layer Definition - p. 37 @@ -270,7 +299,6 @@ winChangeWindowAttributesMultiWindow (WindowPtr pWin, unsigned long mask) { Bool fResult = TRUE; ScreenPtr pScreen = pWin->drawable.pScreen; - winWindowPriv(pWin); winScreenPriv(pScreen); #if CYGMULTIWINDOW_DEBUG @@ -363,7 +391,6 @@ void winReparentWindowMultiWindow (WindowPtr pWin, WindowPtr pPriorParent) { ScreenPtr pScreen = pWin->drawable.pScreen; - winWindowPriv(pWin); winScreenPriv(pScreen); #if CYGMULTIWINDOW_DEBUG @@ -387,12 +414,13 @@ winReparentWindowMultiWindow (WindowPtr pWin, WindowPtr pPriorParent) void winRestackWindowMultiWindow (WindowPtr pWin, WindowPtr pOldNextSib) { +#if 0 WindowPtr pPrevWin; UINT uFlags; HWND hInsertAfter; HWND hWnd = NULL; +#endif ScreenPtr pScreen = pWin->drawable.pScreen; - winWindowPriv(pWin); winScreenPriv(pScreen); #if CYGMULTIWINDOW_DEBUG || CYGWINDOWING_DEBUG @@ -480,18 +508,15 @@ winCreateWindowsWindow (WindowPtr pWin) int iHeight; HWND hWnd; HWND hFore = NULL; - WNDCLASSEX wc; winWindowPriv(pWin); HICON hIcon; HICON hIconSmall; -#define CLASS_NAME_LENGTH 512 - char pszClass[CLASS_NAME_LENGTH], pszWindowID[12]; - char *res_name, *res_class, *res_role; - static int s_iWindowID = 0; winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv; WinXSizeHints hints; WindowPtr pDaddy; + winInitMultiWindowClass(); + #if CYGMULTIWINDOW_DEBUG ErrorF ("winCreateWindowsWindow - pWin: %08x\n", pWin); #endif @@ -499,70 +524,20 @@ winCreateWindowsWindow (WindowPtr pWin) iX = pWin->drawable.x + GetSystemMetrics (SM_XVIRTUALSCREEN); iY = pWin->drawable.y + GetSystemMetrics (SM_YVIRTUALSCREEN); - iWidth = pWin->drawable.width; - iHeight = pWin->drawable.height; - - /* ensure window actually ends up somewhere visible */ - if (iX > GetSystemMetrics (SM_CXVIRTUALSCREEN)) - iX = CW_USEDEFAULT; - - if (iY > GetSystemMetrics (SM_CYVIRTUALSCREEN)) - iY = CW_USEDEFAULT; - - winSelectIcons(pWin, &hIcon, &hIconSmall); - - /* Set standard class name prefix so we can identify window easily */ - strncpy (pszClass, WINDOW_CLASS_X, sizeof(pszClass)); - - if (winMultiWindowGetClassHint (pWin, &res_name, &res_class)) + /* Default positions if none specified */ + if (!winMultiWindowGetWMNormalHints(pWin, &hints)) + hints.flags = 0; + if ( !(hints.flags & (USPosition|PPosition)) && + !winMultiWindowGetTransientFor (pWin, NULL) && + !pWin->overrideRedirect ) { - strncat (pszClass, "-", 1); - strncat (pszClass, res_name, CLASS_NAME_LENGTH - strlen (pszClass)); - strncat (pszClass, "-", 1); - strncat (pszClass, res_class, CLASS_NAME_LENGTH - strlen (pszClass)); - - /* Check if a window class is provided by the WM_WINDOW_ROLE property, - * if not use the WM_CLASS information. - * For further information see: - * http://tronche.com/gui/x/icccm/sec-5.html - */ - if (winMultiWindowGetWindowRole (pWin, &res_role) ) - { - strcat (pszClass, "-"); - strcat (pszClass, res_role); - free (res_role); - } - - free (res_name); - free (res_class); + iX = CW_USEDEFAULT; + iY = CW_USEDEFAULT; } - /* Add incrementing window ID to make unique class name */ - snprintf (pszWindowID, sizeof(pszWindowID), "-%x", s_iWindowID++); - pszWindowID[sizeof(pszWindowID)-1] = 0; - strcat (pszClass, pszWindowID); - -#if CYGMULTIWINDOW_DEBUG - ErrorF ("winCreateWindowsWindow - Creating class: %s\n", pszClass); -#endif + iWidth = pWin->drawable.width; + iHeight = pWin->drawable.height; - /* Setup our window class */ - wc.cbSize = sizeof(wc); - wc.style = CS_HREDRAW | CS_VREDRAW; - wc.lpfnWndProc = winTopLevelWindowProc; - wc.cbClsExtra = 0; - wc.cbWndExtra = 0; - wc.hInstance = g_hInstance; - wc.hIcon = hIcon; - wc.hIconSm = hIconSmall; - wc.hCursor = 0; - wc.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH); - wc.lpszMenuName = NULL; - wc.lpszClassName = pszClass; - RegisterClassEx (&wc); - - if (!pWin->overrideRedirect) - { if (winMultiWindowGetTransientFor (pWin, &pDaddy)) { if (pDaddy) @@ -571,23 +546,12 @@ winCreateWindowsWindow (WindowPtr pWin) if (hFore && (pDaddy != (WindowPtr)GetProp(hFore, WIN_WID_PROP))) hFore = NULL; } } - else - { - /* Default positions if none specified */ - if (!winMultiWindowGetWMNormalHints(pWin, &hints)) hints.flags = 0; - if (!(hints.flags & (USPosition|PPosition))) - { - iX = CW_USEDEFAULT; - iY = CW_USEDEFAULT; - } - } - } /* Create the window */ /* Make it OVERLAPPED in create call since WS_POPUP doesn't support */ /* CW_USEDEFAULT, change back to popup after creation */ hWnd = CreateWindowExA (WS_EX_TOOLWINDOW, /* Extended styles */ - pszClass, /* Class name */ + WINDOW_CLASS_X, /* Class name */ WINDOW_TITLE_X, /* Window name */ WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, iX, /* Horizontal position */ @@ -603,23 +567,27 @@ winCreateWindowsWindow (WindowPtr pWin) ErrorF ("winCreateWindowsWindow - CreateWindowExA () failed: %d\n", (int) GetLastError ()); } + pWinPriv->hWnd = hWnd; + + /* Set application or .XWinrc defined Icons */ + winSelectIcons(pWin, &hIcon, &hIconSmall); + if (hIcon) SendMessage (hWnd, WM_SETICON, ICON_BIG, (LPARAM) hIcon); + if (hIconSmall) SendMessage (hWnd, WM_SETICON, ICON_SMALL, (LPARAM) hIconSmall); /* Change style back to popup, already placed... */ - SetWindowLong (hWnd, GWL_STYLE, WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS); + SetWindowLongPtr(hWnd, GWL_STYLE, WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS); SetWindowPos (hWnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); /* Make sure it gets the proper system menu for a WS_POPUP, too */ GetSystemMenu (hWnd, TRUE); - pWinPriv->hWnd = hWnd; - /* Cause any .XWinrc menus to be added in main WNDPROC */ PostMessage (hWnd, WM_INIT_SYS_MENU, 0, 0); - SetProp (pWinPriv->hWnd, WIN_WID_PROP, (HANDLE) winGetWindowID(pWin)); + SetProp (hWnd, WIN_WID_PROP, (HANDLE) winGetWindowID(pWin)); /* Flag that this Windows window handles its own activation */ - SetProp (pWinPriv->hWnd, WIN_NEEDMANAGE_PROP, (HANDLE) 0); + SetProp (hWnd, WIN_NEEDMANAGE_PROP, (HANDLE) 0); /* Call engine-specific create window procedure */ (*pScreenPriv->pwinFinishCreateWindowsWindow) (pWin); @@ -636,11 +604,6 @@ winDestroyWindowsWindow (WindowPtr pWin) { MSG msg; winWindowPriv(pWin); - HICON hiconClass; - HICON hiconSmClass; - HMODULE hInstance; - int iReturn; - char pszClass[512]; BOOL oldstate = winInDestroyWindowsWindow; #if CYGMULTIWINDOW_DEBUG @@ -653,12 +616,6 @@ winDestroyWindowsWindow (WindowPtr pWin) winInDestroyWindowsWindow = TRUE; - /* Store the info we need to destroy after this window is gone */ - hInstance = (HINSTANCE) GetClassLong (pWinPriv->hWnd, GCL_HMODULE); - hiconClass = (HICON) GetClassLong (pWinPriv->hWnd, GCL_HICON); - hiconSmClass = (HICON) GetClassLong (pWinPriv->hWnd, GCL_HICONSM); - iReturn = GetClassName (pWinPriv->hWnd, pszClass, 512); - SetProp (pWinPriv->hWnd, WIN_WINDOW_PROP, NULL); /* Destroy the Windows window */ DestroyWindow (pWinPriv->hWnd); @@ -675,22 +632,6 @@ winDestroyWindowsWindow (WindowPtr pWin) } } - /* Only if we were able to get the name */ - if (iReturn) - { -#if CYGMULTIWINDOW_DEBUG - ErrorF ("winDestroyWindowsWindow - Unregistering %s: ", pszClass); -#endif - iReturn = UnregisterClass (pszClass, hInstance); - -#if CYGMULTIWINDOW_DEBUG - ErrorF ("winDestroyWindowsWindow - %d Deleting Icon: ", iReturn); -#endif - - winDestroyIcon(hiconClass); - winDestroyIcon(hiconSmClass); - } - winInDestroyWindowsWindow = oldstate; #if CYGMULTIWINDOW_DEBUG @@ -869,7 +810,7 @@ winMinimizeWindow (Window id) ErrorF ("winMinimizeWindow\n"); #endif - pWin = LookupIDByType (id, RT_WINDOW); + pWin = (WindowPtr) LookupIDByType (id, RT_WINDOW); if (!pWin) { ErrorF("%s: NULL pWin. Leaving\n", __FUNCTION__); @@ -907,7 +848,6 @@ winCopyWindowMultiWindow (WindowPtr pWin, DDXPointRec oldpt, RegionPtr oldRegion) { ScreenPtr pScreen = pWin->drawable.pScreen; - winWindowPriv(pWin); winScreenPriv(pScreen); #if CYGWINDOWING_DEBUG @@ -927,7 +867,6 @@ winMoveWindowMultiWindow (WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind) { ScreenPtr pScreen = pWin->drawable.pScreen; - winWindowPriv(pWin); winScreenPriv(pScreen); #if CYGWINDOWING_DEBUG @@ -948,7 +887,6 @@ winResizeWindowMultiWindow (WindowPtr pWin, int x, int y, unsigned int w, unsigned int h, WindowPtr pSib) { ScreenPtr pScreen = pWin->drawable.pScreen; - winWindowPriv(pWin); winScreenPriv(pScreen); #if CYGWINDOWING_DEBUG diff --git a/xorg-server/hw/xwin/winmultiwindowwm.c b/xorg-server/hw/xwin/winmultiwindowwm.c index 6a0928f06..4c908daf9 100644 --- a/xorg-server/hw/xwin/winmultiwindowwm.c +++ b/xorg-server/hw/xwin/winmultiwindowwm.c @@ -1,6 +1,6 @@ /* *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. - *Copyright (C) Colin Harrison 2005-2008 + *Copyright (C) Colin Harrison 2005-2009 * *Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -57,8 +57,6 @@ typedef int pid_t; #include <X11/Xproto.h> #include <X11/Xutil.h> #include <X11/cursorfont.h> - -/* Windows headers */ #include <X11/Xwindows.h> /* Local headers */ @@ -67,9 +65,15 @@ typedef int pid_t; #include "winwindow.h" #include "winprefs.h" #include "window.h" +#include "pixmapstr.h" #include "windowstr.h" + #ifdef XWIN_MULTIWINDOWEXTWM #include <X11/extensions/windowswmstr.h> +#else +/* We need the native HWND atom for intWM, so for consistency use the + same name as extWM would if we were building with enabled... */ +#define WINDOWSWM_NATIVE_HWND "_WINDOWSWM_NATIVE_HWND" #endif extern void winDebug(const char *format, ...); @@ -260,6 +264,12 @@ PushMessage (WMMsgQueuePtr pQueue, WMMsgNodePtr pNode) case WM_WM_MAP: ErrorF ("\tWM_WM_MAP\n"); break; + case WM_WM_MAP2: + ErrorF ("\tWM_WM_MAP2\n"); + break; + case WM_WM_MAP3: + ErrorF ("\tWM_WM_MAP3\n"); + break; case WM_WM_UNMAP: ErrorF ("\tWM_WM_UNMAP\n"); break; @@ -731,6 +741,28 @@ winMultiWindowWMProc (void *pArg) 1); break; + case WM_WM_MAP3: +#if CYGMULTIWINDOW_DEBUG + ErrorF ("\tWM_WM_MAP3\n"); +#endif + /* Put a note as to the HWND associated with this Window */ + XChangeProperty (pWMInfo->pDisplay, + pNode->msg.iWindow, + pWMInfo->atmPrivMap, + XA_INTEGER,//pWMInfo->atmPrivMap, + 32, + PropModeReplace, + (unsigned char *) &(pNode->msg.hwndWindow), + 1); + UpdateName (pWMInfo, pNode->msg.iWindow); + winUpdateIcon (pNode->msg.iWindow); + { + HWND zstyle = HWND_NOTOPMOST; + winApplyHints (pWMInfo->pDisplay, pNode->msg.iWindow, pNode->msg.hwndWindow, &zstyle); + winUpdateWindowPosition (pNode->msg.hwndWindow, TRUE, &zstyle); + } + break; + case WM_WM_UNMAP: #if CYGMULTIWINDOW_DEBUG ErrorF ("\tWM_WM_UNMAP\n"); @@ -1085,7 +1117,6 @@ winMultiWindowXMsgProc (void *pArg) XCloseDisplay (pProcArg->pDisplay); pthread_exit (NULL); return NULL; - } @@ -1464,18 +1495,17 @@ CheckAnotherWindowManager (Display *pDisplay, DWORD dwScreen) */ void -winDeinitMultiWindowWM () +winDeinitMultiWindowWM (void) { ErrorF ("winDeinitMultiWindowWM - Noting shutdown in progress\n"); g_shutdown = TRUE; } /* Windows window styles */ -#define HINT_NOFRAME (1L<<0) +#define HINT_NOFRAME (1l<<0) #define HINT_BORDER (1L<<1) -#define HINT_SIZEBOX (1L<<2) -#define HINT_CAPTION (1L<<3) -#define HINT_NOMAXIMIZE (1L<<4) +#define HINT_SIZEBOX (1l<<2) +#define HINT_CAPTION (1l<<3) /* These two are used on their own */ #define HINT_MAX (1L<<0) #define HINT_MIN (1L<<1) @@ -1483,21 +1513,30 @@ winDeinitMultiWindowWM () static void winApplyHints (Display *pDisplay, Window iWindow, HWND hWnd, HWND *zstyle) { - static Atom windowState, motif_wm_hints, windowType; - Atom type, *pAtom = NULL; - int format; - unsigned long hint = 0, maxmin = 0, rcStyle, nitems = 0 , left = 0; - WindowPtr pWin = GetProp (hWnd, WIN_WINDOW_PROP); + static Atom windowState, motif_wm_hints, windowType; + static Atom hiddenState, fullscreenState, belowState, aboveState; + static Atom dockWindow; + static int generation; + Atom type, *pAtom = NULL; + int format; + unsigned long hint = 0, maxmin = 0, style, nitems = 0 , left = 0; + WindowPtr pWin = GetProp (hWnd, WIN_WINDOW_PROP); MwmHints *mwm_hint = NULL; - XSizeHints *normal_hint; - long supplied; if (!hWnd) return; if (!IsWindow (hWnd)) return; - if (windowState == None) windowState = XInternAtom(pDisplay, "_NET_WM_STATE", False); - if (motif_wm_hints == None) motif_wm_hints = XInternAtom(pDisplay, "_MOTIF_WM_HINTS", False); - if (windowType == None) windowType = XInternAtom(pDisplay, "_NET_WM_WINDOW_TYPE", False); + if (generation != serverGeneration) { + generation = serverGeneration; + windowState = XInternAtom(pDisplay, "_NET_WM_STATE", False); + motif_wm_hints = XInternAtom(pDisplay, "_MOTIF_WM_HINTS", False); + windowType = XInternAtom(pDisplay, "_NET_WM_WINDOW_TYPE", False); + hiddenState = XInternAtom(pDisplay, "_NET_WM_STATE_HIDDEN", False); + fullscreenState = XInternAtom(pDisplay, "_NET_WM_STATE_FULLSCREEN", False); + belowState = XInternAtom(pDisplay, "_NET_WM_STATE_BELOW", False); + aboveState = XInternAtom(pDisplay, "_NET_WM_STATE_ABOVE", False); + dockWindow = XInternAtom(pDisplay, "_NET_WM_WINDOW_TYPE_DOCK", False); + } if (XGetWindowProperty(pDisplay, iWindow, windowState, 0L, 1L, False, XA_ATOM, &type, &format, @@ -1505,11 +1544,6 @@ winApplyHints (Display *pDisplay, Window iWindow, HWND hWnd, HWND *zstyle) { if (pAtom && nitems == 1) { - static Atom hiddenState, fullscreenState, belowState, aboveState; - if (hiddenState == None) hiddenState = XInternAtom(pDisplay, "_NET_WM_STATE_HIDDEN", False); - if (fullscreenState == None) fullscreenState = XInternAtom(pDisplay, "_NET_WM_STATE_FULLSCREEN", False); - if (belowState == None) belowState = XInternAtom(pDisplay, "_NET_WM_STATE_BELOW", False); - if (aboveState == None) aboveState = XInternAtom(pDisplay, "_NET_WM_STATE_ABOVE", False); if (*pAtom == hiddenState) maxmin |= HINT_MIN; else if (*pAtom == fullscreenState) maxmin |= HINT_MAX; if (*pAtom == belowState) *zstyle = HWND_BOTTOM; @@ -1544,73 +1578,47 @@ winApplyHints (Display *pDisplay, Window iWindow, HWND hWnd, HWND *zstyle) { if (pAtom && nitems == 1) { - static Atom dockWindow; - if (dockWindow == None) dockWindow = XInternAtom(pDisplay, "_NET_WM_WINDOW_TYPE_DOCK", False); if (*pAtom == dockWindow) { - hint = (hint & ~HINT_NOFRAME) | HINT_SIZEBOX; /* VcXsrv puts a sizebox on dock windows */ + hint = (hint & ~HINT_NOFRAME) | HINT_SIZEBOX; /* Xming puts a sizebox on dock windows */ *zstyle = HWND_TOPMOST; } } if (pAtom) XFree(pAtom); } - normal_hint = XAllocSizeHints(); - if (normal_hint && (XGetWMNormalHints(pDisplay, iWindow, normal_hint, &supplied) == Success)) - { - if (normal_hint->flags & PMaxSize) - { - /* Not maximizable if a maximum size is specified */ - hint |= HINT_NOMAXIMIZE; - - if (normal_hint->flags & PMinSize) - { - /* - If both minimum size and maximum size are specified and are the same, - don't bother with a resizing frame - */ - if ((normal_hint->min_width == normal_hint->max_width) - && (normal_hint->min_height == normal_hint->max_height)) - hint = (hint & ~HINT_SIZEBOX); - } - } - } - XFree(normal_hint); - /* Apply Styles, overriding hint settings from above */ - rcStyle = winOverrideStyle((unsigned long)pWin); - if (rcStyle & STYLE_TOPMOST) *zstyle = HWND_TOPMOST; - else if (rcStyle & STYLE_MAXIMIZE) maxmin = (hint & ~HINT_MIN) | HINT_MAX; - else if (rcStyle & STYLE_MINIMIZE) maxmin = (hint & ~HINT_MAX) | HINT_MIN; - else if (rcStyle & STYLE_BOTTOM) *zstyle = HWND_BOTTOM; + style = winOverrideStyle((unsigned long)pWin); + if (style & STYLE_TOPMOST) *zstyle = HWND_TOPMOST; + else if (style & STYLE_MAXIMIZE) maxmin = (hint & ~HINT_MIN) | HINT_MAX; + else if (style & STYLE_MINIMIZE) maxmin = (hint & ~HINT_MAX) | HINT_MIN; + else if (style & STYLE_BOTTOM) *zstyle = HWND_BOTTOM; if (maxmin & HINT_MAX) SendMessage(hWnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0); else if (maxmin & HINT_MIN) SendMessage(hWnd, WM_SYSCOMMAND, SC_MINIMIZE, 0); - if (rcStyle & STYLE_NOTITLE) + if (style & STYLE_NOTITLE) hint = (hint & ~HINT_NOFRAME & ~HINT_BORDER & ~HINT_CAPTION) | HINT_SIZEBOX; - else if (rcStyle & STYLE_OUTLINE) + else if (style & STYLE_OUTLINE) hint = (hint & ~HINT_NOFRAME & ~HINT_SIZEBOX & ~HINT_CAPTION) | HINT_BORDER; - else if (rcStyle & STYLE_NOFRAME) + else if (style & STYLE_NOFRAME) hint = (hint & ~HINT_BORDER & ~HINT_CAPTION & ~HINT_SIZEBOX) | HINT_NOFRAME; - SetWindowLongPtr (hWnd, GWL_STYLE, GetWindowLongPtr(hWnd, GWL_STYLE) & ~WS_CAPTION & ~WS_SIZEBOX); /* Just in case */ - if (!hint) /* All on */ - SetWindowLongPtr (hWnd, GWL_STYLE, GetWindowLongPtr(hWnd, GWL_STYLE) | WS_CAPTION | WS_SIZEBOX); + style = GetWindowLongPtr(hWnd, GWL_STYLE) & ~WS_CAPTION & ~WS_SIZEBOX; /* Just in case */ + if (!style) return; + if (!hint) /* All on, but no resize of children is allowed */ + style = style | WS_CAPTION | (GetParent(hWnd) ? 0 : WS_SIZEBOX); else if (hint & HINT_NOFRAME); /* All off, so do nothing */ - else SetWindowLongPtr (hWnd, GWL_STYLE, GetWindowLongPtr(hWnd, GWL_STYLE) | - ((hint & HINT_BORDER) ? WS_BORDER : 0) | - ((hint & HINT_SIZEBOX) ? WS_SIZEBOX : 0) | - ((hint & HINT_CAPTION) ? WS_CAPTION : 0)); - - if (hint & HINT_NOMAXIMIZE) - SetWindowLongPtr(hWnd, GWL_STYLE, GetWindowLongPtr(hWnd, GWL_STYLE) & ~WS_MAXIMIZEBOX); + else style = style | ((hint & HINT_BORDER) ? WS_BORDER : 0) | + ((hint & HINT_SIZEBOX) ? (GetParent(hWnd) ? 0 : WS_SIZEBOX) : 0) | + ((hint & HINT_CAPTION) ? WS_CAPTION : 0); + SetWindowLongPtr (hWnd, GWL_STYLE, style); } void winUpdateWindowPosition (HWND hWnd, Bool reshape, HWND *zstyle) { - int iX, iY, iWidth, iHeight; + int iX, iY, iWidth, iHeight; int iDx, iDy; RECT rcNew; WindowPtr pWin = GetProp (hWnd, WIN_WINDOW_PROP); diff --git a/xorg-server/hw/xwin/winmultiwindowwndproc.c b/xorg-server/hw/xwin/winmultiwindowwndproc.c index 97f7e8945..6ac6c141c 100644 --- a/xorg-server/hw/xwin/winmultiwindowwndproc.c +++ b/xorg-server/hw/xwin/winmultiwindowwndproc.c @@ -216,7 +216,8 @@ ValidateSizing (HWND hwnd, WindowPtr pWin, WinXSizeHints sizeHints; RECT *rect; int iWidth, iHeight; - unsigned long rcStyle; + RECT rcClient, rcWindow; + int iBorderWidthX, iBorderWidthY; /* Invalid input checking */ if (pWin==NULL || lParam==0) @@ -239,30 +240,19 @@ ValidateSizing (HWND hwnd, WindowPtr pWin, iHeight = rect->bottom - rect->top; /* Now remove size of any borders and title bar */ - rcStyle = GetWindowLongPtr(hwnd, GWL_STYLE); - if (rcStyle & WS_CAPTION) - { - iHeight -= GetSystemMetrics(SM_CYCAPTION); - } - if (rcStyle & WS_SIZEBOX) - { - iWidth -= 2 * GetSystemMetrics(SM_CXSIZEFRAME); - iHeight -= 2 * GetSystemMetrics(SM_CYSIZEFRAME); - } + GetClientRect(hwnd, &rcClient); + GetWindowRect(hwnd, &rcWindow); + iBorderWidthX = (rcWindow.right - rcWindow.left) - (rcClient.right - rcClient.left); + iBorderWidthY = (rcWindow.bottom - rcWindow.top) - (rcClient.bottom - rcClient.top); + iWidth -= iBorderWidthX; + iHeight -= iBorderWidthY; /* Constrain the size to legal values */ ConstrainSize (sizeHints, &iWidth, &iHeight); /* Add back the size of borders and title bar */ - if (rcStyle & WS_CAPTION) - { - iHeight += GetSystemMetrics(SM_CYCAPTION); - } - if (rcStyle & WS_SIZEBOX) - { - iWidth += 2 * GetSystemMetrics(SM_CXSIZEFRAME); - iHeight += 2 * GetSystemMetrics(SM_CYSIZEFRAME); - } + iWidth += iBorderWidthX; + iHeight += iBorderWidthY; /* Adjust size according to where we're dragging from */ switch(wParam) { @@ -474,6 +464,14 @@ winTopLevelWindowProc (HWND hwnd, UINT message, HandleCustomWM_INITMENU ((unsigned long)hwnd, wParam); break; + case WM_ERASEBKGND: + /* + * Pretend that we did erase the background but we don't care, + * since we repaint the entire region anyhow + * This avoids some flickering when resizing. + */ + return TRUE; + case WM_PAINT: /* Only paint if our window handle is valid */ if (hwndScreen == NULL) @@ -518,15 +516,24 @@ winTopLevelWindowProc (HWND hwnd, UINT message, return 0; case WM_MOUSEMOVE: - winGetPtMouseScreen(hwnd, lParam, &ptMouse); + /* Unpack the client area mouse coordinates */ + ptMouse.x = GET_X_LPARAM(lParam); + ptMouse.y = GET_Y_LPARAM(lParam); + + /* Translate the client area mouse coordinates to screen coordinates */ + ClientToScreen (hwnd, &ptMouse); + + /* Screen Coords from (-X, -Y) -> Root Window (0, 0) */ + ptMouse.x -= GetSystemMetrics (SM_XVIRTUALSCREEN); + ptMouse.y -= GetSystemMetrics (SM_YVIRTUALSCREEN); /* We can't do anything without privates */ if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput) break; /* Has the mouse pointer crossed screens? */ - if (s_pScreen != miPointerGetScreen(inputInfo.pointer)) - miPointerSetScreen (inputInfo.pointer, s_pScreenInfo->dwScreen, + if (s_pScreen != miPointerGetScreen(g_pwinPointer)) + miPointerSetScreen (g_pwinPointer, s_pScreenInfo->dwScreen, ptMouse.x - s_pScreenInfo->dwXOffset, ptMouse.y - s_pScreenInfo->dwYOffset); @@ -618,7 +625,7 @@ winTopLevelWindowProc (HWND hwnd, UINT message, break; g_fButton[0] = TRUE; SetCapture(hwnd); - return winMouseButtonsHandleScreen (s_pScreen, DeviceButtonPress, Button1, wParam, hwnd, lParam); + return winMouseButtonsHandle (s_pScreen, ButtonPress, Button1, wParam); case WM_LBUTTONUP: if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput) @@ -626,7 +633,7 @@ winTopLevelWindowProc (HWND hwnd, UINT message, g_fButton[0] = FALSE; ReleaseCapture(); winStartMousePolling(s_pScreenPriv); - return winMouseButtonsHandleScreen (s_pScreen, DeviceButtonRelease, Button1, wParam, hwnd, lParam); + return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button1, wParam); case WM_MBUTTONDBLCLK: case WM_MBUTTONDOWN: @@ -634,7 +641,7 @@ winTopLevelWindowProc (HWND hwnd, UINT message, break; g_fButton[1] = TRUE; SetCapture(hwnd); - return winMouseButtonsHandleScreen (s_pScreen, DeviceButtonPress, Button2, wParam, hwnd, lParam); + return winMouseButtonsHandle (s_pScreen, ButtonPress, Button2, wParam); case WM_MBUTTONUP: if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput) @@ -642,7 +649,7 @@ winTopLevelWindowProc (HWND hwnd, UINT message, g_fButton[1] = FALSE; ReleaseCapture(); winStartMousePolling(s_pScreenPriv); - return winMouseButtonsHandleScreen (s_pScreen, DeviceButtonRelease, Button2, wParam, hwnd, lParam); + return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button2, wParam); case WM_RBUTTONDBLCLK: case WM_RBUTTONDOWN: @@ -650,7 +657,7 @@ winTopLevelWindowProc (HWND hwnd, UINT message, break; g_fButton[2] = TRUE; SetCapture(hwnd); - return winMouseButtonsHandleScreen (s_pScreen, DeviceButtonPress, Button3, wParam, hwnd, lParam); + return winMouseButtonsHandle (s_pScreen, ButtonPress, Button3, wParam); case WM_RBUTTONUP: if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput) @@ -658,21 +665,21 @@ winTopLevelWindowProc (HWND hwnd, UINT message, g_fButton[2] = FALSE; ReleaseCapture(); winStartMousePolling(s_pScreenPriv); - return winMouseButtonsHandleScreen (s_pScreen, DeviceButtonRelease, Button3, wParam, hwnd, lParam); + return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button3, wParam); case WM_XBUTTONDBLCLK: case WM_XBUTTONDOWN: if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput) break; SetCapture(hwnd); - return winMouseButtonsHandleScreen (s_pScreen, DeviceButtonPress, HIWORD(wParam) + 5, wParam, hwnd, lParam); + return winMouseButtonsHandle (s_pScreen, ButtonPress, HIWORD(wParam) + 5, wParam); case WM_XBUTTONUP: if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput) break; ReleaseCapture(); winStartMousePolling(s_pScreenPriv); - return winMouseButtonsHandleScreen (s_pScreen, DeviceButtonRelease, HIWORD(wParam) + 5, wParam, hwnd, lParam); + return winMouseButtonsHandle (s_pScreen, ButtonRelease, HIWORD(wParam) + 5, wParam); case WM_MOUSEWHEEL: if (SendMessage(hwnd, WM_NCHITTEST, 0, MAKELONG(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))) == HTCLIENT) @@ -707,7 +714,7 @@ winTopLevelWindowProc (HWND hwnd, UINT message, /* Remove our keyboard hook if it is installed */ winRemoveKeyboardHookLL (); if (!wParam) - /* Revert the X focus as well, but only if the Windows focus is going to another thread */ + /* Revert the X focus as well, but only if the Windows focus is going to another window */ DeleteWindowFromAnyEvents(pWin, FALSE); return 0; @@ -893,7 +900,7 @@ winTopLevelWindowProc (HWND hwnd, UINT message, winUpdateWindowPosition (hwnd, FALSE, &zstyle); SetForegroundWindow (hwnd); } - wmMsg.msg = WM_WM_MAP; + wmMsg.msg = WM_WM_MAP3; } else /* It is an overridden window so make it top of Z stack */ { diff --git a/xorg-server/hw/xwin/winprefs.c b/xorg-server/hw/xwin/winprefs.c index c5fd7eb08..93901cac7 100644 --- a/xorg-server/hw/xwin/winprefs.c +++ b/xorg-server/hw/xwin/winprefs.c @@ -189,35 +189,28 @@ ReloadEnumWindowsProc (HWND hwnd, LPARAM lParam) /* It's our baby, either clean or dirty it */ if (lParam==FALSE) { - hicon = (HICON)GetClassLong(hwnd, GCL_HICON); + /* Reset the window's icon to undefined. */ + hicon = (HICON)SendMessage(hwnd, WM_SETICON, ICON_BIG, 0); - /* Unselect any icon in the class structure */ - SetClassLong (hwnd, GCL_HICON, (LONG)LoadIcon (NULL, IDI_APPLICATION)); - - /* If it's generated on-the-fly, get rid of it, will regen */ + /* If the old icon is generated on-the-fly, get rid of it, will regen */ winDestroyIcon (hicon); - - hicon = (HICON)GetClassLong(hwnd, GCL_HICONSM); - - /* Unselect any icon in the class structure */ - SetClassLong (hwnd, GCL_HICONSM, 0); - /* If it's generated on-the-fly, get rid of it, will regen */ + /* Same for the small icon */ + hicon = (HICON)SendMessage(hwnd, WM_SETICON, ICON_SMALL, 0); winDestroyIcon (hicon); - - /* Remove any menu additions, use bRevert flag */ + + /* Remove any menu additions; bRevert=TRUE destroys any modified menus */ GetSystemMenu (hwnd, TRUE); - /* This window is now clean of our taint */ + /* This window is now clean of our taint (but with undefined icons) */ } else { - /* Make the icon default, dynamic, or from xwinrc */ - SetClassLong (hwnd, GCL_HICON, (LONG)g_hIconX); - SetClassLong (hwnd, GCL_HICONSM, (LONG)g_hSmallIconX); + /* winUpdateIcon() will set the icon default, dynamic, or from xwinrc */ wid = (Window)GetProp (hwnd, WIN_WID_PROP); if (wid) winUpdateIcon (wid); + /* Update the system menu for this window */ SetupSysMenu ((unsigned long)hwnd); @@ -241,8 +234,12 @@ ReloadPrefs (void) int i; #ifdef XWIN_MULTIWINDOW - /* First, iterate over all windows replacing their icon with system */ - /* default one and deleting any custom system menus */ + /* First, iterate over all windows, deleting their icons and custom menus. + * This is really only needed because winDestroyIcon() will try to + * destroy the old global icons, which will have changed. + * It is probably better to set a windows USER_DATA to flag locally defined + * icons, and use that to accurately know when to destroy old icons. + */ EnumThreadWindows (g_dwCurrentThreadID, ReloadEnumWindowsProc, FALSE); #endif @@ -316,7 +313,7 @@ HandleCustomWM_INITMENU(unsigned long hwndIn, if (!hwnd || !hmenu) return; - if (GetWindowLong (hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST) + if (GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST) dwExStyle = MF_BYCOMMAND | MF_CHECKED; else dwExStyle = MF_BYCOMMAND | MF_UNCHECKED; @@ -411,7 +408,7 @@ HandleCustomWM_COMMAND (unsigned long hwndIn, return FALSE; /* Get extended window style */ - dwExStyle = GetWindowLong (hwnd, GWL_EXSTYLE); + dwExStyle = GetWindowLongPtr(hwnd, GWL_EXSTYLE); /* Handle topmost windows */ if (dwExStyle & WS_EX_TOPMOST) @@ -529,7 +526,7 @@ SetupRootMenu (unsigned long hmenuRoot) /* * Check for and return an overridden default ICON specified in the prefs */ -unsigned long +HICON winOverrideDefaultIcon(int size) { HICON hicon; @@ -541,7 +538,7 @@ winOverrideDefaultIcon(int size) ErrorF ("winOverrideDefaultIcon: LoadImageComma(%s) failed\n", pref.defaultIconName); - return (unsigned long)hicon; + return hicon; } return 0; @@ -551,7 +548,7 @@ winOverrideDefaultIcon(int size) /* * Return the HICON to use in the taskbar notification area */ -unsigned long +HICON winTaskbarIcon(void) { HICON hicon; @@ -575,7 +572,7 @@ winTaskbarIcon(void) GetSystemMetrics (SM_CYSMICON), 0); - return (unsigned long)hicon; + return hicon; } @@ -650,7 +647,7 @@ LoadImageComma (char *fname, int sx, int sy, int flags) * Check for a match of the window class to one specified in the * ICONS{} section in the prefs file, and load the icon from a file */ -unsigned long +HICON winOverrideIcon (unsigned long longWin) { WindowPtr pWin = (WindowPtr) longWin; @@ -686,8 +683,8 @@ winOverrideIcon (unsigned long longWin) ErrorF ("winOverrideIcon: LoadImageComma(%s) failed\n", pref.icon[i].iconFile); - pref.icon[i].hicon = (unsigned long)hicon; - return (unsigned long)hicon; + pref.icon[i].hicon = hicon; + return hicon; } } @@ -730,7 +727,7 @@ winIconIsOverride(unsigned hiconIn) * Load it into prefs structure for use by other functions */ void -LoadPreferences () +LoadPreferences (void) { char *home; char fname[PATH_MAX+NAME_MAX+2]; diff --git a/xorg-server/hw/xwin/winprefs.h b/xorg-server/hw/xwin/winprefs.h index 996b02ade..abfc7434e 100644 --- a/xorg-server/hw/xwin/winprefs.h +++ b/xorg-server/hw/xwin/winprefs.h @@ -105,7 +105,7 @@ typedef struct ICONITEM { char match[MENU_MAX+1]; /* What string to search for? */ char iconFile[PATH_MAX+NAME_MAX+2]; /* Icon location, WIN32 path */ - unsigned long hicon; /* LoadImage() result */ + HICON hicon; /* LoadImage() result */ } ICONITEM; /* To redefine styles for certain window types */ @@ -172,15 +172,18 @@ HandleCustomWM_COMMAND (unsigned long hwndIn, int winIconIsOverride (unsigned hiconIn); -unsigned long +HICON winOverrideIcon (unsigned long longpWin); unsigned long winOverrideStyle (unsigned long longpWin); unsigned long +winOverrideStyle (unsigned long longpWin); + +HICON winTaskbarIcon(void); -unsigned long +HICON winOverrideDefaultIcon(int size); #endif diff --git a/xorg-server/hw/xwin/winprefslex.c b/xorg-server/hw/xwin/winprefslex.c index f75191886..83d7f8fa8 100644 --- a/xorg-server/hw/xwin/winprefslex.c +++ b/xorg-server/hw/xwin/winprefslex.c @@ -53,6 +53,7 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -83,8 +84,6 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif -#endif /* ! C99 */ - #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -141,15 +140,7 @@ typedef unsigned int flex_uint32_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else #define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -381,8 +372,8 @@ static void yy_fatal_error (yyconst char msg[] ); *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 25 -#define YY_END_OF_BUFFER 26 +#define YY_NUM_RULES 33 +#define YY_END_OF_BUFFER 34 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -390,23 +381,28 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[136] = +static yyconst flex_int16_t yy_accept[186] = { 0, - 0, 0, 26, 24, 4, 3, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 21, 22, 24, - 4, 24, 0, 24, 0, 1, 1, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 23, 23, 24, 0, 2, 2, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 15, 24, 5, 24, 24, - 24, 24, 24, 24, 24, 14, 24, 17, 24, 24, - 8, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 18, 24, 24, 24, 24, 24, 24, 13, 24, - - 24, 24, 24, 24, 11, 24, 24, 24, 24, 24, - 9, 24, 24, 19, 24, 24, 24, 24, 12, 24, - 24, 24, 24, 24, 20, 16, 7, 24, 24, 24, - 24, 24, 6, 10, 0 + 0, 0, 34, 32, 4, 3, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 29, 30, 32, 4, 32, 0, 32, 0, 1, 1, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 31, 31, 32, 0, 2, 2, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 23, 32, 32, 5, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + + 32, 22, 32, 32, 25, 32, 32, 8, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 13, 32, 32, 32, 32, 32, 32, + 32, 26, 32, 32, 32, 9, 32, 32, 32, 32, + 21, 32, 32, 32, 32, 16, 14, 15, 32, 32, + 32, 19, 10, 32, 32, 32, 32, 32, 11, 12, + 17, 32, 32, 27, 32, 32, 32, 32, 20, 32, + 32, 32, 32, 32, 28, 24, 7, 32, 32, 32, + 32, 32, 6, 18, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -419,12 +415,12 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 9, 10, 11, 12, 13, 14, 1, 15, 1, 1, 16, 17, 18, 19, 20, - 1, 21, 22, 23, 24, 1, 25, 26, 27, 1, - 1, 1, 1, 1, 1, 1, 28, 29, 30, 31, + 1, 21, 22, 23, 24, 1, 25, 26, 27, 28, + 1, 1, 1, 1, 1, 1, 29, 30, 31, 32, - 32, 33, 34, 1, 35, 1, 1, 36, 37, 38, - 39, 40, 1, 41, 42, 43, 44, 1, 45, 46, - 47, 1, 48, 1, 49, 1, 1, 1, 1, 1, + 33, 34, 35, 1, 36, 1, 1, 37, 38, 39, + 40, 41, 1, 42, 43, 44, 45, 1, 46, 47, + 48, 49, 50, 1, 51, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -441,144 +437,181 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[50] = +static yyconst flex_int32_t yy_meta[52] = { 0, 1, 2, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1 } ; -static yyconst flex_int16_t yy_base[143] = +static yyconst flex_int16_t yy_base[193] = { 0, - 0, 0, 267, 0, 264, 301, 48, 52, 258, 35, - 40, 31, 49, 48, 49, 55, 42, 0, 0, 0, - 74, 60, 64, 71, 81, 301, 88, 91, 41, 77, - 87, 85, 79, 83, 87, 85, 85, 90, 85, 100, - 0, 301, 108, 110, 301, 126, 107, 104, 108, 108, - 125, 124, 118, 113, 119, 116, 132, 129, 126, 117, - 118, 135, 139, 134, 125, 0, 151, 0, 142, 138, - 150, 154, 162, 161, 155, 0, 157, 0, 163, 165, - 0, 170, 171, 176, 162, 168, 177, 169, 166, 167, - 174, 0, 184, 188, 200, 189, 195, 198, 0, 202, - - 206, 195, 201, 195, 0, 205, 202, 216, 200, 218, - 0, 208, 215, 0, 216, 223, 229, 229, 0, 230, - 234, 238, 240, 239, 0, 0, 0, 247, 239, 243, - 236, 240, 0, 0, 301, 63, 284, 286, 289, 291, - 294, 297 + 0, 0, 373, 0, 370, 403, 50, 54, 363, 37, + 35, 47, 35, 52, 55, 45, 41, 54, 83, 50, + 0, 0, 0, 367, 74, 362, 97, 74, 403, 93, + 100, 43, 93, 49, 98, 96, 90, 86, 95, 96, + 124, 94, 102, 101, 101, 106, 96, 102, 105, 132, + 0, 403, 146, 148, 403, 150, 147, 138, 134, 136, + 136, 154, 153, 146, 150, 142, 152, 148, 155, 155, + 153, 150, 166, 163, 163, 165, 172, 170, 171, 188, + 193, 183, 190, 181, 0, 195, 190, 0, 191, 201, + 188, 197, 205, 197, 194, 198, 209, 212, 212, 224, + + 218, 0, 220, 226, 0, 228, 231, 0, 232, 233, + 232, 234, 233, 242, 242, 247, 233, 235, 240, 237, + 253, 247, 250, 0, 258, 261, 255, 257, 274, 276, + 277, 0, 272, 268, 280, 0, 269, 272, 277, 279, + 0, 283, 287, 288, 289, 0, 0, 0, 284, 296, + 297, 0, 0, 306, 302, 317, 301, 320, 0, 0, + 0, 310, 317, 0, 314, 315, 313, 314, 0, 315, + 319, 322, 324, 323, 0, 0, 0, 331, 326, 332, + 330, 341, 0, 0, 403, 365, 386, 388, 391, 393, + 396, 399 + } ; -static yyconst flex_int16_t yy_def[143] = +static yyconst flex_int16_t yy_def[193] = { 0, - 135, 1, 135, 136, 135, 135, 137, 138, 136, 136, - 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, - 135, 137, 139, 138, 140, 135, 140, 141, 136, 136, - 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, - 136, 135, 141, 142, 135, 142, 136, 136, 136, 136, - 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, - 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, - 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, - 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, - 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, - - 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, - 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, - 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, - 136, 136, 136, 136, 0, 135, 135, 135, 135, 135, - 135, 135 + 185, 1, 185, 186, 185, 185, 187, 188, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 185, 187, 189, 188, 190, 185, 190, + 191, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 185, 191, 192, 185, 192, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 0, 185, 185, 185, 185, 185, + 185, 185 + } ; -static yyconst flex_int16_t yy_nxt[351] = +static yyconst flex_int16_t yy_nxt[455] = { 0, - 4, 5, 6, 6, 7, 8, 9, 10, 4, 4, - 11, 12, 4, 4, 13, 4, 14, 4, 4, 4, - 15, 16, 17, 4, 4, 4, 4, 10, 4, 4, - 11, 12, 4, 4, 13, 4, 14, 4, 4, 4, - 15, 16, 17, 4, 4, 4, 4, 18, 19, 23, - 29, 31, 20, 25, 26, 27, 32, 30, 33, 34, - 35, 23, 40, 20, 41, 47, 37, 36, 42, 38, - 29, 31, 25, 26, 27, 21, 32, 30, 33, 34, - 35, 39, 40, 26, 27, 47, 37, 36, 48, 38, - 26, 27, 44, 45, 46, 50, 52, 53, 49, 51, - - 54, 39, 55, 56, 57, 58, 59, 60, 48, 44, - 45, 46, 45, 46, 61, 50, 52, 53, 49, 51, - 54, 62, 55, 56, 57, 58, 59, 60, 45, 46, - 63, 64, 65, 66, 61, 67, 68, 69, 70, 71, - 72, 62, 73, 74, 75, 76, 77, 78, 79, 82, - 63, 64, 65, 66, 83, 67, 68, 69, 70, 71, - 72, 80, 73, 74, 75, 76, 77, 78, 79, 82, - 84, 85, 81, 86, 83, 87, 88, 89, 90, 91, - 92, 80, 93, 94, 95, 96, 97, 98, 99, 100, - 84, 85, 81, 86, 101, 87, 88, 89, 90, 91, - - 92, 102, 93, 94, 95, 96, 97, 98, 99, 100, - 103, 104, 105, 106, 101, 107, 108, 110, 111, 112, - 113, 102, 114, 109, 115, 116, 117, 118, 119, 120, - 103, 104, 105, 106, 121, 107, 108, 110, 111, 112, - 113, 122, 114, 109, 115, 116, 117, 118, 119, 120, - 123, 124, 125, 126, 121, 127, 128, 129, 130, 131, - 132, 122, 133, 134, 28, 21, 135, 135, 135, 135, - 123, 124, 125, 126, 135, 127, 128, 129, 130, 131, - 132, 135, 133, 134, 22, 22, 24, 24, 24, 23, - 23, 25, 25, 25, 43, 43, 43, 44, 44, 44, - - 3, 135, 135, 135, 135, 135, 135, 135, 135, 135, - 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, - 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, - 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, - 135, 135, 135, 135, 135, 135, 135, 135, 135, 135 + 4, 5, 6, 6, 7, 8, 9, 10, 11, 4, + 12, 13, 4, 4, 14, 4, 15, 16, 17, 4, + 18, 19, 20, 4, 4, 4, 4, 4, 10, 11, + 4, 12, 13, 4, 4, 14, 4, 15, 16, 17, + 4, 18, 19, 20, 4, 4, 4, 4, 4, 21, + 22, 26, 32, 34, 23, 28, 29, 30, 35, 33, + 36, 37, 38, 41, 42, 43, 39, 57, 49, 40, + 50, 60, 44, 32, 34, 26, 29, 30, 51, 35, + 33, 36, 37, 38, 41, 42, 43, 39, 57, 49, + 40, 50, 60, 44, 45, 29, 30, 46, 28, 29, + + 30, 54, 55, 56, 58, 47, 61, 63, 64, 48, + 62, 65, 66, 67, 59, 45, 70, 71, 46, 72, + 73, 74, 75, 76, 77, 58, 47, 61, 63, 64, + 48, 62, 65, 66, 67, 59, 68, 70, 71, 78, + 72, 73, 74, 75, 76, 77, 69, 54, 55, 56, + 55, 56, 55, 56, 79, 80, 81, 68, 82, 83, + 78, 84, 85, 86, 87, 88, 89, 69, 90, 91, + 92, 93, 94, 95, 96, 79, 80, 81, 97, 82, + 83, 98, 84, 85, 86, 87, 88, 89, 99, 90, + 91, 92, 93, 94, 95, 96, 100, 101, 102, 97, + + 103, 104, 98, 105, 106, 107, 109, 110, 111, 99, + 112, 113, 114, 115, 116, 117, 108, 100, 101, 102, + 118, 103, 104, 119, 105, 106, 107, 109, 110, 111, + 120, 112, 113, 114, 115, 116, 117, 108, 121, 122, + 123, 118, 124, 125, 119, 126, 127, 128, 129, 130, + 131, 120, 132, 133, 134, 135, 136, 137, 138, 121, + 122, 123, 139, 124, 125, 140, 126, 127, 128, 129, + 130, 131, 141, 132, 133, 134, 135, 136, 137, 138, + 142, 143, 144, 139, 145, 146, 140, 147, 148, 149, + 150, 151, 152, 141, 153, 154, 155, 156, 158, 159, + + 160, 142, 143, 144, 157, 145, 146, 161, 147, 148, + 149, 150, 151, 152, 162, 153, 154, 155, 156, 158, + 159, 160, 163, 164, 165, 157, 166, 167, 161, 168, + 169, 170, 171, 172, 173, 162, 174, 175, 176, 177, + 178, 179, 180, 163, 164, 165, 181, 166, 167, 182, + 168, 169, 170, 171, 172, 173, 183, 174, 175, 176, + 177, 178, 179, 180, 184, 23, 52, 181, 24, 31, + 182, 24, 185, 185, 185, 185, 185, 183, 185, 185, + 185, 185, 185, 185, 185, 184, 25, 25, 27, 27, + 27, 26, 26, 28, 28, 28, 53, 53, 53, 54, + + 54, 54, 3, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185 } ; -static yyconst flex_int16_t yy_chk[351] = +static yyconst flex_int16_t yy_chk[455] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, - 10, 11, 7, 8, 8, 8, 12, 10, 13, 14, - 15, 22, 17, 136, 22, 29, 16, 15, 23, 16, - 10, 11, 24, 24, 24, 21, 12, 10, 13, 14, - 15, 16, 17, 25, 25, 29, 16, 15, 30, 16, - 27, 27, 28, 28, 28, 31, 32, 33, 30, 31, - - 34, 16, 35, 36, 37, 38, 39, 40, 30, 43, - 43, 43, 44, 44, 47, 31, 32, 33, 30, 31, - 34, 48, 35, 36, 37, 38, 39, 40, 46, 46, - 49, 50, 51, 52, 47, 53, 54, 55, 56, 57, - 58, 48, 59, 60, 61, 62, 63, 64, 65, 69, - 49, 50, 51, 52, 70, 53, 54, 55, 56, 57, - 58, 67, 59, 60, 61, 62, 63, 64, 65, 69, - 71, 72, 67, 73, 70, 74, 75, 77, 79, 80, - 82, 67, 83, 84, 85, 86, 87, 88, 89, 90, - 71, 72, 67, 73, 91, 74, 75, 77, 79, 80, - - 82, 93, 83, 84, 85, 86, 87, 88, 89, 90, - 94, 95, 96, 97, 91, 98, 100, 101, 102, 103, - 104, 93, 106, 100, 107, 108, 109, 110, 112, 113, - 94, 95, 96, 97, 115, 98, 100, 101, 102, 103, - 104, 116, 106, 100, 107, 108, 109, 110, 112, 113, - 117, 118, 120, 121, 115, 122, 123, 124, 128, 129, - 130, 116, 131, 132, 9, 5, 3, 0, 0, 0, - 117, 118, 120, 121, 0, 122, 123, 124, 128, 129, - 130, 0, 131, 132, 137, 137, 138, 138, 138, 139, - 139, 140, 140, 140, 141, 141, 141, 142, 142, 142, - - 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, - 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, - 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, - 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, - 135, 135, 135, 135, 135, 135, 135, 135, 135, 135 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 7, 10, 11, 7, 8, 8, 8, 12, 10, + 13, 14, 15, 16, 17, 18, 15, 32, 20, 15, + 20, 34, 18, 10, 11, 25, 28, 28, 25, 12, + 10, 13, 14, 15, 16, 17, 18, 15, 32, 20, + 15, 20, 34, 18, 19, 30, 30, 19, 27, 27, + + 27, 31, 31, 31, 33, 19, 35, 36, 37, 19, + 35, 38, 39, 40, 33, 19, 42, 43, 19, 44, + 45, 46, 47, 48, 49, 33, 19, 35, 36, 37, + 19, 35, 38, 39, 40, 33, 41, 42, 43, 50, + 44, 45, 46, 47, 48, 49, 41, 53, 53, 53, + 54, 54, 56, 56, 57, 58, 59, 41, 60, 61, + 50, 62, 63, 64, 65, 66, 67, 41, 68, 69, + 70, 71, 72, 73, 74, 57, 58, 59, 75, 60, + 61, 76, 62, 63, 64, 65, 66, 67, 77, 68, + 69, 70, 71, 72, 73, 74, 78, 79, 80, 75, + + 81, 82, 76, 83, 84, 86, 87, 89, 90, 77, + 91, 92, 93, 94, 95, 96, 86, 78, 79, 80, + 97, 81, 82, 98, 83, 84, 86, 87, 89, 90, + 99, 91, 92, 93, 94, 95, 96, 86, 100, 101, + 103, 97, 104, 106, 98, 107, 109, 110, 111, 112, + 113, 99, 114, 115, 116, 117, 118, 119, 120, 100, + 101, 103, 121, 104, 106, 122, 107, 109, 110, 111, + 112, 113, 123, 114, 115, 116, 117, 118, 119, 120, + 125, 126, 127, 121, 128, 129, 122, 130, 131, 133, + 134, 135, 137, 123, 138, 139, 140, 142, 143, 144, + + 145, 125, 126, 127, 142, 128, 129, 149, 130, 131, + 133, 134, 135, 137, 150, 138, 139, 140, 142, 143, + 144, 145, 151, 154, 155, 142, 156, 157, 149, 158, + 162, 163, 165, 166, 167, 150, 168, 170, 171, 172, + 173, 174, 178, 151, 154, 155, 179, 156, 157, 180, + 158, 162, 163, 165, 166, 167, 181, 168, 170, 171, + 172, 173, 174, 178, 182, 186, 26, 179, 24, 9, + 180, 5, 3, 0, 0, 0, 0, 181, 0, 0, + 0, 0, 0, 0, 0, 182, 187, 187, 188, 188, + 188, 189, 189, 190, 190, 190, 191, 191, 191, 192, + + 192, 192, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185 } ; /* Table of booleans, true if rule could match eol. */ -static yyconst flex_int32_t yy_rule_can_match_eol[26] = +static yyconst flex_int32_t yy_rule_can_match_eol[34] = { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, }; + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; @@ -598,6 +631,7 @@ char *yytext; #line 2 "winprefslex.l" /* * Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. + * Copyright (C) Colin Harrison 2005-2008 * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -624,6 +658,7 @@ char *yytext; * from the XFree86 Project. * * Authors: Earle F. Philhower, III + * Colin Harrison */ /* $XFree86: $ */ @@ -654,7 +689,7 @@ static char *makestr(char *str) return ptr; } -#line 658 "winprefslex.c" +#line 693 "winprefslex.c" #define INITIAL 0 @@ -735,12 +770,7 @@ static int input (void ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else #define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -748,7 +778,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -759,7 +789,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + unsigned n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -841,9 +871,9 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 64 "winprefslex.l" +#line 66 "winprefslex.l" -#line 847 "winprefslex.c" +#line 877 "winprefslex.c" if ( !(yy_init) ) { @@ -896,13 +926,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 136 ) + if ( yy_current_state >= 186 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 301 ); + while ( yy_base[yy_current_state] != 403 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -939,135 +969,175 @@ do_action: /* This label is used only to access EOF actions. */ case 1: /* rule 1 can match eol */ YY_RULE_SETUP -#line 65 "winprefslex.l" +#line 67 "winprefslex.l" { /* comment */ return NEWLINE; } YY_BREAK case 2: /* rule 2 can match eol */ YY_RULE_SETUP -#line 66 "winprefslex.l" +#line 68 "winprefslex.l" { /* comment */ return NEWLINE; } YY_BREAK case 3: /* rule 3 can match eol */ YY_RULE_SETUP -#line 67 "winprefslex.l" +#line 69 "winprefslex.l" { return NEWLINE; } YY_BREAK case 4: YY_RULE_SETUP -#line 68 "winprefslex.l" +#line 70 "winprefslex.l" { /* ignore whitespace */ } YY_BREAK case 5: YY_RULE_SETUP -#line 69 "winprefslex.l" +#line 71 "winprefslex.l" { return MENU; } YY_BREAK case 6: YY_RULE_SETUP -#line 70 "winprefslex.l" +#line 72 "winprefslex.l" { return ICONDIRECTORY; } YY_BREAK case 7: YY_RULE_SETUP -#line 71 "winprefslex.l" +#line 73 "winprefslex.l" { return DEFAULTICON; } YY_BREAK case 8: YY_RULE_SETUP -#line 72 "winprefslex.l" +#line 74 "winprefslex.l" { return ICONS; } YY_BREAK case 9: YY_RULE_SETUP -#line 73 "winprefslex.l" -{ return ROOTMENU; } +#line 75 "winprefslex.l" +{ return STYLES; } YY_BREAK case 10: YY_RULE_SETUP -#line 74 "winprefslex.l" -{ return DEFAULTSYSMENU; } +#line 76 "winprefslex.l" +{ return TOPMOST; } YY_BREAK case 11: YY_RULE_SETUP -#line 75 "winprefslex.l" -{ return SYSMENU; } +#line 77 "winprefslex.l" +{ return MAXIMIZE; } YY_BREAK case 12: YY_RULE_SETUP -#line 76 "winprefslex.l" -{ return SEPARATOR; } +#line 78 "winprefslex.l" +{ return MINIMIZE; } YY_BREAK case 13: YY_RULE_SETUP -#line 77 "winprefslex.l" -{ return ATSTART; } +#line 79 "winprefslex.l" +{ return BOTTOM; } YY_BREAK case 14: YY_RULE_SETUP -#line 78 "winprefslex.l" -{ return ATEND; } +#line 80 "winprefslex.l" +{ return NOTITLE; } YY_BREAK case 15: YY_RULE_SETUP -#line 79 "winprefslex.l" -{ return EXEC; } +#line 81 "winprefslex.l" +{ return OUTLINE; } YY_BREAK case 16: YY_RULE_SETUP -#line 80 "winprefslex.l" -{ return ALWAYSONTOP; } +#line 82 "winprefslex.l" +{ return NOFRAME; } YY_BREAK case 17: YY_RULE_SETUP -#line 81 "winprefslex.l" -{ return DEBUG; } +#line 83 "winprefslex.l" +{ return ROOTMENU; } YY_BREAK case 18: YY_RULE_SETUP -#line 82 "winprefslex.l" -{ return RELOAD; } +#line 84 "winprefslex.l" +{ return DEFAULTSYSMENU; } YY_BREAK case 19: YY_RULE_SETUP -#line 83 "winprefslex.l" -{ return TRAYICON; } +#line 85 "winprefslex.l" +{ return SYSMENU; } YY_BREAK case 20: YY_RULE_SETUP -#line 84 "winprefslex.l" -{ return SILENTEXIT; } +#line 86 "winprefslex.l" +{ return SEPARATOR; } YY_BREAK case 21: YY_RULE_SETUP -#line 85 "winprefslex.l" -{ return LB; } +#line 87 "winprefslex.l" +{ return ATSTART; } YY_BREAK case 22: YY_RULE_SETUP -#line 86 "winprefslex.l" -{ return RB; } +#line 88 "winprefslex.l" +{ return ATEND; } YY_BREAK case 23: YY_RULE_SETUP -#line 87 "winprefslex.l" +#line 89 "winprefslex.l" +{ return EXEC; } + YY_BREAK +case 24: +YY_RULE_SETUP +#line 90 "winprefslex.l" +{ return ALWAYSONTOP; } + YY_BREAK +case 25: +YY_RULE_SETUP +#line 91 "winprefslex.l" +{ return DEBUG; } + YY_BREAK +case 26: +YY_RULE_SETUP +#line 92 "winprefslex.l" +{ return RELOAD; } + YY_BREAK +case 27: +YY_RULE_SETUP +#line 93 "winprefslex.l" +{ return TRAYICON; } + YY_BREAK +case 28: +YY_RULE_SETUP +#line 94 "winprefslex.l" +{ return SILENTEXIT; } + YY_BREAK +case 29: +YY_RULE_SETUP +#line 95 "winprefslex.l" +{ return LB; } + YY_BREAK +case 30: +YY_RULE_SETUP +#line 96 "winprefslex.l" +{ return RB; } + YY_BREAK +case 31: +YY_RULE_SETUP +#line 97 "winprefslex.l" { yylval.sVal = makestr(yytext+1); \ yylval.sVal[strlen(yylval.sVal)-1] = 0; \ return STRING; } YY_BREAK -case 24: +case 32: YY_RULE_SETUP -#line 90 "winprefslex.l" +#line 100 "winprefslex.l" { yylval.sVal = makestr(yytext); \ return STRING; } YY_BREAK -case 25: +case 33: YY_RULE_SETUP -#line 92 "winprefslex.l" +#line 102 "winprefslex.l" ECHO; YY_BREAK -#line 1071 "winprefslex.c" +#line 1141 "winprefslex.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1359,7 +1429,7 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 136 ) + if ( yy_current_state >= 186 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1387,11 +1457,11 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 136 ) + if ( yy_current_state >= 186 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 135); + yy_is_jam = (yy_current_state == 185); return yy_is_jam ? 0 : yy_current_state; } @@ -1834,8 +1904,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ @@ -2077,7 +2147,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 92 "winprefslex.l" +#line 102 "winprefslex.l" @@ -2085,7 +2155,7 @@ void yyfree (void * ptr ) * Run-of-the mill requirement for yacc */ int -yywrap () +yywrap (void) { return 1; } diff --git a/xorg-server/hw/xwin/winprefslex.l b/xorg-server/hw/xwin/winprefslex.l index ee2478bcc..9a384a2cd 100644 --- a/xorg-server/hw/xwin/winprefslex.l +++ b/xorg-server/hw/xwin/winprefslex.l @@ -105,7 +105,7 @@ SILENTEXIT { return SILENTEXIT; } * Run-of-the mill requirement for yacc */ int -yywrap () +yywrap (void) { return 1; } diff --git a/xorg-server/hw/xwin/winprefsyacc.c b/xorg-server/hw/xwin/winprefsyacc.c index ad3b94c3d..ccecc6e33 100644 --- a/xorg-server/hw/xwin/winprefsyacc.c +++ b/xorg-server/hw/xwin/winprefsyacc.c @@ -75,6 +75,7 @@ /* * Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. + * Copyright (C) Colin Harrison 2005-2008 * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -101,6 +102,7 @@ * from the XFree86 Project. * * Authors: Earle F. Philhower, III + * Colin Harrison */ /* $XFree86: $ */ @@ -115,6 +117,10 @@ /* The following give better error messages in bison at the cost of a few KB */ #define YYERROR_VERBOSE 1 +/* YYLTYPE_IS_TRIVIAL and YYENABLE_NLS defined to suppress warnings */ +#define YYLTYPE_IS_TRIVIAL 1 +#define YYENABLE_NLS 0 + /* The global pref settings */ WINPREFS pref; @@ -138,6 +144,10 @@ static void OpenIcons(void); static void AddIconLine(char *matchstr, char *iconfile); static void CloseIcons(void); +static void OpenStyles(void); +static void AddStyleLine(char *matchstr, unsigned long style); +static void CloseStyles(void); + static void OpenSysMenu(void); static void AddSysMenuLine(char *matchstr, char *menuname, int pos); static void CloseSysMenu(void); @@ -151,7 +161,7 @@ extern int yylex(void); /* Line 189 of yacc.c */ -#line 152 "winprefsyacc.c" +#line 162 "winprefsyacc.c" /* Enabling traces. */ #ifndef YYDEBUG @@ -185,19 +195,27 @@ extern int yylex(void); ICONDIRECTORY = 262, DEFAULTICON = 263, ICONS = 264, - DEFAULTSYSMENU = 265, - SYSMENU = 266, - ROOTMENU = 267, - SEPARATOR = 268, - ATSTART = 269, - ATEND = 270, - EXEC = 271, - ALWAYSONTOP = 272, - DEBUG = 273, - RELOAD = 274, - TRAYICON = 275, - SILENTEXIT = 276, - STRING = 277 + STYLES = 265, + TOPMOST = 266, + MAXIMIZE = 267, + MINIMIZE = 268, + BOTTOM = 269, + NOTITLE = 270, + OUTLINE = 271, + NOFRAME = 272, + DEFAULTSYSMENU = 273, + SYSMENU = 274, + ROOTMENU = 275, + SEPARATOR = 276, + ATSTART = 277, + ATEND = 278, + EXEC = 279, + ALWAYSONTOP = 280, + DEBUG = 281, + RELOAD = 282, + TRAYICON = 283, + SILENTEXIT = 284, + STRING = 285 }; #endif /* Tokens. */ @@ -208,19 +226,27 @@ extern int yylex(void); #define ICONDIRECTORY 262 #define DEFAULTICON 263 #define ICONS 264 -#define DEFAULTSYSMENU 265 -#define SYSMENU 266 -#define ROOTMENU 267 -#define SEPARATOR 268 -#define ATSTART 269 -#define ATEND 270 -#define EXEC 271 -#define ALWAYSONTOP 272 -#define DEBUG 273 -#define RELOAD 274 -#define TRAYICON 275 -#define SILENTEXIT 276 -#define STRING 277 +#define STYLES 265 +#define TOPMOST 266 +#define MAXIMIZE 267 +#define MINIMIZE 268 +#define BOTTOM 269 +#define NOTITLE 270 +#define OUTLINE 271 +#define NOFRAME 272 +#define DEFAULTSYSMENU 273 +#define SYSMENU 274 +#define ROOTMENU 275 +#define SEPARATOR 276 +#define ATSTART 277 +#define ATEND 278 +#define EXEC 279 +#define ALWAYSONTOP 280 +#define DEBUG 281 +#define RELOAD 282 +#define TRAYICON 283 +#define SILENTEXIT 284 +#define STRING 285 @@ -230,15 +256,16 @@ typedef union YYSTYPE { /* Line 214 of yacc.c */ -#line 79 "winprefsyacc.y" +#line 89 "winprefsyacc.y" char *sVal; + unsigned long uVal; int iVal; /* Line 214 of yacc.c */ -#line 239 "winprefsyacc.c" +#line 266 "winprefsyacc.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -250,7 +277,7 @@ typedef union YYSTYPE /* Line 264 of yacc.c */ -#line 251 "winprefsyacc.c" +#line 278 "winprefsyacc.c" #ifdef short # undef short @@ -465,20 +492,20 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 68 +#define YYLAST 92 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 23 +#define YYNTOKENS 31 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 25 +#define YYNNTS 32 /* YYNRULES -- Number of rules. */ -#define YYNRULES 46 +#define YYNRULES 63 /* YYNRULES -- Number of states. */ -#define YYNSTATES 94 +#define YYNSTATES 118 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 277 +#define YYMAXUTOK 285 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -513,7 +540,8 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22 + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30 }; #if YYDEBUG @@ -522,40 +550,48 @@ static const yytype_uint8 yytranslate[] = static const yytype_uint8 yyprhs[] = { 0, 0, 3, 4, 7, 9, 11, 12, 15, 17, - 19, 21, 23, 25, 27, 29, 31, 33, 35, 39, - 43, 48, 52, 56, 60, 65, 71, 77, 82, 84, - 87, 88, 96, 101, 103, 106, 107, 114, 115, 117, - 119, 125, 127, 130, 131, 139, 142 + 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, + 41, 45, 50, 54, 58, 62, 67, 73, 79, 84, + 86, 89, 90, 98, 103, 105, 108, 109, 116, 118, + 120, 122, 124, 126, 128, 130, 132, 134, 137, 140, + 145, 147, 150, 151, 158, 159, 161, 163, 169, 171, + 174, 175, 183, 186 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { - 24, 0, -1, -1, 24, 25, -1, 3, -1, 27, - -1, -1, 3, 26, -1, 31, -1, 32, -1, 35, - -1, 39, -1, 44, -1, 29, -1, 30, -1, 47, - -1, 28, -1, 46, -1, 20, 22, 3, -1, 12, - 22, 3, -1, 10, 22, 41, 3, -1, 8, 22, - 3, -1, 7, 22, 3, -1, 13, 3, 26, -1, - 22, 17, 3, 26, -1, 22, 16, 22, 3, 26, - -1, 22, 4, 22, 3, 26, -1, 22, 19, 3, - 26, -1, 33, -1, 33, 34, -1, -1, 4, 22, - 5, 36, 26, 34, 6, -1, 22, 22, 3, 26, - -1, 37, -1, 37, 38, -1, -1, 9, 5, 40, - 26, 38, 6, -1, -1, 14, -1, 15, -1, 22, - 22, 41, 3, 26, -1, 42, -1, 42, 43, -1, - -1, 11, 5, 3, 45, 26, 43, 6, -1, 21, - 3, -1, 18, 22, 3, -1 + 32, 0, -1, -1, 32, 33, -1, 3, -1, 35, + -1, -1, 3, 34, -1, 39, -1, 40, -1, 43, + -1, 47, -1, 54, -1, 59, -1, 37, -1, 38, + -1, 62, -1, 36, -1, 61, -1, 28, 30, 3, + -1, 20, 30, 3, -1, 18, 30, 56, 3, -1, + 8, 30, 3, -1, 7, 30, 3, -1, 21, 3, + 34, -1, 30, 25, 3, 34, -1, 30, 24, 30, + 3, 34, -1, 30, 4, 30, 3, 34, -1, 30, + 27, 3, 34, -1, 41, -1, 41, 42, -1, -1, + 4, 30, 5, 44, 34, 42, 6, -1, 30, 30, + 3, 34, -1, 45, -1, 45, 46, -1, -1, 9, + 5, 48, 34, 46, 6, -1, 11, -1, 12, -1, + 13, -1, 14, -1, 15, -1, 16, -1, 17, -1, + 49, -1, 50, -1, 49, 50, -1, 50, 49, -1, + 30, 51, 3, 34, -1, 52, -1, 52, 53, -1, + -1, 10, 5, 55, 34, 53, 6, -1, -1, 22, + -1, 23, -1, 30, 30, 56, 3, 34, -1, 57, + -1, 57, 58, -1, -1, 19, 5, 3, 60, 34, + 58, 6, -1, 29, 3, -1, 26, 30, 3, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { - 0, 93, 93, 94, 97, 98, 102, 103, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 118, 121, - 124, 127, 130, 133, 134, 135, 136, 137, 140, 141, - 144, 144, 147, 150, 151, 154, 154, 157, 158, 159, - 162, 165, 166, 169, 169, 172, 175 + 0, 108, 108, 109, 112, 113, 117, 118, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 134, + 137, 140, 143, 146, 149, 150, 151, 152, 153, 156, + 157, 160, 160, 163, 166, 167, 170, 170, 173, 174, + 175, 176, 179, 180, 181, 184, 185, 186, 187, 190, + 193, 194, 197, 197, 200, 201, 202, 205, 208, 209, + 212, 212, 215, 218 }; #endif @@ -565,13 +601,16 @@ static const yytype_uint8 yyrline[] = static const char *const yytname[] = { "$end", "error", "$undefined", "NEWLINE", "MENU", "LB", "RB", - "ICONDIRECTORY", "DEFAULTICON", "ICONS", "DEFAULTSYSMENU", "SYSMENU", - "ROOTMENU", "SEPARATOR", "ATSTART", "ATEND", "EXEC", "ALWAYSONTOP", - "DEBUG", "RELOAD", "TRAYICON", "SILENTEXIT", "STRING", "$accept", - "input", "line", "newline_or_nada", "command", "trayicon", "rootmenu", - "defaultsysmenu", "defaulticon", "icondirectory", "menuline", "menulist", - "menu", "$@1", "iconline", "iconlist", "icons", "$@2", "atspot", - "sysmenuline", "sysmenulist", "sysmenu", "$@3", "silentexit", "debug", 0 + "ICONDIRECTORY", "DEFAULTICON", "ICONS", "STYLES", "TOPMOST", "MAXIMIZE", + "MINIMIZE", "BOTTOM", "NOTITLE", "OUTLINE", "NOFRAME", "DEFAULTSYSMENU", + "SYSMENU", "ROOTMENU", "SEPARATOR", "ATSTART", "ATEND", "EXEC", + "ALWAYSONTOP", "DEBUG", "RELOAD", "TRAYICON", "SILENTEXIT", "STRING", + "$accept", "input", "line", "newline_or_nada", "command", "trayicon", + "rootmenu", "defaultsysmenu", "defaulticon", "icondirectory", "menuline", + "menulist", "menu", "$@1", "iconline", "iconlist", "icons", "$@2", + "group1", "group2", "stylecombo", "styleline", "stylelist", "styles", + "$@3", "atspot", "sysmenuline", "sysmenulist", "sysmenu", "$@4", + "silentexit", "debug", 0 }; #endif @@ -582,28 +621,33 @@ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277 + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 23, 24, 24, 25, 25, 26, 26, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 28, 29, - 30, 31, 32, 33, 33, 33, 33, 33, 34, 34, - 36, 35, 37, 38, 38, 40, 39, 41, 41, 41, - 42, 43, 43, 45, 44, 46, 47 + 0, 31, 32, 32, 33, 33, 34, 34, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 35, 35, 36, + 37, 38, 39, 40, 41, 41, 41, 41, 41, 42, + 42, 44, 43, 45, 46, 46, 48, 47, 49, 49, + 49, 49, 50, 50, 50, 51, 51, 51, 51, 52, + 53, 53, 55, 54, 56, 56, 56, 57, 58, 58, + 60, 59, 61, 62 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 0, 2, 1, 1, 0, 2, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, - 4, 3, 3, 3, 4, 5, 5, 4, 1, 2, - 0, 7, 4, 1, 2, 0, 6, 0, 1, 1, - 5, 1, 2, 0, 7, 2, 3 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, + 3, 4, 3, 3, 3, 4, 5, 5, 4, 1, + 2, 0, 7, 4, 1, 2, 0, 6, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 2, 2, 4, + 1, 2, 0, 6, 0, 1, 1, 5, 1, 2, + 0, 7, 2, 3 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -612,48 +656,54 @@ static const yytype_uint8 yyr2[] = static const yytype_uint8 yydefact[] = { 2, 0, 1, 4, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 5, 16, 13, 14, 8, - 9, 10, 11, 12, 17, 15, 0, 0, 0, 35, - 37, 0, 0, 0, 0, 45, 30, 22, 21, 6, - 38, 39, 0, 43, 19, 46, 18, 6, 6, 0, - 20, 6, 0, 7, 0, 33, 0, 0, 0, 0, - 28, 0, 0, 34, 36, 0, 41, 0, 6, 0, - 0, 0, 0, 29, 31, 6, 37, 42, 44, 23, - 0, 0, 6, 6, 32, 0, 6, 6, 24, 27, - 6, 26, 25, 40 + 0, 0, 0, 0, 0, 3, 5, 17, 14, 15, + 8, 9, 10, 11, 12, 13, 18, 16, 0, 0, + 0, 36, 52, 54, 0, 0, 0, 0, 62, 31, + 23, 22, 6, 6, 55, 56, 0, 60, 20, 63, + 19, 6, 6, 0, 0, 21, 6, 0, 7, 0, + 34, 0, 0, 50, 0, 0, 0, 0, 29, 0, + 0, 35, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 0, 51, 53, 0, 58, 0, 6, 0, + 0, 0, 0, 30, 32, 6, 47, 48, 6, 54, + 59, 61, 24, 0, 0, 6, 6, 33, 49, 0, + 6, 6, 25, 28, 6, 27, 26, 57 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { - -1, 1, 14, 49, 15, 16, 17, 18, 19, 20, - 60, 61, 21, 47, 55, 56, 22, 39, 42, 66, - 67, 23, 51, 24, 25 + -1, 1, 15, 53, 16, 17, 18, 19, 20, 21, + 68, 69, 22, 51, 60, 61, 23, 42, 80, 81, + 82, 63, 64, 24, 43, 46, 86, 87, 25, 56, + 26, 27 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -48 +#define YYPACT_NINF -44 static const yytype_int8 yypact[] = { - -48, 2, -48, -48, -15, -3, 4, 22, 7, 25, - 9, 11, 12, 29, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, 32, 35, 38, -48, - 10, 39, 41, 42, 43, -48, -48, -48, -48, 44, - -48, -48, 45, -48, -48, -48, -48, 44, 44, 27, - -48, 44, -5, -48, 28, 27, 46, 31, 48, -1, - -5, 49, 51, -48, -48, 34, 31, 52, 44, 37, - 40, 54, 57, -48, -48, 44, 10, -48, -48, -48, - 58, 60, 44, 44, -48, 61, 44, 44, -48, -48, - 44, -48, -48, -48 + -44, 7, -44, -44, -28, -10, -7, 27, 29, 14, + 41, 18, 19, 20, 44, -44, -44, -44, -44, -44, + -44, -44, -44, -44, -44, -44, -44, -44, 46, 50, + 51, -44, -44, -4, 53, 54, 55, 56, -44, -44, + -44, -44, 57, 57, -44, -44, 58, -44, -44, -44, + -44, 57, 57, 34, 35, -44, 57, -18, -44, 36, + 34, 63, 26, 35, 64, 42, 70, -3, -18, 68, + 72, -44, -44, -44, -44, -44, -44, -44, -44, -44, + -11, 17, 73, -44, -44, 47, 42, 74, 57, 48, + 49, 78, 79, -44, -44, 57, -44, -44, 57, -4, + -44, -44, -44, 80, 81, 57, 57, -44, -44, 82, + 57, 57, -44, -44, 57, -44, -44, -44 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { - -48, -48, -48, -47, -48, -48, -48, -48, -48, -48, - -48, 5, -48, -48, -48, 13, -48, -48, -10, -48, - 1, -48, -48, -48, -48 + -44, -44, -44, -43, -44, -44, -44, -44, -44, -44, + -44, 21, -44, -44, -44, 28, -44, -44, 5, 10, + -44, -44, 24, -44, -44, -8, -44, 6, -44, -44, + -44, -44 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -663,40 +713,48 @@ static const yytype_int8 yypgoto[] = #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { - 52, 53, 2, 69, 57, 3, 4, 26, 58, 5, - 6, 7, 8, 9, 10, 70, 71, 59, 72, 27, - 11, 79, 12, 13, 40, 41, 28, 29, 84, 30, - 31, 32, 35, 33, 34, 88, 89, 36, 37, 91, - 92, 38, 43, 93, 44, 45, 46, 48, 50, 54, - 62, 68, 64, 65, 75, 74, 76, 82, 78, 80, - 83, 86, 81, 87, 90, 73, 85, 77, 63 + 54, 89, 28, 66, 77, 78, 79, 2, 57, 58, + 3, 4, 67, 65, 5, 6, 7, 8, 44, 45, + 29, 90, 91, 30, 92, 9, 10, 11, 73, 74, + 75, 76, 31, 12, 32, 13, 14, 73, 74, 75, + 76, 77, 78, 79, 33, 102, 34, 38, 35, 36, + 37, 39, 107, 40, 41, 108, 47, 48, 49, 50, + 52, 55, 112, 113, 59, 62, 70, 115, 116, 72, + 84, 117, 85, 88, 94, 95, 98, 99, 103, 104, + 101, 105, 106, 110, 111, 114, 97, 83, 71, 93, + 96, 109, 100 }; static const yytype_uint8 yycheck[] = { - 47, 48, 0, 4, 51, 3, 4, 22, 13, 7, - 8, 9, 10, 11, 12, 16, 17, 22, 19, 22, - 18, 68, 20, 21, 14, 15, 22, 5, 75, 22, - 5, 22, 3, 22, 22, 82, 83, 5, 3, 86, - 87, 3, 3, 90, 3, 3, 3, 3, 3, 22, - 22, 3, 6, 22, 3, 6, 22, 3, 6, 22, - 3, 3, 22, 3, 3, 60, 76, 66, 55 + 43, 4, 30, 21, 15, 16, 17, 0, 51, 52, + 3, 4, 30, 56, 7, 8, 9, 10, 22, 23, + 30, 24, 25, 30, 27, 18, 19, 20, 11, 12, + 13, 14, 5, 26, 5, 28, 29, 11, 12, 13, + 14, 15, 16, 17, 30, 88, 5, 3, 30, 30, + 30, 5, 95, 3, 3, 98, 3, 3, 3, 3, + 3, 3, 105, 106, 30, 30, 30, 110, 111, 6, + 6, 114, 30, 3, 6, 3, 3, 30, 30, 30, + 6, 3, 3, 3, 3, 3, 81, 63, 60, 68, + 80, 99, 86 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 24, 0, 3, 4, 7, 8, 9, 10, 11, - 12, 18, 20, 21, 25, 27, 28, 29, 30, 31, - 32, 35, 39, 44, 46, 47, 22, 22, 22, 5, - 22, 5, 22, 22, 22, 3, 5, 3, 3, 40, - 14, 15, 41, 3, 3, 3, 3, 36, 3, 26, - 3, 45, 26, 26, 22, 37, 38, 26, 13, 22, - 33, 34, 22, 38, 6, 22, 42, 43, 3, 4, - 16, 17, 19, 34, 6, 3, 22, 43, 6, 26, - 22, 22, 3, 3, 26, 41, 3, 3, 26, 26, - 3, 26, 26, 26 + 0, 32, 0, 3, 4, 7, 8, 9, 10, 18, + 19, 20, 26, 28, 29, 33, 35, 36, 37, 38, + 39, 40, 43, 47, 54, 59, 61, 62, 30, 30, + 30, 5, 5, 30, 5, 30, 30, 30, 3, 5, + 3, 3, 48, 55, 22, 23, 56, 3, 3, 3, + 3, 44, 3, 34, 34, 3, 60, 34, 34, 30, + 45, 46, 30, 52, 53, 34, 21, 30, 41, 42, + 30, 46, 6, 11, 12, 13, 14, 15, 16, 17, + 49, 50, 51, 53, 6, 30, 57, 58, 3, 4, + 24, 25, 27, 42, 6, 3, 50, 49, 3, 30, + 58, 6, 34, 30, 30, 3, 3, 34, 34, 56, + 3, 3, 34, 34, 3, 34, 34, 34 }; #define yyerrok (yyerrstatus = 0) @@ -1507,171 +1565,269 @@ yyreduce: YY_REDUCE_PRINT (yyn); switch (yyn) { - case 18: + case 19: /* Line 1455 of yacc.c */ -#line 118 "winprefsyacc.y" +#line 134 "winprefsyacc.y" { SetTrayIcon((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); } break; - case 19: + case 20: /* Line 1455 of yacc.c */ -#line 121 "winprefsyacc.y" +#line 137 "winprefsyacc.y" { SetRootMenu((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); } break; - case 20: + case 21: /* Line 1455 of yacc.c */ -#line 124 "winprefsyacc.y" +#line 140 "winprefsyacc.y" { SetDefaultSysMenu((yyvsp[(2) - (4)].sVal), (yyvsp[(3) - (4)].iVal)); free((yyvsp[(2) - (4)].sVal)); } break; - case 21: + case 22: /* Line 1455 of yacc.c */ -#line 127 "winprefsyacc.y" +#line 143 "winprefsyacc.y" { SetDefaultIcon((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); } break; - case 22: + case 23: /* Line 1455 of yacc.c */ -#line 130 "winprefsyacc.y" +#line 146 "winprefsyacc.y" { SetIconDirectory((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); } break; - case 23: + case 24: /* Line 1455 of yacc.c */ -#line 133 "winprefsyacc.y" +#line 149 "winprefsyacc.y" { AddMenuLine("-", CMD_SEPARATOR, ""); } break; - case 24: + case 25: /* Line 1455 of yacc.c */ -#line 134 "winprefsyacc.y" +#line 150 "winprefsyacc.y" { AddMenuLine((yyvsp[(1) - (4)].sVal), CMD_ALWAYSONTOP, ""); free((yyvsp[(1) - (4)].sVal)); } break; - case 25: + case 26: /* Line 1455 of yacc.c */ -#line 135 "winprefsyacc.y" +#line 151 "winprefsyacc.y" { AddMenuLine((yyvsp[(1) - (5)].sVal), CMD_EXEC, (yyvsp[(3) - (5)].sVal)); free((yyvsp[(1) - (5)].sVal)); free((yyvsp[(3) - (5)].sVal)); } break; - case 26: + case 27: /* Line 1455 of yacc.c */ -#line 136 "winprefsyacc.y" +#line 152 "winprefsyacc.y" { AddMenuLine((yyvsp[(1) - (5)].sVal), CMD_MENU, (yyvsp[(3) - (5)].sVal)); free((yyvsp[(1) - (5)].sVal)); free((yyvsp[(3) - (5)].sVal)); } break; - case 27: + case 28: /* Line 1455 of yacc.c */ -#line 137 "winprefsyacc.y" +#line 153 "winprefsyacc.y" { AddMenuLine((yyvsp[(1) - (4)].sVal), CMD_RELOAD, ""); free((yyvsp[(1) - (4)].sVal)); } break; - case 30: + case 31: /* Line 1455 of yacc.c */ -#line 144 "winprefsyacc.y" +#line 160 "winprefsyacc.y" { OpenMenu((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); } break; - case 31: + case 32: /* Line 1455 of yacc.c */ -#line 144 "winprefsyacc.y" +#line 160 "winprefsyacc.y" {CloseMenu();} break; - case 32: + case 33: /* Line 1455 of yacc.c */ -#line 147 "winprefsyacc.y" +#line 163 "winprefsyacc.y" { AddIconLine((yyvsp[(1) - (4)].sVal), (yyvsp[(2) - (4)].sVal)); free((yyvsp[(1) - (4)].sVal)); free((yyvsp[(2) - (4)].sVal)); } break; - case 35: + case 36: /* Line 1455 of yacc.c */ -#line 154 "winprefsyacc.y" +#line 170 "winprefsyacc.y" {OpenIcons();} break; - case 36: + case 37: /* Line 1455 of yacc.c */ -#line 154 "winprefsyacc.y" +#line 170 "winprefsyacc.y" {CloseIcons();} break; - case 37: + case 38: + +/* Line 1455 of yacc.c */ +#line 173 "winprefsyacc.y" + { (yyval.uVal)=STYLE_TOPMOST; } + break; + + case 39: + +/* Line 1455 of yacc.c */ +#line 174 "winprefsyacc.y" + { (yyval.uVal)=STYLE_MAXIMIZE; } + break; + + case 40: + +/* Line 1455 of yacc.c */ +#line 175 "winprefsyacc.y" + { (yyval.uVal)=STYLE_MINIMIZE; } + break; + + case 41: + +/* Line 1455 of yacc.c */ +#line 176 "winprefsyacc.y" + { (yyval.uVal)=STYLE_BOTTOM; } + break; + + case 42: + +/* Line 1455 of yacc.c */ +#line 179 "winprefsyacc.y" + { (yyval.uVal)=STYLE_NOTITLE; } + break; + + case 43: + +/* Line 1455 of yacc.c */ +#line 180 "winprefsyacc.y" + { (yyval.uVal)=STYLE_OUTLINE; } + break; + + case 44: /* Line 1455 of yacc.c */ -#line 157 "winprefsyacc.y" +#line 181 "winprefsyacc.y" + { (yyval.uVal)=STYLE_NOFRAME; } + break; + + case 45: + +/* Line 1455 of yacc.c */ +#line 184 "winprefsyacc.y" + { (yyval.uVal)=(yyvsp[(1) - (1)].uVal); } + break; + + case 46: + +/* Line 1455 of yacc.c */ +#line 185 "winprefsyacc.y" + { (yyval.uVal)=(yyvsp[(1) - (1)].uVal); } + break; + + case 47: + +/* Line 1455 of yacc.c */ +#line 186 "winprefsyacc.y" + { (yyval.uVal)=(yyvsp[(1) - (2)].uVal)|(yyvsp[(2) - (2)].uVal); } + break; + + case 48: + +/* Line 1455 of yacc.c */ +#line 187 "winprefsyacc.y" + { (yyval.uVal)=(yyvsp[(1) - (2)].uVal)|(yyvsp[(2) - (2)].uVal); } + break; + + case 49: + +/* Line 1455 of yacc.c */ +#line 190 "winprefsyacc.y" + { AddStyleLine((yyvsp[(1) - (4)].sVal), (yyvsp[(2) - (4)].uVal)); free((yyvsp[(1) - (4)].sVal)); } + break; + + case 52: + +/* Line 1455 of yacc.c */ +#line 197 "winprefsyacc.y" + {OpenStyles();} + break; + + case 53: + +/* Line 1455 of yacc.c */ +#line 197 "winprefsyacc.y" + {CloseStyles();} + break; + + case 54: + +/* Line 1455 of yacc.c */ +#line 200 "winprefsyacc.y" { (yyval.iVal)=AT_END; } break; - case 38: + case 55: /* Line 1455 of yacc.c */ -#line 158 "winprefsyacc.y" +#line 201 "winprefsyacc.y" { (yyval.iVal)=AT_START; } break; - case 39: + case 56: /* Line 1455 of yacc.c */ -#line 159 "winprefsyacc.y" +#line 202 "winprefsyacc.y" { (yyval.iVal)=AT_END; } break; - case 40: + case 57: /* Line 1455 of yacc.c */ -#line 162 "winprefsyacc.y" +#line 205 "winprefsyacc.y" { AddSysMenuLine((yyvsp[(1) - (5)].sVal), (yyvsp[(2) - (5)].sVal), (yyvsp[(3) - (5)].iVal)); free((yyvsp[(1) - (5)].sVal)); free((yyvsp[(2) - (5)].sVal)); } break; - case 43: + case 60: /* Line 1455 of yacc.c */ -#line 169 "winprefsyacc.y" +#line 212 "winprefsyacc.y" {OpenSysMenu();} break; - case 44: + case 61: /* Line 1455 of yacc.c */ -#line 169 "winprefsyacc.y" +#line 212 "winprefsyacc.y" {CloseSysMenu();} break; - case 45: + case 62: /* Line 1455 of yacc.c */ -#line 172 "winprefsyacc.y" +#line 215 "winprefsyacc.y" { pref.fSilentExit = TRUE; } break; - case 46: + case 63: /* Line 1455 of yacc.c */ -#line 175 "winprefsyacc.y" +#line 218 "winprefsyacc.y" { ErrorF("LoadPreferences: %s\n", (yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); } break; /* Line 1455 of yacc.c */ -#line 1672 "winprefsyacc.c" +#line 1828 "winprefsyacc.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -1883,7 +2039,7 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 179 "winprefsyacc.y" +#line 222 "winprefsyacc.y" /* * Errors in parsing abort and print log messages @@ -2024,6 +2180,39 @@ CloseIcons (void) } static void +OpenStyles (void) +{ + if (pref.style != NULL) { + ErrorF("LoadPreferences: Redefining window style\n"); + free(pref.style); + pref.style = NULL; + } + pref.styleItems = 0; +} + +static void +AddStyleLine (char *matchstr, unsigned long style) +{ + if (pref.style==NULL) + pref.style = (STYLEITEM*)malloc(sizeof(STYLEITEM)); + else + pref.style = (STYLEITEM*) + realloc(pref.style, sizeof(STYLEITEM)*(pref.styleItems+1)); + + strncpy(pref.style[pref.styleItems].match, matchstr, MENU_MAX); + pref.style[pref.styleItems].match[MENU_MAX] = 0; + + pref.style[pref.styleItems].type = style; + + pref.styleItems++; +} + +static void +CloseStyles (void) +{ +} + +static void OpenSysMenu (void) { if (pref.sysMenu != NULL) { diff --git a/xorg-server/hw/xwin/winprefsyacc.h b/xorg-server/hw/xwin/winprefsyacc.h index f299494c9..920e96475 100644 --- a/xorg-server/hw/xwin/winprefsyacc.h +++ b/xorg-server/hw/xwin/winprefsyacc.h @@ -50,19 +50,27 @@ ICONDIRECTORY = 262, DEFAULTICON = 263, ICONS = 264, - DEFAULTSYSMENU = 265, - SYSMENU = 266, - ROOTMENU = 267, - SEPARATOR = 268, - ATSTART = 269, - ATEND = 270, - EXEC = 271, - ALWAYSONTOP = 272, - DEBUG = 273, - RELOAD = 274, - TRAYICON = 275, - SILENTEXIT = 276, - STRING = 277 + STYLES = 265, + TOPMOST = 266, + MAXIMIZE = 267, + MINIMIZE = 268, + BOTTOM = 269, + NOTITLE = 270, + OUTLINE = 271, + NOFRAME = 272, + DEFAULTSYSMENU = 273, + SYSMENU = 274, + ROOTMENU = 275, + SEPARATOR = 276, + ATSTART = 277, + ATEND = 278, + EXEC = 279, + ALWAYSONTOP = 280, + DEBUG = 281, + RELOAD = 282, + TRAYICON = 283, + SILENTEXIT = 284, + STRING = 285 }; #endif /* Tokens. */ @@ -73,19 +81,27 @@ #define ICONDIRECTORY 262 #define DEFAULTICON 263 #define ICONS 264 -#define DEFAULTSYSMENU 265 -#define SYSMENU 266 -#define ROOTMENU 267 -#define SEPARATOR 268 -#define ATSTART 269 -#define ATEND 270 -#define EXEC 271 -#define ALWAYSONTOP 272 -#define DEBUG 273 -#define RELOAD 274 -#define TRAYICON 275 -#define SILENTEXIT 276 -#define STRING 277 +#define STYLES 265 +#define TOPMOST 266 +#define MAXIMIZE 267 +#define MINIMIZE 268 +#define BOTTOM 269 +#define NOTITLE 270 +#define OUTLINE 271 +#define NOFRAME 272 +#define DEFAULTSYSMENU 273 +#define SYSMENU 274 +#define ROOTMENU 275 +#define SEPARATOR 276 +#define ATSTART 277 +#define ATEND 278 +#define EXEC 279 +#define ALWAYSONTOP 280 +#define DEBUG 281 +#define RELOAD 282 +#define TRAYICON 283 +#define SILENTEXIT 284 +#define STRING 285 @@ -95,15 +111,16 @@ typedef union YYSTYPE { /* Line 1676 of yacc.c */ -#line 79 "winprefsyacc.y" +#line 89 "winprefsyacc.y" char *sVal; + unsigned long uVal; int iVal; /* Line 1676 of yacc.c */ -#line 103 "winprefsyacc.h" +#line 120 "winprefsyacc.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ diff --git a/xorg-server/hw/xwin/winprefsyacc.y b/xorg-server/hw/xwin/winprefsyacc.y index c917d04ff..0c2775192 100644 --- a/xorg-server/hw/xwin/winprefsyacc.y +++ b/xorg-server/hw/xwin/winprefsyacc.y @@ -173,18 +173,18 @@ icons: ICONS LB {OpenIcons();} newline_or_nada iconlist RB {CloseIcons();} group1: TOPMOST { $$=STYLE_TOPMOST; } | MAXIMIZE { $$=STYLE_MAXIMIZE; } | MINIMIZE { $$=STYLE_MINIMIZE; } - | BOTTOM { $$=STYLE_BOTTOM; } + | BOTTOM { $$=STYLE_BOTTOM; } ; group2: NOTITLE { $$=STYLE_NOTITLE; } - | OUTLINE { $$=STYLE_OUTLINE; } + | OUTLINE { $$=STYLE_OUTLINE; } | NOFRAME { $$=STYLE_NOFRAME; } ; stylecombo: group1 { $$=$1; } | group2 { $$=$1; } - | group1 group2 { $$=$1+$2; } - | group2 group1 { $$=$1+$2; } + | group1 group2 { $$=$1|$2; } + | group2 group1 { $$=$1|$2; } ; styleline: STRING stylecombo NEWLINE newline_or_nada { AddStyleLine($1, $2); free($1); } diff --git a/xorg-server/hw/xwin/winprocarg.c b/xorg-server/hw/xwin/winprocarg.c index 9271da02b..69d6ab7ac 100644 --- a/xorg-server/hw/xwin/winprocarg.c +++ b/xorg-server/hw/xwin/winprocarg.c @@ -1394,16 +1394,6 @@ ddxProcessArgument (int argc, char *argv[], int i) } #endif -#ifdef XKB - /* - * Look for the '-kb' argument - */ - if (IS_OPTION ("-kb")) - { - g_cmdline.noXkbExtension = TRUE; - return 0; /* Let DIX parse this again */ - } - if (IS_OPTION ("-xkbrules")) { CHECK_ARGS (1); @@ -1434,7 +1424,6 @@ ddxProcessArgument (int argc, char *argv[], int i) g_cmdline.xkbOptions = argv[++i]; return 2; } -#endif if (IS_OPTION ("-keyhook")) { @@ -1520,7 +1509,7 @@ winLogCommandLine (int argc, char *argv[]) iCurrLen = 0; /* Add line break if it fits */ - strncat (g_pszCommandLine, "\n", iSize - strlen (g_pszCommandLine)); + strncat (g_pszCommandLine, "\n ", iSize - strlen (g_pszCommandLine)); } strncat (g_pszCommandLine, argv[i], iSize - strlen (g_pszCommandLine)); @@ -1550,8 +1539,8 @@ winLogVersionInfo (void) ErrorF ("Welcome to the XWin X Server\n"); ErrorF ("Vendor: %s\n", VENDOR_STRING); - ErrorF ("Release: %d.%d.%d.%d (%d)\n", XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP, BUILD_DATE); - ErrorF ("Contact: %s\n", VENDOR_CONTACT); + ErrorF ("Release: %d.%d.%d.%d (%d)\n\n", XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP, XORG_VERSION_CURRENT); + ErrorF ("Contact: %s\n\n", VENDOR_CONTACT); } /* diff --git a/xorg-server/hw/xwin/winshaddd.c b/xorg-server/hw/xwin/winshaddd.c index 96acfcbc7..e35a1bebd 100644 --- a/xorg-server/hw/xwin/winshaddd.c +++ b/xorg-server/hw/xwin/winshaddd.c @@ -42,7 +42,7 @@ */ extern HWND g_hDlgExit; - +extern char *g_pszLogFile; /* * FIXME: Headers are broken, DEFINE_GUID doesn't work correctly, diff --git a/xorg-server/hw/xwin/winshadddnl.c b/xorg-server/hw/xwin/winshadddnl.c index e029154ed..da40cb5ea 100644 --- a/xorg-server/hw/xwin/winshadddnl.c +++ b/xorg-server/hw/xwin/winshadddnl.c @@ -1325,7 +1325,7 @@ winStoreColorsShadowDDNL (ColormapPtr pColormap, + pdefs[0].pixel); if (FAILED (ddrval)) { - ErrorF ("winStoreColorsShadowDDNL - SetEntries () failed: %08x\n", (int) ddrval); + ErrorF ("winStoreColorsShadowDDNL - SetEntries () failed: %08x\n", (unsigned int) ddrval); return FALSE; } diff --git a/xorg-server/hw/xwin/wintrayicon.c b/xorg-server/hw/xwin/wintrayicon.c index 9cd1e5c3c..a813bbfee 100644 --- a/xorg-server/hw/xwin/wintrayicon.c +++ b/xorg-server/hw/xwin/wintrayicon.c @@ -52,7 +52,7 @@ winInitNotifyIcon (winPrivScreenPtr pScreenPriv) nid.uID = pScreenInfo->dwScreen; nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP; nid.uCallbackMessage = WM_TRAYICON; - nid.hIcon = (HICON)winTaskbarIcon (); + nid.hIcon = winTaskbarIcon (); /* Save handle to the icon so it can be freed later */ pScreenPriv->hiconNotifyIcon = nid.hIcon; diff --git a/xorg-server/hw/xwin/winwin32rootless.c b/xorg-server/hw/xwin/winwin32rootless.c index 2c80c0885..d875884d9 100644 --- a/xorg-server/hw/xwin/winwin32rootless.c +++ b/xorg-server/hw/xwin/winwin32rootless.c @@ -48,9 +48,15 @@ /* * Constant defines */ +#ifndef ULW_COLORKEY #define ULW_COLORKEY 0x00000001 +#endif +#ifndef ULW_ALPHA #define ULW_ALPHA 0x00000002 +#endif +#ifndef ULW_OPAQUE #define ULW_OPAQUE 0x00000004 +#endif #define AC_SRC_ALPHA 0x01 /* @@ -67,9 +73,6 @@ winMWExtWMSetNativeProperty (RootlessWindowPtr pFrame); Bool g_fNoConfigureWindow = FALSE; - -extern void winSelectIcons(WindowPtr pWin, HICON *pIcon, HICON *pSmallIcon); - /* * Internal function to get the DIB format that is compatible with the screen * Fixme: Share code with winshadgdi.c @@ -394,9 +397,9 @@ winMWExtWMDestroyFrame (RootlessFrameID wid) #endif /* Store the info we need to destroy after this window is gone */ - hInstance = (HINSTANCE) GetClassLong (pRLWinPriv->hWnd, GCL_HMODULE); - hiconClass = (HICON) GetClassLong (pRLWinPriv->hWnd, GCL_HICON); - hiconSmClass = (HICON) GetClassLong (pRLWinPriv->hWnd, GCL_HICONSM); + hInstance = (HINSTANCE) GetClassLongPtr (pRLWinPriv->hWnd, GCLP_HMODULE); + hiconClass = (HICON) GetClassLongPtr (pRLWinPriv->hWnd, GCLP_HICON); + hiconSmClass = (HICON) GetClassLongPtr (pRLWinPriv->hWnd, GCLP_HICONSM); iReturn = GetClassName (pRLWinPriv->hWnd, pszClass, CLASS_NAME_LENGTH); pRLWinPriv->fClose = TRUE; diff --git a/xorg-server/hw/xwin/winwin32rootlesswindow.c b/xorg-server/hw/xwin/winwin32rootlesswindow.c index dedcd7a76..2b2f63010 100644 --- a/xorg-server/hw/xwin/winwin32rootlesswindow.c +++ b/xorg-server/hw/xwin/winwin32rootlesswindow.c @@ -165,7 +165,7 @@ winMWExtWMUpdateIcon (Window id) HICON hIcon, hiconOld; pWin = (WindowPtr) LookupIDByType (id, RT_WINDOW); - hIcon = (HICON)winOverrideIcon ((unsigned long)pWin); + hIcon = winOverrideIcon ((unsigned long)pWin); if (!hIcon) hIcon = winXIconToHICON (pWin, GetSystemMetrics(SM_CXICON)); @@ -177,12 +177,12 @@ winMWExtWMUpdateIcon (Window id) if (pRLWinPriv->hWnd) { - hiconOld = (HICON) SetClassLong (pRLWinPriv->hWnd, - GCL_HICON, - (int) hIcon); - + + hiconOld = (HICON) SendMessage (pRLWinPriv->hWnd, + WM_SETICON, ICON_BIG, (LPARAM) hIcon); winDestroyIcon(hiconOld); } + hIcon=NULL; } } diff --git a/xorg-server/hw/xwin/winwin32rootlesswndproc.c b/xorg-server/hw/xwin/winwin32rootlesswndproc.c index a5315096c..00627d218 100644 --- a/xorg-server/hw/xwin/winwin32rootlesswndproc.c +++ b/xorg-server/hw/xwin/winwin32rootlesswndproc.c @@ -774,6 +774,17 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, SendMessage (hwndScreen, message, wParam, lParam); return 0; + case WM_ERASEBKGND: +#if CYGDEBUG + winDebug ("winMWExtWMWindowProc - WM_ERASEBKGND\n"); +#endif + /* + * Pretend that we did erase the background but we don't care, + * since we repaint the entire region anyhow + * This avoids some flickering when resizing. + */ + return TRUE; + case WM_PAINT: /* BeginPaint gives us an hdc that clips to the invalidated region */ diff --git a/xorg-server/hw/xwin/winwindow.h b/xorg-server/hw/xwin/winwindow.h index fa4e3c59e..0890e329c 100644 --- a/xorg-server/hw/xwin/winwindow.h +++ b/xorg-server/hw/xwin/winwindow.h @@ -2,7 +2,7 @@ #define _WINWINDOW_H_ /* *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. - *Copyright (C) Colin Harrison 2005-2008 + *Copyright (C) Colin Harrison 2005-2009 * *Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -116,6 +116,7 @@ typedef struct _winWMMessageRec{ #define WM_WM_HINTS_EVENT (WM_USER + 10) #define WM_WM_CHANGE_STATE (WM_USER + 11) #define WM_WM_MAP2 (WM_USER + 12) +#define WM_WM_MAP3 (WM_USER + 13) #define WM_MANAGE (WM_USER + 100) #define WM_UNMANAGE (WM_USER + 102) diff --git a/xorg-server/hw/xwin/winwindowswm.c b/xorg-server/hw/xwin/winwindowswm.c index d72941c7c..61972c932 100644 --- a/xorg-server/hw/xwin/winwindowswm.c +++ b/xorg-server/hw/xwin/winwindowswm.c @@ -31,8 +31,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #endif #include "win.h" -#define NEED_REPLIES -#define NEED_EVENTS #include "misc.h" #include "dixstruct.h" #include "extnsionst.h" @@ -52,7 +50,7 @@ static DISPATCH_PROC(SProcWindowsWMDispatch); static unsigned char WMReqCode = 0; static int WMEventBase = 0; -static RESTYPE ClientType, EventType; /* resource types for event masks */ +static RESTYPE ClientType, eventResourceType; /* resource types for event masks */ static XID eventResource; /* Currently selected events */ @@ -87,10 +85,10 @@ winWindowsWMExtensionInit () ExtensionEntry* extEntry; ClientType = CreateNewResourceType(WMFreeClient); - EventType = CreateNewResourceType(WMFreeEvents); + eventResourceType = CreateNewResourceType(WMFreeEvents); eventResource = FakeClientID(0); - if (ClientType && EventType && + if (ClientType && eventResourceType && (extEntry = AddExtension(WINDOWSWMNAME, WindowsWMNumberEvents, WindowsWMNumberErrors, @@ -149,7 +147,7 @@ WMFreeClient (pointer data, XID id) WMEventPtr *pHead, pCur, pPrev; pEvent = (WMEventPtr) data; - pHead = (WMEventPtr *) LookupIDByType(eventResource, EventType); + pHead = (WMEventPtr *) LookupIDByType(eventResource, eventResourceType); if (pHead) { pPrev = 0; @@ -195,7 +193,7 @@ ProcWindowsWMSelectInput (register ClientPtr client) REQUEST_SIZE_MATCH (xWindowsWMSelectInputReq); pHead = (WMEventPtr *)SecurityLookupIDByType(client, eventResource, - EventType, DixWriteAccess); + eventResourceType, DixWriteAccess); if (stuff->mask != 0) { if (pHead) @@ -237,7 +235,7 @@ ProcWindowsWMSelectInput (register ClientPtr client) { pHead = (WMEventPtr *) xalloc (sizeof (WMEventPtr)); if (!pHead || - !AddResource (eventResource, EventType, (pointer)pHead)) + !AddResource (eventResource, eventResourceType, (pointer)pHead)) { FreeResource (clientResource, RT_NONE); return BadAlloc; @@ -295,7 +293,7 @@ winWindowsWMSendEvent (int type, unsigned int mask, int which, int arg, ErrorF ("winWindowsWMSendEvent %d %d %d %d, %d %d - %d %d\n", type, mask, which, arg, x, y, w, h); #endif - pHead = (WMEventPtr *) LookupIDByType(eventResource, EventType); + pHead = (WMEventPtr *) LookupIDByType(eventResource, eventResourceType); if (!pHead) return; for (pEvent = *pHead; pEvent; pEvent = pEvent->next) diff --git a/xorg-server/hw/xwin/winwndproc.c b/xorg-server/hw/xwin/winwndproc.c index de6b26404..a9207f666 100644 --- a/xorg-server/hw/xwin/winwndproc.c +++ b/xorg-server/hw/xwin/winwndproc.c @@ -42,16 +42,10 @@ #include "winmsg.h" #include "inputstr.h" -#ifdef XKB -extern BOOL winCheckKeyPressed(WPARAM wParam, LPARAM lParam); #ifndef XKB_IN_SERVER #define XKB_IN_SERVER #endif #include <xkbsrv.h> -#endif -extern void winFixShiftKeys (int iScanCode); - - /* * Global variables */ @@ -728,8 +722,8 @@ winWindowProc (HWND hwnd, UINT message, break; /* Has the mouse pointer crossed screens? */ - if (s_pScreen != miPointerGetScreen(inputInfo.pointer)) - miPointerSetScreen (inputInfo.pointer, s_pScreenInfo->dwScreen, + if (s_pScreen != miPointerGetScreen(g_pwinPointer)) + miPointerSetScreen (g_pwinPointer, s_pScreenInfo->dwScreen, GET_X_LPARAM(lParam)-s_pScreenInfo->dwXOffset, GET_Y_LPARAM(lParam)-s_pScreenInfo->dwYOffset); @@ -770,7 +764,6 @@ winWindowProc (HWND hwnd, UINT message, /* Deliver absolute cursor position to X Server */ winEnqueueMotion(GET_X_LPARAM(lParam)-s_pScreenInfo->dwXOffset, GET_Y_LPARAM(lParam)-s_pScreenInfo->dwYOffset); - return 0; case WM_NCMOUSEMOVE: @@ -819,7 +812,7 @@ winWindowProc (HWND hwnd, UINT message, #endif ) SetCapture (hwnd); - return winMouseButtonsHandle (s_pScreen, DeviceButtonPress, Button1, wParam, hwnd, lParam); + return winMouseButtonsHandle (s_pScreen, ButtonPress, Button1, wParam); case WM_LBUTTONUP: if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput) @@ -830,7 +823,7 @@ winWindowProc (HWND hwnd, UINT message, #endif ) ReleaseCapture (); - return winMouseButtonsHandle (s_pScreen, DeviceButtonRelease, Button1, wParam, hwnd, lParam); + return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button1, wParam); case WM_MBUTTONDBLCLK: case WM_MBUTTONDOWN: @@ -842,7 +835,7 @@ winWindowProc (HWND hwnd, UINT message, #endif ) SetCapture (hwnd); - return winMouseButtonsHandle (s_pScreen, DeviceButtonPress, Button2, wParam, hwnd, lParam); + return winMouseButtonsHandle (s_pScreen, ButtonPress, Button2, wParam); case WM_MBUTTONUP: if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput) @@ -853,7 +846,7 @@ winWindowProc (HWND hwnd, UINT message, #endif ) ReleaseCapture (); - return winMouseButtonsHandle (s_pScreen, DeviceButtonRelease, Button2, wParam, hwnd, lParam); + return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button2, wParam); case WM_RBUTTONDBLCLK: case WM_RBUTTONDOWN: @@ -865,7 +858,7 @@ winWindowProc (HWND hwnd, UINT message, #endif ) SetCapture (hwnd); - return winMouseButtonsHandle (s_pScreen, DeviceButtonPress, Button3, wParam, hwnd, lParam); + return winMouseButtonsHandle (s_pScreen, ButtonPress, Button3, wParam); case WM_RBUTTONUP: if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput) @@ -876,7 +869,7 @@ winWindowProc (HWND hwnd, UINT message, #endif ) ReleaseCapture (); - return winMouseButtonsHandle (s_pScreen, DeviceButtonRelease, Button3, wParam, hwnd, lParam); + return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button3, wParam); case WM_XBUTTONDBLCLK: case WM_XBUTTONDOWN: @@ -888,7 +881,7 @@ winWindowProc (HWND hwnd, UINT message, #endif ) SetCapture (hwnd); - return winMouseButtonsHandle (s_pScreen, DeviceButtonPress, HIWORD(wParam) + 5, wParam, hwnd, lParam); + return winMouseButtonsHandle (s_pScreen, ButtonPress, HIWORD(wParam) + 5, wParam); case WM_XBUTTONUP: if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput) break; @@ -898,7 +891,7 @@ winWindowProc (HWND hwnd, UINT message, #endif ) ReleaseCapture (); - return winMouseButtonsHandle (s_pScreen, DeviceButtonRelease, HIWORD(wParam) + 5, wParam, hwnd, lParam); + return winMouseButtonsHandle (s_pScreen, ButtonRelease, HIWORD(wParam) + 5, wParam); case WM_TIMER: if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput) @@ -908,20 +901,15 @@ winWindowProc (HWND hwnd, UINT message, switch (wParam) { case WIN_E3B_TIMER_ID: - { - POINT Pos; - GetCursorPos(&Pos); - ScreenToClient(hwnd,&Pos); /* Send delayed button press */ - winMouseButtonsSendEvent (DeviceButtonPress, - s_pScreenPriv->iE3BCachedPress,Pos.x,Pos.y); + winMouseButtonsSendEvent (ButtonPress, + s_pScreenPriv->iE3BCachedPress); /* Kill this timer */ KillTimer (s_pScreenPriv->hwndScreen, WIN_E3B_TIMER_ID); /* Clear screen privates flags */ s_pScreenPriv->iE3BCachedPress = 0; - } break; case WIN_POLLING_MOUSE_TIMER_ID: @@ -932,11 +920,10 @@ winWindowProc (HWND hwnd, UINT message, /* Get the current position of the mouse cursor */ GetCursorPos (&point); - ScreenToClient(hwnd,&point); /* Map from screen (-X, -Y) to root (0, 0) */ - //point.x -= GetSystemMetrics (SM_XVIRTUALSCREEN); - //point.y -= GetSystemMetrics (SM_YVIRTUALSCREEN); + point.x -= GetSystemMetrics (SM_XVIRTUALSCREEN); + point.y -= GetSystemMetrics (SM_YVIRTUALSCREEN); /* Deliver absolute cursor position to X Server */ winEnqueueMotion(point.x , point.y); @@ -948,7 +935,6 @@ winWindowProc (HWND hwnd, UINT message, wR = (GetKeyState (VK_RBUTTON) & 0x8000)?MK_RBUTTON:0; wShift = (GetKeyState (VK_SHIFT) & 0x8000)?MK_SHIFT:0; wCtrl = (GetKeyState (VK_CONTROL) & 0x8000)?MK_CONTROL:0; - ScreenToClient(hwnd,&point); lPos = MAKELPARAM(point.x, point.y); if (g_fButton[0] & !wL) PostMessage (hwnd, WM_LBUTTONUP, wCtrl|wM|wR|wShift, lPos); @@ -966,19 +952,14 @@ winWindowProc (HWND hwnd, UINT message, return 0; case WM_MOUSEWHEEL: - { - POINT Pos; if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput) break; #if CYGDEBUG winDebug ("winWindowProc - WM_MOUSEWHEEL\n"); #endif - Pos.x=GET_X_LPARAM(lParam); - Pos.y=GET_Y_LPARAM(lParam); - ScreenToClient(hwnd,&Pos); - winMouseWheel (s_pScreen, GET_WHEEL_DELTA_WPARAM(wParam),Pos.x,Pos.y); + winMouseWheel (s_pScreen, GET_WHEEL_DELTA_WPARAM(wParam)); break; - } + case WM_SETFOCUS: if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput) break; @@ -1048,12 +1029,10 @@ winWindowProc (HWND hwnd, UINT message, if ((wParam == VK_LWIN || wParam == VK_RWIN) && !g_fKeyboardHookLL) break; -#ifdef XKB /* * Discard presses generated from Windows auto-repeat - * ago: Only discard them if XKB is not disabled */ - if (!g_winInfo.xkb.disable && (lParam & (1<<30))) + if (lParam & (1<<30)) { switch (wParam) { @@ -1069,7 +1048,6 @@ winWindowProc (HWND hwnd, UINT message, return 0; } } -#endif /* Discard fake Ctrl_L presses that precede AltGR on non-US keyboards */ if (winIsFakeCtrl_L (message, wParam, lParam)) |