From 4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05 Mon Sep 17 00:00:00 2001 From: marha Date: Sat, 25 Jul 2009 19:39:46 +0000 Subject: Added xorg-server-1.6.2.tar.gz --- xorg-server/hw/xquartz/GL/Makefile.am | 8 +- xorg-server/hw/xquartz/GL/Makefile.in | 89 +- xorg-server/hw/xquartz/GL/capabilities.c | 559 +++ xorg-server/hw/xquartz/GL/capabilities.h | 66 + xorg-server/hw/xquartz/GL/indirect.c | 1263 +++--- xorg-server/hw/xquartz/GL/visualConfigs.c | 255 ++ xorg-server/hw/xquartz/GL/visualConfigs.h | 28 + xorg-server/hw/xquartz/Makefile.am | 27 +- xorg-server/hw/xquartz/Makefile.in | 122 +- xorg-server/hw/xquartz/X11Application.h | 29 +- xorg-server/hw/xquartz/X11Application.m | 953 +++-- xorg-server/hw/xquartz/X11Controller.h | 22 +- xorg-server/hw/xquartz/X11Controller.m | 415 +- xorg-server/hw/xquartz/applewm.c | 20 +- .../xquartz/bundle/Dutch.lproj/InfoPlist.strings | Bin 274 -> 0 bytes .../xquartz/bundle/Dutch.lproj/Localizable.strings | Bin 1084 -> 0 bytes .../bundle/Dutch.lproj/main.nib/keyedobjects.nib | Bin 32654 -> 0 bytes .../xquartz/bundle/English.lproj/InfoPlist.strings | Bin 276 -> 0 bytes .../bundle/English.lproj/Localizable.strings | Bin 1094 -> 0 bytes .../bundle/English.lproj/main.nib/designable.nib | 3482 ----------------- .../bundle/English.lproj/main.nib/keyedobjects.nib | Bin 35571 -> 0 bytes .../xquartz/bundle/French.lproj/InfoPlist.strings | Bin 276 -> 0 bytes .../bundle/French.lproj/Localizable.strings | Bin 1168 -> 0 bytes .../bundle/French.lproj/main.nib/keyedobjects.nib | Bin 36404 -> 0 bytes .../xquartz/bundle/German.lproj/InfoPlist.strings | Bin 276 -> 0 bytes .../bundle/German.lproj/Localizable.strings | Bin 1096 -> 0 bytes .../bundle/German.lproj/main.nib/keyedobjects.nib | Bin 34995 -> 0 bytes xorg-server/hw/xquartz/bundle/Info.plist | 39 - xorg-server/hw/xquartz/bundle/Info.plist.cpp | 39 + .../xquartz/bundle/Italian.lproj/InfoPlist.strings | Bin 278 -> 0 bytes .../bundle/Italian.lproj/Localizable.strings | Bin 1146 -> 0 bytes .../bundle/Italian.lproj/main.nib/keyedobjects.nib | Bin 33677 -> 0 bytes .../bundle/Japanese.lproj/InfoPlist.strings | Bin 272 -> 0 bytes .../bundle/Japanese.lproj/Localizable.strings | Bin 916 -> 0 bytes .../Japanese.lproj/main.nib/keyedobjects.nib | Bin 33095 -> 0 bytes xorg-server/hw/xquartz/bundle/Makefile.am | 139 +- xorg-server/hw/xquartz/bundle/Makefile.in | 305 +- xorg-server/hw/xquartz/bundle/PkgInfo | 1 + .../bundle/Resources/Dutch.lproj/InfoPlist.strings | Bin 0 -> 274 bytes .../Resources/Dutch.lproj/Localizable.strings | Bin 0 -> 1084 bytes .../Dutch.lproj/main.nib/keyedobjects.nib | Bin 0 -> 32654 bytes .../Resources/English.lproj/InfoPlist.strings | Bin 0 -> 276 bytes .../Resources/English.lproj/Localizable.strings | Bin 0 -> 2528 bytes .../English.lproj/main.nib/designable.nib | 4038 ++++++++++++++++++++ .../English.lproj/main.nib/keyedobjects.nib | Bin 0 -> 41769 bytes .../Resources/French.lproj/InfoPlist.strings | Bin 0 -> 276 bytes .../Resources/French.lproj/Localizable.strings | Bin 0 -> 1168 bytes .../French.lproj/main.nib/keyedobjects.nib | Bin 0 -> 36404 bytes .../Resources/German.lproj/InfoPlist.strings | Bin 0 -> 276 bytes .../Resources/German.lproj/Localizable.strings | Bin 0 -> 1096 bytes .../German.lproj/main.nib/keyedobjects.nib | Bin 0 -> 34995 bytes .../Resources/Italian.lproj/InfoPlist.strings | Bin 0 -> 278 bytes .../Resources/Italian.lproj/Localizable.strings | Bin 0 -> 1146 bytes .../Italian.lproj/main.nib/keyedobjects.nib | Bin 0 -> 33677 bytes .../Resources/Japanese.lproj/InfoPlist.strings | Bin 0 -> 272 bytes .../Resources/Japanese.lproj/Localizable.strings | Bin 0 -> 916 bytes .../Japanese.lproj/main.nib/keyedobjects.nib | Bin 0 -> 33095 bytes .../Resources/Spanish.lproj/InfoPlist.strings | Bin 0 -> 276 bytes .../Resources/Spanish.lproj/Localizable.strings | Bin 0 -> 1134 bytes .../Spanish.lproj/main.nib/keyedobjects.nib | Bin 0 -> 35294 bytes xorg-server/hw/xquartz/bundle/Resources/X11.icns | Bin 0 -> 189002 bytes .../bundle/Resources/da.lproj/InfoPlist.strings | Bin 0 -> 276 bytes .../bundle/Resources/da.lproj/Localizable.strings | Bin 0 -> 1090 bytes .../Resources/da.lproj/main.nib/keyedobjects.nib | Bin 0 -> 34164 bytes .../bundle/Resources/fi.lproj/InfoPlist.strings | Bin 0 -> 274 bytes .../bundle/Resources/fi.lproj/Localizable.strings | Bin 0 -> 1102 bytes .../Resources/fi.lproj/main.nib/keyedobjects.nib | Bin 0 -> 34765 bytes .../bundle/Resources/ko.lproj/InfoPlist.strings | Bin 0 -> 266 bytes .../bundle/Resources/ko.lproj/Localizable.strings | Bin 0 -> 916 bytes .../Resources/ko.lproj/main.nib/keyedobjects.nib | Bin 0 -> 32690 bytes .../bundle/Resources/no.lproj/InfoPlist.strings | Bin 0 -> 276 bytes .../bundle/Resources/no.lproj/Localizable.strings | Bin 0 -> 1084 bytes .../Resources/no.lproj/main.nib/keyedobjects.nib | Bin 0 -> 33581 bytes .../bundle/Resources/pl.lproj/InfoPlist.strings | Bin 0 -> 274 bytes .../bundle/Resources/pl.lproj/Localizable.strings | Bin 0 -> 1116 bytes .../Resources/pl.lproj/main.nib/keyedobjects.nib | Bin 0 -> 35113 bytes .../bundle/Resources/pt.lproj/InfoPlist.strings | Bin 0 -> 274 bytes .../bundle/Resources/pt.lproj/Localizable.strings | Bin 0 -> 1192 bytes .../Resources/pt.lproj/main.nib/keyedobjects.nib | Bin 0 -> 34533 bytes .../bundle/Resources/pt_PT.lproj/InfoPlist.strings | Bin 0 -> 274 bytes .../Resources/pt_PT.lproj/Localizable.strings | Bin 0 -> 1140 bytes .../pt_PT.lproj/main.nib/keyedobjects.nib | Bin 0 -> 35485 bytes .../bundle/Resources/ru.lproj/InfoPlist.strings | Bin 0 -> 274 bytes .../bundle/Resources/ru.lproj/Localizable.strings | Bin 0 -> 1122 bytes .../Resources/ru.lproj/main.nib/keyedobjects.nib | Bin 0 -> 36593 bytes .../bundle/Resources/sv.lproj/InfoPlist.strings | Bin 0 -> 260 bytes .../bundle/Resources/sv.lproj/Localizable.strings | Bin 0 -> 1106 bytes .../Resources/sv.lproj/main.nib/keyedobjects.nib | Bin 0 -> 35017 bytes .../bundle/Resources/zh_CN.lproj/InfoPlist.strings | Bin 0 -> 260 bytes .../Resources/zh_CN.lproj/Localizable.strings | Bin 0 -> 884 bytes .../zh_CN.lproj/main.nib/keyedobjects.nib | Bin 0 -> 31481 bytes .../bundle/Resources/zh_TW.lproj/InfoPlist.strings | Bin 0 -> 266 bytes .../Resources/zh_TW.lproj/Localizable.strings | Bin 0 -> 890 bytes .../zh_TW.lproj/main.nib/keyedobjects.nib | Bin 0 -> 31748 bytes .../xquartz/bundle/Spanish.lproj/InfoPlist.strings | Bin 276 -> 0 bytes .../bundle/Spanish.lproj/Localizable.strings | Bin 1134 -> 0 bytes .../bundle/Spanish.lproj/main.nib/keyedobjects.nib | Bin 35294 -> 0 bytes xorg-server/hw/xquartz/bundle/X11.icns | Bin 65908 -> 0 bytes xorg-server/hw/xquartz/bundle/X11.sh | 15 + .../xquartz/bundle/X11.xcodeproj/project.pbxproj | 458 --- xorg-server/hw/xquartz/bundle/bundle-main.c | 136 - xorg-server/hw/xquartz/bundle/cpprules.in | 37 + .../hw/xquartz/bundle/da.lproj/InfoPlist.strings | Bin 276 -> 0 bytes .../hw/xquartz/bundle/da.lproj/Localizable.strings | Bin 1090 -> 0 bytes .../bundle/da.lproj/main.nib/keyedobjects.nib | Bin 34164 -> 0 bytes .../hw/xquartz/bundle/fi.lproj/InfoPlist.strings | Bin 274 -> 0 bytes .../hw/xquartz/bundle/fi.lproj/Localizable.strings | Bin 1102 -> 0 bytes .../bundle/fi.lproj/main.nib/keyedobjects.nib | Bin 34765 -> 0 bytes .../hw/xquartz/bundle/ko.lproj/InfoPlist.strings | Bin 266 -> 0 bytes .../hw/xquartz/bundle/ko.lproj/Localizable.strings | Bin 916 -> 0 bytes .../bundle/ko.lproj/main.nib/keyedobjects.nib | Bin 32690 -> 0 bytes xorg-server/hw/xquartz/bundle/mk_bundke.sh | 30 + .../hw/xquartz/bundle/no.lproj/InfoPlist.strings | Bin 276 -> 0 bytes .../hw/xquartz/bundle/no.lproj/Localizable.strings | Bin 1084 -> 0 bytes .../bundle/no.lproj/main.nib/keyedobjects.nib | Bin 33581 -> 0 bytes .../hw/xquartz/bundle/pl.lproj/InfoPlist.strings | Bin 274 -> 0 bytes .../hw/xquartz/bundle/pl.lproj/Localizable.strings | Bin 1116 -> 0 bytes .../bundle/pl.lproj/main.nib/keyedobjects.nib | Bin 35113 -> 0 bytes .../hw/xquartz/bundle/pt.lproj/InfoPlist.strings | Bin 274 -> 0 bytes .../hw/xquartz/bundle/pt.lproj/Localizable.strings | Bin 1192 -> 0 bytes .../bundle/pt.lproj/main.nib/keyedobjects.nib | Bin 34533 -> 0 bytes .../xquartz/bundle/pt_PT.lproj/InfoPlist.strings | Bin 274 -> 0 bytes .../xquartz/bundle/pt_PT.lproj/Localizable.strings | Bin 1140 -> 0 bytes .../bundle/pt_PT.lproj/main.nib/keyedobjects.nib | Bin 35485 -> 0 bytes .../hw/xquartz/bundle/ru.lproj/InfoPlist.strings | Bin 274 -> 0 bytes .../hw/xquartz/bundle/ru.lproj/Localizable.strings | Bin 1122 -> 0 bytes .../bundle/ru.lproj/main.nib/keyedobjects.nib | Bin 36593 -> 0 bytes .../hw/xquartz/bundle/sv.lproj/InfoPlist.strings | Bin 260 -> 0 bytes .../hw/xquartz/bundle/sv.lproj/Localizable.strings | Bin 1106 -> 0 bytes .../bundle/sv.lproj/main.nib/keyedobjects.nib | Bin 35017 -> 0 bytes .../xquartz/bundle/zh_CN.lproj/InfoPlist.strings | Bin 260 -> 0 bytes .../xquartz/bundle/zh_CN.lproj/Localizable.strings | Bin 884 -> 0 bytes .../bundle/zh_CN.lproj/main.nib/keyedobjects.nib | Bin 31481 -> 0 bytes .../xquartz/bundle/zh_TW.lproj/InfoPlist.strings | Bin 266 -> 0 bytes .../xquartz/bundle/zh_TW.lproj/Localizable.strings | Bin 890 -> 0 bytes .../bundle/zh_TW.lproj/main.nib/keyedobjects.nib | Bin 31748 -> 0 bytes xorg-server/hw/xquartz/darwin.c | 359 +- xorg-server/hw/xquartz/darwin.h | 52 +- xorg-server/hw/xquartz/darwinEvents.c | 795 ++-- xorg-server/hw/xquartz/darwinEvents.h | 52 +- xorg-server/hw/xquartz/darwinKeyboard.c | 1009 ----- xorg-server/hw/xquartz/darwinKeyboard.h | 45 - xorg-server/hw/xquartz/darwinXinput.c | 200 +- xorg-server/hw/xquartz/doc/Makefile.am | 14 + xorg-server/hw/xquartz/doc/Makefile.in | 587 +++ xorg-server/hw/xquartz/doc/Xquartz.man.pre | 159 + xorg-server/hw/xquartz/mach-startup/Makefile.am | 74 + xorg-server/hw/xquartz/mach-startup/Makefile.in | 754 ++++ xorg-server/hw/xquartz/mach-startup/bundle-main.c | 581 +++ xorg-server/hw/xquartz/mach-startup/launchd_fd.c | 82 + xorg-server/hw/xquartz/mach-startup/launchd_fd.h | 36 + .../hw/xquartz/mach-startup/mach_startup.defs | 50 + .../hw/xquartz/mach-startup/mach_startup_types.h | 9 + xorg-server/hw/xquartz/mach-startup/stub.c | 345 ++ xorg-server/hw/xquartz/pbproxy/Makefile.am | 23 + xorg-server/hw/xquartz/pbproxy/Makefile.in | 698 ++++ xorg-server/hw/xquartz/pbproxy/app-main.m | 92 + xorg-server/hw/xquartz/pbproxy/main.m | 164 + xorg-server/hw/xquartz/pbproxy/pbproxy.h | 91 + xorg-server/hw/xquartz/pbproxy/trick_autotools.c | 3 + xorg-server/hw/xquartz/pbproxy/x-input.m | 187 + xorg-server/hw/xquartz/pbproxy/x-selection.h | 116 + xorg-server/hw/xquartz/pbproxy/x-selection.m | 1545 ++++++++ xorg-server/hw/xquartz/pseudoramiX.c | 41 +- xorg-server/hw/xquartz/quartz.c | 286 +- xorg-server/hw/xquartz/quartz.h | 17 +- xorg-server/hw/xquartz/quartzAudio.c | 16 +- xorg-server/hw/xquartz/quartzCocoa.m | 13 +- xorg-server/hw/xquartz/quartzCommon.h | 27 +- xorg-server/hw/xquartz/quartzCursor.c | 646 ---- xorg-server/hw/xquartz/quartzCursor.h | 42 - xorg-server/hw/xquartz/quartzForeground.c | 47 - xorg-server/hw/xquartz/quartzForeground.h | 37 - xorg-server/hw/xquartz/quartzKeyboard.c | 548 ++- xorg-server/hw/xquartz/quartzKeyboard.h | 19 +- xorg-server/hw/xquartz/quartzPasteboard.c | 12 +- xorg-server/hw/xquartz/quartzPasteboard.h | 4 +- xorg-server/hw/xquartz/quartzStartup.c | 97 +- xorg-server/hw/xquartz/sanitizedCarbon.h | 32 + xorg-server/hw/xquartz/sanitizedCocoa.h | 27 + xorg-server/hw/xquartz/threadSafety.c | 78 + xorg-server/hw/xquartz/threadSafety.h | 56 + xorg-server/hw/xquartz/xpr/Makefile.am | 60 +- xorg-server/hw/xquartz/xpr/Makefile.in | 355 +- xorg-server/hw/xquartz/xpr/appledri.c | 6 +- xorg-server/hw/xquartz/xpr/dri.c | 224 +- xorg-server/hw/xquartz/xpr/dri.h | 2 +- xorg-server/hw/xquartz/xpr/x-hash.c | 12 +- xorg-server/hw/xquartz/xpr/x-hash.h | 31 + xorg-server/hw/xquartz/xpr/xpr.h | 3 + xorg-server/hw/xquartz/xpr/xprAppleWM.c | 29 +- xorg-server/hw/xquartz/xpr/xprCursor.c | 61 +- xorg-server/hw/xquartz/xpr/xprEvent.c | 91 + xorg-server/hw/xquartz/xpr/xprEvent.h | 34 + xorg-server/hw/xquartz/xpr/xprFrame.c | 107 +- xorg-server/hw/xquartz/xpr/xprScreen.c | 112 +- 196 files changed, 14539 insertions(+), 9330 deletions(-) create mode 100644 xorg-server/hw/xquartz/GL/capabilities.c create mode 100644 xorg-server/hw/xquartz/GL/capabilities.h create mode 100644 xorg-server/hw/xquartz/GL/visualConfigs.c create mode 100644 xorg-server/hw/xquartz/GL/visualConfigs.h delete mode 100644 xorg-server/hw/xquartz/bundle/Dutch.lproj/InfoPlist.strings delete mode 100644 xorg-server/hw/xquartz/bundle/Dutch.lproj/Localizable.strings delete mode 100644 xorg-server/hw/xquartz/bundle/Dutch.lproj/main.nib/keyedobjects.nib delete mode 100644 xorg-server/hw/xquartz/bundle/English.lproj/InfoPlist.strings delete mode 100644 xorg-server/hw/xquartz/bundle/English.lproj/Localizable.strings delete mode 100644 xorg-server/hw/xquartz/bundle/English.lproj/main.nib/designable.nib delete mode 100644 xorg-server/hw/xquartz/bundle/English.lproj/main.nib/keyedobjects.nib delete mode 100644 xorg-server/hw/xquartz/bundle/French.lproj/InfoPlist.strings delete mode 100644 xorg-server/hw/xquartz/bundle/French.lproj/Localizable.strings delete mode 100644 xorg-server/hw/xquartz/bundle/French.lproj/main.nib/keyedobjects.nib delete mode 100644 xorg-server/hw/xquartz/bundle/German.lproj/InfoPlist.strings delete mode 100644 xorg-server/hw/xquartz/bundle/German.lproj/Localizable.strings delete mode 100644 xorg-server/hw/xquartz/bundle/German.lproj/main.nib/keyedobjects.nib delete mode 100644 xorg-server/hw/xquartz/bundle/Info.plist create mode 100644 xorg-server/hw/xquartz/bundle/Info.plist.cpp delete mode 100644 xorg-server/hw/xquartz/bundle/Italian.lproj/InfoPlist.strings delete mode 100644 xorg-server/hw/xquartz/bundle/Italian.lproj/Localizable.strings delete mode 100644 xorg-server/hw/xquartz/bundle/Italian.lproj/main.nib/keyedobjects.nib delete mode 100644 xorg-server/hw/xquartz/bundle/Japanese.lproj/InfoPlist.strings delete mode 100644 xorg-server/hw/xquartz/bundle/Japanese.lproj/Localizable.strings delete mode 100644 xorg-server/hw/xquartz/bundle/Japanese.lproj/main.nib/keyedobjects.nib create mode 100644 xorg-server/hw/xquartz/bundle/PkgInfo create mode 100644 xorg-server/hw/xquartz/bundle/Resources/Dutch.lproj/InfoPlist.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/Dutch.lproj/Localizable.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/Dutch.lproj/main.nib/keyedobjects.nib create mode 100644 xorg-server/hw/xquartz/bundle/Resources/English.lproj/InfoPlist.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/English.lproj/main.nib/designable.nib create mode 100644 xorg-server/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib create mode 100644 xorg-server/hw/xquartz/bundle/Resources/French.lproj/InfoPlist.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/French.lproj/Localizable.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/French.lproj/main.nib/keyedobjects.nib create mode 100644 xorg-server/hw/xquartz/bundle/Resources/German.lproj/InfoPlist.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/German.lproj/Localizable.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/German.lproj/main.nib/keyedobjects.nib create mode 100644 xorg-server/hw/xquartz/bundle/Resources/Italian.lproj/InfoPlist.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/Italian.lproj/Localizable.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/Italian.lproj/main.nib/keyedobjects.nib create mode 100644 xorg-server/hw/xquartz/bundle/Resources/Japanese.lproj/InfoPlist.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/Japanese.lproj/Localizable.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/Japanese.lproj/main.nib/keyedobjects.nib create mode 100644 xorg-server/hw/xquartz/bundle/Resources/Spanish.lproj/InfoPlist.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/Spanish.lproj/Localizable.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/Spanish.lproj/main.nib/keyedobjects.nib create mode 100644 xorg-server/hw/xquartz/bundle/Resources/X11.icns create mode 100644 xorg-server/hw/xquartz/bundle/Resources/da.lproj/InfoPlist.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/da.lproj/Localizable.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/da.lproj/main.nib/keyedobjects.nib create mode 100644 xorg-server/hw/xquartz/bundle/Resources/fi.lproj/InfoPlist.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/fi.lproj/Localizable.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/fi.lproj/main.nib/keyedobjects.nib create mode 100644 xorg-server/hw/xquartz/bundle/Resources/ko.lproj/InfoPlist.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/ko.lproj/Localizable.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/ko.lproj/main.nib/keyedobjects.nib create mode 100644 xorg-server/hw/xquartz/bundle/Resources/no.lproj/InfoPlist.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/no.lproj/Localizable.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/no.lproj/main.nib/keyedobjects.nib create mode 100644 xorg-server/hw/xquartz/bundle/Resources/pl.lproj/InfoPlist.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/pl.lproj/Localizable.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/pl.lproj/main.nib/keyedobjects.nib create mode 100644 xorg-server/hw/xquartz/bundle/Resources/pt.lproj/InfoPlist.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/pt.lproj/Localizable.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/pt.lproj/main.nib/keyedobjects.nib create mode 100644 xorg-server/hw/xquartz/bundle/Resources/pt_PT.lproj/InfoPlist.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/pt_PT.lproj/Localizable.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/pt_PT.lproj/main.nib/keyedobjects.nib create mode 100644 xorg-server/hw/xquartz/bundle/Resources/ru.lproj/InfoPlist.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/ru.lproj/Localizable.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/ru.lproj/main.nib/keyedobjects.nib create mode 100644 xorg-server/hw/xquartz/bundle/Resources/sv.lproj/InfoPlist.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/sv.lproj/Localizable.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/sv.lproj/main.nib/keyedobjects.nib create mode 100644 xorg-server/hw/xquartz/bundle/Resources/zh_CN.lproj/InfoPlist.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/zh_CN.lproj/Localizable.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/zh_CN.lproj/main.nib/keyedobjects.nib create mode 100644 xorg-server/hw/xquartz/bundle/Resources/zh_TW.lproj/InfoPlist.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/zh_TW.lproj/Localizable.strings create mode 100644 xorg-server/hw/xquartz/bundle/Resources/zh_TW.lproj/main.nib/keyedobjects.nib delete mode 100644 xorg-server/hw/xquartz/bundle/Spanish.lproj/InfoPlist.strings delete mode 100644 xorg-server/hw/xquartz/bundle/Spanish.lproj/Localizable.strings delete mode 100644 xorg-server/hw/xquartz/bundle/Spanish.lproj/main.nib/keyedobjects.nib delete mode 100644 xorg-server/hw/xquartz/bundle/X11.icns create mode 100644 xorg-server/hw/xquartz/bundle/X11.sh delete mode 100644 xorg-server/hw/xquartz/bundle/X11.xcodeproj/project.pbxproj delete mode 100644 xorg-server/hw/xquartz/bundle/bundle-main.c create mode 100644 xorg-server/hw/xquartz/bundle/cpprules.in delete mode 100644 xorg-server/hw/xquartz/bundle/da.lproj/InfoPlist.strings delete mode 100644 xorg-server/hw/xquartz/bundle/da.lproj/Localizable.strings delete mode 100644 xorg-server/hw/xquartz/bundle/da.lproj/main.nib/keyedobjects.nib delete mode 100644 xorg-server/hw/xquartz/bundle/fi.lproj/InfoPlist.strings delete mode 100644 xorg-server/hw/xquartz/bundle/fi.lproj/Localizable.strings delete mode 100644 xorg-server/hw/xquartz/bundle/fi.lproj/main.nib/keyedobjects.nib delete mode 100644 xorg-server/hw/xquartz/bundle/ko.lproj/InfoPlist.strings delete mode 100644 xorg-server/hw/xquartz/bundle/ko.lproj/Localizable.strings delete mode 100644 xorg-server/hw/xquartz/bundle/ko.lproj/main.nib/keyedobjects.nib create mode 100644 xorg-server/hw/xquartz/bundle/mk_bundke.sh delete mode 100644 xorg-server/hw/xquartz/bundle/no.lproj/InfoPlist.strings delete mode 100644 xorg-server/hw/xquartz/bundle/no.lproj/Localizable.strings delete mode 100644 xorg-server/hw/xquartz/bundle/no.lproj/main.nib/keyedobjects.nib delete mode 100644 xorg-server/hw/xquartz/bundle/pl.lproj/InfoPlist.strings delete mode 100644 xorg-server/hw/xquartz/bundle/pl.lproj/Localizable.strings delete mode 100644 xorg-server/hw/xquartz/bundle/pl.lproj/main.nib/keyedobjects.nib delete mode 100644 xorg-server/hw/xquartz/bundle/pt.lproj/InfoPlist.strings delete mode 100644 xorg-server/hw/xquartz/bundle/pt.lproj/Localizable.strings delete mode 100644 xorg-server/hw/xquartz/bundle/pt.lproj/main.nib/keyedobjects.nib delete mode 100644 xorg-server/hw/xquartz/bundle/pt_PT.lproj/InfoPlist.strings delete mode 100644 xorg-server/hw/xquartz/bundle/pt_PT.lproj/Localizable.strings delete mode 100644 xorg-server/hw/xquartz/bundle/pt_PT.lproj/main.nib/keyedobjects.nib delete mode 100644 xorg-server/hw/xquartz/bundle/ru.lproj/InfoPlist.strings delete mode 100644 xorg-server/hw/xquartz/bundle/ru.lproj/Localizable.strings delete mode 100644 xorg-server/hw/xquartz/bundle/ru.lproj/main.nib/keyedobjects.nib delete mode 100644 xorg-server/hw/xquartz/bundle/sv.lproj/InfoPlist.strings delete mode 100644 xorg-server/hw/xquartz/bundle/sv.lproj/Localizable.strings delete mode 100644 xorg-server/hw/xquartz/bundle/sv.lproj/main.nib/keyedobjects.nib delete mode 100644 xorg-server/hw/xquartz/bundle/zh_CN.lproj/InfoPlist.strings delete mode 100644 xorg-server/hw/xquartz/bundle/zh_CN.lproj/Localizable.strings delete mode 100644 xorg-server/hw/xquartz/bundle/zh_CN.lproj/main.nib/keyedobjects.nib delete mode 100644 xorg-server/hw/xquartz/bundle/zh_TW.lproj/InfoPlist.strings delete mode 100644 xorg-server/hw/xquartz/bundle/zh_TW.lproj/Localizable.strings delete mode 100644 xorg-server/hw/xquartz/bundle/zh_TW.lproj/main.nib/keyedobjects.nib delete mode 100644 xorg-server/hw/xquartz/darwinKeyboard.c delete mode 100644 xorg-server/hw/xquartz/darwinKeyboard.h create mode 100644 xorg-server/hw/xquartz/doc/Makefile.am create mode 100644 xorg-server/hw/xquartz/doc/Makefile.in create mode 100644 xorg-server/hw/xquartz/doc/Xquartz.man.pre create mode 100644 xorg-server/hw/xquartz/mach-startup/Makefile.am create mode 100644 xorg-server/hw/xquartz/mach-startup/Makefile.in create mode 100644 xorg-server/hw/xquartz/mach-startup/bundle-main.c create mode 100644 xorg-server/hw/xquartz/mach-startup/launchd_fd.c create mode 100644 xorg-server/hw/xquartz/mach-startup/launchd_fd.h create mode 100644 xorg-server/hw/xquartz/mach-startup/mach_startup.defs create mode 100644 xorg-server/hw/xquartz/mach-startup/mach_startup_types.h create mode 100644 xorg-server/hw/xquartz/mach-startup/stub.c create mode 100644 xorg-server/hw/xquartz/pbproxy/Makefile.am create mode 100644 xorg-server/hw/xquartz/pbproxy/Makefile.in create mode 100644 xorg-server/hw/xquartz/pbproxy/app-main.m create mode 100644 xorg-server/hw/xquartz/pbproxy/main.m create mode 100644 xorg-server/hw/xquartz/pbproxy/pbproxy.h create mode 100644 xorg-server/hw/xquartz/pbproxy/trick_autotools.c create mode 100644 xorg-server/hw/xquartz/pbproxy/x-input.m create mode 100644 xorg-server/hw/xquartz/pbproxy/x-selection.h create mode 100644 xorg-server/hw/xquartz/pbproxy/x-selection.m delete mode 100644 xorg-server/hw/xquartz/quartzCursor.c delete mode 100644 xorg-server/hw/xquartz/quartzCursor.h delete mode 100644 xorg-server/hw/xquartz/quartzForeground.c delete mode 100644 xorg-server/hw/xquartz/quartzForeground.h create mode 100644 xorg-server/hw/xquartz/sanitizedCarbon.h create mode 100644 xorg-server/hw/xquartz/sanitizedCocoa.h create mode 100644 xorg-server/hw/xquartz/threadSafety.c create mode 100644 xorg-server/hw/xquartz/threadSafety.h create mode 100644 xorg-server/hw/xquartz/xpr/xprEvent.c create mode 100644 xorg-server/hw/xquartz/xpr/xprEvent.h (limited to 'xorg-server/hw/xquartz') diff --git a/xorg-server/hw/xquartz/GL/Makefile.am b/xorg-server/hw/xquartz/GL/Makefile.am index 450ee5c5b..8f4478fec 100644 --- a/xorg-server/hw/xquartz/GL/Makefile.am +++ b/xorg-server/hw/xquartz/GL/Makefile.am @@ -10,4 +10,10 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/miext/damage libCGLCore_la_SOURCES = \ - indirect.c + indirect.c \ + capabilities.c \ + visualConfigs.c + +EXTRA_DIST = \ + capabilities.h \ + visualConfigs.h diff --git a/xorg-server/hw/xquartz/GL/Makefile.in b/xorg-server/hw/xquartz/GL/Makefile.in index 893c0123b..d4572abfe 100644 --- a/xorg-server/hw/xquartz/GL/Makefile.in +++ b/xorg-server/hw/xquartz/GL/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -43,7 +43,6 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-server.h \ $(top_builddir)/include/dix-config.h \ - $(top_builddir)/include/xgl-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ @@ -51,16 +50,14 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libCGLCore_la_LIBADD = -am_libCGLCore_la_OBJECTS = indirect.lo +am_libCGLCore_la_OBJECTS = indirect.lo capabilities.lo \ + visualConfigs.lo libCGLCore_la_OBJECTS = $(am_libCGLCore_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ @@ -75,8 +72,9 @@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ -APPDEFAULTDIR = @APPDEFAULTDIR@ APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ +APPLE_APPLICATION_ID = @APPLE_APPLICATION_ID@ +APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ APP_MAN_DIR = @APP_MAN_DIR@ APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ AR = @AR@ @@ -97,10 +95,6 @@ CFLAGS = @CFLAGS@ COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DARWIN_LIBS = @DARWIN_LIBS@ DBUS_CFLAGS = @DBUS_CFLAGS@ @@ -122,6 +116,7 @@ DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@ DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@ DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ +DOLT_BASH = @DOLT_BASH@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ @@ -131,18 +126,15 @@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ -ECHO = @ECHO@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ -FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ -FREETYPE_LIBS = @FREETYPE_LIBS@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ GL_CFLAGS = @GL_CFLAGS@ @@ -161,7 +153,7 @@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ -LAUNCHD = @LAUNCHD@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ LEX = @LEX@ @@ -175,7 +167,10 @@ LIBTOOL = @LIBTOOL@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LINUXDOC = @LINUXDOC@ +LIPO = @LIPO@ LN_S = @LN_S@ +LTCOMPILE = @LTCOMPILE@ +LTCXXCOMPILE = @LTCXXCOMPILE@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ @@ -187,8 +182,7 @@ MESA_SOURCE = @MESA_SOURCE@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ -MKFONTDIR = @MKFONTDIR@ -MKFONTSCALE = @MKFONTSCALE@ +NM = @NM@ NMEDIT = @NMEDIT@ OBJC = @OBJC@ OBJCCLD = @OBJCCLD@ @@ -197,8 +191,8 @@ OBJCFLAGS = @OBJCFLAGS@ OBJCLINK = @OBJCLINK@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -231,7 +225,6 @@ VENDOR_NAME = @VENDOR_NAME@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VENDOR_RELEASE = @VENDOR_RELEASE@ VERSION = @VERSION@ -X11APP_ARCHS = @X11APP_ARCHS@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ @@ -241,27 +234,12 @@ XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@ XDMX_CFLAGS = @XDMX_CFLAGS@ XDMX_LIBS = @XDMX_LIBS@ XDMX_SYS_LIBS = @XDMX_SYS_LIBS@ -XEGLMODULES_CFLAGS = @XEGLMODULES_CFLAGS@ -XEGL_LIBS = @XEGL_LIBS@ -XEGL_SYS_LIBS = @XEGL_SYS_LIBS@ XEPHYR_CFLAGS = @XEPHYR_CFLAGS@ -XEPHYR_DRI_LIBS = @XEPHYR_DRI_LIBS@ XEPHYR_INCS = @XEPHYR_INCS@ XEPHYR_LIBS = @XEPHYR_LIBS@ XF86CONFIGFILE = @XF86CONFIGFILE@ -XF86MISC_CFLAGS = @XF86MISC_CFLAGS@ -XF86MISC_LIBS = @XF86MISC_LIBS@ XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@ XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@ -XGLMODULES_CFLAGS = @XGLMODULES_CFLAGS@ -XGLMODULES_LIBS = @XGLMODULES_LIBS@ -XGLXMODULES_CFLAGS = @XGLXMODULES_CFLAGS@ -XGLXMODULES_LIBS = @XGLXMODULES_LIBS@ -XGLX_LIBS = @XGLX_LIBS@ -XGLX_SYS_LIBS = @XGLX_SYS_LIBS@ -XGL_LIBS = @XGL_LIBS@ -XGL_MODULE_PATH = @XGL_MODULE_PATH@ -XGL_SYS_LIBS = @XGL_SYS_LIBS@ XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@ XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@ XKB_COMPILED_DIR = @XKB_COMPILED_DIR@ @@ -272,10 +250,6 @@ XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ -XORGCFG_DEP_CFLAGS = @XORGCFG_DEP_CFLAGS@ -XORGCFG_DEP_LIBS = @XORGCFG_DEP_LIBS@ -XORGCONFIG_DEP_CFLAGS = @XORGCONFIG_DEP_CFLAGS@ -XORGCONFIG_DEP_LIBS = @XORGCONFIG_DEP_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ @@ -284,13 +258,8 @@ XORG_MODULES_LIBS = @XORG_MODULES_LIBS@ XORG_OS = @XORG_OS@ XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ XORG_SYS_LIBS = @XORG_SYS_LIBS@ -XPRINTMODULES_CFLAGS = @XPRINTMODULES_CFLAGS@ -XPRINTMODULES_LIBS = @XPRINTMODULES_LIBS@ -XPRINTPROTO_CFLAGS = @XPRINTPROTO_CFLAGS@ -XPRINTPROTO_LIBS = @XPRINTPROTO_LIBS@ -XPRINT_CFLAGS = @XPRINT_CFLAGS@ -XPRINT_LIBS = @XPRINT_LIBS@ -XPRINT_SYS_LIBS = @XPRINT_SYS_LIBS@ +XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ +XPBPROXY_LIBS = @XPBPROXY_LIBS@ XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ XSDL_INCS = @XSDL_INCS@ @@ -323,8 +292,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -344,7 +312,6 @@ driverdir = @driverdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ extdir = @extdir@ -ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -354,12 +321,12 @@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -launchagentsdir = @launchagentsdir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ logdir = @logdir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ @@ -377,8 +344,6 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xglmoduledir = @xglmoduledir@ -xpconfigdir = @xpconfigdir@ noinst_LTLIBRARIES = libCGLCore.la AM_CFLAGS = $(XSERVER_CFLAGS) $(DIX_CFLAGS) AM_CPPFLAGS = \ @@ -391,7 +356,13 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/miext/damage libCGLCore_la_SOURCES = \ - indirect.c + indirect.c \ + capabilities.c \ + visualConfigs.c + +EXTRA_DIST = \ + capabilities.h \ + visualConfigs.h all: all-am @@ -401,8 +372,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -444,7 +415,9 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/capabilities.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indirect.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/visualConfigs.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -478,7 +451,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/xorg-server/hw/xquartz/GL/capabilities.c b/xorg-server/hw/xquartz/GL/capabilities.c new file mode 100644 index 000000000..bc3966f4b --- /dev/null +++ b/xorg-server/hw/xquartz/GL/capabilities.c @@ -0,0 +1,559 @@ +/* + * Copyright (c) 2008 Apple Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "capabilities.h" + +static void handleBufferModes(struct glCapabilitiesConfig *c, GLint bufferModes) { + if(bufferModes & kCGLStereoscopicBit) { + c->stereo = true; + } + + if(bufferModes & kCGLDoubleBufferBit) { + c->buffers = 2; + } else { + c->buffers = 1; + } +} + +static void handleStencilModes(struct glCapabilitiesConfig *c, GLint smodes) { + int offset = 0; + + if(kCGL0Bit & smodes) + c->stencil_bit_depths[offset++] = 0; + + if(kCGL1Bit & smodes) + c->stencil_bit_depths[offset++] = 1; + + if(kCGL2Bit & smodes) + c->stencil_bit_depths[offset++] = 2; + + if(kCGL3Bit & smodes) + c->stencil_bit_depths[offset++] = 3; + + if(kCGL4Bit & smodes) + c->stencil_bit_depths[offset++] = 4; + + if(kCGL5Bit & smodes) + c->stencil_bit_depths[offset++] = 5; + + if(kCGL6Bit & smodes) + c->stencil_bit_depths[offset++] = 6; + + if(kCGL8Bit & smodes) + c->stencil_bit_depths[offset++] = 8; + + if(kCGL10Bit & smodes) + c->stencil_bit_depths[offset++] = 10; + + if(kCGL12Bit & smodes) + c->stencil_bit_depths[offset++] = 12; + + if(kCGL16Bit & smodes) + c->stencil_bit_depths[offset++] = 16; + + if(kCGL24Bit & smodes) + c->stencil_bit_depths[offset++] = 24; + + if(kCGL32Bit & smodes) + c->stencil_bit_depths[offset++] = 32; + + if(kCGL48Bit & smodes) + c->stencil_bit_depths[offset++] = 48; + + if(kCGL64Bit & smodes) + c->stencil_bit_depths[offset++] = 64; + + if(kCGL96Bit & smodes) + c->stencil_bit_depths[offset++] = 96; + + if(kCGL128Bit & smodes) + c->stencil_bit_depths[offset++] = 128; + + assert(offset < GLCAPS_STENCIL_BIT_DEPTH_BUFFERS); + + c->total_stencil_bit_depths = offset; +} + +static int handleColorAndAccumulation(struct glColorBufCapabilities *c, + GLint cmodes) { + int offset = 0; + + /*1*/ + if(kCGLRGB444Bit & cmodes) { + c[offset].r = 4; + c[offset].g = 4; + c[offset].b = 4; + ++offset; + } + + /*2*/ + if(kCGLARGB4444Bit & cmodes) { + c[offset].a = 4; + c[offset].r = 4; + c[offset].g = 4; + c[offset].b = 4; + c[offset].is_argb = true; + ++offset; + } + + /*3*/ + if(kCGLRGB444A8Bit & cmodes) { + c[offset].r = 4; + c[offset].g = 4; + c[offset].b = 4; + c[offset].a = 8; + ++offset; + } + + /*4*/ + if(kCGLRGB555Bit & cmodes) { + c[offset].r = 5; + c[offset].g = 5; + c[offset].b = 5; + ++offset; + } + + /*5*/ + if(kCGLARGB1555Bit & cmodes) { + c[offset].a = 1; + c[offset].r = 5; + c[offset].g = 5; + c[offset].b = 5; + c[offset].is_argb = true; + ++offset; + } + + /*6*/ + if(kCGLRGB555A8Bit & cmodes) { + c[offset].r = 5; + c[offset].g = 5; + c[offset].b = 5; + c[offset].a = 8; + ++offset; + } + + /*7*/ + if(kCGLRGB565Bit & cmodes) { + c[offset].r = 5; + c[offset].g = 6; + c[offset].b = 5; + ++offset; + } + + /*8*/ + if(kCGLRGB565A8Bit & cmodes) { + c[offset].r = 5; + c[offset].g = 6; + c[offset].b = 5; + c[offset].a = 8; + ++offset; + } + + /*9*/ + if(kCGLRGB888Bit & cmodes) { + c[offset].r = 8; + c[offset].g = 8; + c[offset].b = 8; + ++offset; + } + + /*10*/ + if(kCGLARGB8888Bit & cmodes) { + c[offset].a = 8; + c[offset].r = 8; + c[offset].g = 8; + c[offset].b = 8; + c[offset].is_argb = true; + ++offset; + } + + /*11*/ + if(kCGLRGB888A8Bit & cmodes) { + c[offset].r = 8; + c[offset].g = 8; + c[offset].b = 8; + c[offset].a = 8; + ++offset; + } + +#if 0 + /* + * Disable this path, because some part of libGL, X, or Xplugin + * doesn't work with sizes greater than 8. + * When this is enabled and visuals are chosen using depths + * such as 16, the result is that the windows don't redraw + * and are often white, until a resize. + */ + + /*12*/ + if(kCGLRGB101010Bit & cmodes) { + c[offset].r = 10; + c[offset].g = 10; + c[offset].b = 10; + ++offset; + } + + /*13*/ + if(kCGLARGB2101010Bit & cmodes) { + c[offset].a = 2; + c[offset].r = 10; + c[offset].g = 10; + c[offset].b = 10; + c[offset].is_argb = true; + ++offset; + } + + /*14*/ + if(kCGLRGB101010_A8Bit & cmodes) { + c[offset].r = 10; + c[offset].g = 10; + c[offset].b = 10; + c[offset].a = 8; + ++offset; + } + + /*15*/ + if(kCGLRGB121212Bit & cmodes) { + c[offset].r = 12; + c[offset].g = 12; + c[offset].b = 12; + ++offset; + } + + /*16*/ + if(kCGLARGB12121212Bit & cmodes) { + c[offset].a = 12; + c[offset].r = 12; + c[offset].g = 12; + c[offset].b = 12; + c[offset].is_argb = true; + ++offset; + } + + /*17*/ + if(kCGLRGB161616Bit & cmodes) { + c[offset].r = 16; + c[offset].g = 16; + c[offset].b = 16; + ++offset; + } + + /*18*/ + if(kCGLRGBA16161616Bit & cmodes) { + c[offset].r = 16; + c[offset].g = 16; + c[offset].b = 16; + c[offset].a = 16; + ++offset; + } +#endif + + /* FIXME should we handle the floating point color modes, and if so, how? */ + + return offset; +} + + +static void handleColorModes(struct glCapabilitiesConfig *c, GLint cmodes) { + c->total_color_buffers = handleColorAndAccumulation(c->color_buffers, + cmodes); + + assert(c->total_color_buffers < GLCAPS_COLOR_BUFFERS); +} + +static void handleAccumulationModes(struct glCapabilitiesConfig *c, GLint cmodes) { + c->total_accum_buffers = handleColorAndAccumulation(c->accum_buffers, + cmodes); + assert(c->total_accum_buffers < GLCAPS_COLOR_BUFFERS); +} + +static void handleDepthModes(struct glCapabilitiesConfig *c, GLint dmodes) { + int offset = 0; +#define DEPTH(flag,value) do { \ + if(dmodes & flag) { \ + c->depth_buffers[offset++] = value; \ + } \ + } while(0) + + /*1*/ + DEPTH(kCGL0Bit, 0); + /*2*/ + DEPTH(kCGL1Bit, 1); + /*3*/ + DEPTH(kCGL2Bit, 2); + /*4*/ + DEPTH(kCGL3Bit, 3); + /*5*/ + DEPTH(kCGL4Bit, 4); + /*6*/ + DEPTH(kCGL5Bit, 5); + /*7*/ + DEPTH(kCGL6Bit, 6); + /*8*/ + DEPTH(kCGL8Bit, 8); + /*9*/ + DEPTH(kCGL10Bit, 10); + /*10*/ + DEPTH(kCGL12Bit, 12); + /*11*/ + DEPTH(kCGL16Bit, 16); + /*12*/ + DEPTH(kCGL24Bit, 24); + /*13*/ + DEPTH(kCGL32Bit, 32); + /*14*/ + DEPTH(kCGL48Bit, 48); + /*15*/ + DEPTH(kCGL64Bit, 64); + /*16*/ + DEPTH(kCGL96Bit, 96); + /*17*/ + DEPTH(kCGL128Bit, 128); + +#undef DEPTH + + c->total_depth_buffer_depths = offset; + assert(c->total_depth_buffer_depths < GLCAPS_DEPTH_BUFFERS); +} + +/* Return non-zero if an error occured. */ +static CGLError handleRendererDescriptions(CGLRendererInfoObj info, GLint r, + struct glCapabilitiesConfig *c) { + CGLError err; + GLint accelerated = 0, flags = 0, aux = 0, samplebufs = 0, samples = 0; + + err = CGLDescribeRenderer (info, r, kCGLRPAccelerated, &accelerated); + + if(err) + return err; + + c->accelerated = accelerated; + + /* Buffering modes: single/double, stereo */ + err = CGLDescribeRenderer(info, r, kCGLRPBufferModes, &flags); + + if(err) + return err; + + handleBufferModes(c, flags); + + /* AUX buffers */ + err = CGLDescribeRenderer(info, r, kCGLRPMaxAuxBuffers, &aux); + + if(err) + return err; + + c->aux_buffers = aux; + + + /* Depth buffer size */ + err = CGLDescribeRenderer(info, r, kCGLRPDepthModes, &flags); + + if(err) + return err; + + handleDepthModes(c, flags); + + + /* Multisample buffers */ + err = CGLDescribeRenderer(info, r, kCGLRPMaxSampleBuffers, &samplebufs); + + if(err) + return err; + + c->multisample_buffers = samplebufs; + + + /* Multisample samples per multisample buffer */ + err = CGLDescribeRenderer(info, r, kCGLRPMaxSamples, &samples); + + if(err) + return err; + + c->multisample_samples = samples; + + + /* Stencil bit depths */ + err = CGLDescribeRenderer(info, r, kCGLRPStencilModes, &flags); + + if(err) + return err; + + handleStencilModes(c, flags); + + + /* Color modes (RGB/RGBA depths supported */ + err = CGLDescribeRenderer(info, r, kCGLRPColorModes, &flags); + + if(err) + return err; + + handleColorModes(c, flags); + + err = CGLDescribeRenderer(info, r, kCGLRPAccumModes, &flags); + + if(err) + return err; + + handleAccumulationModes(c, flags); + + return 0; +} + +static void initCapabilities(struct glCapabilities *cap) { + cap->configurations = NULL; + cap->total_configurations = 0; +} + +static void initConfig(struct glCapabilitiesConfig *c) { + int i; + + c->accelerated = false; + c->stereo = false; + c->aux_buffers = 0; + c->buffers = 0; + + c->total_depth_buffer_depths = 0; + + for(i = 0; i < GLCAPS_DEPTH_BUFFERS; ++i) { + c->depth_buffers[i] = GLCAPS_INVALID_DEPTH_VALUE; + } + + c->multisample_buffers = 0; + c->multisample_samples = 0; + + c->total_stencil_bit_depths = 0; + + for(i = 0; i < GLCAPS_STENCIL_BIT_DEPTH_BUFFERS; ++i) { + c->stencil_bit_depths[i] = GLCAPS_INVALID_STENCIL_DEPTH; + } + + c->total_color_buffers = 0; + + for(i = 0; i < GLCAPS_COLOR_BUFFERS; ++i) { + c->color_buffers[i].r = c->color_buffers[i].g = + c->color_buffers[i].b = c->color_buffers[i].a = + GLCAPS_COLOR_BUF_INVALID_VALUE; + c->color_buffers[i].is_argb = false; + } + + c->total_accum_buffers = 0; + + for(i = 0; i < GLCAPS_COLOR_BUFFERS; ++i) { + c->accum_buffers[i].r = c->accum_buffers[i].g = + c->accum_buffers[i].b = c->accum_buffers[i].a = + GLCAPS_COLOR_BUF_INVALID_VALUE; + c->accum_buffers[i].is_argb = false; + } + + c->next = NULL; +} + +void freeGlCapabilities(struct glCapabilities *cap) { + struct glCapabilitiesConfig *conf, *next; + + conf = cap->configurations; + + while(conf) { + next = conf->next; + free(conf); + conf = next; + } + + cap->configurations = NULL; +} + +enum { MAX_DISPLAYS = 3 }; + +/*Return true if an error occured. */ +bool getGlCapabilities(struct glCapabilities *cap) { + CGDirectDisplayID dspys[MAX_DISPLAYS]; + CGDisplayErr err; + CGOpenGLDisplayMask displayMask; + CGDisplayCount i, displayCount = 0; + + initCapabilities(cap); + + err = CGGetActiveDisplayList(MAX_DISPLAYS, dspys, &displayCount); + if(err) { + fprintf(stderr, "CGGetActiveDisplayList error: %s\n", CGLErrorString(err)); + return true; + } + + for(i = 0; i < displayCount; ++i) { + displayMask = CGDisplayIDToOpenGLDisplayMask(dspys[i]); + + CGLRendererInfoObj info; + GLint numRenderers = 0, r, renderCount = 0; + + err = CGLQueryRendererInfo(displayMask, &info, &numRenderers); + + if(err) { + fprintf(stderr, "CGLQueryRendererInfo error: %s\n", CGLErrorString(err)); + fprintf(stderr, "trying to continue...\n"); + continue; + } + + CGLDescribeRenderer(info, 0, kCGLRPRendererCount, &renderCount); + + for(r = 0; r < renderCount; ++r) { + CGLError derr; + struct glCapabilitiesConfig tmpconf, *conf; + + initConfig(&tmpconf); + + derr = handleRendererDescriptions(info, r, &tmpconf); + if(derr) { + fprintf(stderr, "error: %s\n", CGLErrorString(derr)); + fprintf(stderr, "trying to continue...\n"); + continue; + } + + conf = malloc(sizeof(*conf)); + if(NULL == conf) { + perror("malloc"); + abort(); + } + + /* Copy the struct. */ + *conf = tmpconf; + + /* Now link the configuration into the list. */ + conf->next = cap->configurations; + cap->configurations = conf; + } + + CGLDestroyRendererInfo(info); + } + + /* No error occured. We are done. */ + return false; +} diff --git a/xorg-server/hw/xquartz/GL/capabilities.h b/xorg-server/hw/xquartz/GL/capabilities.h new file mode 100644 index 000000000..361856b07 --- /dev/null +++ b/xorg-server/hw/xquartz/GL/capabilities.h @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2008 Apple Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef CAPABILITIES_H +#define CAPABILITIES_H + +#include + +enum { GLCAPS_INVALID_STENCIL_DEPTH = -1 }; +enum { GLCAPS_COLOR_BUF_INVALID_VALUE = -1 }; +enum { GLCAPS_COLOR_BUFFERS = 20 }; +enum { GLCAPS_STENCIL_BIT_DEPTH_BUFFERS = 20 }; +enum { GLCAPS_DEPTH_BUFFERS = 20 }; +enum { GLCAPS_INVALID_DEPTH_VALUE = 1 }; + +struct glColorBufCapabilities { + char r, g, b, a; + bool is_argb; +}; + +struct glCapabilitiesConfig { + bool accelerated; + bool stereo; + int aux_buffers; + int buffers; + int total_depth_buffer_depths; + int depth_buffers[GLCAPS_DEPTH_BUFFERS]; + int multisample_buffers; + int multisample_samples; + int total_stencil_bit_depths; + char stencil_bit_depths[GLCAPS_STENCIL_BIT_DEPTH_BUFFERS]; + int total_color_buffers; + struct glColorBufCapabilities color_buffers[GLCAPS_COLOR_BUFFERS]; + int total_accum_buffers; + struct glColorBufCapabilities accum_buffers[GLCAPS_COLOR_BUFFERS]; + struct glCapabilitiesConfig *next; +}; + +struct glCapabilities { + struct glCapabilitiesConfig *configurations; + int total_configurations; +}; + +bool getGlCapabilities(struct glCapabilities *cap); +void freeGlCapabilities(struct glCapabilities *cap); + +#endif diff --git a/xorg-server/hw/xquartz/GL/indirect.c b/xorg-server/hw/xquartz/GL/indirect.c index 07a9c066a..0a60672b6 100644 --- a/xorg-server/hw/xquartz/GL/indirect.c +++ b/xorg-server/hw/xquartz/GL/indirect.c @@ -1,8 +1,8 @@ /* * GLX implementation that uses Apple's OpenGL.framework - * (Indirect rendering path) + * (Indirect rendering path -- it's also used for some direct mode code too) * - * Copyright (c) 2007 Apple Inc. + * Copyright (c) 2007, 2008, 2009 Apple Inc. * Copyright (c) 2004 Torrey T. Lyons. All Rights Reserved. * Copyright (c) 2002 Greg Parker. All Rights Reserved. * @@ -37,6 +37,13 @@ #include "dri.h" +#include + +/* + * These define seem questionable to me, but I'm not sure why they were here + * in the first place. + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 #define GL_EXT_histogram 1 #define GL_EXT_polygon_offset 1 #define GL_SGIS_pixel_texture 1 @@ -53,11 +60,11 @@ #define GL_APPLE_fence 1 #define GL_IBM_multimode_draw_arrays 1 #define GL_EXT_fragment_shader 1 +#endif #include #include -// X11 and X11's glx #include #include #include @@ -76,17 +83,15 @@ #include "x-hash.h" #include "x-list.h" -#include -#define GLAPIENTRYP * +#include "capabilities.h" + typedef unsigned long long GLuint64EXT; typedef long long GLint64EXT; +#include #include -#include "glcontextmodes.h" #include #include -// ggs: needed to call back to glx with visual configs -extern void GlxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, void **configprivs); __GLXprovider * GlxGetDRISWrastProvider (void); // Write debugging output, or not @@ -102,35 +107,27 @@ void warn_func(void * p1, char *format, ...); // some prototypes static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen); -static __GLXdrawable * __glXAquaScreenCreateDrawable(__GLXscreen *screen, DrawablePtr pDraw, XID drawId, __GLcontextModes *modes); - -static Bool glAquaInitVisuals(VisualPtr *visualp, DepthPtr *depthp, - int *nvisualp, int *ndepthp, - int *rootDepthp, VisualID *defaultVisp, - unsigned long sizes, int bitsPerRGB); -static void glAquaSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, - void **privates); +static __GLXdrawable * __glXAquaScreenCreateDrawable(__GLXscreen *screen, DrawablePtr pDraw, int type, XID drawId, __GLXconfig *conf); -static void glAquaResetExtension(void); static void __glXAquaContextDestroy(__GLXcontext *baseContext); static int __glXAquaContextMakeCurrent(__GLXcontext *baseContext); static int __glXAquaContextLoseCurrent(__GLXcontext *baseContext); static int __glXAquaContextForceCurrent(__GLXcontext *baseContext); static int __glXAquaContextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc, unsigned long mask); -static CGLPixelFormatObj makeFormat(__GLcontextModes *mode); +static CGLPixelFormatObj makeFormat(__GLXconfig *conf); __GLXprovider __glXDRISWRastProvider = { - __glXAquaScreenProbe, - "Core OpenGL", + __glXAquaScreenProbe, + "Core OpenGL", NULL }; __GLXprovider * GlxGetDRISWRastProvider (void) { - GLAQUA_DEBUG_MSG("GlxGetDRISWRastProvider\n"); - return &__glXDRISWRastProvider; + GLAQUA_DEBUG_MSG("GlxGetDRISWRastProvider\n"); + return &__glXDRISWRastProvider; } typedef struct __GLXAquaScreen __GLXAquaScreen; @@ -138,86 +135,77 @@ typedef struct __GLXAquaContext __GLXAquaContext; typedef struct __GLXAquaDrawable __GLXAquaDrawable; struct __GLXAquaScreen { - __GLXscreen base; - int index; + __GLXscreen base; + int index; int num_vis; - __GLcontextModes *modes; }; -static __GLXAquaScreen glAquaScreens[MAXSCREENS]; - struct __GLXAquaContext { - __GLXcontext base; - CGLContextObj ctx; - CGLPixelFormatObj pixelFormat; - xp_surface_id sid; - unsigned isAttached :1; + __GLXcontext base; + CGLContextObj ctx; + CGLPixelFormatObj pixelFormat; + xp_surface_id sid; + unsigned isAttached :1; }; struct __GLXAquaDrawable { - __GLXdrawable base; + __GLXdrawable base; DrawablePtr pDraw; xp_surface_id sid; + __GLXAquaContext *context; }; + static __GLXcontext * __glXAquaScreenCreateContext(__GLXscreen *screen, - __GLcontextModes *modes, + __GLXconfig *conf, __GLXcontext *baseShareContext) { - __GLXAquaContext *context; - __GLXAquaContext *shareContext = (__GLXAquaContext *) baseShareContext; - CGLError gl_err; + __GLXAquaContext *context; + __GLXAquaContext *shareContext = (__GLXAquaContext *) baseShareContext; + CGLError gl_err; - GLAQUA_DEBUG_MSG("glXAquaScreenCreateContext\n"); - - context = malloc (sizeof (__GLXAquaContext)); - if (context == NULL) return NULL; - - memset(context, 0, sizeof *context); - - context->base.pGlxScreen = screen; - context->base.modes = modes; - - context->base.destroy = __glXAquaContextDestroy; - context->base.makeCurrent = __glXAquaContextMakeCurrent; - context->base.loseCurrent = __glXAquaContextLoseCurrent; - context->base.copy = __glXAquaContextCopy; - context->base.forceCurrent = __glXAquaContextForceCurrent; - // context->base.createDrawable = __glXAquaContextCreateDrawable; + GLAQUA_DEBUG_MSG("glXAquaScreenCreateContext\n"); + + context = xalloc (sizeof (__GLXAquaContext)); + + if (context == NULL) + return NULL; - context->pixelFormat = makeFormat(modes); - if (!context->pixelFormat) { - free(context); + memset(context, 0, sizeof *context); + + context->base.pGlxScreen = screen; + + context->base.destroy = __glXAquaContextDestroy; + context->base.makeCurrent = __glXAquaContextMakeCurrent; + context->base.loseCurrent = __glXAquaContextLoseCurrent; + context->base.copy = __glXAquaContextCopy; + context->base.forceCurrent = __glXAquaContextForceCurrent; + /*FIXME verify that the context->base is fully initialized. */ + + context->pixelFormat = makeFormat(conf); + + if (!context->pixelFormat) { + xfree(context); return NULL; - } - - context->ctx = NULL; - gl_err = CGLCreateContext(context->pixelFormat, - shareContext ? shareContext->ctx : NULL, - &context->ctx); + } - if (gl_err != 0) { - ErrorF("CGLCreateContext error: %s\n", CGLErrorString(gl_err)); - CGLDestroyPixelFormat(context->pixelFormat); - free(context); - return NULL; + context->ctx = NULL; + gl_err = CGLCreateContext(context->pixelFormat, + shareContext ? shareContext->ctx : NULL, + &context->ctx); + + if (gl_err != 0) { + ErrorF("CGLCreateContext error: %s\n", CGLErrorString(gl_err)); + CGLDestroyPixelFormat(context->pixelFormat); + xfree(context); + return NULL; } - setup_dispatch_table(); + + setup_dispatch_table(); GLAQUA_DEBUG_MSG("glAquaCreateContext done\n"); - return &context->base; -} - -static __GLXextensionInfo __glDDXExtensionInfo = { - GL_CORE_APPLE, - glAquaResetExtension, - glAquaInitVisuals, - glAquaSetVisualConfigs -}; - -void *__glXglDDXExtensionInfo(void) { - GLAQUA_DEBUG_MSG("glXAglDDXExtensionInfo\n"); - return &__glDDXExtensionInfo; + + return &context->base; } /* maps from surface id -> list of __GLcontext */ @@ -227,21 +215,23 @@ static void __glXAquaContextDestroy(__GLXcontext *baseContext) { x_list *lst; __GLXAquaContext *context = (__GLXAquaContext *) baseContext; - + GLAQUA_DEBUG_MSG("glAquaContextDestroy (ctx 0x%x)\n", (unsigned int) baseContext); if (context != NULL) { if (context->sid != 0 && surface_hash != NULL) { - lst = x_hash_table_lookup(surface_hash, (void *) context->sid, NULL); + lst = x_hash_table_lookup(surface_hash, x_cvt_uint_to_vptr(context->sid), NULL); lst = x_list_remove(lst, context); - x_hash_table_insert(surface_hash, (void *) context->sid, lst); + x_hash_table_insert(surface_hash, x_cvt_uint_to_vptr(context->sid), lst); } - if (context->ctx != NULL) CGLDestroyContext(context->ctx); + if (context->ctx != NULL) + CGLDestroyContext(context->ctx); - if (context->pixelFormat != NULL) CGLDestroyPixelFormat(context->pixelFormat); + if (context->pixelFormat != NULL) + CGLDestroyPixelFormat(context->pixelFormat); - free(context); + xfree(context); } } @@ -266,79 +256,95 @@ static void surface_notify(void *_arg, void *data) { __GLXAquaDrawable *draw = (__GLXAquaDrawable *)data; __GLXAquaContext *context; x_list *lst; - if(_arg == NULL || data == NULL) { - ErrorF("surface_notify called with bad params"); - return; - } + if(_arg == NULL || data == NULL) { + ErrorF("surface_notify called with bad params"); + return; + } GLAQUA_DEBUG_MSG("surface_notify(%p, %p)\n", _arg, data); switch (arg->kind) { case AppleDRISurfaceNotifyDestroyed: if (surface_hash != NULL) - x_hash_table_remove(surface_hash, (void *) arg->id); - draw->base.pDraw = NULL; - draw->sid = 0; + x_hash_table_remove(surface_hash, x_cvt_uint_to_vptr(arg->id)); + draw->base.pDraw = NULL; + draw->sid = 0; break; case AppleDRISurfaceNotifyChanged: if (surface_hash != NULL) { - lst = x_hash_table_lookup(surface_hash, (void *) arg->id, NULL); + lst = x_hash_table_lookup(surface_hash, x_cvt_uint_to_vptr(arg->id), NULL); for (; lst != NULL; lst = lst->next) - { + { context = lst->data; xp_update_gl_context(context->ctx); } } break; - default: - ErrorF("surface_notify: unknown kind %d\n", arg->kind); - break; + default: + ErrorF("surface_notify: unknown kind %d\n", arg->kind); + break; } } -static void attach(__GLXAquaContext *context, __GLXAquaDrawable *draw) { +static BOOL attach(__GLXAquaContext *context, __GLXAquaDrawable *draw) { DrawablePtr pDraw; - GLAQUA_DEBUG_MSG("attach(%p, %p)\n", context, draw); + + GLAQUA_DEBUG_MSG("attach(%p, %p)\n", context, draw); + + if(NULL == context || NULL == draw) + return TRUE; + pDraw = draw->base.pDraw; + if(NULL == pDraw) { + ErrorF("%s:%s() pDraw is NULL!\n", __FILE__, __func__); + return TRUE; + } + if (draw->sid == 0) { -// if (!quartzProcs->CreateSurface(pDraw->pScreen, pDraw->id, pDraw, + //if (!quartzProcs->CreateSurface(pDraw->pScreen, pDraw->id, pDraw, if (!DRICreateSurface(pDraw->pScreen, pDraw->id, pDraw, - 0, &draw->sid, NULL, - surface_notify, draw)) - return; + 0, &draw->sid, NULL, + surface_notify, draw)) + return TRUE; draw->pDraw = pDraw; - } - + } + if (!context->isAttached || context->sid != draw->sid) { x_list *lst; - + if (xp_attach_gl_context(context->ctx, draw->sid) != Success) { -// quartzProcs->DestroySurface(pDraw->pScreen, pDraw->id, pDraw, + //quartzProcs->DestroySurface(pDraw->pScreen, pDraw->id, pDraw, DRIDestroySurface(pDraw->pScreen, pDraw->id, pDraw, - surface_notify, draw); + surface_notify, draw); if (surface_hash != NULL) - x_hash_table_remove(surface_hash, (void *) draw->sid); - + x_hash_table_remove(surface_hash, x_cvt_uint_to_vptr(draw->sid)); + draw->sid = 0; - return; + return TRUE; } - + context->isAttached = TRUE; context->sid = draw->sid; - + if (surface_hash == NULL) surface_hash = x_hash_table_new(NULL, NULL, NULL, NULL); - - lst = x_hash_table_lookup(surface_hash, (void *) context->sid, NULL); + + lst = x_hash_table_lookup(surface_hash, x_cvt_uint_to_vptr(context->sid), NULL); if (x_list_find(lst, context) == NULL) { lst = x_list_prepend(lst, context); - x_hash_table_insert(surface_hash, (void *) context->sid, lst); + x_hash_table_insert(surface_hash, x_cvt_uint_to_vptr(context->sid), lst); } + + GLAQUA_DEBUG_MSG("attached 0x%x to 0x%x\n", (unsigned int) pDraw->id, (unsigned int) draw->sid); } + + draw->context = context; + + return FALSE; } #if 0 // unused @@ -368,11 +374,12 @@ static void unattach(__GLXAquaContext *context) { static int __glXAquaContextMakeCurrent(__GLXcontext *baseContext) { CGLError gl_err; __GLXAquaContext *context = (__GLXAquaContext *) baseContext; - __GLXAquaDrawable *drawPriv = (__GLXAquaDrawable *) context->base.drawPriv; - + __GLXAquaDrawable *drawPriv = (__GLXAquaDrawable *) context->base.drawPriv; + GLAQUA_DEBUG_MSG("glAquaMakeCurrent (ctx 0x%p)\n", baseContext); - attach(context, drawPriv); + if(attach(context, drawPriv)) + return /*error*/ 0; gl_err = CGLSetCurrentContext(context->ctx); if (gl_err != 0) @@ -412,797 +419,388 @@ static int __glXAquaContextForceCurrent(__GLXcontext *baseContext) /* Drawing surface notification callbacks */ -static GLboolean __glXAquaDrawableResize(__GLXdrawable *base) { - GLAQUA_DEBUG_MSG("unimplemented glAquaDrawableResize\n"); - return GL_TRUE; -} - static GLboolean __glXAquaDrawableSwapBuffers(__GLXdrawable *base) { - CGLError gl_err; - __GLXAquaContext * drawableCtx; -// GLAQUA_DEBUG_MSG("glAquaDrawableSwapBuffers(%p)\n",base); + CGLError err; + __GLXAquaDrawable *drawable; + + // GLAQUA_DEBUG_MSG("glAquaDrawableSwapBuffers(%p)\n",base); - if(!base) { - ErrorF("glXAquaDrawbleSwapBuffers passed NULL\n"); - return GL_FALSE; - } - - drawableCtx = (__GLXAquaContext *)base->drawGlxc; - - if (drawableCtx != NULL && drawableCtx->ctx != NULL) { - gl_err = CGLFlushDrawable(drawableCtx->ctx); - if (gl_err != 0) - ErrorF("CGLFlushDrawable error: %s\n", CGLErrorString(gl_err)); + if(!base) { + ErrorF("%s passed NULL\n", __func__); + return GL_FALSE; } - return GL_TRUE; -} -static CGLPixelFormatObj makeFormat(__GLcontextModes *mode) { - int i; - CGLPixelFormatAttribute attr[64]; // currently uses max of 30 - CGLPixelFormatObj result; - GLint n_formats; - CGLError gl_err; - - GLAQUA_DEBUG_MSG("makeFormat\n"); - - if (!mode->rgbMode) - return NULL; - - i = 0; - - // attr [i++] = kCGLPFAAcelerated; // require hwaccel - BAD for multiscreen - // attr [i++] = kCGLPFANoRecovery; // disable fallback renderers - BAD - - if (mode->stereoMode) { - attr[i++] = kCGLPFAStereo; - } - if (mode->doubleBufferMode) { - attr[i++] = kCGLPFADoubleBuffer; - } + drawable = (__GLXAquaDrawable *)base; - if (mode->colorIndexMode) { - /* ignored */ + if(NULL == drawable->context) { + ErrorF("%s called with a NULL->context for drawable %p!\n", + __func__, (void *)drawable); + return GL_FALSE; } - if (mode->rgbMode) { - attr[i++] = kCGLPFAColorSize; - attr[i++] = mode->redBits + mode->greenBits + mode->blueBits; - attr[i++] = kCGLPFAAlphaSize; - attr[i++] = 1; /* FIXME: ignoring mode->alphaBits which is always 0 */ - } + err = CGLFlushDrawable(drawable->context->ctx); - if (mode->haveAccumBuffer) { - attr[i++] = kCGLPFAAccumSize; - attr[i++] = mode->accumRedBits + mode->accumGreenBits - + mode->accumBlueBits + mode->accumAlphaBits; - } - - if (mode->haveDepthBuffer) { - attr[i++] = kCGLPFADepthSize; - attr[i++] = mode->depthBits; + if(kCGLNoError != err) { + ErrorF("CGLFlushDrawable error: %s in %s\n", CGLErrorString(err), + __func__); + return GL_FALSE; } - - if (mode->haveStencilBuffer) { - attr[i++] = kCGLPFAStencilSize; - attr[i++] = mode->stencilBits; - } - - attr[i++] = kCGLPFAAuxBuffers; - attr[i++] = mode->numAuxBuffers; - - /* mode->level ignored */ - - /* mode->pixmapMode ? */ - - attr[i++] = 0; - - GLAQUA_DEBUG_MSG("makeFormat almost done\n"); - - result = NULL; - gl_err = CGLChoosePixelFormat(attr, &result, &n_formats); - if (gl_err != 0) - ErrorF("CGLChoosePixelFormat error: %s\n", CGLErrorString(gl_err)); - - GLAQUA_DEBUG_MSG("makeFormat done (0x%x)\n", (unsigned int) result); - return result; + return GL_TRUE; } -// Originally copied from Mesa - -static int numConfigs = 0; -static __GLXvisualConfig *visualConfigs = NULL; -static void **visualPrivates = NULL; - -/* - * In the case the driver defines no GLX visuals we'll use these. - * Note that for TrueColor and DirectColor visuals, bufferSize is the - * sum of redSize, greenSize, blueSize and alphaSize, which may be larger - * than the nplanes/rootDepth of the server's X11 visuals - */ -#define NUM_FALLBACK_CONFIGS 5 -static __GLXvisualConfig FallbackConfigs[NUM_FALLBACK_CONFIGS] = { - /* [0] = RGB, double buffered, Z */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 0, 0, 0, 0, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 0, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [1] = RGB, double buffered, Z, stencil, accum */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 16, 16, 16, 0, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 8, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [2] = RGB+Alpha, double buffered, Z, stencil, accum */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 8, /* rgba sizes */ - -1, -1, -1, -1, /* rgba masks */ - 16, 16, 16, 16, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 8, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [3] = RGB+Alpha, single buffered, Z, stencil, accum */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 8, /* rgba sizes */ - -1, -1, -1, -1, /* rgba masks */ - 16, 16, 16, 16, /* rgba accum sizes */ - False, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 8, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [4] = CI, double buffered, Z */ - { - -1, /* vid */ - -1, /* class */ - False, /* rgba? (false = color index) */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 0, 0, 0, 0, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 0, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, -}; - -static __GLXvisualConfig NullConfig = { - -1, /* vid */ - -1, /* class */ - False, /* rgba */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 0, 0, 0, 0, /* rgba accum sizes */ - False, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 0, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE_EXT, /* visualRating */ - 0, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ -}; +static CGLPixelFormatObj makeFormat(__GLXconfig *conf) { + CGLPixelFormatAttribute attr[64]; + CGLPixelFormatObj fobj; + GLint formats; + CGLError error; + int i = 0; + + if(conf->doubleBufferMode) + attr[i++] = kCGLPFADoubleBuffer; -static inline int count_bits(uint32_t x) -{ - x = x - ((x >> 1) & 0x55555555); - x = (x & 0x33333333) + ((x >> 2) & 0x33333333); - x = (x + (x >> 4)) & 0x0f0f0f0f; - x = x + (x >> 8); - x = x + (x >> 16); - return x & 63; -} + if(conf->stereoMode) + attr[i++] = kCGLPFAStereo; + attr[i++] = kCGLPFAColorSize; + attr[i++] = conf->redBits + conf->greenBits + conf->blueBits; + attr[i++] = kCGLPFAAlphaSize; + attr[i++] = conf->alphaBits; -static Bool init_visuals(int *nvisualp, VisualPtr *visualp, - VisualID *defaultVisp, - int ndepth, DepthPtr pdepth, - int rootDepth) -{ - int numRGBconfigs; - int numCIconfigs; - int numVisuals = *nvisualp; - int numNewVisuals; - int numNewConfigs; - VisualPtr pVisual = *visualp; - VisualPtr pVisualNew = NULL; - VisualID *orig_vid = NULL; - __GLcontextModes *modes; - __GLXvisualConfig *pNewVisualConfigs = NULL; - void **glXVisualPriv; - void **pNewVisualPriv; - int found_default; - int i, j, k; - - GLAQUA_DEBUG_MSG("init_visuals\n"); - - if (numConfigs > 0) - numNewConfigs = numConfigs; - else - numNewConfigs = NUM_FALLBACK_CONFIGS; - - /* Alloc space for the list of new GLX visuals */ - pNewVisualConfigs = (__GLXvisualConfig *) - malloc(numNewConfigs * sizeof(__GLXvisualConfig)); - if (!pNewVisualConfigs) { - return FALSE; - } + if((conf->accumRedBits + conf->accumGreenBits + conf->accumBlueBits + + conf->accumAlphaBits) > 0) { - /* Alloc space for the list of new GLX visual privates */ - pNewVisualPriv = (void **) malloc(numNewConfigs * sizeof(void *)); - if (!pNewVisualPriv) { - free(pNewVisualConfigs); - return FALSE; + attr[i++] = kCGLPFAAccumSize; + attr[i++] = conf->accumRedBits + conf->accumGreenBits + + conf->accumBlueBits + conf->accumAlphaBits; } + + attr[i++] = kCGLPFADepthSize; + attr[i++] = conf->depthBits; - /* - ** If SetVisualConfigs was not called, then use default GLX - ** visual configs. - */ - if (numConfigs == 0) { - memcpy(pNewVisualConfigs, FallbackConfigs, - NUM_FALLBACK_CONFIGS * sizeof(__GLXvisualConfig)); - memset(pNewVisualPriv, 0, NUM_FALLBACK_CONFIGS * sizeof(void *)); + if(conf->stencilBits) { + attr[i++] = kCGLPFAStencilSize; + attr[i++] = conf->stencilBits; } - else { - /* copy driver's visual config info */ - for (i = 0; i < numConfigs; i++) { - pNewVisualConfigs[i] = visualConfigs[i]; - pNewVisualPriv[i] = visualPrivates[i]; - } - } - - /* Count the number of RGB and CI visual configs */ - numRGBconfigs = 0; - numCIconfigs = 0; - for (i = 0; i < numNewConfigs; i++) { - if (pNewVisualConfigs[i].rgba) - numRGBconfigs++; - else - numCIconfigs++; + + if(conf->numAuxBuffers > 0) { + attr[i++] = kCGLPFAAuxBuffers; + attr[i++] = conf->numAuxBuffers; } - /* Count the total number of visuals to compute */ - numNewVisuals = 0; - for (i = 0; i < numVisuals; i++) { - int count; - - count = ((pVisual[i].class == TrueColor || - pVisual[i].class == DirectColor) - ? numRGBconfigs : numCIconfigs); - if (count == 0) - count = 1; /* preserve the existing visual */ - - numNewVisuals += count; + if(conf->sampleBuffers > 0) { + attr[i++] = kCGLPFASampleBuffers; + attr[i++] = conf->sampleBuffers; + attr[i++] = kCGLPFASamples; + attr[i++] = conf->samples; } + + attr[i++] = 0; - /* Reset variables for use with the next screen/driver's visual configs */ - visualConfigs = NULL; - numConfigs = 0; - - /* Alloc temp space for the list of orig VisualIDs for each new visual */ - orig_vid = (VisualID *)malloc(numNewVisuals * sizeof(VisualID)); - if (!orig_vid) { - free(pNewVisualPriv); - free(pNewVisualConfigs); - return FALSE; + error = CGLChoosePixelFormat(attr, &fobj, &formats); + if(error) { + ErrorF("error: creating pixel format %s\n", CGLErrorString(error)); + return NULL; } - /* Alloc space for the list of glXVisuals */ - modes = _gl_context_modes_create(numNewVisuals, sizeof(__GLcontextModes)); - if (modes == NULL) { - free(orig_vid); - free(pNewVisualPriv); - free(pNewVisualConfigs); - return FALSE; - } + return fobj; +} - /* Alloc space for the list of glXVisualPrivates */ - glXVisualPriv = (void **)malloc(numNewVisuals * sizeof(void *)); - if (!glXVisualPriv) { - _gl_context_modes_destroy( modes ); - free(orig_vid); - free(pNewVisualPriv); - free(pNewVisualConfigs); - return FALSE; - } +static void __glXAquaScreenDestroy(__GLXscreen *screen) { - /* Alloc space for the new list of the X server's visuals */ - pVisualNew = (VisualPtr)malloc(numNewVisuals * sizeof(VisualRec)); - if (!pVisualNew) { - free(glXVisualPriv); - _gl_context_modes_destroy( modes ); - free(orig_vid); - free(pNewVisualPriv); - free(pNewVisualConfigs); - return FALSE; - } + GLAQUA_DEBUG_MSG("glXAquaScreenDestroy(%p)\n", screen); + __glXScreenDestroy(screen); - /* Initialize the new visuals */ - found_default = FALSE; - glAquaScreens[screenInfo.numScreens-1].modes = modes; - for (i = j = 0; i < numVisuals; i++) { - int is_rgb = (pVisual[i].class == TrueColor || - pVisual[i].class == DirectColor); - - if (!is_rgb) - { - /* We don't support non-rgb visuals for GL. But we don't - want to remove them either, so just pass them through - with null glX configs */ - - pVisualNew[j] = pVisual[i]; - pVisualNew[j].vid = FakeClientID(0); - - /* Check for the default visual */ - if (!found_default && pVisual[i].vid == *defaultVisp) { - *defaultVisp = pVisualNew[j].vid; - found_default = TRUE; - } + xfree(screen); +} - /* Save the old VisualID */ - orig_vid[j] = pVisual[i].vid; +static __GLXconfig *CreateConfigs(int *numConfigsPtr, int screenNumber) { + __GLXconfig *c, *result; + struct glCapabilities cap; + struct glCapabilitiesConfig *conf = NULL; + int numConfigs = 0; + int i; - /* Initialize the glXVisual */ - _gl_copy_visual_to_context_mode( modes, & NullConfig ); - modes->visualID = pVisualNew[j].vid; + if(getGlCapabilities(&cap)) + FatalError("error from getGlCapabilities() in %s\n", __func__); - j++; + assert(NULL != cap.configurations); + for(conf = cap.configurations; conf; conf = conf->next) { + if(conf->total_color_buffers <= 0) continue; - } - - for (k = 0; k < numNewConfigs; k++) { - if (pNewVisualConfigs[k].rgba != is_rgb) - continue; - - assert( modes != NULL ); - - /* Initialize the new visual */ - pVisualNew[j] = pVisual[i]; - pVisualNew[j].vid = FakeClientID(0); - - /* Check for the default visual */ - if (!found_default && pVisual[i].vid == *defaultVisp) { - *defaultVisp = pVisualNew[j].vid; - found_default = TRUE; - } - - /* Save the old VisualID */ - orig_vid[j] = pVisual[i].vid; - - /* Initialize the glXVisual */ - _gl_copy_visual_to_context_mode( modes, & pNewVisualConfigs[k] ); - modes->visualID = pVisualNew[j].vid; - - /* - * If the class is -1, then assume the X visual information - * is identical to what GLX needs, and take them from the X - * visual. NOTE: if class != -1, then all other fields MUST - * be initialized. - */ - if (modes->visualType == GLX_NONE) { - modes->visualType = _gl_convert_from_x_visual_type( pVisual[i].class ); - modes->redBits = count_bits(pVisual[i].redMask); - modes->greenBits = count_bits(pVisual[i].greenMask); - modes->blueBits = count_bits(pVisual[i].blueMask); - modes->alphaBits = modes->alphaBits; - modes->redMask = pVisual[i].redMask; - modes->greenMask = pVisual[i].greenMask; - modes->blueMask = pVisual[i].blueMask; - modes->alphaMask = modes->alphaMask; - modes->rgbBits = (is_rgb) - ? (modes->redBits + modes->greenBits + - modes->blueBits + modes->alphaBits) - : rootDepth; - } - - /* Save the device-dependent private for this visual */ - glXVisualPriv[j] = pNewVisualPriv[k]; - j++; - modes = modes->next; - } - } - - assert(j <= numNewVisuals); - - /* Save the GLX visuals in the screen structure */ - glAquaScreens[screenInfo.numScreens-1].num_vis = numNewVisuals; - // glAquaScreens[screenInfo.numScreens-1].priv = glXVisualPriv; - - /* set up depth's VisualIDs */ - for (i = 0; i < ndepth; i++) { - int numVids = 0; - VisualID *pVids = NULL; - int k, n = 0; - - /* Count the new number of VisualIDs at this depth */ - for (j = 0; j < pdepth[i].numVids; j++) - for (k = 0; k < numNewVisuals; k++) - if (pdepth[i].vids[j] == orig_vid[k]) - numVids++; - - /* Allocate a new list of VisualIDs for this depth */ - pVids = (VisualID *)malloc(numVids * sizeof(VisualID)); - - /* Initialize the new list of VisualIDs for this depth */ - for (j = 0; j < pdepth[i].numVids; j++) - for (k = 0; k < numNewVisuals; k++) - if (pdepth[i].vids[j] == orig_vid[k]) - pVids[n++] = pVisualNew[k].vid; - - /* Update this depth's list of VisualIDs */ - free(pdepth[i].vids); - pdepth[i].vids = pVids; - pdepth[i].numVids = numVids; + numConfigs += (conf->stereo ? 2 : 1) + * (conf->aux_buffers ? 2 : 1) + * conf->buffers + * ((conf->total_stencil_bit_depths > 0) ? + conf->total_stencil_bit_depths : 1) + * conf->total_color_buffers + * ((conf->total_accum_buffers > 0) ? conf->total_accum_buffers : 1) + * conf->total_depth_buffer_depths + * (conf->multisample_buffers + 1); } - /* Update the X server's visuals */ - *nvisualp = numNewVisuals; - *visualp = pVisualNew; - - /* Free the old list of the X server's visuals */ - free(pVisual); - - /* Clean up temporary allocations */ - free(orig_vid); - free(pNewVisualPriv); - free(pNewVisualConfigs); - - /* Free the private list created by DDX HW driver */ - if (visualPrivates) - free(visualPrivates); - visualPrivates = NULL; + *numConfigsPtr = numConfigs; + + c = xalloc(sizeof(*c) * numConfigs); + + if(NULL == c) + return NULL; - return TRUE; -} + -Bool enable_stereo = FALSE; -/* based on code in i830_dri.c - This ends calling glAquaSetVisualConfigs to set the static - numconfigs, etc. */ -static void -glAquaInitVisualConfigs(void) -{ - int lclNumConfigs = 0; - __GLXvisualConfig *lclVisualConfigs = NULL; - void **lclVisualPrivates = NULL; + result = c; + + memset(result, 0, sizeof(*c) * numConfigs); - int stereo, depth, aux, buffers, stencil, accum; - int i = 0; + i = 0; - GLAQUA_DEBUG_MSG("glAquaInitVisualConfigs "); - - /* count num configs: - 2 stereo (on, off) (optional) - 2 Z buffer (0, 24 bit) - 2 AUX buffer (0, 2) - 2 buffers (single, double) - 2 stencil (0, 8 bit) - 2 accum (0, 64 bit) - = 64 configs with stereo, or 32 without */ - - if (enable_stereo) lclNumConfigs = 2 * 2 * 2 * 2 * 2 * 2; /* 64 */ - else lclNumConfigs = 2 * 2 * 2 * 2 * 2; /* 32 */ - - /* alloc */ - lclVisualConfigs = xcalloc(sizeof(__GLXvisualConfig), lclNumConfigs); - lclVisualPrivates = xcalloc(sizeof(void *), lclNumConfigs); - - /* fill in configs */ - if (NULL != lclVisualConfigs) { - i = 0; /* current buffer */ - for (stereo = 0; stereo < (enable_stereo ? 2 : 1); stereo++) { - for (depth = 0; depth < 2; depth++) { - for (aux = 0; aux < 2; aux++) { - for (buffers = 0; buffers < 2; buffers++) { - for (stencil = 0; stencil < 2; stencil++) { - for (accum = 0; accum < 2; accum++) { - lclVisualConfigs[i].vid = -1; - lclVisualConfigs[i].class = -1; - lclVisualConfigs[i].rgba = TRUE; - lclVisualConfigs[i].redSize = -1; - lclVisualConfigs[i].greenSize = -1; - lclVisualConfigs[i].blueSize = -1; - lclVisualConfigs[i].redMask = -1; - lclVisualConfigs[i].greenMask = -1; - lclVisualConfigs[i].blueMask = -1; - lclVisualConfigs[i].alphaMask = 0; - if (accum) { - lclVisualConfigs[i].accumRedSize = 16; - lclVisualConfigs[i].accumGreenSize = 16; - lclVisualConfigs[i].accumBlueSize = 16; - lclVisualConfigs[i].accumAlphaSize = 16; - } else { - lclVisualConfigs[i].accumRedSize = 0; - lclVisualConfigs[i].accumGreenSize = 0; - lclVisualConfigs[i].accumBlueSize = 0; - lclVisualConfigs[i].accumAlphaSize = 0; + for(conf = cap.configurations; conf; conf = conf->next) { + int stereo, aux, buffers, stencil, color, accum, depth, msample; + + for(stereo = 0; stereo < (conf->stereo ? 2 : 1); ++stereo) { + for(aux = 0; aux < (conf->aux_buffers ? 2 : 1); ++aux) { + for(buffers = 0; buffers < conf->buffers; ++buffers) { + for(stencil = 0; stencil < ((conf->total_stencil_bit_depths > 0) ? + conf->total_stencil_bit_depths : 1); ++stencil) { + for(color = 0; color < conf->total_color_buffers; ++color) { + for(accum = 0; accum < ((conf->total_accum_buffers > 0) ? + conf->total_accum_buffers : 1); ++accum) { + for(depth = 0; depth < conf->total_depth_buffer_depths; ++depth) { + for(msample = 0; msample < (conf->multisample_buffers + 1); ++msample) { + if((i + 1) < numConfigs) { + c->next = c + 1; + } else { + c->next = NULL; + } + + c->doubleBufferMode = buffers ? GL_TRUE : GL_FALSE; + c->stereoMode = stereo ? GL_TRUE : GL_FALSE; + + c->redBits = conf->color_buffers[color].r; + c->greenBits = conf->color_buffers[color].g; + c->blueBits = conf->color_buffers[color].b; + c->alphaBits = 0; + + if(GLCAPS_COLOR_BUF_INVALID_VALUE != conf->color_buffers[color].a) { + c->alphaBits = conf->color_buffers[color].a; + } + + c->redMask = -1; + c->greenMask = -1; + c->blueMask = -1; + c->alphaMask = -1; + + c->rgbBits = c->redBits + c->greenBits + c->blueBits + c->alphaBits; + c->indexBits = 0; + + c->accumRedBits = 0; + c->accumGreenBits = 0; + c->accumBlueBits = 0; + c->accumAlphaBits = 0; + + if(conf->total_accum_buffers > 0) { + c->accumRedBits = conf->accum_buffers[accum].r; + c->accumGreenBits = conf->accum_buffers[accum].g; + c->accumBlueBits = conf->accum_buffers[accum].b; + if(GLCAPS_COLOR_BUF_INVALID_VALUE != conf->accum_buffers[accum].a) { + c->accumAlphaBits = conf->accum_buffers[accum].a; + } + } + + c->depthBits = conf->depth_buffers[depth]; + + c->stencilBits = 0; + + if(conf->total_stencil_bit_depths > 0) { + c->stencilBits = conf->stencil_bit_depths[stencil]; + } + + + c->numAuxBuffers = aux ? conf->aux_buffers : 0; + + c->level = 0; + /*TODO what should this be? */ + c->pixmapMode = 0; + + c->visualID = -1; + c->visualType = GLX_TRUE_COLOR; + + if(conf->accelerated) { + c->visualRating = GLX_NONE; + } else { + c->visualRating = GLX_SLOW_VISUAL_EXT; + } + + c->transparentPixel = GLX_NONE; + c->transparentRed = GLX_NONE; + c->transparentGreen = GLX_NONE; + c->transparentAlpha = GLX_NONE; + c->transparentIndex = GLX_NONE; + + c->sampleBuffers = 0; + c->samples = 0; + + if(msample > 0) { + c->sampleBuffers = conf->multisample_buffers; + c->samples = conf->multisample_samples; + } + + /* SGIX_fbconfig / GLX 1.3 */ + c->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT; + c->renderType = GLX_RGBA_BIT; + c->xRenderable = GL_TRUE; + c->fbconfigID = -1; + + /*TODO add querying code to capabilities.c for the Pbuffer maximums. + *I'm not sure we can even use CGL for Pbuffers yet... + */ + /* SGIX_pbuffer / GLX 1.3 */ + c->maxPbufferWidth = 0; + c->maxPbufferHeight = 0; + c->maxPbufferPixels = 0; + c->optimalPbufferWidth = 0; + c->optimalPbufferHeight = 0; + c->visualSelectGroup = 0; + + c->swapMethod = GLX_SWAP_UNDEFINED_OML; + + c->screen = screenNumber; + + /* EXT_texture_from_pixmap */ + c->bindToTextureRgb = 0; + c->bindToTextureRgba = 0; + c->bindToMipmapTexture = 0; + c->bindToTextureTargets = 0; + c->yInverted = 0; + + if(c->next) + c = c->next; + + ++i; + } + } + } + } } - lclVisualConfigs[i].doubleBuffer = buffers ? TRUE : FALSE; - lclVisualConfigs[i].stereo = stereo ? TRUE : FALSE; - lclVisualConfigs[i].bufferSize = -1; - - lclVisualConfigs[i].depthSize = depth? 24 : 0; - lclVisualConfigs[i].stencilSize = stencil ? 8 : 0; - lclVisualConfigs[i].auxBuffers = aux ? 2 : 0; - lclVisualConfigs[i].level = 0; - lclVisualConfigs[i].visualRating = GLX_NONE_EXT; - lclVisualConfigs[i].transparentPixel = 0; - lclVisualConfigs[i].transparentRed = 0; - lclVisualConfigs[i].transparentGreen = 0; - lclVisualConfigs[i].transparentBlue = 0; - lclVisualConfigs[i].transparentAlpha = 0; - lclVisualConfigs[i].transparentIndex = 0; - i++; - } } - } - } - } + } } } - if (i != lclNumConfigs) - GLAQUA_DEBUG_MSG("glAquaInitVisualConfigs failed to alloc visual configs"); - - GlxSetVisualConfigs(lclNumConfigs, lclVisualConfigs, lclVisualPrivates); -} - -static void glAquaSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, - void **privates) -{ - GLAQUA_DEBUG_MSG("glAquaSetVisualConfigs\n"); - - numConfigs = nconfigs; - visualConfigs = configs; - visualPrivates = privates; -} - -static Bool glAquaInitVisuals(VisualPtr *visualp, DepthPtr *depthp, - int *nvisualp, int *ndepthp, - int *rootDepthp, VisualID *defaultVisp, - unsigned long sizes, int bitsPerRGB) -{ - GLAQUA_DEBUG_MSG("glAquaInitVisuals\n"); + if(i != numConfigs) + FatalError("The number of __GLXconfig generated does not match the initial calculation!\n"); - if (numConfigs == 0) /* if no configs */ - glAquaInitVisualConfigs(); /* ensure the visual configs are setup */ - /* - * setup the visuals supported by this particular screen. - */ - return init_visuals(nvisualp, visualp, defaultVisp, - *ndepthp, *depthp, *rootDepthp); -} - -#if 0 -static void fixup_visuals(int screen) -{ - ScreenPtr pScreen = screenInfo.screens[screen]; - glAquaScreenRec *pScr = &glAquaScreens[screen]; - int j; - __GLcontextModes *modes; - - GLAQUA_DEBUG_MSG("fixup_visuals\n"); - - for ( modes = pScr->modes ; modes != NULL ; modes = modes->next ) { - const int vis_class = _gl_convert_to_x_visual_type( modes->visualType ); - const int nplanes = (modes->rgbBits - modes->alphaBits); - const VisualPtr pVis = pScreen->visuals; - - /* Find a visual that matches the GLX visual's class and size */ - for (j = 0; j < pScreen->numVisuals; j++) { - if (pVis[j].class == vis_class && - pVis[j].nplanes == nplanes) { - - /* Fixup the masks */ - modes->redMask = pVis[j].redMask; - modes->greenMask = pVis[j].greenMask; - modes->blueMask = pVis[j].blueMask; - - /* Recalc the sizes */ - modes->redBits = count_bits(modes->redMask); - modes->greenBits = count_bits(modes->greenMask); - modes->blueBits = count_bits(modes->blueMask); - } - } - } -} -#endif -static void __glXAquaScreenDestroy(__GLXscreen *screen) { + freeGlCapabilities(&cap); - GLAQUA_DEBUG_MSG("glXAquaScreenDestroy(%p)\n", screen); - __glXScreenDestroy(screen); - - free(screen); -} - -static void init_screen_visuals(__GLXAquaScreen *screen) { - ScreenPtr pScreen = screen->base.pScreen; - - __GLcontextModes *modes; - int *used; - int i, j; - - GLAQUA_DEBUG_MSG("init_screen_visuals\n"); - - /* FIXME: Change 'used' to be a array of bits (rather than of ints), - * FIXME: create a stack array of 8 or 16 bytes. If 'numVisuals' is less - * FIXME: than 64 or 128 the stack array can be used instead of calling - * FIXME: malloc / free. If nothing else, convert 'used' to - * FIXME: array of bytes instead of ints! - */ - used = (int *)malloc(pScreen->numVisuals * sizeof(int)); - memset(used, 0, pScreen->numVisuals * sizeof(int)); - - i = 0; - for ( modes = screen -> base.modes - ; modes != NULL - ; modes = modes->next ) { - const int vis_class = _gl_convert_to_x_visual_type( modes->visualType ); - const int nplanes = (modes->rgbBits - modes->alphaBits); - const VisualPtr pVis = pScreen->visuals; - - for (j = 0; j < pScreen->numVisuals; j++) { - if (pVis[j].class == vis_class && - pVis[j].nplanes == nplanes && - pVis[j].redMask == modes->redMask && - pVis[j].greenMask == modes->greenMask && - pVis[j].blueMask == modes->blueMask && - !used[j]) { - - /* set the VisualID */ - modes->visualID = pVis[j].vid; - - /* Mark this visual used */ - used[j] = 1; - break; - } - } - if ( j == pScreen->numVisuals ) { - ErrorF("No matching visual for __GLcontextMode with " - "visual class = %d (%d), nplanes = %u\n", - vis_class, - (int)modes->visualType, - (unsigned int)(modes->rgbBits - modes->alphaBits) ); - } - else if ( modes->visualID == -1 ) { - FatalError( "Matching visual found, but visualID still -1!\n" ); - } - - i++; - } - - free(used); + return result; } +/* This is called by __glXInitScreens(). */ static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen) { - __GLXAquaScreen *screen; - GLAQUA_DEBUG_MSG("glXAquaScreenProbe\n"); - if (screen == NULL) return NULL; - - screen = malloc(sizeof *screen); + __GLXAquaScreen *screen; - __glXScreenInit(&screen->base, pScreen); + GLAQUA_DEBUG_MSG("glXAquaScreenProbe\n"); - screen->base.destroy = __glXAquaScreenDestroy; - screen->base.createContext = __glXAquaScreenCreateContext; - screen->base.createDrawable = __glXAquaScreenCreateDrawable; - screen->base.pScreen = pScreen; + if (pScreen == NULL) + return NULL; - init_screen_visuals(screen); + screen = xalloc(sizeof *screen); + if(NULL == screen) + return NULL; + + screen->base.destroy = __glXAquaScreenDestroy; + screen->base.createContext = __glXAquaScreenCreateContext; + screen->base.createDrawable = __glXAquaScreenCreateDrawable; + screen->base.swapInterval = /*FIXME*/ NULL; + screen->base.hyperpipeFuncs = NULL; + screen->base.swapBarrierFuncs = NULL; + screen->base.pScreen = pScreen; + + screen->base.fbconfigs = CreateConfigs(&screen->base.numFBConfigs, + pScreen->myNum); + + __glXScreenInit(&screen->base, pScreen); + + /* __glXScreenInit initializes these, so the order here is important, if we need these... */ + // screen->base.GLextensions = ""; + // screen->base.GLXvendor = "Apple"; + screen->base.GLXversion = xstrdup("1.4"); + screen->base.GLXextensions = xstrdup("GLX_SGIX_fbconfig " + "GLX_SGIS_multisample " + "GLX_ARB_multisample " + "GLX_EXT_visual_info " + "GLX_EXT_import_context "); + + /*We may be able to add more GLXextensions at a later time. */ + + return &screen->base; +} - return &screen->base; +static void __glXAquaDrawableCopySubBuffer (__GLXdrawable *drawable, + int x, int y, int w, int h) { + /*TODO finish me*/ } + static void __glXAquaDrawableDestroy(__GLXdrawable *base) { - GLAQUA_DEBUG_MSG("glAquaDestroyDrawablePrivate\n"); + /* gstaplin: base is the head of the structure, so it's at the same + * offset in memory. + * Is this safe with strict aliasing? I noticed that the other dri code + * does this too... + */ + __GLXAquaDrawable *glxPriv = (__GLXAquaDrawable *)base; + GLAQUA_DEBUG_MSG(__func__); + /* It doesn't work to call DRIDestroySurface here, the drawable's already gone.. But dri.c notices the window destruction and frees the surface itself. */ - free(base); + /*gstaplin: verify the statement above. The surface destroy + *messages weren't making it through, and may still not be. + *We need a good test case for surface creation and destruction. + *We also need a good way to enable introspection on the server + *to validate the test, beyond using gdb with print. + */ + + xfree(glxPriv); } static __GLXdrawable * __glXAquaScreenCreateDrawable(__GLXscreen *screen, DrawablePtr pDraw, + int type, XID drawId, - __GLcontextModes *modes) { + __GLXconfig *conf) { __GLXAquaDrawable *glxPriv; - GLAQUA_DEBUG_MSG("glAquaScreenCreateDrawable(%p,%p,%d,%p)\n", context, pDraw, drawId, modes); - glxPriv = xalloc(sizeof *glxPriv); - if (glxPriv == NULL) return NULL; + + if(glxPriv == NULL) + return NULL; memset(glxPriv, 0, sizeof *glxPriv); - if (!__glXDrawableInit(&glxPriv->base, screen, pDraw, drawId, modes)) { + if(!__glXDrawableInit(&glxPriv->base, screen, pDraw, type, drawId, conf)) { xfree(glxPriv); return NULL; } glxPriv->base.destroy = __glXAquaDrawableDestroy; - glxPriv->base.resize = __glXAquaDrawableResize; glxPriv->base.swapBuffers = __glXAquaDrawableSwapBuffers; - // glxPriv->base.copySubBuffer = __glXAquaDrawableCopySubBuffer; + glxPriv->base.copySubBuffer = NULL; /* __glXAquaDrawableCopySubBuffer; */ + glxPriv->pDraw = pDraw; + glxPriv->sid = 0; + glxPriv->context = NULL; + return &glxPriv->base; } -static void glAquaResetExtension(void) -{ - GLAQUA_DEBUG_MSG("glAquaResetExtension\n"); - CGLSetOption(kCGLGOResetLibrary, GL_TRUE); -} - // Extra goodies for glx GLuint __glFloorLog2(GLuint val) @@ -1255,7 +853,9 @@ static void setup_dispatch_table(void) { SET_BlendEquationSeparateEXT(disp, glBlendEquationSeparateEXT); SET_BlendFunc(disp, glBlendFunc); SET_BlendFuncSeparateEXT(disp, glBlendFuncSeparateEXT); +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 SET_BlitFramebufferEXT(disp, glBlitFramebufferEXT); +#endif SET_BufferDataARB(disp, glBufferDataARB); SET_BufferSubDataARB(disp, glBufferSubDataARB); SET_CallList(disp, glCallList); @@ -1312,12 +912,16 @@ static void setup_dispatch_table(void) { SET_ColorTable(disp, glColorTable); SET_ColorTableParameterfv(disp, glColorTableParameterfv); SET_ColorTableParameteriv(disp, glColorTableParameteriv); + + +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 SET_CombinerInputNV(disp, glCombinerInputNV); SET_CombinerOutputNV(disp, glCombinerOutputNV); SET_CombinerParameterfNV(disp, glCombinerParameterfNV); SET_CombinerParameterfvNV(disp, glCombinerParameterfvNV); SET_CombinerParameteriNV(disp, glCombinerParameteriNV); SET_CombinerParameterivNV(disp, glCombinerParameterivNV); +#endif SET_CompileShaderARB(disp, glCompileShaderARB); SET_CompressedTexImage1DARB(disp, glCompressedTexImage1DARB); SET_CompressedTexImage2DARB(disp, glCompressedTexImage2DARB); @@ -1395,7 +999,10 @@ static void setup_dispatch_table(void) { SET_EvalPoint2(disp, glEvalPoint2); //SET_ExecuteProgramNV(disp, glExecuteProgramNV); SET_FeedbackBuffer(disp, glFeedbackBuffer); + +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 SET_FinalCombinerInputNV(disp, glFinalCombinerInputNV); +#endif SET_Finish(disp, glFinish); SET_FinishFenceNV(disp, glFinishFenceAPPLE); // <-- APPLE -> NV SET_Flush(disp, glFlush); @@ -1437,10 +1044,12 @@ static void setup_dispatch_table(void) { SET_GetColorTable(disp, glGetColorTable); SET_GetColorTableParameterfv(disp, glGetColorTableParameterfv); SET_GetColorTableParameteriv(disp, glGetColorTableParameteriv); +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 SET_GetCombinerInputParameterfvNV(disp, glGetCombinerInputParameterfvNV); SET_GetCombinerInputParameterivNV(disp, glGetCombinerInputParameterivNV); SET_GetCombinerOutputParameterfvNV(disp, glGetCombinerOutputParameterfvNV); SET_GetCombinerOutputParameterivNV(disp, glGetCombinerOutputParameterivNV); +#endif SET_GetCompressedTexImageARB(disp, glGetCompressedTexImageARB); SET_GetConvolutionFilter(disp, glGetConvolutionFilter); SET_GetConvolutionParameterfv(disp, glGetConvolutionParameterfv); @@ -1448,8 +1057,10 @@ static void setup_dispatch_table(void) { SET_GetDoublev(disp, glGetDoublev); SET_GetError(disp, glGetError); //SET_GetFenceivNV(disp, glGetFenceivNV); +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 SET_GetFinalCombinerInputParameterfvNV(disp, glGetFinalCombinerInputParameterfvNV); SET_GetFinalCombinerInputParameterivNV(disp, glGetFinalCombinerInputParameterivNV); +#endif SET_GetFloatv(disp, glGetFloatv); SET_GetFramebufferAttachmentParameterivEXT(disp, glGetFramebufferAttachmentParameterivEXT); SET_GetHandleARB(disp, glGetHandleARB); diff --git a/xorg-server/hw/xquartz/GL/visualConfigs.c b/xorg-server/hw/xquartz/GL/visualConfigs.c new file mode 100644 index 000000000..81f88fb3c --- /dev/null +++ b/xorg-server/hw/xquartz/GL/visualConfigs.c @@ -0,0 +1,255 @@ +/* + * Copyright (c) 2007, 2008 Apple Inc. + * Copyright (c) 2004 Torrey T. Lyons. All Rights Reserved. + * Copyright (c) 2002 Greg Parker. All Rights Reserved. + * + * Portions of this file are copied from Mesa's xf86glx.c, + * which contains the following copyright: + * + * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include "dri.h" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "capabilities.h" +#include "visualConfigs.h" + +/* Based originally on code from indirect.c which was based on code from i830_dri.c. */ +void setVisualConfigs(void) { + int numConfigs = 0; + __GLXvisualConfig *visualConfigs = NULL; + void **visualPrivates = NULL; + struct glCapabilities caps; + struct glCapabilitiesConfig *conf = NULL; + int stereo, depth, aux, buffers, stencil, accum, color, msample; + int i = 0; + + if(getGlCapabilities(&caps)) { + ErrorF("error from getGlCapabilities()!\n"); + return; + } + + /* + conf->stereo is 0 or 1, but we need at least 1 iteration of the loop, + so we treat a true conf->stereo as 2. + + The depth size is 0 or 24. Thus we do 2 iterations for that. + + conf->aux_buffers (when available/non-zero) result in 2 iterations instead of 1. + + conf->buffers indicates whether we have single or double buffering. + + conf->total_stencil_bit_depths + + conf->total_color_buffers indicates the RGB/RGBA color depths. + + conf->total_accum_buffers iterations for accum (with at least 1 if equal to 0) + + conf->total_depth_buffer_depths + + conf->multisample_buffers iterations (with at least 1 if equal to 0). We add 1 + for the 0 multisampling config. + + */ + + assert(NULL != caps.configurations); + conf = caps.configurations; + + numConfigs = 0; + + for(conf = caps.configurations; conf; conf = conf->next) { + if(conf->total_color_buffers <= 0) + continue; + + numConfigs += (conf->stereo ? 2 : 1) + * (conf->aux_buffers ? 2 : 1) + * conf->buffers + * ((conf->total_stencil_bit_depths > 0) ? conf->total_stencil_bit_depths : 1) + * conf->total_color_buffers + * ((conf->total_accum_buffers > 0) ? conf->total_accum_buffers : 1) + * conf->total_depth_buffer_depths + * (conf->multisample_buffers + 1); + } + + visualConfigs = xcalloc(sizeof(*visualConfigs), numConfigs); + + if(NULL == visualConfigs) { + ErrorF("xcalloc failure when allocating visualConfigs\n"); + freeGlCapabilities(&caps); + return; + } + + visualPrivates = xcalloc(sizeof(void *), numConfigs); + + if(NULL == visualPrivates) { + ErrorF("xcalloc failure when allocating visualPrivates"); + freeGlCapabilities(&caps); + xfree(visualConfigs); + return; + } + + i = 0; /* current buffer */ + for(conf = caps.configurations; conf; conf = conf->next) { + for(stereo = 0; stereo < (conf->stereo ? 2 : 1); ++stereo) { + for(aux = 0; aux < (conf->aux_buffers ? 2 : 1); ++aux) { + for(buffers = 0; buffers < conf->buffers; ++buffers) { + for(stencil = 0; stencil < ((conf->total_stencil_bit_depths > 0) ? + conf->total_stencil_bit_depths : 1); ++stencil) { + for(color = 0; color < conf->total_color_buffers; ++color) { + for(accum = 0; accum < ((conf->total_accum_buffers > 0) ? + conf->total_accum_buffers : 1); ++accum) { + for(depth = 0; depth < conf->total_depth_buffer_depths; ++depth) { + for(msample = 0; msample < (conf->multisample_buffers + 1); ++msample) { + visualConfigs[i].vid = (VisualID)(-1); + visualConfigs[i].class = TrueColor; + + visualConfigs[i].rgba = true; + visualConfigs[i].redSize = conf->color_buffers[color].r; + visualConfigs[i].greenSize = conf->color_buffers[color].g; + visualConfigs[i].blueSize = conf->color_buffers[color].b; + + if(GLCAPS_COLOR_BUF_INVALID_VALUE == conf->color_buffers[color].a) { + /* This visual has no alpha. */ + visualConfigs[i].alphaSize = 0; + } else { + visualConfigs[i].alphaSize = conf->color_buffers[color].a; + } + + /* + * If the .a/alpha value is unset, then don't add it to the + * bufferSize specification. The INVALID_VALUE indicates that it + * was unset. + * + * This prevents odd bufferSizes, such as 14. + */ + if(GLCAPS_COLOR_BUF_INVALID_VALUE == conf->color_buffers[color].a) { + visualConfigs[i].bufferSize = conf->color_buffers[color].r + + conf->color_buffers[color].g + conf->color_buffers[color].b; + } else { + visualConfigs[i].bufferSize = conf->color_buffers[color].r + + conf->color_buffers[color].g + conf->color_buffers[color].b + + conf->color_buffers[color].a; + } + + /* + * I'm uncertain about these masks. + * I don't think we actually care what the values are in our + * libGL, so it doesn't seem to make a difference. + */ + visualConfigs[i].redMask = -1; + visualConfigs[i].greenMask = -1; + visualConfigs[i].blueMask = -1; + visualConfigs[i].alphaMask = -1; + + if(conf->total_accum_buffers > 0) { + visualConfigs[i].accumRedSize = conf->accum_buffers[accum].r; + visualConfigs[i].accumGreenSize = conf->accum_buffers[accum].g; + visualConfigs[i].accumBlueSize = conf->accum_buffers[accum].b; + if(GLCAPS_COLOR_BUF_INVALID_VALUE != conf->accum_buffers[accum].a) { + visualConfigs[i].accumAlphaSize = conf->accum_buffers[accum].a; + } else { + visualConfigs[i].accumAlphaSize = 0; + } + } else { + visualConfigs[i].accumRedSize = 0; + visualConfigs[i].accumGreenSize = 0; + visualConfigs[i].accumBlueSize = 0; + visualConfigs[i].accumAlphaSize = 0; + } + + visualConfigs[i].doubleBuffer = buffers ? TRUE : FALSE; + visualConfigs[i].stereo = stereo ? TRUE : FALSE; + + visualConfigs[i].depthSize = conf->depth_buffers[depth]; + + if(conf->total_stencil_bit_depths > 0) { + visualConfigs[i].stencilSize = conf->stencil_bit_depths[stencil]; + } else { + visualConfigs[i].stencilSize = 0; + } + visualConfigs[i].auxBuffers = aux ? conf->aux_buffers : 0; + visualConfigs[i].level = 0; + + if(conf->accelerated) { + visualConfigs[i].visualRating = GLX_NONE; + } else { + visualConfigs[i].visualRating = GLX_SLOW_VISUAL_EXT; + } + + visualConfigs[i].transparentPixel = GLX_NONE; + visualConfigs[i].transparentRed = GLX_NONE; + visualConfigs[i].transparentGreen = GLX_NONE; + visualConfigs[i].transparentBlue = GLX_NONE; + visualConfigs[i].transparentAlpha = GLX_NONE; + visualConfigs[i].transparentIndex = GLX_NONE; + + if(msample > 0) { + visualConfigs[i].multiSampleSize = conf->multisample_samples; + visualConfigs[i].nMultiSampleBuffers = conf->multisample_buffers; + } else { + visualConfigs[i].multiSampleSize = 0; + visualConfigs[i].nMultiSampleBuffers = 0; + } + + ++i; + } + } + } + } + } + } + } + } + } + + if (i != numConfigs) { + ErrorF("numConfigs calculation error in setVisualConfigs! numConfigs is %d i is %d\n", numConfigs, i); + abort(); + } + + freeGlCapabilities(&caps); + + GlxSetVisualConfigs(numConfigs, visualConfigs, visualPrivates); +} diff --git a/xorg-server/hw/xquartz/GL/visualConfigs.h b/xorg-server/hw/xquartz/GL/visualConfigs.h new file mode 100644 index 000000000..b9e6ae756 --- /dev/null +++ b/xorg-server/hw/xquartz/GL/visualConfigs.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2008 Apple Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef VISUAL_CONFIGS_H +#define VISUAL_CONFIGS_H + +void setVisualConfigs(void); + +#endif diff --git a/xorg-server/hw/xquartz/Makefile.am b/xorg-server/hw/xquartz/Makefile.am index 999013d1b..e5e2e9e37 100644 --- a/xorg-server/hw/xquartz/Makefile.am +++ b/xorg-server/hw/xquartz/Makefile.am @@ -7,35 +7,35 @@ AM_CPPFLAGS = \ -DINXQUARTZ \ -DUSE_NEW_CLUT \ -DXFree86Server \ - -I$(top_srcdir)/miext/rootless + -I$(top_srcdir)/miext/rootless \ + -DX11LIBDIR=\"$(libdir)\" -if X11APP -X11APP_SUBDIRS = bundle +if GLX +GL_DIR = GL endif -SUBDIRS = . GL xpr $(X11APP_SUBDIRS) -DIST_SUBDIRS = GL xpr bundle +SUBDIRS = bundle . $(GL_DIR) xpr pbproxy mach-startup doc + +DIST_SUBDIRS = bundle . GL xpr pbproxy mach-startup doc libXquartz_la_SOURCES = \ $(top_srcdir)/fb/fbcmap_mi.c \ $(top_srcdir)/mi/miinitext.c \ - $(top_srcdir)/Xext/dpmsstubs.c \ X11Application.m \ X11Controller.m \ applewm.c \ darwin.c \ darwinEvents.c \ - darwinKeyboard.c \ darwinXinput.c \ keysym2ucs.c \ pseudoramiX.c \ quartz.c \ quartzAudio.c \ quartzCocoa.m \ - quartzForeground.c \ quartzKeyboard.c \ quartzPasteboard.c \ - quartzStartup.c + quartzStartup.c \ + threadSafety.c EXTRA_DIST = \ X11Application.h \ @@ -44,14 +44,13 @@ EXTRA_DIST = \ darwinClut8.h \ darwin.h \ darwinEvents.h \ - darwinKeyboard.h \ keysym2ucs.h \ pseudoramiX.h \ quartz.h \ quartzAudio.h \ quartzCommon.h \ - quartzCursor.c \ - quartzCursor.h \ - quartzForeground.h \ quartzKeyboard.h \ - quartzPasteboard.h + quartzPasteboard.h \ + sanitizedCarbon.h \ + sanitizedCocoa.h \ + threadSafety.h diff --git a/xorg-server/hw/xquartz/Makefile.in b/xorg-server/hw/xquartz/Makefile.in index b57b513bf..6a2dbf41c 100644 --- a/xorg-server/hw/xquartz/Makefile.in +++ b/xorg-server/hw/xquartz/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -43,7 +43,6 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-server.h \ $(top_builddir)/include/dix-config.h \ - $(top_builddir)/include/xgl-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ @@ -51,21 +50,17 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libXquartz_la_LIBADD = -am_libXquartz_la_OBJECTS = fbcmap_mi.lo miinitext.lo dpmsstubs.lo \ - X11Application.lo X11Controller.lo applewm.lo darwin.lo \ - darwinEvents.lo darwinKeyboard.lo darwinXinput.lo \ - keysym2ucs.lo pseudoramiX.lo quartz.lo quartzAudio.lo \ - quartzCocoa.lo quartzForeground.lo quartzKeyboard.lo \ - quartzPasteboard.lo quartzStartup.lo +am_libXquartz_la_OBJECTS = fbcmap_mi.lo miinitext.lo X11Application.lo \ + X11Controller.lo applewm.lo darwin.lo darwinEvents.lo \ + darwinXinput.lo keysym2ucs.lo pseudoramiX.lo quartz.lo \ + quartzAudio.lo quartzCocoa.lo quartzKeyboard.lo \ + quartzPasteboard.lo quartzStartup.lo threadSafety.lo libXquartz_la_OBJECTS = $(am_libXquartz_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ @@ -95,8 +90,9 @@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ -APPDEFAULTDIR = @APPDEFAULTDIR@ APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ +APPLE_APPLICATION_ID = @APPLE_APPLICATION_ID@ +APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ APP_MAN_DIR = @APP_MAN_DIR@ APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ AR = @AR@ @@ -117,10 +113,6 @@ CFLAGS = @CFLAGS@ COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DARWIN_LIBS = @DARWIN_LIBS@ DBUS_CFLAGS = @DBUS_CFLAGS@ @@ -142,6 +134,7 @@ DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@ DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@ DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ +DOLT_BASH = @DOLT_BASH@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ @@ -151,18 +144,15 @@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ -ECHO = @ECHO@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ -FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ -FREETYPE_LIBS = @FREETYPE_LIBS@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ GL_CFLAGS = @GL_CFLAGS@ @@ -181,7 +171,7 @@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ -LAUNCHD = @LAUNCHD@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ LEX = @LEX@ @@ -195,7 +185,10 @@ LIBTOOL = @LIBTOOL@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LINUXDOC = @LINUXDOC@ +LIPO = @LIPO@ LN_S = @LN_S@ +LTCOMPILE = @LTCOMPILE@ +LTCXXCOMPILE = @LTCXXCOMPILE@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ @@ -207,8 +200,7 @@ MESA_SOURCE = @MESA_SOURCE@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ -MKFONTDIR = @MKFONTDIR@ -MKFONTSCALE = @MKFONTSCALE@ +NM = @NM@ NMEDIT = @NMEDIT@ OBJC = @OBJC@ OBJCCLD = @OBJCCLD@ @@ -217,8 +209,8 @@ OBJCFLAGS = @OBJCFLAGS@ OBJCLINK = @OBJCLINK@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -251,7 +243,6 @@ VENDOR_NAME = @VENDOR_NAME@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VENDOR_RELEASE = @VENDOR_RELEASE@ VERSION = @VERSION@ -X11APP_ARCHS = @X11APP_ARCHS@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ @@ -261,27 +252,12 @@ XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@ XDMX_CFLAGS = @XDMX_CFLAGS@ XDMX_LIBS = @XDMX_LIBS@ XDMX_SYS_LIBS = @XDMX_SYS_LIBS@ -XEGLMODULES_CFLAGS = @XEGLMODULES_CFLAGS@ -XEGL_LIBS = @XEGL_LIBS@ -XEGL_SYS_LIBS = @XEGL_SYS_LIBS@ XEPHYR_CFLAGS = @XEPHYR_CFLAGS@ -XEPHYR_DRI_LIBS = @XEPHYR_DRI_LIBS@ XEPHYR_INCS = @XEPHYR_INCS@ XEPHYR_LIBS = @XEPHYR_LIBS@ XF86CONFIGFILE = @XF86CONFIGFILE@ -XF86MISC_CFLAGS = @XF86MISC_CFLAGS@ -XF86MISC_LIBS = @XF86MISC_LIBS@ XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@ XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@ -XGLMODULES_CFLAGS = @XGLMODULES_CFLAGS@ -XGLMODULES_LIBS = @XGLMODULES_LIBS@ -XGLXMODULES_CFLAGS = @XGLXMODULES_CFLAGS@ -XGLXMODULES_LIBS = @XGLXMODULES_LIBS@ -XGLX_LIBS = @XGLX_LIBS@ -XGLX_SYS_LIBS = @XGLX_SYS_LIBS@ -XGL_LIBS = @XGL_LIBS@ -XGL_MODULE_PATH = @XGL_MODULE_PATH@ -XGL_SYS_LIBS = @XGL_SYS_LIBS@ XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@ XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@ XKB_COMPILED_DIR = @XKB_COMPILED_DIR@ @@ -292,10 +268,6 @@ XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ -XORGCFG_DEP_CFLAGS = @XORGCFG_DEP_CFLAGS@ -XORGCFG_DEP_LIBS = @XORGCFG_DEP_LIBS@ -XORGCONFIG_DEP_CFLAGS = @XORGCONFIG_DEP_CFLAGS@ -XORGCONFIG_DEP_LIBS = @XORGCONFIG_DEP_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ @@ -304,13 +276,8 @@ XORG_MODULES_LIBS = @XORG_MODULES_LIBS@ XORG_OS = @XORG_OS@ XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ XORG_SYS_LIBS = @XORG_SYS_LIBS@ -XPRINTMODULES_CFLAGS = @XPRINTMODULES_CFLAGS@ -XPRINTMODULES_LIBS = @XPRINTMODULES_LIBS@ -XPRINTPROTO_CFLAGS = @XPRINTPROTO_CFLAGS@ -XPRINTPROTO_LIBS = @XPRINTPROTO_LIBS@ -XPRINT_CFLAGS = @XPRINT_CFLAGS@ -XPRINT_LIBS = @XPRINT_LIBS@ -XPRINT_SYS_LIBS = @XPRINT_SYS_LIBS@ +XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ +XPBPROXY_LIBS = @XPBPROXY_LIBS@ XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ XSDL_INCS = @XSDL_INCS@ @@ -343,8 +310,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -364,7 +330,6 @@ driverdir = @driverdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ extdir = @extdir@ -ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -374,12 +339,12 @@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -launchagentsdir = @launchagentsdir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ logdir = @logdir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ @@ -397,8 +362,6 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xglmoduledir = @xglmoduledir@ -xpconfigdir = @xpconfigdir@ noinst_LTLIBRARIES = libXquartz.la AM_CFLAGS = $(XSERVER_CFLAGS) $(DIX_CFLAGS) AM_OBJCFLAGS = $(XSERVER_CFLAGS) $(DIX_CFLAGS) @@ -408,31 +371,30 @@ AM_CPPFLAGS = \ -DINXQUARTZ \ -DUSE_NEW_CLUT \ -DXFree86Server \ - -I$(top_srcdir)/miext/rootless + -I$(top_srcdir)/miext/rootless \ + -DX11LIBDIR=\"$(libdir)\" -@X11APP_TRUE@X11APP_SUBDIRS = bundle -SUBDIRS = . GL xpr $(X11APP_SUBDIRS) -DIST_SUBDIRS = GL xpr bundle +@GLX_TRUE@GL_DIR = GL +SUBDIRS = bundle . $(GL_DIR) xpr pbproxy mach-startup doc +DIST_SUBDIRS = bundle . GL xpr pbproxy mach-startup doc libXquartz_la_SOURCES = \ $(top_srcdir)/fb/fbcmap_mi.c \ $(top_srcdir)/mi/miinitext.c \ - $(top_srcdir)/Xext/dpmsstubs.c \ X11Application.m \ X11Controller.m \ applewm.c \ darwin.c \ darwinEvents.c \ - darwinKeyboard.c \ darwinXinput.c \ keysym2ucs.c \ pseudoramiX.c \ quartz.c \ quartzAudio.c \ quartzCocoa.m \ - quartzForeground.c \ quartzKeyboard.c \ quartzPasteboard.c \ - quartzStartup.c + quartzStartup.c \ + threadSafety.c EXTRA_DIST = \ X11Application.h \ @@ -441,17 +403,16 @@ EXTRA_DIST = \ darwinClut8.h \ darwin.h \ darwinEvents.h \ - darwinKeyboard.h \ keysym2ucs.h \ pseudoramiX.h \ quartz.h \ quartzAudio.h \ quartzCommon.h \ - quartzCursor.c \ - quartzCursor.h \ - quartzForeground.h \ quartzKeyboard.h \ - quartzPasteboard.h + quartzPasteboard.h \ + sanitizedCarbon.h \ + sanitizedCocoa.h \ + threadSafety.h all: all-recursive @@ -461,8 +422,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -509,9 +470,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/applewm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/darwin.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/darwinEvents.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/darwinKeyboard.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/darwinXinput.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dpmsstubs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fbcmap_mi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keysym2ucs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miinitext.Plo@am__quote@ @@ -519,10 +478,10 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quartz.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quartzAudio.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quartzCocoa.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quartzForeground.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quartzKeyboard.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quartzPasteboard.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quartzStartup.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threadSafety.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -559,13 +518,6 @@ miinitext.lo: $(top_srcdir)/mi/miinitext.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o miinitext.lo `test -f '$(top_srcdir)/mi/miinitext.c' || echo '$(srcdir)/'`$(top_srcdir)/mi/miinitext.c -dpmsstubs.lo: $(top_srcdir)/Xext/dpmsstubs.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dpmsstubs.lo -MD -MP -MF $(DEPDIR)/dpmsstubs.Tpo -c -o dpmsstubs.lo `test -f '$(top_srcdir)/Xext/dpmsstubs.c' || echo '$(srcdir)/'`$(top_srcdir)/Xext/dpmsstubs.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/dpmsstubs.Tpo $(DEPDIR)/dpmsstubs.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/Xext/dpmsstubs.c' object='dpmsstubs.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dpmsstubs.lo `test -f '$(top_srcdir)/Xext/dpmsstubs.c' || echo '$(srcdir)/'`$(top_srcdir)/Xext/dpmsstubs.c - .m.o: @am__fastdepOBJC_TRUE@ $(OBJCCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepOBJC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @@ -668,7 +620,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/xorg-server/hw/xquartz/X11Application.h b/xorg-server/hw/xquartz/X11Application.h index 86da67f2e..80aee5932 100644 --- a/xorg-server/hw/xquartz/X11Application.h +++ b/xorg-server/hw/xquartz/X11Application.h @@ -32,7 +32,6 @@ #if __OBJC__ -#import #import "X11Controller.h" @interface X11Application : NSApplication { @@ -56,8 +55,7 @@ - (void) prefs_set_string:(NSString *)key value:(NSString *)value; - (void) prefs_synchronize; -- (BOOL) x_active; - +- (OSX_BOOL) x_active; @end extern X11Application *X11App; @@ -72,18 +70,17 @@ void X11ApplicationSetCanQuit (int state); void X11ApplicationServerReady (void); void X11ApplicationShowHideMenubar (int state); -void X11ApplicationMain(int argc, const char **argv, void (*server_thread) (void *), void *server_arg); +void X11ApplicationMain(int argc, char **argv, char **envp); extern int X11EnableKeyEquivalents; -extern int quartzHasRoot, quartzEnableRootless; - -#define APP_PREFS "org.x.X11" +extern int quartzHasRoot, quartzEnableRootless, quartzFullscreenMenu; #define PREFS_APPSMENU "apps_menu" #define PREFS_FAKEBUTTONS "enable_fake_buttons" #define PREFS_SYSBEEP "enable_system_beep" #define PREFS_KEYEQUIVS "enable_key_equivalents" -#define PREFS_KEYMAP_FILE "keymap_file" +#define PREFS_FULLSCREEN_HOTKEYS "fullscreen_hotkeys" +#define PREFS_FULLSCREEN_MENU "fullscreen_menu" #define PREFS_SYNC_KEYMAP "sync_keymap" #define PREFS_DEPTH "depth" #define PREFS_NO_AUTH "no_auth" @@ -92,12 +89,20 @@ extern int quartzHasRoot, quartzEnableRootless; #define PREFS_NO_QUIT_ALERT "no_quit_alert" #define PREFS_FAKE_BUTTON2 "fake_button2" #define PREFS_FAKE_BUTTON3 "fake_button3" +#define PREFS_APPKIT_MODIFIERS "appkit_modifiers" +#define PREFS_WINDOW_ITEM_MODIFIERS "window_item_modifiers" #define PREFS_ROOTLESS "rootless" -#define PREFS_FULLSCREEN_HOTKEYS "fullscreen_hotkeys" -#define PREFS_SWAP_ALT_META "swap_alt_meta" +#define PREFS_TEST_EXTENSIONS "enable_test_extensions" #define PREFS_XP_OPTIONS "xp_options" -#define PREFS_ENABLE_STEREO "enable_stereo" #define PREFS_LOGIN_SHELL "login_shell" -#define PREFS_QUARTZ_WM_CLICK_THROUGH "wm_click_through" +#define PREFS_CLICK_THROUGH "wm_click_through" +#define PREFS_FFM "wm_ffm" +#define PREFS_FOCUS_ON_NEW_WINDOW "wm_focus_on_new_window" + +#define PREFS_SYNC_PB "sync_pasteboard" +#define PREFS_SYNC_PB_TO_CLIPBOARD "sync_pasteboard_to_clipboard" +#define PREFS_SYNC_PB_TO_PRIMARY "sync_pasteboard_to_primary" +#define PREFS_SYNC_CLIPBOARD_TO_PB "sync_clipboard_to_pasteboard" +#define PREFS_SYNC_PRIMARY_ON_SELECT "sync_primary_on_select" #endif /* X11APPLICATION_H */ diff --git a/xorg-server/hw/xquartz/X11Application.m b/xorg-server/hw/xquartz/X11Application.m index be5511d30..9f4738c47 100644 --- a/xorg-server/hw/xquartz/X11Application.m +++ b/xorg-server/hw/xquartz/X11Application.m @@ -1,6 +1,6 @@ /* X11Application.m -- subclass of NSApplication to multiplex events - Copyright (c) 2002-2007 Apple Inc. + Copyright (c) 2002-2008 Apple Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files @@ -27,48 +27,69 @@ promote the sale, use or other dealings in this Software without prior written authorization. */ +#include "sanitizedCarbon.h" + #ifdef HAVE_DIX_CONFIG_H #include #endif #include "quartzCommon.h" -#include "quartzForeground.h" #import "X11Application.h" -#include - -/* ouch! */ -#define BOOL X_BOOL -# include "darwin.h" -# include "darwinEvents.h" -# include "quartz.h" -# define _APPLEWM_SERVER_ -# include "X11/extensions/applewm.h" -# include "micmap.h" -#undef BOOL + +#include "darwin.h" +#include "darwinEvents.h" +#include "quartzKeyboard.h" +#include "quartz.h" +#define _APPLEWM_SERVER_ +#include "X11/extensions/applewm.h" +#include "micmap.h" #include #include -#include +#include + +#include -#include "rootlessCommon.h" +// pbproxy/pbproxy.h +extern BOOL xpbproxy_init (void); -WindowPtr xprGetXWindowFromAppKit(int windowNumber); // xpr/xprFrame.c +#define DEFAULTS_FILE X11LIBDIR"/X11/xserver/Xquartz.plist" + +#ifndef XSERVER_VERSION +#define XSERVER_VERSION "?" +#endif -#define DEFAULTS_FILE "/usr/X11/lib/X11/xserver/Xquartz.plist" +#define ProximityIn 0 +#define ProximityOut 1 -int X11EnableKeyEquivalents = TRUE; +/* Stuck modifier / button state... force release when we context switch */ +static NSEventType keyState[NUM_KEYCODES]; +static int modifierFlagsMask; + +int X11EnableKeyEquivalents = TRUE, quartzFullscreenMenu = FALSE; int quartzHasRoot = FALSE, quartzEnableRootless = TRUE; -extern int darwinFakeButtons, input_check_flag; -extern Bool enable_stereo; +extern Bool noTestExtensions; + +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 +static TISInputSourceRef last_key_layout; +#else +static KeyboardLayoutRef last_key_layout; +#endif -extern xEvent *darwinEvents; +extern int darwinFakeButtons; X11Application *X11App; +CFStringRef app_prefs_domain_cfstr = NULL; + #define ALL_KEY_MASKS (NSShiftKeyMask | NSControlKeyMask | NSAlternateKeyMask | NSCommandKeyMask) +@interface X11Application (Private) +- (void) sendX11NSEvent:(NSEvent *)e; +@end + @implementation X11Application typedef struct message_struct message; @@ -80,8 +101,6 @@ struct message_struct { static mach_port_t _port; -static void send_nsevent (NSEventType type, NSEvent *e); - /* Quartz mode initialization routine. This is often dynamically loaded but is statically linked into this X server. */ Bool QuartzModeBundleInit(void); @@ -144,195 +163,259 @@ static void message_kit_thread (SEL selector, NSObject *arg) { NSMutableDictionary *dict; NSDictionary *infoDict; NSString *tem; - - dict = [NSMutableDictionary dictionaryWithCapacity:2]; + + dict = [NSMutableDictionary dictionaryWithCapacity:3]; infoDict = [[NSBundle mainBundle] infoDictionary]; - + [dict setObject: NSLocalizedString (@"The X Window System", @"About panel") - forKey:@"ApplicationName"]; - + forKey:@"ApplicationName"]; + tem = [infoDict objectForKey:@"CFBundleShortVersionString"]; - - [dict setObject:[NSString stringWithFormat:@"XQuartz %@ - (xorg-server %s)", tem, XSERVER_VERSION] - forKey:@"ApplicationVersion"]; - + + [dict setObject:[NSString stringWithFormat:@"XQuartz %@", tem] + forKey:@"ApplicationVersion"]; + + [dict setObject:[NSString stringWithFormat:@"xorg-server %s", XSERVER_VERSION] + forKey:@"Version"]; + [self orderFrontStandardAboutPanelWithOptions: dict]; } -- (void) activateX:(BOOL)state { +- (void) activateX:(OSX_BOOL)state { /* Create a TSM document that supports full Unicode input, and - have it activated while X is active (unless using the old - keymapping files) */ + have it activated while X is active */ static TSMDocumentID x11_document; - DEBUG_LOG("state=%d, _x_active=%d, \n", state, _x_active) + size_t i; + DEBUG_LOG("state=%d, _x_active=%d, \n", state, _x_active) if (state) { - QuartzMessageServerThread (kXDarwinActivate, 0); - - if (!_x_active) { - if (x11_document == 0 && darwinKeymapFile == NULL) { - OSType types[1]; - types[0] = kUnicodeDocument; - NewTSMDocument (1, types, &x11_document, 0); - } - - if (x11_document != 0) ActivateTSMDocument (x11_document); - } + DarwinSendDDXEvent(kXquartzActivate, 0); + + if (!_x_active) { + if (x11_document == 0) { + OSType types[1]; + types[0] = kUnicodeDocument; + NewTSMDocument (1, types, &x11_document, 0); + } + + if (x11_document != 0) ActivateTSMDocument (x11_document); + } } else { - QuartzMessageServerThread (kXDarwinDeactivate, 0); - - if (_x_active && x11_document != 0) - DeactivateTSMDocument (x11_document); + + if(darwin_modifier_flags) + DarwinUpdateModKeys(0); + for(i=0; i < NUM_KEYCODES; i++) { + if(keyState[i] == NSKeyDown) { + DarwinSendKeyboardEvents(KeyRelease, i); + keyState[i] = NSKeyUp; + } + } + + DarwinSendDDXEvent(kXquartzDeactivate, 0); + + if (_x_active && x11_document != 0) + DeactivateTSMDocument (x11_document); } - + _x_active = state; } - (void) became_key:(NSWindow *)win { - [self activateX:NO]; + [self activateX:NO]; } - (void) sendEvent:(NSEvent *)e { - NSEventType type; - BOOL for_appkit, for_x; - - type = [e type]; - - /* By default pass down the responder chain and to X. */ - for_appkit = YES; - for_x = YES; - - switch (type) { - case NSLeftMouseDown: case NSRightMouseDown: case NSOtherMouseDown: - case NSLeftMouseUp: case NSRightMouseUp: case NSOtherMouseUp: - if ([e window] != nil) { - /* Pointer event has an (AppKit) window. Probably something for the kit. */ - for_x = NO; - if (_x_active) [self activateX:NO]; - } else if ([self modalWindow] == nil) { - /* Must be an X window. Tell appkit it doesn't have focus. */ - WindowPtr pWin = xprGetXWindowFromAppKit([e windowNumber]); - if (pWin) RootlessReorderWindow(pWin); - for_appkit = NO; - - if ([self isActive]) { - [self deactivate]; - - if (!_x_active && quartzProcs->IsX11Window([e window], - [e windowNumber])) - [self activateX:YES]; - } - } - break; - - case NSKeyDown: case NSKeyUp: - if (_x_active) { - static int swallow_up; - - /* No kit window is focused, so send it to X. */ - for_appkit = NO; - if (type == NSKeyDown) { - /* Before that though, see if there are any global - shortcuts bound to it. */ - - if (X11EnableKeyEquivalents - && [[self mainMenu] performKeyEquivalent:e]) { - swallow_up = [e keyCode]; - for_x = NO; - } else if (!quartzEnableRootless - && ([e modifierFlags] & ALL_KEY_MASKS) - == (NSCommandKeyMask | NSAlternateKeyMask) - && ([e keyCode] == 0 /*a*/ - || [e keyCode] == 53 /*Esc*/)) { - swallow_up = 0; - for_x = NO; -#ifdef DARWIN_DDX_MISSING - QuartzMessageServerThread (kXDarwinToggleFullscreen, 0); -#endif - } - } else { - /* If we saw a key equivalent on the down, don't pass - the up through to X. */ - - if (swallow_up != 0 && [e keyCode] == swallow_up) { - swallow_up = 0; - for_x = NO; - } - } - } else for_x = NO; - break; + OSX_BOOL for_appkit, for_x; - case NSFlagsChanged: - /* For the l33t X users who remap modifier keys to normal keysyms. */ - if (!_x_active) for_x = NO; - break; + /* By default pass down the responder chain and to X. */ + for_appkit = YES; + for_x = YES; - case NSAppKitDefined: - switch ([e subtype]) { - case NSApplicationActivatedEventType: - for_x = NO; - if ([self modalWindow] == nil) { - for_appkit = NO; - - /* FIXME: hack to avoid having to pass the event to appkit, - which would cause it to raise one of its windows. */ - _appFlags._active = YES; - - [self activateX:YES]; - if ([e data2] & 0x10) X11ApplicationSetFrontProcess(); - } - break; - - case 18: /* ApplicationDidReactivate */ - if (quartzHasRoot) for_appkit = NO; - break; - - case NSApplicationDeactivatedEventType: - for_x = NO; - [self activateX:NO]; - break; + switch ([e type]) { + case NSLeftMouseDown: case NSRightMouseDown: case NSOtherMouseDown: + case NSLeftMouseUp: case NSRightMouseUp: case NSOtherMouseUp: + if ([e window] != nil) { + /* Pointer event has an (AppKit) window. Probably something for the kit. */ + for_x = NO; + if (_x_active) [self activateX:NO]; + } else if ([self modalWindow] == nil) { + /* Must be an X window. Tell appkit it doesn't have focus. */ + for_appkit = NO; + + if ([self isActive]) { + [self deactivate]; + if (!_x_active && quartzProcs->IsX11Window([e window], + [e windowNumber])) + [self activateX:YES]; + } + } + + /* We want to force sending to appkit if we're over the menu bar */ + if(!for_appkit) { + NSPoint NSlocation = [e locationInWindow]; + NSWindow *window = [e window]; + + if (window != nil) { + NSRect frame = [window frame]; + NSlocation.x += frame.origin.x; + NSlocation.y += frame.origin.y; + } + + NSRect NSframe = [[NSScreen mainScreen] frame]; + NSRect NSvisibleFrame = [[NSScreen mainScreen] visibleFrame]; + + CGRect CGframe = CGRectMake(NSframe.origin.x, NSframe.origin.y, + NSframe.size.width, NSframe.size.height); + CGRect CGvisibleFrame = CGRectMake(NSvisibleFrame.origin.x, + NSvisibleFrame.origin.y, + NSvisibleFrame.size.width, + NSvisibleFrame.size.height); + CGPoint CGlocation = CGPointMake(NSlocation.x, NSlocation.y); + + if(CGRectContainsPoint(CGframe, CGlocation) && + !CGRectContainsPoint(CGvisibleFrame, CGlocation)) + for_appkit = YES; + } + + break; + + case NSKeyDown: case NSKeyUp: + + if(_x_active) { + static BOOL do_swallow = NO; + static int swallow_keycode; + + if([e type] == NSKeyDown) { + /* Before that though, see if there are any global + * shortcuts bound to it. */ + + if(darwinAppKitModMask & [e modifierFlags]) { + /* Override to force sending to Appkit */ + swallow_keycode = [e keyCode]; + do_swallow = YES; + for_x = NO; +#if XPLUGIN_VERSION >= 1 + } else if(X11EnableKeyEquivalents && + xp_is_symbolic_hotkey_event([e eventRef])) { + swallow_keycode = [e keyCode]; + do_swallow = YES; + for_x = NO; +#endif + } else if(X11EnableKeyEquivalents && + [[self mainMenu] performKeyEquivalent:e]) { + swallow_keycode = [e keyCode]; + do_swallow = YES; + for_appkit = NO; + for_x = NO; + } else if(!quartzEnableRootless + && ([e modifierFlags] & ALL_KEY_MASKS) == (NSCommandKeyMask | NSAlternateKeyMask) + && ([e keyCode] == 0 /*a*/ || [e keyCode] == 53 /*Esc*/)) { + /* We have this here to force processing fullscreen + * toggle even if X11EnableKeyEquivalents is disabled */ + swallow_keycode = [e keyCode]; + do_swallow = YES; + for_x = NO; + for_appkit = NO; + DarwinSendDDXEvent(kXquartzToggleFullscreen, 0); + } else { + /* No kit window is focused, so send it to X. */ + for_appkit = NO; + } + } else { /* KeyUp */ + /* If we saw a key equivalent on the down, don't pass + * the up through to X. */ + if (do_swallow && [e keyCode] == swallow_keycode) { + do_swallow = NO; + for_x = NO; + } + } + } else { /* !_x_active */ + for_x = NO; + } + break; + + case NSFlagsChanged: + /* Don't tell X11 about modifiers changing while it's not active */ + if (!_x_active) + for_x = NO; + break; + + case NSAppKitDefined: + switch ([e subtype]) { + case NSApplicationActivatedEventType: + for_x = NO; + if ([self modalWindow] == nil) { + for_appkit = NO; + + /* FIXME: hack to avoid having to pass the event to appkit, + which would cause it to raise one of its windows. */ + _appFlags._active = YES; + + [self activateX:YES]; + + /* Get the Spaces preference for SwitchOnActivate */ + (void)CFPreferencesAppSynchronize(CFSTR(".GlobalPreferences")); + BOOL switch_on_activate, ok; + switch_on_activate = CFPreferencesGetAppBooleanValue(CFSTR("AppleSpacesSwitchOnActivate"), CFSTR(".GlobalPreferences"), &ok); + if(!ok) + switch_on_activate = YES; + + if ([e data2] & 0x10 && switch_on_activate) + DarwinSendDDXEvent(kXquartzBringAllToFront, 0); + } + break; + + case 18: /* ApplicationDidReactivate */ + if (quartzHasRoot) for_appkit = NO; + break; + + case NSApplicationDeactivatedEventType: + for_x = NO; + [self activateX:NO]; + break; + } + break; + + default: break; /* for gcc */ } - break; - default: break; /* for gcc */ - } - - if (for_appkit) [super sendEvent:e]; - - if (for_x) send_nsevent (type, e); + if (for_appkit) [super sendEvent:e]; + + if (for_x) [self sendX11NSEvent:e]; } - (void) set_window_menu:(NSArray *)list { - [_controller set_window_menu:list]; + [_controller set_window_menu:list]; } - (void) set_window_menu_check:(NSNumber *)n { - [_controller set_window_menu_check:n]; + [_controller set_window_menu_check:n]; } - (void) set_apps_menu:(NSArray *)list { - [_controller set_apps_menu:list]; + [_controller set_apps_menu:list]; } - (void) set_front_process:unused { - /* Hackery needed due to argv[0] hackery */ - // [self activateX:YES]; - ProcessSerialNumber psn = { 0, kCurrentProcess }; - SetFrontProcess(&psn); + [NSApp activateIgnoringOtherApps:YES]; - QuartzMessageServerThread(kXDarwinBringAllToFront, 0); + if ([self modalWindow] == nil) + [self activateX:YES]; } - (void) set_can_quit:(NSNumber *)state { - [_controller set_can_quit:[state boolValue]]; + [_controller set_can_quit:[state boolValue]]; } - (void) server_ready:unused { - [_controller server_ready]; + [_controller server_ready]; } - (void) show_hide_menubar:(NSNumber *)state { - if ([state boolValue]) ShowMenuBar (); - else HideMenuBar (); + /* Also shows/hides the dock */ + if ([state boolValue]) + SetSystemUIMode(kUIModeNormal, 0); + else + SetSystemUIMode(kUIModeAllHidden, quartzFullscreenMenu ? kUIOptionAutoShowMenuBar : 0); // kUIModeAllSuppressed or kUIOptionAutoShowMenuBar can be used to allow "mouse-activation" } @@ -350,63 +433,63 @@ static void cfrelease (CFAllocatorRef a, const void *b) { } static CFMutableArrayRef nsarray_to_cfarray (NSArray *in) { - CFMutableArrayRef out; - CFArrayCallBacks cb; - NSObject *ns; - const CFTypeRef *cf; - int i, count; - - memset (&cb, 0, sizeof (cb)); - cb.version = 0; - cb.retain = cfretain; - cb.release = cfrelease; - - count = [in count]; - out = CFArrayCreateMutable (NULL, count, &cb); - - for (i = 0; i < count; i++) { - ns = [in objectAtIndex:i]; - - if ([ns isKindOfClass:[NSArray class]]) - cf = (CFTypeRef) nsarray_to_cfarray ((NSArray *) ns); - else - cf = CFRetain ((CFTypeRef) ns); - - CFArrayAppendValue (out, cf); - CFRelease (cf); - } - - return out; + CFMutableArrayRef out; + CFArrayCallBacks cb; + NSObject *ns; + const CFTypeRef *cf; + int i, count; + + memset (&cb, 0, sizeof (cb)); + cb.version = 0; + cb.retain = cfretain; + cb.release = cfrelease; + + count = [in count]; + out = CFArrayCreateMutable (NULL, count, &cb); + + for (i = 0; i < count; i++) { + ns = [in objectAtIndex:i]; + + if ([ns isKindOfClass:[NSArray class]]) + cf = (CFTypeRef) nsarray_to_cfarray ((NSArray *) ns); + else + cf = CFRetain ((CFTypeRef) ns); + + CFArrayAppendValue (out, cf); + CFRelease (cf); + } + + return out; } static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) { - NSMutableArray *out; - const CFTypeRef *cf; - NSObject *ns; - int i, count; - - count = CFArrayGetCount (in); - out = [[NSMutableArray alloc] initWithCapacity:count]; - - for (i = 0; i < count; i++) { - cf = CFArrayGetValueAtIndex (in, i); - - if (CFGetTypeID (cf) == CFArrayGetTypeID ()) - ns = cfarray_to_nsarray ((CFArrayRef) cf); - else - ns = [(id)cf retain]; - - [out addObject:ns]; - [ns release]; - } - - return out; + NSMutableArray *out; + const CFTypeRef *cf; + NSObject *ns; + int i, count; + + count = CFArrayGetCount (in); + out = [[NSMutableArray alloc] initWithCapacity:count]; + + for (i = 0; i < count; i++) { + cf = CFArrayGetValueAtIndex (in, i); + + if (CFGetTypeID (cf) == CFArrayGetTypeID ()) + ns = cfarray_to_nsarray ((CFArrayRef) cf); + else + ns = [(id)cf retain]; + + [out addObject:ns]; + [ns release]; + } + + return out; } - (CFPropertyListRef) prefs_get:(NSString *)key { CFPropertyListRef value; - value = CFPreferencesCopyAppValue ((CFStringRef) key, CFSTR (APP_PREFS)); + value = CFPreferencesCopyAppValue ((CFStringRef) key, app_prefs_domain_cfstr); if (value == NULL) { static CFDictionaryRef defaults; @@ -503,7 +586,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) { if (value != NULL && CFGetTypeID (value) == CFNumberGetTypeID () - && CFNumberIsFloatType (value)) + && CFNumberIsFloatType (value)) CFNumberGetValue (value, kCFNumberFloatType, &ret); else if (value != NULL && CFGetTypeID (value) == CFStringGetTypeID ()) ret = CFStringGetDoubleValue (value); @@ -558,7 +641,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) { x = CFNumberCreate (NULL, kCFNumberIntType, &value); - CFPreferencesSetValue ((CFStringRef) key, (CFTypeRef) x, CFSTR (APP_PREFS), + CFPreferencesSetValue ((CFStringRef) key, (CFTypeRef) x, app_prefs_domain_cfstr, kCFPreferencesCurrentUser, kCFPreferencesAnyHost); CFRelease (x); @@ -569,7 +652,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) { x = CFNumberCreate (NULL, kCFNumberFloatType, &value); - CFPreferencesSetValue ((CFStringRef) key, (CFTypeRef) x, CFSTR (APP_PREFS), + CFPreferencesSetValue ((CFStringRef) key, (CFTypeRef) x, app_prefs_domain_cfstr, kCFPreferencesCurrentUser, kCFPreferencesAnyHost); CFRelease (x); @@ -577,8 +660,8 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) { - (void) prefs_set_boolean:(NSString *)key value:(int)value { CFPreferencesSetValue ((CFStringRef) key, - (CFTypeRef) value ? kCFBooleanTrue - : kCFBooleanFalse, CFSTR (APP_PREFS), + (CFTypeRef) (value ? kCFBooleanTrue + : kCFBooleanFalse), app_prefs_domain_cfstr, kCFPreferencesCurrentUser, kCFPreferencesAnyHost); } @@ -589,14 +672,14 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) { cfarray = nsarray_to_cfarray (value); CFPreferencesSetValue ((CFStringRef) key, (CFTypeRef) cfarray, - CFSTR (APP_PREFS), + app_prefs_domain_cfstr, kCFPreferencesCurrentUser, kCFPreferencesAnyHost); CFRelease (cfarray); } - (void) prefs_set_string:(NSString *)key value:(NSString *)value { CFPreferencesSetValue ((CFStringRef) key, (CFTypeRef) value, - CFSTR (APP_PREFS), kCFPreferencesCurrentUser, + app_prefs_domain_cfstr, kCFPreferencesCurrentUser, kCFPreferencesAnyHost); } @@ -606,55 +689,65 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) { - (void) read_defaults { + NSString *nsstr; const char *tem; quartzUseSysBeep = [self prefs_get_boolean:@PREFS_SYSBEEP - default:quartzUseSysBeep]; + default:quartzUseSysBeep]; quartzEnableRootless = [self prefs_get_boolean:@PREFS_ROOTLESS - default:quartzEnableRootless]; -#ifdef DARWIN_DDX_MISSING + default:quartzEnableRootless]; + quartzFullscreenMenu = [self prefs_get_boolean:@PREFS_FULLSCREEN_MENU + default:quartzFullscreenMenu]; quartzFullscreenDisableHotkeys = ![self prefs_get_boolean: - @PREFS_FULLSCREEN_HOTKEYS default: - !quartzFullscreenDisableHotkeys]; - quartzXpluginOptions = [self prefs_get_integer:@PREFS_XP_OPTIONS - default:quartzXpluginOptions]; -#endif + @PREFS_FULLSCREEN_HOTKEYS default:!quartzFullscreenDisableHotkeys]; darwinFakeButtons = [self prefs_get_boolean:@PREFS_FAKEBUTTONS - default:darwinFakeButtons]; + default:darwinFakeButtons]; if (darwinFakeButtons) { - const char *fake2, *fake3; - - fake2 = [self prefs_get_string:@PREFS_FAKE_BUTTON2 default:NULL]; - fake3 = [self prefs_get_string:@PREFS_FAKE_BUTTON3 default:NULL]; - - if (fake2 != NULL) darwinFakeMouse2Mask = DarwinParseModifierList(fake2); - if (fake3 != NULL) darwinFakeMouse3Mask = DarwinParseModifierList(fake3); + const char *fake2, *fake3; + + fake2 = [self prefs_get_string:@PREFS_FAKE_BUTTON2 default:NULL]; + fake3 = [self prefs_get_string:@PREFS_FAKE_BUTTON3 default:NULL]; + + if (fake2 != NULL) darwinFakeMouse2Mask = DarwinParseModifierList(fake2, TRUE); + if (fake3 != NULL) darwinFakeMouse3Mask = DarwinParseModifierList(fake3, TRUE); } + + tem = [self prefs_get_string:@PREFS_APPKIT_MODIFIERS default:NULL]; + if (tem != NULL) darwinAppKitModMask = DarwinParseModifierList(tem, TRUE); + tem = [self prefs_get_string:@PREFS_WINDOW_ITEM_MODIFIERS default:NULL]; + if (tem != NULL) { + windowItemModMask = DarwinParseModifierList(tem, FALSE); + } else { + nsstr = NSLocalizedString (@"window item modifiers", @"window item modifiers"); + if(nsstr != NULL) { + tem = [nsstr UTF8String]; + if((tem != NULL) && strcmp(tem, "window item modifiers")) { + windowItemModMask = DarwinParseModifierList(tem, FALSE); + } + } + } + X11EnableKeyEquivalents = [self prefs_get_boolean:@PREFS_KEYEQUIVS - default:X11EnableKeyEquivalents]; + default:X11EnableKeyEquivalents]; darwinSyncKeymap = [self prefs_get_boolean:@PREFS_SYNC_KEYMAP - default:darwinSyncKeymap]; - - tem = [self prefs_get_string:@PREFS_KEYMAP_FILE default:NULL]; - if (tem != NULL) darwinKeymapFile = strdup (tem); - else darwinKeymapFile = NULL; - + default:darwinSyncKeymap]; + darwinDesiredDepth = [self prefs_get_integer:@PREFS_DEPTH - default:darwinDesiredDepth]; - - enable_stereo = [self prefs_get_boolean:@PREFS_ENABLE_STEREO - default:false]; + default:darwinDesiredDepth]; + + noTestExtensions = ![self prefs_get_boolean:@PREFS_TEST_EXTENSIONS + default:FALSE]; } /* This will end up at the end of the responder chain. */ - (void) copy:sender { - QuartzMessageServerThread (kXDarwinPasteboardNotify, 1, + DarwinSendDDXEvent(kXquartzPasteboardNotify, 1, AppleWMCopyToPasteboard); } -- (BOOL) x_active { +- (OSX_BOOL) x_active { return _x_active; } @@ -741,19 +834,6 @@ void X11ApplicationShowHideMenubar (int state) { [n release]; } -static void * create_thread (void *func, void *arg) { - pthread_attr_t attr; - pthread_t tid; - - pthread_attr_init (&attr); - pthread_attr_setscope (&attr, PTHREAD_SCOPE_SYSTEM); - pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED); - pthread_create (&tid, &attr, func, arg); - pthread_attr_destroy (&attr); - - return (void *) tid; -} - static void check_xinitrc (void) { char *tem, buf[1024]; NSString *msg; @@ -768,26 +848,23 @@ static void check_xinitrc (void) { if (access (buf, F_OK) != 0) goto done; - /* FIXME: put localized strings into Resources/English.lproj */ - msg = NSLocalizedString (@"You have an existing ~/.xinitrc file.\n\n\ Windows displayed by X11 applications may not have titlebars, or may look \ different to windows displayed by native applications.\n\n\ Would you like to move aside the existing file and use the standard X11 \ -environment?", @"Startup xinitrc dialog"); - - if (NSRunAlertPanel (nil, msg, NSLocalizedString (@"Yes", @""), - NSLocalizedString (@"No", @""), nil) - == NSAlertDefaultReturn) { - char buf2[1024]; - int i = -1; - - snprintf (buf2, sizeof (buf2), "%s.old", buf); +environment the next time you start X11?", @"Startup xinitrc dialog"); + + if(NSAlertDefaultReturn == NSRunAlertPanel (nil, msg, NSLocalizedString (@"Yes", @""), + NSLocalizedString (@"No", @""), nil)) { + char buf2[1024]; + int i = -1; - for (i = 1; access (buf2, F_OK) == 0; i++) - snprintf (buf2, sizeof (buf2), "%s.old.%d", buf, i); + snprintf (buf2, sizeof (buf2), "%s.old", buf); - rename (buf, buf2); + for(i = 1; access (buf2, F_OK) == 0; i++) + snprintf (buf2, sizeof (buf2), "%s.old.%d", buf, i); + + rename (buf, buf2); } done: @@ -795,8 +872,9 @@ environment?", @"Startup xinitrc dialog"); [X11App prefs_synchronize]; } -void X11ApplicationMain (int argc, const char **argv, void (*server_thread) (void *), void *server_arg) { +void X11ApplicationMain (int argc, char **argv, char **envp) { NSAutoreleasePool *pool; + int *p; #ifdef DEBUG while (access ("/tmp/x11-block", F_OK) == 0) sleep (1); @@ -805,12 +883,14 @@ void X11ApplicationMain (int argc, const char **argv, void (*server_thread) (voi pool = [[NSAutoreleasePool alloc] init]; X11App = (X11Application *) [X11Application sharedApplication]; init_ports (); + + app_prefs_domain_cfstr = (CFStringRef)[[NSBundle mainBundle] bundleIdentifier]; + [NSApp read_defaults]; [NSBundle loadNibNamed:@"main" owner:NSApp]; [[NSNotificationCenter defaultCenter] addObserver:NSApp selector:@selector (became_key:) name:NSWindowDidBecomeKeyNotification object:nil]; - check_xinitrc (); /* * The xpr Quartz mode is statically linked into this server. @@ -821,102 +901,255 @@ void X11ApplicationMain (int argc, const char **argv, void (*server_thread) (voi /* Calculate the height of the menubar so we can avoid it. */ aquaMenuBarHeight = NSHeight([[NSScreen mainScreen] frame]) - NSMaxY([[NSScreen mainScreen] visibleFrame]); - - if (!create_thread (server_thread, server_arg)) { - ErrorF("can't create secondary thread\n"); - exit (1); - } - QuartzMoveToForeground(); + /* Set the key layout seed before we start the server */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 + last_key_layout = TISCopyCurrentKeyboardLayoutInputSource(); + if(!last_key_layout) + fprintf(stderr, "X11ApplicationMain: Unable to determine TISCopyCurrentKeyboardLayoutInputSource() at startup.\n"); +#else + KLGetCurrentKeyboardLayout(&last_key_layout); + if(!last_key_layout) + fprintf(stderr, "X11ApplicationMain: Unable to determine KLGetCurrentKeyboardLayout() at startup.\n"); +#endif + + memset(keyInfo.keyMap, 0, sizeof(keyInfo.keyMap)); + if (!QuartzReadSystemKeymap(&keyInfo)) { + fprintf(stderr, "X11ApplicationMain: Could not build a valid keymap.\n"); + } + + for(p=darwin_modifier_mask_list, modifierFlagsMask=0; *p; p++) { + modifierFlagsMask |= *p; + } + + /* Tell the server thread that it can proceed */ + QuartzInitServer(argc, argv, envp); + + /* This must be done after QuartzInitServer because it can result in + * an mieqEnqueue() - + */ + check_xinitrc(); + + if(!xpbproxy_init()) + fprintf(stderr, "Error initializing xpbproxy\n"); + [NSApp run]; /* not reached */ } -/* event conversion */ - -static inline unsigned short -convert_flags (unsigned int nsflags) { - unsigned int xflags = 0; - - if (nsflags == ~0) return 0xffff; - - if (nsflags & NSAlphaShiftKeyMask) xflags |= LockMask; - if (nsflags & NSShiftKeyMask) xflags |= ShiftMask; - if (nsflags & NSControlKeyMask) xflags |= ControlMask; - if (nsflags & NSAlternateKeyMask) xflags |= Mod1Mask; - if (nsflags & NSCommandKeyMask) xflags |= Mod2Mask; - /* FIXME: secondaryfn? */ - - return xflags; +@implementation X11Application (Private) + +#ifdef NX_DEVICELCMDKEYMASK +/* This is to workaround a bug in the VNC server where we sometimes see the L + * modifier and sometimes see no "side" + */ +static inline int ensure_flag(int flags, int device_independent, int device_dependents, int device_dependent_default) { + if( (flags & device_independent) && + !(flags & device_dependents)) + flags |= device_dependent_default; + return flags; } +#endif - -// This code should probably be merged with that in XDarwin's XServer.m - BB -static void send_nsevent (NSEventType type, NSEvent *e) { - // static unsigned int button_state = 0; +- (void) sendX11NSEvent:(NSEvent *)e { NSRect screen; NSPoint location; NSWindow *window; - int pointer_x, pointer_y, ev_button, ev_type; - // int num_events=0, i=0, state; - // xEvent xe; - - /* convert location to global top-left coordinates */ + int ev_button, ev_type; + float pointer_x, pointer_y, pressure, tilt_x, tilt_y; + DeviceIntPtr pDev; + int modifierFlags; + + /* convert location to be relative to top-left of primary display */ location = [e locationInWindow]; window = [e window]; screen = [[[NSScreen screens] objectAtIndex:0] frame]; - + if (window != nil) { - NSRect frame = [window frame]; - pointer_x = location.x + frame.origin.x; - pointer_y = (((screen.origin.y + screen.size.height) - - location.y) - frame.origin.y); + NSRect frame = [window frame]; + pointer_x = location.x + frame.origin.x; + pointer_y = (screen.origin.y + screen.size.height) + - (location.y + frame.origin.y); } else { - pointer_x = location.x; - pointer_y = (screen.origin.y + screen.size.height) - location.y; + pointer_x = location.x; + pointer_y = (screen.origin.y + screen.size.height) - location.y; } + + /* Setup our valuators. These will range from 0 to 1 */ + pressure = 0; + tilt_x = 0; + tilt_y = 0; - pointer_y -= aquaMenuBarHeight; - // state = convert_flags ([e modifierFlags]); + modifierFlags = [e modifierFlags]; - switch (type) { - case NSLeftMouseDown: ev_button=1; ev_type=ButtonPress; goto handle_mouse; - case NSOtherMouseDown: ev_button=2; ev_type=ButtonPress; goto handle_mouse; - case NSRightMouseDown: ev_button=3; ev_type=ButtonPress; goto handle_mouse; - case NSLeftMouseUp: ev_button=1; ev_type=ButtonRelease; goto handle_mouse; - case NSOtherMouseUp: ev_button=2; ev_type=ButtonRelease; goto handle_mouse; - case NSRightMouseUp: ev_button=3; ev_type=ButtonRelease; goto handle_mouse; - case NSLeftMouseDragged: ev_button=1; ev_type=MotionNotify; goto handle_mouse; - case NSOtherMouseDragged: ev_button=2; ev_type=MotionNotify; goto handle_mouse; - case NSRightMouseDragged: ev_button=3; ev_type=MotionNotify; goto handle_mouse; - case NSMouseMoved: ev_button=0; ev_type=MotionNotify; goto handle_mouse; - handle_mouse: - - /* I'm not sure the below code is necessary or useful (-bb) - if(ev_type==ButtonPress) { - if (!quartzProcs->IsX11Window([e window], [e windowNumber])) { - fprintf(stderr, "Dropping event because it's not a window\n"); - break; - } - button_state |= (1 << ev_button); - DarwinSendPointerEvents(ev_type, ev_button, pointer_x, pointer_y); - } else if (ev_type==ButtonRelease && (button_state & (1 << ev_button)) == 0) break; - */ - DarwinSendPointerEvents(ev_type, ev_button, pointer_x, pointer_y); - break; - case NSScrollWheel: - DarwinSendScrollEvents([e deltaY], pointer_x, pointer_y); - break; - - case NSKeyDown: // do we need to translate these keyCodes? - case NSKeyUp: - DarwinSendKeyboardEvents((type == NSKeyDown)?KeyPress:KeyRelease, [e keyCode]); - break; +#ifdef NX_DEVICELCMDKEYMASK + /* This is to workaround a bug in the VNC server where we sometimes see the L + * modifier and sometimes see no "side" + */ + modifierFlags = ensure_flag(modifierFlags, NX_CONTROLMASK, NX_DEVICELCTLKEYMASK | NX_DEVICERCTLKEYMASK, NX_DEVICELCTLKEYMASK); + modifierFlags = ensure_flag(modifierFlags, NX_SHIFTMASK, NX_DEVICELSHIFTKEYMASK | NX_DEVICERSHIFTKEYMASK, NX_DEVICELSHIFTKEYMASK); + modifierFlags = ensure_flag(modifierFlags, NX_COMMANDMASK, NX_DEVICELCMDKEYMASK | NX_DEVICERCMDKEYMASK, NX_DEVICELCMDKEYMASK); + modifierFlags = ensure_flag(modifierFlags, NX_ALTERNATEMASK, NX_DEVICELALTKEYMASK | NX_DEVICERALTKEYMASK, NX_DEVICELALTKEYMASK); +#endif + + modifierFlags &= modifierFlagsMask; - case NSFlagsChanged: - DarwinUpdateModKeys([e modifierFlags]); - break; - default: break; /* for gcc */ - } + /* We don't receive modifier key events while out of focus, and 3button + * emulation mucks this up, so we need to check our modifier flag state + * on every event... ugg + */ + + if(darwin_modifier_flags != modifierFlags) + DarwinUpdateModKeys(modifierFlags); + + switch ([e type]) { + case NSLeftMouseDown: ev_button=1; ev_type=ButtonPress; goto handle_mouse; + case NSOtherMouseDown: ev_button=2; ev_type=ButtonPress; goto handle_mouse; + case NSRightMouseDown: ev_button=3; ev_type=ButtonPress; goto handle_mouse; + case NSLeftMouseUp: ev_button=1; ev_type=ButtonRelease; goto handle_mouse; + case NSOtherMouseUp: ev_button=2; ev_type=ButtonRelease; goto handle_mouse; + case NSRightMouseUp: ev_button=3; ev_type=ButtonRelease; goto handle_mouse; + case NSLeftMouseDragged: ev_button=1; ev_type=MotionNotify; goto handle_mouse; + case NSOtherMouseDragged: ev_button=2; ev_type=MotionNotify; goto handle_mouse; + case NSRightMouseDragged: ev_button=3; ev_type=MotionNotify; goto handle_mouse; + case NSMouseMoved: ev_button=0; ev_type=MotionNotify; goto handle_mouse; + case NSTabletPoint: ev_button=0; ev_type=MotionNotify; goto handle_mouse; + + handle_mouse: + pDev = darwinPointer; + + /* NSTabletPoint can have no subtype */ + if([e type] != NSTabletPoint && + [e subtype] == NSTabletProximityEventSubtype) { + switch([e pointingDeviceType]) { + case NSEraserPointingDevice: + darwinTabletCurrent=darwinTabletEraser; + break; + case NSPenPointingDevice: + darwinTabletCurrent=darwinTabletStylus; + break; + case NSCursorPointingDevice: + case NSUnknownPointingDevice: + default: + darwinTabletCurrent=darwinTabletCursor; + break; + } + + /* NSTabletProximityEventSubtype doesn't encode pressure ant tilt + * So we just pretend the motion was caused by the mouse. Hopefully + * we'll have a better solution for this in the future (like maybe + * NSTabletProximityEventSubtype will come from NSTabletPoint + * rather than NSMouseMoved. + pressure = [e pressure]; + tilt_x = [e tilt].x; + tilt_y = [e tilt].y; + pDev = darwinTabletCurrent; + */ + + DarwinSendProximityEvents([e isEnteringProximity]?ProximityIn:ProximityOut, + pointer_x, pointer_y); + } + + if ([e type] == NSTabletPoint || [e subtype] == NSTabletPointEventSubtype) { + pressure = [e pressure]; + tilt_x = [e tilt].x; + tilt_y = [e tilt].y; + + pDev = darwinTabletCurrent; + } + +/* Older libXplugin (Tiger/"Stock" Leopard) aren't thread safe, so we can't call xp_find_window from the Appkit thread */ +#ifdef XPLUGIN_VERSION +#if XPLUGIN_VERSION > 0 + if(!quartzServerVisible) { + xp_window_id wid; + + /* Sigh. Need to check that we're really over one of + * our windows. (We need to receive pointer events while + * not in the foreground, but we don't want to receive them + * when another window is over us or we might show a tooltip) + */ + + wid = 0; + + if (xp_find_window(pointer_x, pointer_y, 0, &wid) == XP_Success && + wid == 0) + return; + } +#endif +#endif + + DarwinSendPointerEvents(pDev, ev_type, ev_button, pointer_x, pointer_y, + pressure, tilt_x, tilt_y); + + break; + + case NSTabletProximity: + switch([e pointingDeviceType]) { + case NSEraserPointingDevice: + darwinTabletCurrent=darwinTabletEraser; + break; + case NSPenPointingDevice: + darwinTabletCurrent=darwinTabletStylus; + break; + case NSCursorPointingDevice: + case NSUnknownPointingDevice: + default: + darwinTabletCurrent=darwinTabletCursor; + break; + } + + DarwinSendProximityEvents([e isEnteringProximity]?ProximityIn:ProximityOut, + pointer_x, pointer_y); + break; + + case NSScrollWheel: + DarwinSendScrollEvents([e deltaX], [e deltaY], pointer_x, pointer_y, + pressure, tilt_x, tilt_y); + break; + + case NSKeyDown: case NSKeyUp: + if(darwinSyncKeymap) { +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 + TISInputSourceRef key_layout = TISCopyCurrentKeyboardLayoutInputSource(); + TISInputSourceRef clear; + if (CFEqual(key_layout, last_key_layout)) { + CFRelease(key_layout); + } else { + /* Swap/free thread-safely */ + clear = last_key_layout; + last_key_layout = key_layout; + CFRelease(clear); +#else + KeyboardLayoutRef key_layout; + KLGetCurrentKeyboardLayout(&key_layout); + if(key_layout != last_key_layout) { + last_key_layout = key_layout; +#endif + + /* Update keyInfo */ + pthread_mutex_lock(&keyInfo_mutex); + memset(keyInfo.keyMap, 0, sizeof(keyInfo.keyMap)); + if (!QuartzReadSystemKeymap(&keyInfo)) { + fprintf(stderr, "sendX11NSEvent: Could not build a valid keymap.\n"); + } + pthread_mutex_unlock(&keyInfo_mutex); + + /* Tell server thread to deal with new keyInfo */ + DarwinSendDDXEvent(kXquartzReloadKeymap, 0); + } + } + + /* Avoid stuck keys on context switch */ + if(keyState[[e keyCode]] == [e type]) + return; + keyState[[e keyCode]] = [e type]; + + DarwinSendKeyboardEvents(([e type] == NSKeyDown) ? KeyPress : KeyRelease, [e keyCode]); + break; + + default: break; /* for gcc */ + } } +@end diff --git a/xorg-server/hw/xquartz/X11Controller.h b/xorg-server/hw/xquartz/X11Controller.h index 64d5cd1ce..bb9adb1ce 100644 --- a/xorg-server/hw/xquartz/X11Controller.h +++ b/xorg-server/hw/xquartz/X11Controller.h @@ -32,7 +32,7 @@ #if __OBJC__ -#import +#include "sanitizedCocoa.h" #include "xpr/x-list.h" @interface X11Controller : NSObject @@ -41,12 +41,22 @@ IBOutlet NSButton *fake_buttons; IBOutlet NSButton *enable_fullscreen; + IBOutlet NSButton *enable_fullscreen_menu; IBOutlet NSButton *use_sysbeep; IBOutlet NSButton *enable_keyequivs; IBOutlet NSButton *sync_keymap; IBOutlet NSButton *click_through; + IBOutlet NSButton *focus_follows_mouse; + IBOutlet NSButton *focus_on_new_window; IBOutlet NSButton *enable_auth; IBOutlet NSButton *enable_tcp; + IBOutlet NSButton *sync_pasteboard; + IBOutlet NSButton *sync_pasteboard_to_clipboard; + IBOutlet NSButton *sync_pasteboard_to_primary; + IBOutlet NSButton *sync_clipboard_to_pasteboard; + IBOutlet NSButton *sync_primary_immediately; + IBOutlet NSTextField *sync_text1; + IBOutlet NSTextField *sync_text2; IBOutlet NSPopUpButton *depth; IBOutlet NSMenuItem *x11_about_item; @@ -54,6 +64,7 @@ IBOutlet NSMenuItem *dock_window_separator; IBOutlet NSMenuItem *apps_separator; IBOutlet NSMenuItem *toggle_fullscreen_item; + IBOutlet NSMenuItem *copy_menu_item; IBOutlet NSMenu *dock_apps_menu; IBOutlet NSTableView *apps_table; @@ -65,18 +76,17 @@ int checked_window_item; x_list *pending_apps; - BOOL finished_launching; - BOOL can_quit; + OSX_BOOL finished_launching; + OSX_BOOL can_quit; } - (void) set_window_menu:(NSArray *)list; - (void) set_window_menu_check:(NSNumber *)n; - (void) set_apps_menu:(NSArray *)list; -- (void) set_can_quit:(BOOL)state; +- (void) set_can_quit:(OSX_BOOL)state; - (void) server_ready; - (IBAction) apps_table_show:(id)sender; -- (IBAction) apps_table_cancel:(id)sender; - (IBAction) apps_table_done:(id)sender; - (IBAction) apps_table_new:(id)sender; - (IBAction) apps_table_duplicate:(id)sender; @@ -98,6 +108,6 @@ #endif /* __OBJC__ */ -void X11ControllerMain(int argc, const char **argv, void (*server_thread) (void *), void *server_arg); +void X11ControllerMain(int argc, char **argv, char **envp); #endif /* X11CONTROLLER_H */ diff --git a/xorg-server/hw/xquartz/X11Controller.m b/xorg-server/hw/xquartz/X11Controller.m index 5111eafc3..adf861ca9 100644 --- a/xorg-server/hw/xquartz/X11Controller.m +++ b/xorg-server/hw/xquartz/X11Controller.m @@ -1,6 +1,6 @@ /* X11Controller.m -- connect the IB ui, also the NSApp delegate - Copyright (c) 2002-2007 Apple Inc. All rights reserved. + Copyright (c) 2002-2008 Apple Inc. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files @@ -27,27 +27,25 @@ promote the sale, use or other dealings in this Software without prior written authorization. */ +#include "sanitizedCarbon.h" +#include + #ifdef HAVE_DIX_CONFIG_H #include #endif -#define DEFAULT_PATH "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11/bin" - #include "quartzCommon.h" #import "X11Controller.h" #import "X11Application.h" -#import -/* ouch! */ -#define BOOL X_BOOL #include "opaque.h" -# include "darwin.h" -# include "quartz.h" -# define _APPLEWM_SERVER_ -# include "X11/extensions/applewm.h" -# include "applewmExt.h" -#undef BOOL +#include "darwin.h" +#include "darwinEvents.h" +#include "quartz.h" +#define _APPLEWM_SERVER_ +#include "X11/extensions/applewm.h" +#include "applewmExt.h" #include #include @@ -55,6 +53,8 @@ #include #include +BOOL xquartz_resetenv_display = NO; + @implementation X11Controller - (void) awakeFromNib @@ -97,13 +97,20 @@ [self set_apps_menu:array]; } + + [[NSNotificationCenter defaultCenter] + addObserver: self + selector: @selector(apps_table_done:) + name: NSWindowWillCloseNotification + object: [apps_table window]]; + } - (void) item_selected:sender { [NSApp activateIgnoringOtherApps:YES]; - QuartzMessageServerThread (kXDarwinControllerNotify, 2, + DarwinSendDDXEvent(kXquartzControllerNotify, 2, AppleWMWindowMenuItem, [sender tag]); } @@ -130,7 +137,7 @@ NSMenu *menu; NSMenuItem *item; int first, count, i; - + menu = [window_separator menu]; first = [menu indexOfItem:window_separator] + 1; count = [list count]; @@ -140,17 +147,30 @@ name = [[list objectAtIndex:i] objectAtIndex:0]; shortcut = [[list objectAtIndex:i] objectAtIndex:1]; - + + if(windowItemModMask == 0 || windowItemModMask == -1) + shortcut = @""; + item = (NSMenuItem *) [menu addItemWithTitle:name action:@selector (item_selected:) keyEquivalent:shortcut]; +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 + [item setKeyEquivalentModifierMask:(NSUInteger) windowItemModMask]; +#else + [item setKeyEquivalentModifierMask:windowItemModMask]; +#endif [item setTarget:self]; [item setTag:i]; [item setEnabled:YES]; - + item = (NSMenuItem *) [dock_menu insertItemWithTitle:name action:@selector (item_selected:) keyEquivalent:shortcut atIndex:i]; +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 + [item setKeyEquivalentModifierMask:(NSUInteger) windowItemModMask]; +#else + [item setKeyEquivalentModifierMask:windowItemModMask]; +#endif [item setTarget:self]; [item setTag:i]; [item setEnabled:YES]; @@ -254,7 +274,7 @@ [self remove_window_menu]; [self install_window_menu:list]; - QuartzMessageServerThread (kXDarwinControllerNotify, 1, + DarwinSendDDXEvent(kXquartzControllerNotify, 1, AppleWMWindowMenuNotify); } @@ -294,76 +314,59 @@ - (void) launch_client:(NSString *)filename { - const char *command = [filename UTF8String]; - const char *argv[7]; - int child1, child2 = 0; - int status; - - argv[0] = "/usr/bin/login"; - argv[1] = "-fp"; - argv[2] = getlogin(); - argv[3] = [X11App prefs_get_string:@PREFS_LOGIN_SHELL default:"/bin/sh"]; - argv[4] = "-c"; - argv[5] = command; - argv[6] = NULL; - - /* Do the fork-twice trick to avoid having to reap zombies */ + int child1, child2 = 0; + int status; + const char *newargv[4]; + char buf[128]; + char *s; - child1 = fork(); + newargv[0] = [X11App prefs_get_string:@PREFS_LOGIN_SHELL default:"/bin/sh"]; + newargv[1] = "-c"; + newargv[2] = [filename UTF8String]; + newargv[3] = NULL; - switch (child1) { - case -1: /* error */ - break; + s = getenv("DISPLAY"); + if (xquartz_resetenv_display || s == NULL || s[0] == 0) { + snprintf(buf, sizeof(buf), ":%s", display); + setenv("DISPLAY", buf, TRUE); + } + + /* Do the fork-twice trick to avoid having to reap zombies */ + child1 = fork(); + switch (child1) { + case -1: /* error */ + break; - case 0: /* child1 */ - child2 = fork(); + case 0: /* child1 */ + child2 = fork(); - switch (child2) { - int max_files, i; - char buf[1024], *temp; - - case -1: /* error */ - _exit(1); - - case 0: /* child2 */ - /* close all open files except for standard streams */ - max_files = sysconf(_SC_OPEN_MAX); - for (i = 3; i < max_files; i++) close(i); - - /* ensure stdin is on /dev/null */ - close(0); - open("/dev/null", O_RDONLY); - - /* Setup environment */ - temp = getenv("DISPLAY"); - if (temp == NULL || temp[0] == 0) { - snprintf(buf, sizeof(buf), ":%s", display); - setenv("DISPLAY", buf, TRUE); - } - - temp = getenv("PATH"); - if (temp == NULL || temp[0] == 0) - setenv ("PATH", DEFAULT_PATH, TRUE); - else if (strnstr(temp, "/usr/X11/bin", sizeof(temp)) == NULL) { - snprintf(buf, sizeof(buf), "%s:/usr/X11/bin", temp); - setenv("PATH", buf, TRUE); - } - /* cd $HOME */ - temp = getenv("HOME"); - if (temp != NULL && temp[0]!=0) chdir(temp); - - execvp(argv[0], (char **const) argv); - - _exit(2); - - default: /* parent (child1) */ - _exit(0); - } - break; + switch (child2) { + int max_files, i; + + case -1: /* error */ + _exit(1); + + case 0: /* child2 */ + /* close all open files except for standard streams */ + max_files = sysconf(_SC_OPEN_MAX); + for(i = 3; i < max_files; i++) + close(i); + + /* ensure stdin is on /dev/null */ + close(0); + open("/dev/null", O_RDONLY); + + execvp(newargv[0], (char **const) newargv); + _exit(2); + + default: /* parent (child1) */ + _exit(0); + } + break; - default: /* parent */ - waitpid(child1, &status, 0); - } + default: /* parent */ + waitpid(child1, &status, 0); + } } - (void) app_selected:sender @@ -383,12 +386,14 @@ - (IBAction) apps_table_show:sender { NSArray *columns; + NSMutableArray *oldapps = nil; - if (table_apps == nil) { - table_apps = [[NSMutableArray alloc] initWithCapacity:1]; - - if (apps != nil)[table_apps addObjectsFromArray:apps]; - } + if (table_apps != nil) + oldapps = table_apps; + + table_apps = [[NSMutableArray alloc] initWithCapacity:1]; + if(apps != nil) + [table_apps addObjectsFromArray:apps]; columns = [apps_table tableColumns]; [[columns objectAtIndex:0] setIdentifier:@"0"]; @@ -399,15 +404,9 @@ [apps_table selectRow:0 byExtendingSelection:NO]; [[apps_table window] makeKeyAndOrderFront:sender]; -} - -- (IBAction) apps_table_cancel:sender -{ - [[apps_table window] orderOut:sender]; [apps_table reloadData]; - - [table_apps release]; - table_apps = nil; + if(oldapps != nil) + [oldapps release]; } - (IBAction) apps_table_done:sender @@ -539,20 +538,20 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row - (void) hide_window:sender { if ([X11App x_active]) - QuartzMessageServerThread (kXDarwinControllerNotify, 1, AppleWMHideWindow); + DarwinSendDDXEvent(kXquartzControllerNotify, 1, AppleWMHideWindow); else NSBeep (); /* FIXME: something here */ } - (IBAction)bring_to_front:sender { - QuartzMessageServerThread(kXDarwinControllerNotify, 1, AppleWMBringAllToFront); + DarwinSendDDXEvent(kXquartzControllerNotify, 1, AppleWMBringAllToFront); } - (IBAction)close_window:sender { if ([X11App x_active]) - QuartzMessageServerThread (kXDarwinControllerNotify, 1, AppleWMCloseWindow); + DarwinSendDDXEvent(kXquartzControllerNotify, 1, AppleWMCloseWindow); else [[NSApp keyWindow] performClose:sender]; } @@ -560,7 +559,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row - (IBAction)minimize_window:sender { if ([X11App x_active]) - QuartzMessageServerThread (kXDarwinControllerNotify, 1, AppleWMMinimizeWindow); + DarwinSendDDXEvent(kXquartzControllerNotify, 1, AppleWMMinimizeWindow); else [[NSApp keyWindow] performMiniaturize:sender]; } @@ -568,101 +567,145 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row - (IBAction)zoom_window:sender { if ([X11App x_active]) - QuartzMessageServerThread (kXDarwinControllerNotify, 1, AppleWMZoomWindow); + DarwinSendDDXEvent(kXquartzControllerNotify, 1, AppleWMZoomWindow); else [[NSApp keyWindow] performZoom:sender]; } - (IBAction) next_window:sender { - QuartzMessageServerThread (kXDarwinControllerNotify, 1, AppleWMNextWindow); + DarwinSendDDXEvent(kXquartzControllerNotify, 1, AppleWMNextWindow); } - (IBAction) previous_window:sender { - QuartzMessageServerThread (kXDarwinControllerNotify, 1, AppleWMPreviousWindow); + DarwinSendDDXEvent(kXquartzControllerNotify, 1, AppleWMPreviousWindow); } -- (IBAction) enable_fullscreen_changed:sender -{ - int value = ![enable_fullscreen intValue]; - -#ifdef DARWIN_DDX_MISSING - QuartzMessageServerThread (kXDarwinSetRootless, 1, value); -#endif - - [NSApp prefs_set_boolean:@PREFS_ROOTLESS value:value]; - [NSApp prefs_synchronize]; +- (IBAction) enable_fullscreen_changed:sender { + int value = ![enable_fullscreen intValue]; + + [enable_fullscreen_menu setEnabled:!value]; + + DarwinSendDDXEvent(kXquartzSetRootless, 1, value); + + [NSApp prefs_set_boolean:@PREFS_ROOTLESS value:value]; + [NSApp prefs_synchronize]; } - (IBAction) toggle_fullscreen:sender { -#ifdef DARWIN_DDX_MISSING - QuartzMessageServerThread (kXDarwinToggleFullscreen, 0); -#endif + DarwinSendDDXEvent(kXquartzToggleFullscreen, 0); } -- (void) set_can_quit:(BOOL)state +- (void) set_can_quit:(OSX_BOOL)state { can_quit = state; } - (IBAction)prefs_changed:sender { - darwinFakeButtons = [fake_buttons intValue]; - quartzUseSysBeep = [use_sysbeep intValue]; - X11EnableKeyEquivalents = [enable_keyequivs intValue]; - darwinSyncKeymap = [sync_keymap intValue]; - - /* after adding prefs here, also add to [X11Application read_defaults] - and below */ - - [NSApp prefs_set_boolean:@PREFS_FAKEBUTTONS value:darwinFakeButtons]; - [NSApp prefs_set_boolean:@PREFS_SYSBEEP value:quartzUseSysBeep]; - [NSApp prefs_set_boolean:@PREFS_KEYEQUIVS value:X11EnableKeyEquivalents]; - [NSApp prefs_set_boolean:@PREFS_SYNC_KEYMAP value:darwinSyncKeymap]; - [NSApp prefs_set_boolean:@PREFS_QUARTZ_WM_CLICK_THROUGH value:[click_through intValue]]; - [NSApp prefs_set_boolean:@PREFS_NO_AUTH value:![enable_auth intValue]]; - [NSApp prefs_set_boolean:@PREFS_NO_TCP value:![enable_tcp intValue]]; - [NSApp prefs_set_integer:@PREFS_DEPTH value:[depth selectedTag]]; - - [NSApp prefs_synchronize]; + darwinFakeButtons = [fake_buttons intValue]; + quartzUseSysBeep = [use_sysbeep intValue]; + X11EnableKeyEquivalents = [enable_keyequivs intValue]; + darwinSyncKeymap = [sync_keymap intValue]; + quartzFullscreenMenu = [enable_fullscreen_menu intValue]; + + /* after adding prefs here, also add to [X11Application read_defaults] + and prefs_show */ + + [NSApp prefs_set_boolean:@PREFS_FAKEBUTTONS value:darwinFakeButtons]; + [NSApp prefs_set_boolean:@PREFS_SYSBEEP value:quartzUseSysBeep]; + [NSApp prefs_set_boolean:@PREFS_KEYEQUIVS value:X11EnableKeyEquivalents]; + [NSApp prefs_set_boolean:@PREFS_SYNC_KEYMAP value:darwinSyncKeymap]; + [NSApp prefs_set_boolean:@PREFS_FULLSCREEN_MENU value:quartzFullscreenMenu]; + [NSApp prefs_set_boolean:@PREFS_CLICK_THROUGH value:[click_through intValue]]; + [NSApp prefs_set_boolean:@PREFS_FFM value:[focus_follows_mouse intValue]]; + [NSApp prefs_set_boolean:@PREFS_FOCUS_ON_NEW_WINDOW value:[focus_on_new_window intValue]]; + [NSApp prefs_set_boolean:@PREFS_NO_AUTH value:![enable_auth intValue]]; + [NSApp prefs_set_boolean:@PREFS_NO_TCP value:![enable_tcp intValue]]; + [NSApp prefs_set_integer:@PREFS_DEPTH value:[depth selectedTag]]; + + BOOL pbproxy_active = [sync_pasteboard intValue]; + + [NSApp prefs_set_boolean:@PREFS_SYNC_PB value:pbproxy_active]; + [NSApp prefs_set_boolean:@PREFS_SYNC_PB_TO_CLIPBOARD value:[sync_pasteboard_to_clipboard intValue]]; + [NSApp prefs_set_boolean:@PREFS_SYNC_PB_TO_PRIMARY value:[sync_pasteboard_to_primary intValue]]; + [NSApp prefs_set_boolean:@PREFS_SYNC_CLIPBOARD_TO_PB value:[sync_clipboard_to_pasteboard intValue]]; + [NSApp prefs_set_boolean:@PREFS_SYNC_PRIMARY_ON_SELECT value:[sync_primary_immediately intValue]]; + + [NSApp prefs_synchronize]; + + [sync_pasteboard_to_clipboard setEnabled:pbproxy_active]; + [sync_pasteboard_to_primary setEnabled:pbproxy_active]; + [sync_clipboard_to_pasteboard setEnabled:pbproxy_active]; + [sync_primary_immediately setEnabled:pbproxy_active]; + + // setEnabled doesn't do this... + [sync_text1 setTextColor:pbproxy_active ? [NSColor controlTextColor] : [NSColor disabledControlTextColor]]; + [sync_text2 setTextColor:pbproxy_active ? [NSColor controlTextColor] : [NSColor disabledControlTextColor]]; + + DarwinSendDDXEvent(kXquartzReloadPreferences, 0); } - (IBAction) prefs_show:sender { - [fake_buttons setIntValue:darwinFakeButtons]; - [use_sysbeep setIntValue:quartzUseSysBeep]; - [enable_keyequivs setIntValue:X11EnableKeyEquivalents]; - [sync_keymap setIntValue:darwinSyncKeymap]; - [sync_keymap setEnabled:darwinKeymapFile == NULL]; - [click_through setIntValue:[NSApp prefs_get_boolean:@PREFS_QUARTZ_WM_CLICK_THROUGH default:NO]]; - - [enable_auth setIntValue:![NSApp prefs_get_boolean:@PREFS_NO_AUTH default:NO]]; - [enable_tcp setIntValue:![NSApp prefs_get_boolean:@PREFS_NO_TCP default:NO]]; - [depth selectItemAtIndex:[depth indexOfItemWithTag:[NSApp prefs_get_integer:@PREFS_DEPTH default:-1]]]; - - [enable_fullscreen setIntValue:!quartzEnableRootless]; + BOOL pbproxy_active = [NSApp prefs_get_boolean:@PREFS_SYNC_PB default:YES]; + + [fake_buttons setIntValue:darwinFakeButtons]; + [use_sysbeep setIntValue:quartzUseSysBeep]; + [enable_keyequivs setIntValue:X11EnableKeyEquivalents]; + [sync_keymap setIntValue:darwinSyncKeymap]; + [click_through setIntValue:[NSApp prefs_get_boolean:@PREFS_CLICK_THROUGH default:NO]]; + [focus_follows_mouse setIntValue:[NSApp prefs_get_boolean:@PREFS_FFM default:NO]]; + [focus_on_new_window setIntValue:[NSApp prefs_get_boolean:@PREFS_FOCUS_ON_NEW_WINDOW default:YES]]; + + [enable_auth setIntValue:![NSApp prefs_get_boolean:@PREFS_NO_AUTH default:NO]]; + [enable_tcp setIntValue:![NSApp prefs_get_boolean:@PREFS_NO_TCP default:NO]]; + + [depth selectItemAtIndex:[depth indexOfItemWithTag:[NSApp prefs_get_integer:@PREFS_DEPTH default:-1]]]; + + [sync_pasteboard setIntValue:pbproxy_active]; + [sync_pasteboard_to_clipboard setIntValue:[NSApp prefs_get_boolean:@PREFS_SYNC_PB_TO_CLIPBOARD default:YES]]; + [sync_pasteboard_to_primary setIntValue:[NSApp prefs_get_boolean:@PREFS_SYNC_PB_TO_PRIMARY default:YES]]; + [sync_clipboard_to_pasteboard setIntValue:[NSApp prefs_get_boolean:@PREFS_SYNC_CLIPBOARD_TO_PB default:YES]]; + [sync_primary_immediately setIntValue:[NSApp prefs_get_boolean:@PREFS_SYNC_PRIMARY_ON_SELECT default:NO]]; + + [sync_pasteboard_to_clipboard setEnabled:pbproxy_active]; + [sync_pasteboard_to_primary setEnabled:pbproxy_active]; + [sync_clipboard_to_pasteboard setEnabled:pbproxy_active]; + [sync_primary_immediately setEnabled:pbproxy_active]; + + // setEnabled doesn't do this... + [sync_text1 setTextColor:pbproxy_active ? [NSColor controlTextColor] : [NSColor disabledControlTextColor]]; + [sync_text2 setTextColor:pbproxy_active ? [NSColor controlTextColor] : [NSColor disabledControlTextColor]]; - [prefs_panel makeKeyAndOrderFront:sender]; + [enable_fullscreen setIntValue:!quartzEnableRootless]; + [enable_fullscreen_menu setEnabled:!quartzEnableRootless]; + [enable_fullscreen_menu setIntValue:quartzFullscreenMenu]; + + [prefs_panel makeKeyAndOrderFront:sender]; } -- (IBAction) quit:sender -{ - QuartzMessageServerThread (kXDarwinQuit, 0); +- (IBAction) quit:sender { + DarwinSendDDXEvent(kXquartzQuit, 0); } -- (IBAction) x11_help:sender -{ - AHLookupAnchor ((CFStringRef)NSLocalizedString(@"Mac Help", no comment), CFSTR ("mchlp2276")); +- (IBAction) x11_help:sender { +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 + AHLookupAnchor((CFStringRef)NSLocalizedString(@"Mac Help", no comment), CFSTR("mchlp2276")); +#else + AHLookupAnchor(CFSTR("com.apple.machelp"), CFSTR("mchlp2276")); +#endif } -- (BOOL) validateMenuItem:(NSMenuItem *)item -{ +- (OSX_BOOL) validateMenuItem:(NSMenuItem *)item { NSMenu *menu = [item menu]; - + if (item == toggle_fullscreen_item) return !quartzEnableRootless; + else if (item == copy_menu_item) // For some reason, this isn't working... + return NO; else if (menu == [window_separator menu] || menu == dock_menu || (menu == [x11_about_item menu] && [item tag] == 42)) return (AppleWMSelectedEvents () & AppleWMControllerNotifyMask) != 0; @@ -672,32 +715,34 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row - (void) applicationDidHide:(NSNotification *)notify { - QuartzMessageServerThread (kXDarwinControllerNotify, 1, AppleWMHideAll); + DarwinSendDDXEvent(kXquartzControllerNotify, 1, AppleWMHideAll); } - (void) applicationDidUnhide:(NSNotification *)notify { - QuartzMessageServerThread (kXDarwinControllerNotify, 1, AppleWMShowAll); + DarwinSendDDXEvent(kXquartzControllerNotify, 1, AppleWMShowAll); } -- (NSApplicationTerminateReply) applicationShouldTerminate:sender -{ - NSString *msg; - - if (can_quit || [X11App prefs_get_boolean:@PREFS_NO_QUIT_ALERT default:NO]) - return NSTerminateNow; +- (NSApplicationTerminateReply) applicationShouldTerminate:sender { + NSString *msg; + NSString *title; - /* Make sure we're frontmost. */ - [NSApp activateIgnoringOtherApps:YES]; + if (can_quit || [X11App prefs_get_boolean:@PREFS_NO_QUIT_ALERT default:NO]) + return NSTerminateNow; - msg = NSLocalizedString (@"Are you sure you want to quit X11?\n\nIf you quit X11, any X11 applications you are running will stop immediately and you will lose any changes you have not saved.", @"Dialog when quitting"); + /* Make sure we're frontmost. */ + [NSApp activateIgnoringOtherApps:YES]; - /* FIXME: safe to run the alert in here? Or should we return Later - and then run the alert on a timer? It seems to work here, so.. */ + title = NSLocalizedString(@"Do you really want to quit X11?", @"Dialog title when quitting"); + msg = NSLocalizedString(@"Any open X11 applications will stop immediately, and you will lose any unsaved changes.", @"Dialog when quitting"); + + /* FIXME: safe to run the alert in here? Or should we return Later + * and then run the alert on a timer? It seems to work here, so.. + */ - return (NSRunAlertPanel (nil, msg, NSLocalizedString (@"Quit", @""), - NSLocalizedString (@"Cancel", @""), nil) - == NSAlertDefaultReturn) ? NSTerminateNow : NSTerminateCancel; + return (NSRunAlertPanel (title, msg, NSLocalizedString (@"Quit", @""), + NSLocalizedString (@"Cancel", @""), nil) + == NSAlertDefaultReturn) ? NSTerminateNow : NSTerminateCancel; } - (void) applicationWillTerminate:(NSNotification *)aNotification @@ -705,7 +750,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row [X11App prefs_synchronize]; /* shutdown the X server, it will exit () for us. */ - QuartzMessageServerThread (kXDarwinQuit, 0); + DarwinSendDDXEvent(kXquartzQuit, 0); /* In case it doesn't, exit anyway after a while. */ while (sleep (10) != 0) ; @@ -729,21 +774,21 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row pending_apps = NULL; } -- (BOOL) application:(NSApplication *)app openFile:(NSString *)filename +- (OSX_BOOL) application:(NSApplication *)app openFile:(NSString *)filename { - const char *name = [filename UTF8String]; - - if (finished_launching) - [self launch_client:filename]; - else if (name[0] != ':') /* ignore display names */ - pending_apps = x_list_prepend (pending_apps, [filename retain]); - - /* FIXME: report failures. */ - return YES; + const char *name = [filename UTF8String]; + + if (finished_launching) + [self launch_client:filename]; + else if (name[0] != ':') /* ignore display names */ + pending_apps = x_list_prepend (pending_apps, [filename retain]); + + /* FIXME: report failures. */ + return YES; } @end -void X11ControllerMain(int argc, const char **argv, void (*server_thread) (void *), void *server_arg) { - X11ApplicationMain (argc, argv, server_thread, server_arg); +void X11ControllerMain(int argc, char **argv, char **envp) { + X11ApplicationMain (argc, argv, envp); } diff --git a/xorg-server/hw/xquartz/applewm.c b/xorg-server/hw/xquartz/applewm.c index 072e57ff4..c72540ace 100644 --- a/xorg-server/hw/xquartz/applewm.c +++ b/xorg-server/hw/xquartz/applewm.c @@ -25,6 +25,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ +#include "sanitizedCarbon.h" + #ifdef HAVE_DIX_CONFIG_H #include #endif @@ -72,8 +74,6 @@ static int WMErrorBase; static DISPATCH_PROC(ProcAppleWMDispatch); static DISPATCH_PROC(SProcAppleWMDispatch); -static void AppleWMResetProc(ExtensionEntry* extEntry); - static unsigned char WMReqCode = 0; static int WMEventBase = 0; @@ -122,7 +122,7 @@ AppleWMExtensionInit( AppleWMNumberErrors, ProcAppleWMDispatch, SProcAppleWMDispatch, - AppleWMResetProc, + NULL, StandardMinorOpcode))) { WMReqCode = (unsigned char)extEntry->base; @@ -133,14 +133,6 @@ AppleWMExtensionInit( } } -/*ARGSUSED*/ -static void -AppleWMResetProc ( - ExtensionEntry* extEntry -) -{ -} - /* Updates the _NATIVE_SCREEN_ORIGIN property on the given root window. */ void AppleWMSetScreenOrigin( @@ -173,7 +165,11 @@ AppleWMDoReorderWindow( atom = xa_apple_no_order_in(); rc = dixLookupProperty(&prop, pWin, atom, serverClient, DixReadAccess); - return (rc == Success) && (prop->type == atom); + + if(Success == rc && prop->type == atom) + return 0; + + return 1; } diff --git a/xorg-server/hw/xquartz/bundle/Dutch.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/Dutch.lproj/InfoPlist.strings deleted file mode 100644 index 8f978d63f..000000000 Binary files a/xorg-server/hw/xquartz/bundle/Dutch.lproj/InfoPlist.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/Dutch.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Dutch.lproj/Localizable.strings deleted file mode 100644 index 1ff39fe67..000000000 Binary files a/xorg-server/hw/xquartz/bundle/Dutch.lproj/Localizable.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/Dutch.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Dutch.lproj/main.nib/keyedobjects.nib deleted file mode 100644 index 95c26d7b3..000000000 Binary files a/xorg-server/hw/xquartz/bundle/Dutch.lproj/main.nib/keyedobjects.nib and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/English.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/English.lproj/InfoPlist.strings deleted file mode 100644 index 88e1f04ac..000000000 Binary files a/xorg-server/hw/xquartz/bundle/English.lproj/InfoPlist.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/English.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/English.lproj/Localizable.strings deleted file mode 100644 index c83b08536..000000000 Binary files a/xorg-server/hw/xquartz/bundle/English.lproj/Localizable.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/English.lproj/main.nib/designable.nib b/xorg-server/hw/xquartz/bundle/English.lproj/main.nib/designable.nib deleted file mode 100644 index ea3a0daa8..000000000 --- a/xorg-server/hw/xquartz/bundle/English.lproj/main.nib/designable.nib +++ /dev/null @@ -1,3482 +0,0 @@ - - - - 1050 - 9C31 - 639 - 949.26 - 352.00 - - YES - - - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - - - YES - - - NSApplication - - - - FirstResponder - - - NSApplication - - - MainMenu - - YES - - - X11 - - 1048576 - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - submenuAction: - - X11 - - YES - - - About X11 - - 2147483647 - - - - - - Preferences... - , - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Services - - 1048576 - 2147483647 - - - submenuAction: - - - Services - - - YES - - _NSServicesMenu - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Toggle Full Screen - a - 1572864 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Hide X11 - h - 1048576 - 2147483647 - - - 42 - - - - Hide Others - - 1048576 - 2147483647 - - - - - - Show All - - 1048576 - 2147483647 - - - 42 - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Quit X11 - q - 1048576 - 2147483647 - - - - - _NSAppleMenu - - - - - Applications - - 1048576 - 2147483647 - - - submenuAction: - - Applications - - YES - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Customize... - - 1048576 - 2147483647 - - - - - - - - - Edit - - 1048576 - 2147483647 - - - submenuAction: - - Edit - - YES - - - Undo - z - 1048576 - 2147483647 - - - - - - Redo - Z - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Cut - x - 1048576 - 2147483647 - - - - - - Copy - c - 1048576 - 2147483647 - - - - - - Paste - v - 1048576 - 2147483647 - - - - - - Delete - - 1048576 - 2147483647 - - - - - - Select All - a - 1048576 - 2147483647 - - - - - - - - - Window - - 1048576 - 2147483647 - - - submenuAction: - - - Window - - - YES - - - Minimize - m - 1048576 - 2147483647 - - - - - - Zoom - - 1048576 - 2147483647 - - - - - - Cycle Through Windows - ` - 1048840 - 2147483647 - - - - - - Reverse Cycle Through Windows - ~ - 1179914 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Close - w - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Bring All to Front - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - _NSWindowsMenu - - - - - Help - - 1048576 - 2147483647 - - - submenuAction: - - Help - - YES - - - X11 Help - - 1048576 - 2147483647 - - - - - - - - _NSMainMenu - - - X11Controller - - - 3 - 2 - {{319, 294}, {481, 345}} - 1350041600 - X11 Preferences - NSPanel - - View - - {3.40282e+38, 3.40282e+38} - {213, 107} - - - 256 - - YES - - - 256 - {{10, 10}, {458, 325}} - - - YES - - - 1 - - - - 256 - - YES - - - 256 - {{18, 243}, {402, 18}} - - YES - - 67239424 - 0 - Emulate three button mouse - - LucidaGrande - 1.300000e+01 - 1044 - - - 1211912703 - 2 - - NSSwitch - - - - 200 - 25 - - - - - 256 - {{36, 93}, {385, 31}} - - YES - - 67239424 - 4194304 - When enabled, menu bar key equivalents may interfere with X11 applications that use the Meta modifier. - - LucidaGrande - 1.100000e+01 - 3100 - - - - 6 - System - controlColor - - 3 - MC42NjY2NjY2OQA - - - - 6 - System - controlTextColor - - 3 - MAA - - - - - - - 256 - {{36, 208}, {385, 29}} - - YES - - 67239424 - 4194304 - SG9sZCBPcHRpb24gYW5kIENvbW1hbmQgd2hpbGUgY2xpY2tpbmcgdG8gYWN0aXZhdGUgdGhlIG1pZGRs -ZSBhbmQgcmlnaHQgbW91c2UgYnV0dG9ucy4KA - - - - - - - - - 256 - {{18, 130}, {402, 18}} - - YES - - 67239424 - 0 - Enable key equivalents under X11 - - - 1211912703 - 2 - - - - 200 - 25 - - - - - 256 - {{36, 159}, {385, 14}} - - YES - - 67239424 - 4194304 - Allows input menu changes to overwrite the current X11 keymap. - - - - - - - - - 256 - {{18, 179}, {402, 18}} - - YES - - 67239424 - 0 - Follow system keyboard layout - - - 1211912703 - 2 - - - - 200 - 25 - - - - - 256 - {{18, 69}, {402, 18}} - - YES - - 67239424 - 0 - Click-through Inactive Windows - - - 1211912703 - 2 - - - - 200 - 25 - - - - - 256 - {{33, 32}, {385, 31}} - - YES - - 67239424 - 4194304 - When enabled, clicking on an inactive window will cause that mouse click to pass through to that window in addition to activating it. - - - - - - - - {{10, 33}, {438, 279}} - - - Input - - - - - - 2 - - - - 256 - - YES - - - 256 - {{18, 116}, {402, 18}} - - YES - - 67239424 - 0 - Use system alert effect - - - 1211912703 - 2 - - - - 200 - 25 - - - - - 256 - {{36, 82}, {385, 28}} - - YES - - 67239424 - 4194304 - X11 beeps will use the standard system alert, as defined in the Sound Effects system preferences panel. - - - - - - - - - 256 - {{74, 235}, {128, 26}} - - YES - - -2076049856 - 1024 - - - 109199615 - 1 - - LucidaGrande - 1.300000e+01 - 16 - - - - - - - - 400 - 75 - - - From Display - - 1048576 - 2147483647 - 1 - - - _popUpItemAction: - -1 - - - YES - - - OtherViews - - - YES - - - - 256 Colors - - 1048576 - 2147483647 - - - _popUpItemAction: - 8 - - - - - Thousands - - 1048576 - 2147483647 - - - _popUpItemAction: - 15 - - - - - Millions - - 1048576 - 2147483647 - - - _popUpItemAction: - 24 - - - - - 3 - YES - YES - 1 - - - - - 256 - {{17, 238}, {55, 20}} - - YES - - 67239424 - 4194304 - Q29sb3JzOgo - - - - - - - - - 256 - {{36, 216}, {392, 14}} - - YES - - 67239424 - 4194304 - This option takes effect when X11 is launched again. - - - - - - - - - 256 - {{18, 182}, {409, 23}} - - YES - - 67239424 - 0 - Full screen mode - - - 1211912703 - 2 - - - - 200 - 25 - - - - - 256 - {{36, 145}, {385, 31}} - - YES - - 67239424 - 4194304 - Enables the X11 root window. Use the Command-Option-A keystroke to enter and leave full screen mode. - - - - - - - - {{10, 33}, {438, 279}} - - Output - - - - - - - 256 - - YES - - - 256 - {{18, 243}, {402, 18}} - - YES - - 67239424 - 0 - Authenticate connections - - - 1211912703 - 2 - - - - 200 - 25 - - - - - 256 - {{18, 166}, {402, 18}} - - YES - - 67239424 - 0 - Allow connections from network clients - - - 1211912703 - 2 - - - - 200 - 25 - - - - - 256 - {{36, 195}, {385, 42}} - - YES - - 67239424 - 4194304 - TGF1bmNoaW5nIFgxMSB3aWxsIGNyZWF0ZSBYYXV0aG9yaXR5IGFjY2Vzcy1jb250cm9sIGtleXMuIElm -IHRoZSBzeXN0ZW0ncyBJUCBhZGRyZXNzIGNoYW5nZXMsIHRoZXNlIGtleXMgYmVjb21lIGludmFsaWQg -d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4 - - - - - - - - - 256 - {{36, 118}, {385, 42}} - - YES - - 67239424 - 4194304 - If enabled, Authenticate connections must also be enabled to ensure system security. When disabled, connections from remote applications are not allowed. - - - - - - - - - 256 - {{20, 17}, {404, 14}} - - YES - - 67239424 - 4194304 - These options take effect when X11 is next launched. - - - - - - - - {{10, 33}, {438, 279}} - - Security - - - - - - - 0 - YES - YES - - YES - - - - - {481, 345} - - {{0, 0}, {1440, 878}} - {213, 129} - {3.40282e+38, 3.40282e+38} - x11_prefs - - - 11 - 2 - {{361, 362}, {454, 311}} - 1350041600 - X11 Application Menu - NSPanel - - View - - {10000, 10000} - {320, 240} - - - 256 - - YES - - - 265 - {{340, 231}, {100, 32}} - - YES - - 67239424 - 137887744 - Duplicate - - - -2038284033 - 1 - - Helvetica - 1.300000e+01 - 16 - - - - - - - - 200 - 25 - - - - - 265 - {{340, 199}, {100, 32}} - - YES - - 67239424 - 137887744 - Remove - - - -2038284033 - 1 - - - - - - - - 200 - 25 - - - - - 274 - - YES - - - 2304 - - YES - - - 256 - {301, 198} - - YES - - - 256 - {301, 17} - - - - - - 256 - {{302, 0}, {16, 17}} - - - - YES - - 9.900000e+01 - 4.000000e+01 - 1.000000e+03 - - 75628032 - 0 - Name - - - 3 - MC4zMzMzMzI5OQA - - - 6 - System - headerTextColor - - - - - 338820672 - 1024 - Text Cell - - - - 3 - MQA - - - - 3 - YES - YES - - - - 1.217310e+02 - 6.273100e+01 - 1.000000e+03 - - 75628032 - 0 - Command - - - - - - 338820672 - 1024 - Text Cell - - - - - - 3 - YES - YES - - - - 7.100000e+01 - 1.000000e+01 - 1.000000e+03 - - 67239424 - 0 - Shortcut - - - 6 - System - headerColor - - - - - - 338820672 - 1024 - Text Cell - - LucidaGrande - 1.200000e+01 - 16 - - - YES - - 6 - System - controlBackgroundColor - - - - - 3 - YES - YES - - - - 3.000000e+00 - 2.000000e+00 - - - 6 - System - gridColor - - 3 - MC41AA - - - 1.700000e+01 - 1379958784 - 1 - -1 - 0 - YES - - - {{1, 17}, {301, 198}} - - - - - 4 - - - - 256 - {{302, 17}, {15, 198}} - - - _doScroller: - 9.949238e-01 - - - - 256 - {{1, 215}, {301, 15}} - - 1 - - _doScroller: - 6.885246e-01 - - - - 2304 - - YES - - - {{1, 0}, {301, 17}} - - - - - 4 - - - - {{20, 60}, {318, 231}} - - - 50 - - - - - - QSAAAEEgAABBmAAAQZgAAA - - - - 265 - {{340, 263}, {100, 32}} - - YES - - -2080244224 - 137887744 - Add Item - - - -2038284033 - 1 - - - - - - - - 200 - 25 - - - - - 257 - {{356, 12}, {84, 32}} - - YES - - -2080244224 - 137887744 - Cancel - - - -2038284033 - 1 - - - - - - - - 200 - 25 - - - - - 257 - {{272, 12}, {84, 32}} - - YES - - -2080244224 - 137887744 - Done - - - -2038284033 - 1 - - - - - - 200 - 25 - - - - {454, 311} - - - {{0, 0}, {1440, 878}} - {320, 262} - x11_apps - - - Menu - - YES - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Applications - - 1048576 - 2147483647 - - - submenuAction: - - Applications - - YES - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Q3VzdG9taXpl4oCmA - - 1048576 - 2147483647 - - - - - - - - - - - - - YES - - - cut: - - - - 175 - - - - paste: - - - - 176 - - - - redo: - - - - 178 - - - - selectAll: - - - - 179 - - - - undo: - - - - 180 - - - - copy: - - - - 181 - - - - delete: - - - - 195 - - - - minimize_window: - - - - 202 - - - - close_window: - - - - 205 - - - - zoom_window: - - - - 206 - - - - bring_to_front: - - - - 207 - - - - hideOtherApplications: - - - - 263 - - - - apps_separator - - - - 273 - - - - apps_table - - - - 301 - - - - apps_table_done: - - - - 302 - - - - apps_table_delete: - - - - 303 - - - - apps_table_duplicate: - - - - 304 - - - - apps_table_show: - - - - 308 - - - - apps_table_cancel: - - - - 309 - - - - apps_table_new: - - - - 311 - - - - prefs_show: - - - - 318 - - - - x11_about_item - - - - 321 - - - - enable_auth - - - - 387 - - - - enable_tcp - - - - 388 - - - - depth - - - - 389 - - - - use_sysbeep - - - - 390 - - - - fake_buttons - - - - 391 - - - - sync_keymap - - - - 392 - - - - enable_keyequivs - - - - 393 - - - - prefs_changed: - - - - 394 - - - - prefs_changed: - - - - 395 - - - - prefs_changed: - - - - 396 - - - - prefs_changed: - - - - 397 - - - - prefs_changed: - - - - 398 - - - - prefs_changed: - - - - 399 - - - - prefs_changed: - - - - 401 - - - - prefs_panel - - - - 402 - - - - x11_help: - - - - 422 - - - - dockMenu - - - - 426 - - - - dock_menu - - - - 428 - - - - delegate - - - - 429 - - - - hide: - - - - 430 - - - - unhideAllApplications: - - - - 431 - - - - orderFrontStandardAboutPanel: - - - - 433 - - - - dock_apps_menu - - - - 530 - - - - dock_window_separator - - - - 531 - - - - apps_table_show: - - - - 534 - - - - next_window: - - - - 539 - - - - previous_window: - - - - 540 - - - - enable_fullscreen - - - - 546 - - - - enable_fullscreen_changed: - - - - 547 - - - - toggle_fullscreen: - - - - 548 - - - - toggle_fullscreen_item - - - - 549 - - - - prefs_changed: - - - - 300300 - - - - window_separator - - - - 300331 - - - - click_through - - - - 300332 - - - - menu - - - - 300334 - - - - terminate: - - - - 300336 - - - - - YES - - 0 - - YES - - - - - - -2 - - - RmlsZSdzIE93bmVyA - - - -1 - - - First Responder - - - -3 - - - Application - - - 29 - - - YES - - - - - - - - MainMenu - - - 19 - - - YES - - - - - - 24 - - - YES - - - - - - - - - - - - - - 5 - - - - - 23 - - - - - 92 - - - - - 203 - - - - - 204 - - - - - 536 - - - - - 537 - - - - - 538 - - - - - 56 - - - YES - - - - - - 57 - - - YES - - - - - - - - - - - - - - - - - 58 - - - - - 129 - - - - - 131 - - - YES - - - - - - 130 - - - - - 134 - - - - - 136 - - - - - 143 - - - - - 144 - - - - - 145 - - - - - 149 - - - - - 150 - - - - - 544 - - - - - 545 - - - - - 163 - - - YES - - - - - - 169 - - - YES - - - - - - - - - - - - - 156 - - - - - 157 - - - - - 158 - - - - - 160 - - - - - 164 - - - - - 171 - - - - - 172 - - - - - 173 - - - - - 269 - - - YES - - - - - - 270 - - - YES - - - - - - - 272 - - - - - 305 - - - - - 419 - - - YES - - - - - - 420 - - - YES - - - - - - 421 - - - - - 196 - - - X11Controller - - - 244 - - - YES - - - - PrefsPanel - - - 245 - - - YES - - - - - - 348 - - - YES - - - - - - - - 349 - - - YES - - - - - - 351 - - - YES - - - - - - - - - - - - - 363 - - - YES - - - - - - 364 - - - YES - - - - - - 365 - - - YES - - - - - - 368 - - - YES - - - - - - 369 - - - YES - - - - - - 370 - - - YES - - - - - - 352 - - - YES - - - - - - 350 - - - YES - - - - - - - - - - - - 371 - - - YES - - - - - - 372 - - - YES - - - - - - 382 - - - YES - - - - - - 385 - - - YES - - - - - - 386 - - - YES - - - - - - 541 - - - YES - - - - - - 543 - - - YES - - - - - - 353 - - - YES - - - - - - 354 - - - YES - - - - - - - - - - 374 - - - YES - - - - - - 375 - - - YES - - - - - - 376 - - - YES - - - - - - 377 - - - YES - - - - - - 379 - - - YES - - - - - - 285 - - - YES - - - - EditPrograms - - - 286 - - - YES - - - - - - - - - - - 423 - - - YES - - - - - DockMenu - - - 524 - - - - - 526 - - - YES - - - - - - 527 - - - YES - - - - - - - 532 - - - - - 533 - - - - - 100363 - - - - - 100364 - - - - - 100365 - - - - - 100368 - - - - - 100369 - - - - - 100370 - - - - - 100371 - - - - - 100372 - - - - - 100382 - - - YES - - - - - - 100385 - - - - - 100386 - - - - - 100541 - - - - - 100543 - - - - - 100374 - - - - - 100375 - - - - - 100376 - - - - - 100377 - - - - - 100379 - - - - - 380 - - - YES - - - - - - - - - 435 - - - - - 384 - - - - - 383 - - - - - 381 - - - - - 300296 - - - YES - - - - - - 300297 - - - - - 300298 - - - YES - - - - - - 300299 - - - - - 295 - - - YES - - - - - - - - - 300295 - - - - - 200295 - - - - - 100295 - - - - - 296 - - - YES - - - - - - - - 535 - - - YES - - - - - - 575 - - - - - 298 - - - YES - - - - - - 573 - - - - - 297 - - - YES - - - - - - 574 - - - - - 310 - - - YES - - - - - - 100310 - - - - - 292 - - - YES - - - - - - 100292 - - - - - 293 - - - YES - - - - - - 100293 - - - - - 299 - - - YES - - - - - - 100299 - - - - - 291 - - - YES - - - - - - 100291 - - - - - 300330 - - - - - - - YES - - YES - -1.IBPluginDependency - -2.IBPluginDependency - -3.IBPluginDependency - -3.ImportedFromIB2 - 100295.IBShouldRemoveOnLegacySave - 129.IBPluginDependency - 129.ImportedFromIB2 - 130.IBPluginDependency - 130.ImportedFromIB2 - 131.IBPluginDependency - 131.ImportedFromIB2 - 134.IBPluginDependency - 134.ImportedFromIB2 - 136.IBPluginDependency - 136.ImportedFromIB2 - 143.IBPluginDependency - 143.ImportedFromIB2 - 144.IBPluginDependency - 144.ImportedFromIB2 - 145.IBPluginDependency - 145.ImportedFromIB2 - 149.IBPluginDependency - 149.ImportedFromIB2 - 150.IBPluginDependency - 150.ImportedFromIB2 - 156.IBPluginDependency - 156.ImportedFromIB2 - 157.IBPluginDependency - 157.ImportedFromIB2 - 158.IBPluginDependency - 158.ImportedFromIB2 - 160.IBPluginDependency - 160.ImportedFromIB2 - 163.IBPluginDependency - 163.ImportedFromIB2 - 164.IBPluginDependency - 164.ImportedFromIB2 - 169.IBPluginDependency - 169.ImportedFromIB2 - 169.editorWindowContentRectSynchronizationRect - 171.IBPluginDependency - 171.ImportedFromIB2 - 172.IBPluginDependency - 172.ImportedFromIB2 - 173.IBPluginDependency - 173.ImportedFromIB2 - 19.IBPluginDependency - 19.ImportedFromIB2 - 196.IBPluginDependency - 196.ImportedFromIB2 - 200295.IBShouldRemoveOnLegacySave - 203.IBPluginDependency - 203.ImportedFromIB2 - 204.IBPluginDependency - 204.ImportedFromIB2 - 23.IBPluginDependency - 23.ImportedFromIB2 - 24.IBPluginDependency - 24.ImportedFromIB2 - 24.editorWindowContentRectSynchronizationRect - 244.IBPluginDependency - 244.IBWindowTemplateEditedContentRect - 244.ImportedFromIB2 - 244.editorWindowContentRectSynchronizationRect - 244.windowTemplate.hasMaxSize - 244.windowTemplate.hasMinSize - 244.windowTemplate.maxSize - 244.windowTemplate.minSize - 245.IBPluginDependency - 245.ImportedFromIB2 - 269.IBPluginDependency - 269.ImportedFromIB2 - 270.IBPluginDependency - 270.ImportedFromIB2 - 270.editorWindowContentRectSynchronizationRect - 272.IBPluginDependency - 272.ImportedFromIB2 - 285.IBEditorWindowLastContentRect - 285.IBPluginDependency - 285.IBViewEditorWindowController.showingBoundsRectangles - 285.IBViewEditorWindowController.showingLayoutRectangles - 285.IBWindowTemplateEditedContentRect - 285.ImportedFromIB2 - 285.editorWindowContentRectSynchronizationRect - 285.lastResizeAction - 285.windowTemplate.hasMaxSize - 285.windowTemplate.hasMinSize - 285.windowTemplate.maxSize - 285.windowTemplate.minSize - 286.IBPluginDependency - 286.ImportedFromIB2 - 29.IBEditorWindowLastContentRect - 29.IBPluginDependency - 29.ImportedFromIB2 - 29.editorWindowContentRectSynchronizationRect - 291.IBPluginDependency - 291.ImportedFromIB2 - 292.IBPluginDependency - 292.ImportedFromIB2 - 293.IBPluginDependency - 293.ImportedFromIB2 - 295.IBPluginDependency - 295.ImportedFromIB2 - 296.IBPluginDependency - 296.ImportedFromIB2 - 297.IBPluginDependency - 297.ImportedFromIB2 - 298.IBPluginDependency - 298.ImportedFromIB2 - 299.IBPluginDependency - 299.ImportedFromIB2 - 300295.IBShouldRemoveOnLegacySave - 300296.IBPluginDependency - 300296.ImportedFromIB2 - 300298.IBPluginDependency - 300298.ImportedFromIB2 - 300330.IBPluginDependency - 300330.ImportedFromIB2 - 305.IBPluginDependency - 305.ImportedFromIB2 - 310.IBPluginDependency - 310.ImportedFromIB2 - 348.IBPluginDependency - 348.ImportedFromIB2 - 349.IBPluginDependency - 349.ImportedFromIB2 - 350.IBPluginDependency - 350.ImportedFromIB2 - 351.IBPluginDependency - 351.ImportedFromIB2 - 352.IBPluginDependency - 352.ImportedFromIB2 - 353.IBPluginDependency - 353.ImportedFromIB2 - 354.IBPluginDependency - 354.ImportedFromIB2 - 363.IBPluginDependency - 363.ImportedFromIB2 - 364.IBPluginDependency - 364.ImportedFromIB2 - 365.IBPluginDependency - 365.ImportedFromIB2 - 368.IBPluginDependency - 368.ImportedFromIB2 - 369.IBPluginDependency - 369.ImportedFromIB2 - 370.IBPluginDependency - 370.ImportedFromIB2 - 371.IBPluginDependency - 371.ImportedFromIB2 - 372.IBPluginDependency - 372.ImportedFromIB2 - 374.IBPluginDependency - 374.ImportedFromIB2 - 375.IBPluginDependency - 375.ImportedFromIB2 - 376.IBPluginDependency - 376.ImportedFromIB2 - 377.IBPluginDependency - 377.ImportedFromIB2 - 379.IBPluginDependency - 379.ImportedFromIB2 - 380.IBPluginDependency - 380.ImportedFromIB2 - 381.IBPluginDependency - 381.ImportedFromIB2 - 382.IBPluginDependency - 382.ImportedFromIB2 - 383.IBPluginDependency - 383.ImportedFromIB2 - 384.IBPluginDependency - 384.ImportedFromIB2 - 385.IBPluginDependency - 385.ImportedFromIB2 - 386.IBPluginDependency - 386.ImportedFromIB2 - 419.IBPluginDependency - 419.ImportedFromIB2 - 420.IBPluginDependency - 420.ImportedFromIB2 - 421.IBPluginDependency - 421.ImportedFromIB2 - 423.IBPluginDependency - 423.ImportedFromIB2 - 435.IBPluginDependency - 435.ImportedFromIB2 - 5.IBPluginDependency - 5.ImportedFromIB2 - 524.IBPluginDependency - 524.ImportedFromIB2 - 526.IBPluginDependency - 526.ImportedFromIB2 - 527.IBPluginDependency - 527.ImportedFromIB2 - 532.IBPluginDependency - 532.ImportedFromIB2 - 533.IBPluginDependency - 533.ImportedFromIB2 - 535.IBPluginDependency - 535.ImportedFromIB2 - 536.IBPluginDependency - 536.ImportedFromIB2 - 537.IBPluginDependency - 537.ImportedFromIB2 - 538.IBPluginDependency - 538.ImportedFromIB2 - 541.IBPluginDependency - 541.ImportedFromIB2 - 543.IBPluginDependency - 543.ImportedFromIB2 - 544.IBPluginDependency - 544.ImportedFromIB2 - 545.IBPluginDependency - 545.ImportedFromIB2 - 56.IBPluginDependency - 56.ImportedFromIB2 - 57.IBEditorWindowLastContentRect - 57.IBPluginDependency - 57.ImportedFromIB2 - 57.editorWindowContentRectSynchronizationRect - 573.IBPluginDependency - 573.ImportedFromIB2 - 574.IBPluginDependency - 574.ImportedFromIB2 - 575.IBPluginDependency - 575.ImportedFromIB2 - 58.IBPluginDependency - 58.ImportedFromIB2 - 92.IBPluginDependency - 92.ImportedFromIB2 - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{202, 626}, {154, 153}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{271, 666}, {301, 153}} - com.apple.InterfaceBuilder.CocoaPlugin - {{184, 290}, {481, 345}} - - {{184, 290}, {481, 345}} - - - {3.40282e+38, 3.40282e+38} - {213, 107} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{100, 746}, {155, 33}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{537, 545}, {454, 311}} - com.apple.InterfaceBuilder.CocoaPlugin - - - {{537, 545}, {454, 311}} - - {{433, 406}, {486, 327}} - - YES - - YES - IBResizeActionFinalFrame - IBResizeActionInitialFrame - - - YES - {{537, 554}, {454, 311}} - {{537, 576}, {471, 289}} - - - - - {3.40282e+38, 3.40282e+38} - {320, 240} - com.apple.InterfaceBuilder.CocoaPlugin - - {{0, 836}, {336, 20}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{67, 819}, {336, 20}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{12, 633}, {218, 203}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{79, 616}, {218, 203}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - - - - YES - - YES - - - YES - - - - - YES - - YES - - - YES - - - - 300336 - - - - YES - - FirstResponder - - IBUserSource - - - - - NSFormatter - - IBUserSource - - - - - X11Controller - NSObject - - YES - - YES - apps_table_cancel: - apps_table_delete: - apps_table_done: - apps_table_duplicate: - apps_table_new: - apps_table_show: - bring_to_front: - close_window: - enable_fullscreen_changed: - minimize_window: - next_window: - prefs_changed: - prefs_show: - previous_window: - quit: - toggle_fullscreen: - x11_help: - zoom_window: - - - YES - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - - - - YES - - YES - apps_separator - apps_table - click_through - depth - dock_apps_menu - dock_menu - dock_window_separator - enable_auth - enable_fullscreen - enable_keyequivs - enable_tcp - fake_buttons - prefs_panel - sync_keymap - toggle_fullscreen_item - use_sysbeep - window_separator - x11_about_item - - - YES - NSMenuItem - NSTableView - NSButton - NSPopUpButton - NSMenu - NSMenu - NSMenuItem - NSButton - NSButton - NSButton - NSButton - NSButton - NSPanel - NSButton - NSMenuItem - NSButton - NSMenuItem - NSMenuItem - - - - IBUserSource - - - - - - 0 - - 3 - - diff --git a/xorg-server/hw/xquartz/bundle/English.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/English.lproj/main.nib/keyedobjects.nib deleted file mode 100644 index f60dcbacb..000000000 Binary files a/xorg-server/hw/xquartz/bundle/English.lproj/main.nib/keyedobjects.nib and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/French.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/French.lproj/InfoPlist.strings deleted file mode 100644 index 88e1f04ac..000000000 Binary files a/xorg-server/hw/xquartz/bundle/French.lproj/InfoPlist.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/French.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/French.lproj/Localizable.strings deleted file mode 100644 index 2770dfb8c..000000000 Binary files a/xorg-server/hw/xquartz/bundle/French.lproj/Localizable.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/French.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/French.lproj/main.nib/keyedobjects.nib deleted file mode 100644 index 9f9a7da67..000000000 Binary files a/xorg-server/hw/xquartz/bundle/French.lproj/main.nib/keyedobjects.nib and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/German.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/German.lproj/InfoPlist.strings deleted file mode 100644 index aa37e7555..000000000 Binary files a/xorg-server/hw/xquartz/bundle/German.lproj/InfoPlist.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/German.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/German.lproj/Localizable.strings deleted file mode 100644 index a5489ab5c..000000000 Binary files a/xorg-server/hw/xquartz/bundle/German.lproj/Localizable.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/German.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/German.lproj/main.nib/keyedobjects.nib deleted file mode 100644 index 19532a9c2..000000000 Binary files a/xorg-server/hw/xquartz/bundle/German.lproj/main.nib/keyedobjects.nib and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/Info.plist b/xorg-server/hw/xquartz/bundle/Info.plist deleted file mode 100644 index 6ba02dda2..000000000 --- a/xorg-server/hw/xquartz/bundle/Info.plist +++ /dev/null @@ -1,39 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - X11 - CFBundleGetInfoString - X11 - CFBundleIconFile - X11.icns - CFBundleIdentifier - org.x.X11 - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - X11 - CFBundlePackageType - APPL - CFBundleShortVersionString - 2.2.0 - CFBundleSignature - x11a - CSResourcesFileMapped - - NSHumanReadableCopyright - Copyright © 2003-2008, Apple Inc. -Copyright © 2003, XFree86 Project, Inc. -Copyright © 2003-2008, X.org Foundation, Inc. - - NSMainNibFile - main - NSPrincipalClass - X11Application - LSBackgroundOnly - - - diff --git a/xorg-server/hw/xquartz/bundle/Info.plist.cpp b/xorg-server/hw/xquartz/bundle/Info.plist.cpp new file mode 100644 index 000000000..47018fdf3 --- /dev/null +++ b/xorg-server/hw/xquartz/bundle/Info.plist.cpp @@ -0,0 +1,39 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + X11 + CFBundleGetInfoString + APPLE_APPLICATION_NAME + CFBundleIconFile + X11.icns + CFBundleIdentifier + APPLE_APPLICATION_ID + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + APPLE_APPLICATION_NAME + CFBundlePackageType + APPL + CFBundleShortVersionString + 2.3.2 + CFBundleVersion + 2.3.2 + CFBundleSignature + x11a + CSResourcesFileMapped + + NSHumanReadableCopyright + Copyright © 2003-2009, Apple Inc. +Copyright © 2003, XFree86 Project, Inc. +Copyright © 2003-2009, X.org Foundation, Inc. + + NSMainNibFile + main + NSPrincipalClass + X11Application + + diff --git a/xorg-server/hw/xquartz/bundle/Italian.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/Italian.lproj/InfoPlist.strings deleted file mode 100644 index 412169880..000000000 Binary files a/xorg-server/hw/xquartz/bundle/Italian.lproj/InfoPlist.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/Italian.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Italian.lproj/Localizable.strings deleted file mode 100644 index d05d73d44..000000000 Binary files a/xorg-server/hw/xquartz/bundle/Italian.lproj/Localizable.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/Italian.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Italian.lproj/main.nib/keyedobjects.nib deleted file mode 100644 index b6e2e1bb1..000000000 Binary files a/xorg-server/hw/xquartz/bundle/Italian.lproj/main.nib/keyedobjects.nib and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/Japanese.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/Japanese.lproj/InfoPlist.strings deleted file mode 100644 index 2d6330fa7..000000000 Binary files a/xorg-server/hw/xquartz/bundle/Japanese.lproj/InfoPlist.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/Japanese.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Japanese.lproj/Localizable.strings deleted file mode 100644 index 99821ea1f..000000000 Binary files a/xorg-server/hw/xquartz/bundle/Japanese.lproj/Localizable.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/Japanese.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Japanese.lproj/main.nib/keyedobjects.nib deleted file mode 100644 index 523fd0856..000000000 Binary files a/xorg-server/hw/xquartz/bundle/Japanese.lproj/main.nib/keyedobjects.nib and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/Makefile.am b/xorg-server/hw/xquartz/bundle/Makefile.am index 801fdc7d8..963327bb9 100644 --- a/xorg-server/hw/xquartz/bundle/Makefile.am +++ b/xorg-server/hw/xquartz/bundle/Makefile.am @@ -1,77 +1,82 @@ -bin_SCRIPTS = x11app +include cpprules.in -.PHONY: x11app - -x11app: - xcodebuild CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ARCHS="$(X11APP_ARCHS)" +CPP_FILES_FLAGS = \ + -DAPPLE_APPLICATION_ID="$(APPLE_APPLICATION_ID)" \ + -DAPPLE_APPLICATION_NAME="$(APPLE_APPLICATION_NAME)" install-data-hook: - xcodebuild install DSTROOT="/$(DESTDIR)" INSTALL_PATH="$(APPLE_APPLICATIONS_DIR)" DEPLOYMENT_LOCATION=YES SKIP_INSTALL=NO ARCHS="$(X11APP_ARCHS)" + $(srcdir)/mk_bundke.sh $(srcdir) $(builddir) $(DESTDIR)$(APPLE_APPLICATIONS_DIR)/$(APPLE_APPLICATION_NAME).app install + +uninstall-hook: + $(RM) -rf $(DESTDIR)$(APPLE_APPLICATIONS_DIR)/$(APPLE_APPLICATION_NAME).app + +noinst_PRE = Info.plist.cpp +noinst_DATA = $(noinst_PRE:plist.cpp=plist) -clean-local: - rm -rf build +CLEANFILES = $(noinst_DATA) resourcedir=$(libdir)/X11/xserver resource_DATA = Xquartz.plist EXTRA_DIST = \ + mk_bundke.sh \ + X11.sh \ + Info.plist.cpp \ + PkgInfo \ $(resource_DATA) \ - Info.plist \ - X11.icns \ - bundle-main.c \ - X11.xcodeproj/project.pbxproj \ - Dutch.lproj/InfoPlist.strings \ - Dutch.lproj/Localizable.strings \ - Dutch.lproj/main.nib/keyedobjects.nib \ - English.lproj/InfoPlist.strings \ - English.lproj/Localizable.strings \ - English.lproj/main.nib/designable.nib \ - English.lproj/main.nib/keyedobjects.nib \ - French.lproj/InfoPlist.strings \ - French.lproj/Localizable.strings \ - French.lproj/main.nib/keyedobjects.nib \ - German.lproj/InfoPlist.strings \ - German.lproj/Localizable.strings \ - German.lproj/main.nib/keyedobjects.nib \ - Italian.lproj/InfoPlist.strings \ - Italian.lproj/Localizable.strings \ - Italian.lproj/main.nib/keyedobjects.nib \ - Japanese.lproj/InfoPlist.strings \ - Japanese.lproj/Localizable.strings \ - Japanese.lproj/main.nib/keyedobjects.nib \ - Spanish.lproj/InfoPlist.strings \ - Spanish.lproj/Localizable.strings \ - Spanish.lproj/main.nib/keyedobjects.nib \ - da.lproj/InfoPlist.strings \ - da.lproj/Localizable.strings \ - da.lproj/main.nib/keyedobjects.nib \ - fi.lproj/InfoPlist.strings \ - fi.lproj/Localizable.strings \ - fi.lproj/main.nib/keyedobjects.nib \ - ko.lproj/InfoPlist.strings \ - ko.lproj/Localizable.strings \ - ko.lproj/main.nib/keyedobjects.nib \ - no.lproj/InfoPlist.strings \ - no.lproj/Localizable.strings \ - no.lproj/main.nib/keyedobjects.nib \ - pl.lproj/InfoPlist.strings \ - pl.lproj/Localizable.strings \ - pl.lproj/main.nib/keyedobjects.nib \ - pt.lproj/InfoPlist.strings \ - pt.lproj/Localizable.strings \ - pt.lproj/main.nib/keyedobjects.nib \ - pt_PT.lproj/InfoPlist.strings \ - pt_PT.lproj/Localizable.strings \ - pt_PT.lproj/main.nib/keyedobjects.nib \ - ru.lproj/InfoPlist.strings \ - ru.lproj/Localizable.strings \ - ru.lproj/main.nib/keyedobjects.nib \ - sv.lproj/InfoPlist.strings \ - sv.lproj/Localizable.strings \ - sv.lproj/main.nib/keyedobjects.nib \ - zh_CN.lproj/InfoPlist.strings \ - zh_CN.lproj/Localizable.strings \ - zh_CN.lproj/main.nib/keyedobjects.nib \ - zh_TW.lproj/InfoPlist.strings \ - zh_TW.lproj/Localizable.strings \ - zh_TW.lproj/main.nib/keyedobjects.nib + Resources/da.lproj/InfoPlist.strings \ + Resources/da.lproj/Localizable.strings \ + Resources/da.lproj/main.nib/keyedobjects.nib \ + Resources/Dutch.lproj/InfoPlist.strings \ + Resources/Dutch.lproj/Localizable.strings \ + Resources/Dutch.lproj/main.nib/keyedobjects.nib \ + Resources/English.lproj/InfoPlist.strings \ + Resources/English.lproj/Localizable.strings \ + Resources/English.lproj/main.nib/designable.nib \ + Resources/English.lproj/main.nib/keyedobjects.nib \ + Resources/fi.lproj/InfoPlist.strings \ + Resources/fi.lproj/Localizable.strings \ + Resources/fi.lproj/main.nib/keyedobjects.nib \ + Resources/French.lproj/InfoPlist.strings \ + Resources/French.lproj/Localizable.strings \ + Resources/French.lproj/main.nib/keyedobjects.nib \ + Resources/German.lproj/InfoPlist.strings \ + Resources/German.lproj/Localizable.strings \ + Resources/German.lproj/main.nib/keyedobjects.nib \ + Resources/Italian.lproj/InfoPlist.strings \ + Resources/Italian.lproj/Localizable.strings \ + Resources/Italian.lproj/main.nib/keyedobjects.nib \ + Resources/Japanese.lproj/InfoPlist.strings \ + Resources/Japanese.lproj/Localizable.strings \ + Resources/Japanese.lproj/main.nib/keyedobjects.nib \ + Resources/ko.lproj/InfoPlist.strings \ + Resources/ko.lproj/Localizable.strings \ + Resources/ko.lproj/main.nib/keyedobjects.nib \ + Resources/no.lproj/InfoPlist.strings \ + Resources/no.lproj/Localizable.strings \ + Resources/no.lproj/main.nib/keyedobjects.nib \ + Resources/pl.lproj/InfoPlist.strings \ + Resources/pl.lproj/Localizable.strings \ + Resources/pl.lproj/main.nib/keyedobjects.nib \ + Resources/pt.lproj/InfoPlist.strings \ + Resources/pt.lproj/Localizable.strings \ + Resources/pt.lproj/main.nib/keyedobjects.nib \ + Resources/pt_PT.lproj/InfoPlist.strings \ + Resources/pt_PT.lproj/Localizable.strings \ + Resources/pt_PT.lproj/main.nib/keyedobjects.nib \ + Resources/ru.lproj/InfoPlist.strings \ + Resources/ru.lproj/Localizable.strings \ + Resources/ru.lproj/main.nib/keyedobjects.nib \ + Resources/Spanish.lproj/InfoPlist.strings \ + Resources/Spanish.lproj/Localizable.strings \ + Resources/Spanish.lproj/main.nib/keyedobjects.nib \ + Resources/sv.lproj/InfoPlist.strings \ + Resources/sv.lproj/Localizable.strings \ + Resources/sv.lproj/main.nib/keyedobjects.nib \ + Resources/X11.icns \ + Resources/zh_CN.lproj/InfoPlist.strings \ + Resources/zh_CN.lproj/Localizable.strings \ + Resources/zh_CN.lproj/main.nib/keyedobjects.nib \ + Resources/zh_TW.lproj/InfoPlist.strings \ + Resources/zh_TW.lproj/Localizable.strings \ + Resources/zh_TW.lproj/main.nib/keyedobjects.nib diff --git a/xorg-server/hw/xquartz/bundle/Makefile.in b/xorg-server/hw/xquartz/bundle/Makefile.in index bd065ed9d..dd3b3c066 100644 --- a/xorg-server/hw/xquartz/bundle/Makefile.in +++ b/xorg-server/hw/xquartz/bundle/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -14,6 +14,12 @@ @SET_MAKE@ +# 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. VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ @@ -33,8 +39,9 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/cpprules.in subdir = hw/xquartz/bundle -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac @@ -44,15 +51,11 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-server.h \ $(top_builddir)/include/dix-config.h \ - $(top_builddir)/include/xgl-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 CONFIG_CLEAN_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(resourcedir)" -binSCRIPT_INSTALL = $(INSTALL_SCRIPT) -SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; @@ -61,16 +64,18 @@ am__vpath_adj = case $$p in \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(resourcedir)" resourceDATA_INSTALL = $(INSTALL_DATA) -DATA = $(resource_DATA) +DATA = $(noinst_DATA) $(resource_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ -APPDEFAULTDIR = @APPDEFAULTDIR@ APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ +APPLE_APPLICATION_ID = @APPLE_APPLICATION_ID@ +APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ APP_MAN_DIR = @APP_MAN_DIR@ APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ AR = @AR@ @@ -91,10 +96,6 @@ CFLAGS = @CFLAGS@ COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DARWIN_LIBS = @DARWIN_LIBS@ DBUS_CFLAGS = @DBUS_CFLAGS@ @@ -116,6 +117,7 @@ DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@ DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@ DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ +DOLT_BASH = @DOLT_BASH@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ @@ -125,18 +127,15 @@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ -ECHO = @ECHO@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ -FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ -FREETYPE_LIBS = @FREETYPE_LIBS@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ GL_CFLAGS = @GL_CFLAGS@ @@ -155,7 +154,7 @@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ -LAUNCHD = @LAUNCHD@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ LEX = @LEX@ @@ -169,7 +168,10 @@ LIBTOOL = @LIBTOOL@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LINUXDOC = @LINUXDOC@ +LIPO = @LIPO@ LN_S = @LN_S@ +LTCOMPILE = @LTCOMPILE@ +LTCXXCOMPILE = @LTCXXCOMPILE@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ @@ -181,8 +183,7 @@ MESA_SOURCE = @MESA_SOURCE@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ -MKFONTDIR = @MKFONTDIR@ -MKFONTSCALE = @MKFONTSCALE@ +NM = @NM@ NMEDIT = @NMEDIT@ OBJC = @OBJC@ OBJCCLD = @OBJCCLD@ @@ -191,8 +192,8 @@ OBJCFLAGS = @OBJCFLAGS@ OBJCLINK = @OBJCLINK@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -225,7 +226,6 @@ VENDOR_NAME = @VENDOR_NAME@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VENDOR_RELEASE = @VENDOR_RELEASE@ VERSION = @VERSION@ -X11APP_ARCHS = @X11APP_ARCHS@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ @@ -235,27 +235,12 @@ XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@ XDMX_CFLAGS = @XDMX_CFLAGS@ XDMX_LIBS = @XDMX_LIBS@ XDMX_SYS_LIBS = @XDMX_SYS_LIBS@ -XEGLMODULES_CFLAGS = @XEGLMODULES_CFLAGS@ -XEGL_LIBS = @XEGL_LIBS@ -XEGL_SYS_LIBS = @XEGL_SYS_LIBS@ XEPHYR_CFLAGS = @XEPHYR_CFLAGS@ -XEPHYR_DRI_LIBS = @XEPHYR_DRI_LIBS@ XEPHYR_INCS = @XEPHYR_INCS@ XEPHYR_LIBS = @XEPHYR_LIBS@ XF86CONFIGFILE = @XF86CONFIGFILE@ -XF86MISC_CFLAGS = @XF86MISC_CFLAGS@ -XF86MISC_LIBS = @XF86MISC_LIBS@ XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@ XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@ -XGLMODULES_CFLAGS = @XGLMODULES_CFLAGS@ -XGLMODULES_LIBS = @XGLMODULES_LIBS@ -XGLXMODULES_CFLAGS = @XGLXMODULES_CFLAGS@ -XGLXMODULES_LIBS = @XGLXMODULES_LIBS@ -XGLX_LIBS = @XGLX_LIBS@ -XGLX_SYS_LIBS = @XGLX_SYS_LIBS@ -XGL_LIBS = @XGL_LIBS@ -XGL_MODULE_PATH = @XGL_MODULE_PATH@ -XGL_SYS_LIBS = @XGL_SYS_LIBS@ XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@ XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@ XKB_COMPILED_DIR = @XKB_COMPILED_DIR@ @@ -266,10 +251,6 @@ XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ -XORGCFG_DEP_CFLAGS = @XORGCFG_DEP_CFLAGS@ -XORGCFG_DEP_LIBS = @XORGCFG_DEP_LIBS@ -XORGCONFIG_DEP_CFLAGS = @XORGCONFIG_DEP_CFLAGS@ -XORGCONFIG_DEP_LIBS = @XORGCONFIG_DEP_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ @@ -278,13 +259,8 @@ XORG_MODULES_LIBS = @XORG_MODULES_LIBS@ XORG_OS = @XORG_OS@ XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ XORG_SYS_LIBS = @XORG_SYS_LIBS@ -XPRINTMODULES_CFLAGS = @XPRINTMODULES_CFLAGS@ -XPRINTMODULES_LIBS = @XPRINTMODULES_LIBS@ -XPRINTPROTO_CFLAGS = @XPRINTPROTO_CFLAGS@ -XPRINTPROTO_LIBS = @XPRINTPROTO_LIBS@ -XPRINT_CFLAGS = @XPRINT_CFLAGS@ -XPRINT_LIBS = @XPRINT_LIBS@ -XPRINT_SYS_LIBS = @XPRINT_SYS_LIBS@ +XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ +XPBPROXY_LIBS = @XPBPROXY_LIBS@ XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ XSDL_INCS = @XSDL_INCS@ @@ -317,8 +293,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -338,7 +313,6 @@ driverdir = @driverdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ extdir = @extdir@ -ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -348,12 +322,12 @@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -launchagentsdir = @launchagentsdir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ logdir = @logdir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ @@ -371,82 +345,112 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xglmoduledir = @xglmoduledir@ -xpconfigdir = @xpconfigdir@ -bin_SCRIPTS = x11app +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 '/XSLASHGLOB/s/XSLASHGLOB/\/\*/' \ + -e '/\@\@$$/s/\@\@$$/\\/' + + +# Strings to replace in man pages +XORGRELSTRING = @PACKAGE_STRING@ +XORGMANNAME = X Version 11 +MANDEFS = \ + -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__XSERVERNAME__=Xorg -D__XCONFIGFILE__=xorg.conf \ + -D__xinitdir__=$(XINITDIR) \ + -D__bindir__=$(bindir) \ + -DSHELL_CMD=$(SHELL_CMD) $(ARCHMANDEFS) + +SUFFIXES = .$(APP_MAN_SUFFIX) .man .cpp +CPP_FILES_FLAGS = \ + -DAPPLE_APPLICATION_ID="$(APPLE_APPLICATION_ID)" \ + -DAPPLE_APPLICATION_NAME="$(APPLE_APPLICATION_NAME)" + +noinst_PRE = Info.plist.cpp +noinst_DATA = $(noinst_PRE:plist.cpp=plist) +CLEANFILES = $(noinst_DATA) resourcedir = $(libdir)/X11/xserver resource_DATA = Xquartz.plist EXTRA_DIST = \ + mk_bundke.sh \ + X11.sh \ + Info.plist.cpp \ + PkgInfo \ $(resource_DATA) \ - Info.plist \ - X11.icns \ - bundle-main.c \ - X11.xcodeproj/project.pbxproj \ - Dutch.lproj/InfoPlist.strings \ - Dutch.lproj/Localizable.strings \ - Dutch.lproj/main.nib/keyedobjects.nib \ - English.lproj/InfoPlist.strings \ - English.lproj/Localizable.strings \ - English.lproj/main.nib/designable.nib \ - English.lproj/main.nib/keyedobjects.nib \ - French.lproj/InfoPlist.strings \ - French.lproj/Localizable.strings \ - French.lproj/main.nib/keyedobjects.nib \ - German.lproj/InfoPlist.strings \ - German.lproj/Localizable.strings \ - German.lproj/main.nib/keyedobjects.nib \ - Italian.lproj/InfoPlist.strings \ - Italian.lproj/Localizable.strings \ - Italian.lproj/main.nib/keyedobjects.nib \ - Japanese.lproj/InfoPlist.strings \ - Japanese.lproj/Localizable.strings \ - Japanese.lproj/main.nib/keyedobjects.nib \ - Spanish.lproj/InfoPlist.strings \ - Spanish.lproj/Localizable.strings \ - Spanish.lproj/main.nib/keyedobjects.nib \ - da.lproj/InfoPlist.strings \ - da.lproj/Localizable.strings \ - da.lproj/main.nib/keyedobjects.nib \ - fi.lproj/InfoPlist.strings \ - fi.lproj/Localizable.strings \ - fi.lproj/main.nib/keyedobjects.nib \ - ko.lproj/InfoPlist.strings \ - ko.lproj/Localizable.strings \ - ko.lproj/main.nib/keyedobjects.nib \ - no.lproj/InfoPlist.strings \ - no.lproj/Localizable.strings \ - no.lproj/main.nib/keyedobjects.nib \ - pl.lproj/InfoPlist.strings \ - pl.lproj/Localizable.strings \ - pl.lproj/main.nib/keyedobjects.nib \ - pt.lproj/InfoPlist.strings \ - pt.lproj/Localizable.strings \ - pt.lproj/main.nib/keyedobjects.nib \ - pt_PT.lproj/InfoPlist.strings \ - pt_PT.lproj/Localizable.strings \ - pt_PT.lproj/main.nib/keyedobjects.nib \ - ru.lproj/InfoPlist.strings \ - ru.lproj/Localizable.strings \ - ru.lproj/main.nib/keyedobjects.nib \ - sv.lproj/InfoPlist.strings \ - sv.lproj/Localizable.strings \ - sv.lproj/main.nib/keyedobjects.nib \ - zh_CN.lproj/InfoPlist.strings \ - zh_CN.lproj/Localizable.strings \ - zh_CN.lproj/main.nib/keyedobjects.nib \ - zh_TW.lproj/InfoPlist.strings \ - zh_TW.lproj/Localizable.strings \ - zh_TW.lproj/main.nib/keyedobjects.nib + Resources/da.lproj/InfoPlist.strings \ + Resources/da.lproj/Localizable.strings \ + Resources/da.lproj/main.nib/keyedobjects.nib \ + Resources/Dutch.lproj/InfoPlist.strings \ + Resources/Dutch.lproj/Localizable.strings \ + Resources/Dutch.lproj/main.nib/keyedobjects.nib \ + Resources/English.lproj/InfoPlist.strings \ + Resources/English.lproj/Localizable.strings \ + Resources/English.lproj/main.nib/designable.nib \ + Resources/English.lproj/main.nib/keyedobjects.nib \ + Resources/fi.lproj/InfoPlist.strings \ + Resources/fi.lproj/Localizable.strings \ + Resources/fi.lproj/main.nib/keyedobjects.nib \ + Resources/French.lproj/InfoPlist.strings \ + Resources/French.lproj/Localizable.strings \ + Resources/French.lproj/main.nib/keyedobjects.nib \ + Resources/German.lproj/InfoPlist.strings \ + Resources/German.lproj/Localizable.strings \ + Resources/German.lproj/main.nib/keyedobjects.nib \ + Resources/Italian.lproj/InfoPlist.strings \ + Resources/Italian.lproj/Localizable.strings \ + Resources/Italian.lproj/main.nib/keyedobjects.nib \ + Resources/Japanese.lproj/InfoPlist.strings \ + Resources/Japanese.lproj/Localizable.strings \ + Resources/Japanese.lproj/main.nib/keyedobjects.nib \ + Resources/ko.lproj/InfoPlist.strings \ + Resources/ko.lproj/Localizable.strings \ + Resources/ko.lproj/main.nib/keyedobjects.nib \ + Resources/no.lproj/InfoPlist.strings \ + Resources/no.lproj/Localizable.strings \ + Resources/no.lproj/main.nib/keyedobjects.nib \ + Resources/pl.lproj/InfoPlist.strings \ + Resources/pl.lproj/Localizable.strings \ + Resources/pl.lproj/main.nib/keyedobjects.nib \ + Resources/pt.lproj/InfoPlist.strings \ + Resources/pt.lproj/Localizable.strings \ + Resources/pt.lproj/main.nib/keyedobjects.nib \ + Resources/pt_PT.lproj/InfoPlist.strings \ + Resources/pt_PT.lproj/Localizable.strings \ + Resources/pt_PT.lproj/main.nib/keyedobjects.nib \ + Resources/ru.lproj/InfoPlist.strings \ + Resources/ru.lproj/Localizable.strings \ + Resources/ru.lproj/main.nib/keyedobjects.nib \ + Resources/Spanish.lproj/InfoPlist.strings \ + Resources/Spanish.lproj/Localizable.strings \ + Resources/Spanish.lproj/main.nib/keyedobjects.nib \ + Resources/sv.lproj/InfoPlist.strings \ + Resources/sv.lproj/Localizable.strings \ + Resources/sv.lproj/main.nib/keyedobjects.nib \ + Resources/X11.icns \ + Resources/zh_CN.lproj/InfoPlist.strings \ + Resources/zh_CN.lproj/Localizable.strings \ + Resources/zh_CN.lproj/main.nib/keyedobjects.nib \ + Resources/zh_TW.lproj/InfoPlist.strings \ + Resources/zh_TW.lproj/Localizable.strings \ + Resources/zh_TW.lproj/main.nib/keyedobjects.nib all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +.SUFFIXES: .$(APP_MAN_SUFFIX) .man .cpp +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/cpprules.in $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -470,25 +474,6 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -install-binSCRIPTS: $(bin_SCRIPTS) - @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - @list='$(bin_SCRIPTS)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f $$d$$p; then \ - f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ - echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \ - $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \ - else :; fi; \ - done - -uninstall-binSCRIPTS: - @$(NORMAL_UNINSTALL) - @list='$(bin_SCRIPTS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ - echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ - rm -f "$(DESTDIR)$(bindir)/$$f"; \ - done mostlyclean-libtool: -rm -f *.lo @@ -547,9 +532,9 @@ distdir: $(DISTFILES) done check-am: all-am check: check-am -all-am: Makefile $(SCRIPTS) $(DATA) +all-am: Makefile $(DATA) installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(resourcedir)"; do \ + for dir in "$(DESTDIR)$(resourcedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -569,6 +554,7 @@ install-strip: mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) @@ -578,7 +564,7 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libtool clean-local mostlyclean-am +clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile @@ -600,7 +586,7 @@ install-data-am: install-resourceDATA install-dvi: install-dvi-am -install-exec-am: install-binSCRIPTS +install-exec-am: install-html: install-html-am @@ -630,34 +616,37 @@ ps: ps-am ps-am: -uninstall-am: uninstall-binSCRIPTS uninstall-resourceDATA +uninstall-am: uninstall-resourceDATA + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-hook -.MAKE: install-am install-data-am install-strip +.MAKE: install-am install-data-am install-strip uninstall-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ - clean-local distclean distclean-generic distclean-libtool \ - distdir dvi dvi-am html html-am info info-am install \ - install-am install-binSCRIPTS install-data install-data-am \ - install-data-hook install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-resourceDATA install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-data-hook install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-resourceDATA install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ - uninstall-binSCRIPTS uninstall-resourceDATA + uninstall-hook uninstall-resourceDATA -.PHONY: x11app +.cpp: + $(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) < $< | $(CPP_SED_MAGIC) > $@ -x11app: - xcodebuild CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ARCHS="$(X11APP_ARCHS)" +.man.$(APP_MAN_SUFFIX): + $(RAWCPP) $(RAWCPPFLAGS) $(MANDEFS) $(EXTRAMANDEFS) < $< | $(CPP_SED_MAGIC) > $@ install-data-hook: - xcodebuild install DSTROOT="/$(DESTDIR)" INSTALL_PATH="$(APPLE_APPLICATIONS_DIR)" DEPLOYMENT_LOCATION=YES SKIP_INSTALL=NO ARCHS="$(X11APP_ARCHS)" + $(srcdir)/mk_bundke.sh $(srcdir) $(builddir) $(DESTDIR)$(APPLE_APPLICATIONS_DIR)/$(APPLE_APPLICATION_NAME).app install -clean-local: - rm -rf build +uninstall-hook: + $(RM) -rf $(DESTDIR)$(APPLE_APPLICATIONS_DIR)/$(APPLE_APPLICATION_NAME).app # 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. .NOEXPORT: diff --git a/xorg-server/hw/xquartz/bundle/PkgInfo b/xorg-server/hw/xquartz/bundle/PkgInfo new file mode 100644 index 000000000..b8e0aec42 --- /dev/null +++ b/xorg-server/hw/xquartz/bundle/PkgInfo @@ -0,0 +1 @@ +APPLx11a \ No newline at end of file diff --git a/xorg-server/hw/xquartz/bundle/Resources/Dutch.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/Resources/Dutch.lproj/InfoPlist.strings new file mode 100644 index 000000000..8f978d63f Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/Dutch.lproj/InfoPlist.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/Dutch.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/Dutch.lproj/Localizable.strings new file mode 100644 index 000000000..1ff39fe67 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/Dutch.lproj/Localizable.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/Dutch.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/Dutch.lproj/main.nib/keyedobjects.nib new file mode 100644 index 000000000..95c26d7b3 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/Dutch.lproj/main.nib/keyedobjects.nib differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/English.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/Resources/English.lproj/InfoPlist.strings new file mode 100644 index 000000000..88e1f04ac Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/English.lproj/InfoPlist.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings new file mode 100644 index 000000000..001227afe Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/English.lproj/main.nib/designable.nib b/xorg-server/hw/xquartz/bundle/Resources/English.lproj/main.nib/designable.nib new file mode 100644 index 000000000..d27162539 --- /dev/null +++ b/xorg-server/hw/xquartz/bundle/Resources/English.lproj/main.nib/designable.nib @@ -0,0 +1,4038 @@ + + + + 1050 + 9G55 + 677 + 949.43 + 353.00 + + YES + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + + NSApplication + + + + FirstResponder + + + NSApplication + + + MainMenu + + YES + + + X11 + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + X11 + + YES + + + About X11 + + 2147483647 + + + + + + Preferences... + , + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Services + + 1048576 + 2147483647 + + + submenuAction: + + + Services + + + YES + + _NSServicesMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Toggle Full Screen + a + 1572864 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Hide X11 + h + 1048576 + 2147483647 + + + 42 + + + + Hide Others + h + 1572864 + 2147483647 + + + + + + Show All + + 1048576 + 2147483647 + + + 42 + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Quit X11 + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + + Applications + + 1048576 + 2147483647 + + + submenuAction: + + Applications + + YES + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Customize... + + 1048576 + 2147483647 + + + + + + + + + Edit + + 1048576 + 2147483647 + + + submenuAction: + + Edit + + YES + + + Copy + c + 1048576 + 2147483647 + + + + + + + + + Window + + 1048576 + 2147483647 + + + submenuAction: + + + Window + + + YES + + + Close + w + 1048576 + 2147483647 + + + + + + Minimize + m + 1048576 + 2147483647 + + + + + + Zoom + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Cycle Through Windows + ` + 1048840 + 2147483647 + + + + + + Reverse Cycle Through Windows + ~ + 1179914 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Bring All to Front + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + _NSWindowsMenu + + + + + Help + + 1048576 + 2147483647 + + + submenuAction: + + Help + + YES + + + X11 Help + + 1048576 + 2147483647 + + + + + + + + _NSMainMenu + + + X11Controller + + + 3 + 2 + {{266, 364}, {484, 308}} + 1350041600 + X11 Preferences + NSPanel + + View + + {3.40282e+38, 3.40282e+38} + {320, 240} + + + 256 + + YES + + + 256 + {{13, 10}, {458, 292}} + + + YES + + + 1 + + + + 256 + + YES + + + 256 + {{18, 210}, {402, 18}} + + YES + + 67239424 + 0 + Emulate three button mouse + + LucidaGrande + 1.300000e+01 + 1044 + + + 1211912703 + 2 + + NSSwitch + + + + 200 + 25 + + + + + 256 + {{36, 60}, {385, 31}} + + YES + + 67239424 + 4194304 + When enabled, menu bar key equivalents may interfere with X11 applications that use the Meta modifier. + + LucidaGrande + 1.100000e+01 + 3100 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2OQA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 256 + {{36, 162}, {385, 42}} + + YES + + 67239424 + 4194304 + SG9sZCBPcHRpb24gb3IgQ29tbWFuZCB3aGlsZSBjbGlja2luZyB0byBhY3RpdmF0ZSB0aGUgbWlkZGxl +IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg + + + + + + + + + 256 + {{18, 97}, {402, 18}} + + YES + + 67239424 + 0 + Enable key equivalents under X11 + + + 1211912703 + 2 + + + + 200 + 25 + + + + + 256 + {{36, 126}, {385, 14}} + + YES + + 67239424 + 4194304 + Allows input menu changes to overwrite the current X11 keymap. + + + + + + + + + 256 + {{18, 146}, {402, 18}} + + YES + + 67239424 + 0 + Follow system keyboard layout + + + 1211912703 + 2 + + + + 200 + 25 + + + + {{10, 33}, {438, 246}} + + + Input + + + + + + 2 + + + + 256 + + YES + + + 256 + {{18, 63}, {402, 18}} + + YES + + 67239424 + 0 + Use system alert effect + + + 1211912703 + 2 + + + + 200 + 25 + + + + + 256 + {{36, 29}, {385, 28}} + + YES + + 67239424 + 4194304 + X11 beeps will use the standard system alert, as defined in the Sound Effects system preferences panel. + + + + + + + + + 256 + {{74, 202}, {128, 26}} + + YES + + -2076049856 + 1024 + + + 109199615 + 1 + + LucidaGrande + 1.300000e+01 + 16 + + + + + + + + 400 + 75 + + + From Display + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + -1 + + + YES + + + OtherViews + + + YES + + + + 256 Colors + + 1048576 + 2147483647 + + + _popUpItemAction: + 8 + + + + + Thousands + + 1048576 + 2147483647 + + + _popUpItemAction: + 15 + + + + + Millions + + 1048576 + 2147483647 + + + _popUpItemAction: + 24 + + + + + 3 + YES + YES + 1 + + + + + 256 + {{17, 205}, {55, 20}} + + YES + + 67239424 + 4194304 + Q29sb3JzOgo + + + + + + + + + 256 + {{36, 183}, {392, 14}} + + YES + + 67239424 + 4194304 + This option takes effect when X11 is launched again. + + + + + + + + + 256 + {{18, 149}, {409, 23}} + + YES + + 67239424 + 0 + Full-screen mode + + + 1211912703 + 2 + + + + 200 + 25 + + + + + 256 + {{37, 83}, {409, 23}} + + YES + + 67239424 + 0 + Auto-show menu bar in full-screen mode + + + 1211912703 + 2 + + + + 200 + 25 + + + + + 256 + {{36, 112}, {385, 31}} + + YES + + 67239424 + 4194304 + Enables the X11 root window. Use the Command-Option-A keystroke to enter and leave full screen mode. + + + + + + + + {{10, 33}, {438, 246}} + + Output + + + + + + 2 + + + + 256 + + YES + + + 256 + {{18, 222}, {409, 23}} + + YES + + 67239424 + 0 + Enable syncing + + + 1211912703 + 2 + + + + 200 + 25 + + + + + 256 + {{36, 188}, {385, 28}} + + YES + + 67239424 + 4194304 + RW5hYmxlcyB0aGUgImNvcHkiIG1lbnUgaXRlbSBhbmQgYWxsb3dzIGZvciBzeW5jaW5nIGJldHdlZW4g +dGhlIE9TWCBQYXN0ZWJvYXJkIGFuZCB0aGUgWDExIENMSVBCT0FSRCBhbmQgUFJJTUFSWSBidWZmZXJz +Lg + + + + + + + + + 256 + {{34, 96}, {409, 23}} + + YES + + 67239424 + 0 + Update CLIPBOARD when Pasteboard changes. + + + 1211912703 + 2 + + + + 200 + 25 + + + + + 256 + {{34, 71}, {409, 23}} + + YES + + 67239424 + 0 + Update PRIMARY (middle-click) when Pasteboard changes. + + + 1211912703 + 2 + + + + 200 + 25 + + + + + 256 + {{34, 46}, {409, 23}} + + YES + + 67239424 + 0 + Update Pasteboard immediately when new text is selected. + + + 1211912703 + 2 + + + + 200 + 25 + + + + + 256 + {{34, 159}, {409, 23}} + + YES + + 67239424 + 0 + Update Pasteboard when CLIPBOARD changes. + + + 1211912703 + 2 + + + + 200 + 25 + + + + + 256 + {{48, 125}, {385, 28}} + + YES + + 67239424 + 4194304 + Disable this option if you want to use xclipboard, klipper, or any other X11 clipboard manager. + + + + + + + + + 256 + {{48, 14}, {370, 28}} + + YES + + 67239424 + 4194304 + Due to limitations in the X11 protocol, this option may not always work in some applications. + + + + + + + + {{10, 33}, {438, 246}} + + Pasteboard + + + + + + 2 + + + + 256 + + YES + + + 256 + {{15, 212}, {402, 18}} + + YES + + 67239424 + 0 + Click-through Inactive Windows + + + 1211912703 + 2 + + + + 200 + 25 + + + + + 256 + {{23, 175}, {385, 31}} + + YES + + 67239424 + 4194304 + When enabled, clicking on an inactive window will cause that mouse click to pass through to that window in addition to activating it. + + + + + + + + + 256 + {{15, 151}, {402, 18}} + + YES + + 67239424 + 0 + Focus Follows Mouse + + + 1211912703 + 2 + + + + 200 + 25 + + + + + 256 + {{23, 128}, {385, 17}} + + YES + + 67239424 + 4194304 + X11 window focus follows the cursor. This has some adverse effects. + + + + + + + + + 256 + {{15, 107}, {402, 18}} + + YES + + 67239424 + 0 + Focus On New Windows + + + 1211912703 + 2 + + + + 200 + 25 + + + + + 256 + {{23, 73}, {385, 28}} + + YES + + 67239424 + 4194304 + When enabled, creation of a new X11 window will cause X11.app to move to the foreground (instead of Finder.app, Terminal.app, etc.) + + + + + + + + {{10, 33}, {438, 246}} + + Windows + + + + + + + 256 + + YES + + + 256 + {{18, 210}, {402, 18}} + + YES + + 67239424 + 0 + Authenticate connections + + + 1211912703 + 2 + + + + 200 + 25 + + + + + 256 + {{18, 133}, {402, 18}} + + YES + + 67239424 + 0 + Allow connections from network clients + + + 1211912703 + 2 + + + + 200 + 25 + + + + + 256 + {{36, 162}, {385, 42}} + + YES + + 67239424 + 4194304 + TGF1bmNoaW5nIFgxMSB3aWxsIGNyZWF0ZSBYYXV0aG9yaXR5IGFjY2Vzcy1jb250cm9sIGtleXMuIElm +IHRoZSBzeXN0ZW0ncyBJUCBhZGRyZXNzIGNoYW5nZXMsIHRoZXNlIGtleXMgYmVjb21lIGludmFsaWQg +d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4 + + + + + + + + + 256 + {{36, 85}, {385, 42}} + + YES + + 67239424 + 4194304 + If enabled, Authenticate connections must also be enabled to ensure system security. When disabled, connections from remote applications are not allowed. + + + + + + + + + 256 + {{20, -16}, {404, 14}} + + YES + + 67239424 + 4194304 + These options take effect when X11 is next launched. + + + + + + + + {{10, 33}, {438, 246}} + + Security + + + + + + + 0 + YES + YES + + YES + + + + + {484, 308} + + {{0, 0}, {1280, 938}} + {320, 262} + {3.40282e+38, 3.40282e+38} + x11_prefs + + + 11 + 2 + {{302, 440}, {454, 271}} + 1350041600 + X11 Application Menu + NSPanel + + View + + {3.40282e+38, 3.40282e+38} + {320, 240} + + + 256 + + YES + + + 265 + {{340, 191}, {100, 32}} + + YES + + 67239424 + 137887744 + Duplicate + + + -2038284033 + 1 + + Helvetica + 1.300000e+01 + 16 + + + + + + + + 200 + 25 + + + + + 265 + {{340, 159}, {100, 32}} + + YES + + 67239424 + 137887744 + Remove + + + -2038284033 + 1 + + + + + + + + 200 + 25 + + + + + 274 + + YES + + + 2304 + + YES + + + 256 + {301, 198} + + YES + + + 256 + {301, 17} + + + + + + 256 + {{302, 0}, {16, 17}} + + + + YES + + 1.217310e+02 + 6.273100e+01 + 1.000000e+03 + + 75628032 + 0 + Name + + + 3 + MC4zMzMzMzI5OQA + + + 6 + System + headerTextColor + + + + + 338820672 + 1024 + Text Cell + + + + 3 + MQA + + + + 3 + YES + YES + + + + 9.900000e+01 + 4.000000e+01 + 1.000000e+03 + + 75628032 + 0 + Command + + + + + + 338820672 + 1024 + Text Cell + + + + + + 3 + YES + YES + + + + 7.100000e+01 + 1.000000e+01 + 1.000000e+03 + + 67239424 + 0 + Shortcut + + + 6 + System + headerColor + + + + + + 338820672 + 1024 + Text Cell + + LucidaGrande + 1.200000e+01 + 16 + + + YES + + 6 + System + controlBackgroundColor + + + + + 3 + YES + YES + + + + 3.000000e+00 + 2.000000e+00 + + + 6 + System + gridColor + + 3 + MC41AA + + + 1.700000e+01 + 1379958784 + 1 + -1 + 0 + YES + + + {{1, 17}, {301, 198}} + + + + + 4 + + + + 256 + {{302, 17}, {15, 198}} + + + _doScroller: + 9.949238e-01 + + + + 256 + {{1, 215}, {301, 15}} + + 1 + + _doScroller: + 6.885246e-01 + + + + 2304 + + YES + + + {{1, 0}, {301, 17}} + + + + + 4 + + + + {{20, 20}, {318, 231}} + + + 50 + + + + + + QSAAAEEgAABBmAAAQZgAAA + + + + 265 + {{340, 223}, {100, 32}} + + YES + + -2080244224 + 137887744 + Add Item + + + -2038284033 + 1 + + + + + + + + 200 + 25 + + + + {454, 271} + + {{0, 0}, {1280, 938}} + {320, 262} + {3.40282e+38, 3.40282e+38} + x11_apps + + + Menu + + YES + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Applications + + 1048576 + 2147483647 + + + submenuAction: + + Applications + + YES + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Q3VzdG9taXpl4oCmA + + 1048576 + 2147483647 + + + + + + + + + + + + + YES + + + copy: + + + + 181 + + + + minimize_window: + + + + 202 + + + + close_window: + + + + 205 + + + + zoom_window: + + + + 206 + + + + bring_to_front: + + + + 207 + + + + hideOtherApplications: + + + + 263 + + + + apps_separator + + + + 273 + + + + apps_table + + + + 301 + + + + apps_table_delete: + + + + 303 + + + + apps_table_duplicate: + + + + 304 + + + + apps_table_show: + + + + 308 + + + + apps_table_new: + + + + 311 + + + + prefs_show: + + + + 318 + + + + x11_about_item + + + + 321 + + + + enable_auth + + + + 387 + + + + enable_tcp + + + + 388 + + + + depth + + + + 389 + + + + use_sysbeep + + + + 390 + + + + fake_buttons + + + + 391 + + + + sync_keymap + + + + 392 + + + + enable_keyequivs + + + + 393 + + + + prefs_changed: + + + + 394 + + + + prefs_changed: + + + + 395 + + + + prefs_changed: + + + + 396 + + + + prefs_changed: + + + + 397 + + + + prefs_changed: + + + + 398 + + + + prefs_changed: + + + + 399 + + + + prefs_changed: + + + + 401 + + + + prefs_panel + + + + 402 + + + + x11_help: + + + + 422 + + + + dockMenu + + + + 426 + + + + dock_menu + + + + 428 + + + + delegate + + + + 429 + + + + hide: + + + + 430 + + + + unhideAllApplications: + + + + 431 + + + + orderFrontStandardAboutPanel: + + + + 433 + + + + dock_apps_menu + + + + 530 + + + + dock_window_separator + + + + 531 + + + + apps_table_show: + + + + 534 + + + + next_window: + + + + 539 + + + + previous_window: + + + + 540 + + + + enable_fullscreen + + + + 546 + + + + enable_fullscreen_changed: + + + + 547 + + + + toggle_fullscreen: + + + + 548 + + + + toggle_fullscreen_item + + + + 549 + + + + window_separator + + + + 300331 + + + + menu + + + + 300334 + + + + terminate: + + + + 300336 + + + + prefs_changed: + + + + 300389 + + + + prefs_changed: + + + + 300390 + + + + prefs_changed: + + + + 300391 + + + + click_through + + + + 300392 + + + + focus_follows_mouse + + + + 300393 + + + + focus_on_new_window + + + + 300394 + + + + copy_menu_item + + + + 300443 + + + + sync_pasteboard + + + + 300444 + + + + sync_clipboard_to_pasteboard + + + + 300461 + + + + sync_pasteboard_to_clipboard + + + + 300462 + + + + sync_pasteboard_to_primary + + + + 300463 + + + + sync_primary_immediately + + + + 300464 + + + + prefs_changed: + + + + 300465 + + + + prefs_changed: + + + + 300466 + + + + prefs_changed: + + + + 300467 + + + + prefs_changed: + + + + 300468 + + + + prefs_changed: + + + + 300469 + + + + sync_text1 + + + + 300470 + + + + sync_text2 + + + + 300471 + + + + enable_fullscreen_menu + + + + 300474 + + + + prefs_changed: + + + + 300475 + + + + + YES + + 0 + + YES + + + + + + -2 + + + RmlsZSdzIE93bmVyA + + + -1 + + + First Responder + + + -3 + + + Application + + + 29 + + + YES + + + + + + + + MainMenu + + + 19 + + + YES + + + + + + 24 + + + YES + + + + + + + + + + + + + + 5 + + + + + 23 + + + + + 92 + + + + + 203 + + + + + 204 + + + + + 536 + + + + + 537 + + + + + 538 + + + + + 56 + + + YES + + + + + + 57 + + + YES + + + + + + + + + + + + + + + + + 58 + + + + + 129 + + + + + 131 + + + YES + + + + + + 130 + + + + + 134 + + + + + 136 + + + + + 143 + + + + + 144 + + + + + 145 + + + + + 149 + + + + + 150 + + + + + 544 + + + + + 545 + + + + + 163 + + + YES + + + + + + 169 + + + YES + + + + + + 157 + + + + + 269 + + + YES + + + + + + 270 + + + YES + + + + + + + 272 + + + + + 305 + + + + + 419 + + + YES + + + + + + 420 + + + YES + + + + + + 421 + + + + + 196 + + + X11Controller + + + 244 + + + YES + + + + PrefsPanel + + + 245 + + + YES + + + + + + 348 + + + YES + + + + + + + + + + 349 + + + YES + + + + + + 351 + + + YES + + + + + + + + + + + 363 + + + YES + + + + + + 364 + + + YES + + + + + + 365 + + + YES + + + + + + 368 + + + YES + + + + + + 369 + + + YES + + + + + + 370 + + + YES + + + + + + 352 + + + YES + + + + + + 350 + + + YES + + + + + + + + + + + + + 371 + + + YES + + + + + + 372 + + + YES + + + + + + 382 + + + YES + + + + + + 385 + + + YES + + + + + + 386 + + + YES + + + + + + 541 + + + YES + + + + + + 543 + + + YES + + + + + + 353 + + + YES + + + + + + 354 + + + YES + + + + + + + + + + 374 + + + YES + + + + + + 375 + + + YES + + + + + + 376 + + + YES + + + + + + 377 + + + YES + + + + + + 379 + + + YES + + + + + + 285 + + + YES + + + + EditPrograms + + + 286 + + + YES + + + + + + + + + 423 + + + YES + + + + + DockMenu + + + 524 + + + + + 526 + + + YES + + + + + + 527 + + + YES + + + + + + + 532 + + + + + 533 + + + + + 100363 + + + + + 100364 + + + + + 100365 + + + + + 100368 + + + + + 100369 + + + + + 100370 + + + + + 100371 + + + + + 100372 + + + + + 100382 + + + YES + + + + + + 100385 + + + + + 100386 + + + + + 100541 + + + + + 100543 + + + + + 100374 + + + + + 100375 + + + + + 100376 + + + + + 100377 + + + + + 100379 + + + + + 380 + + + YES + + + + + + + + + 435 + + + + + 384 + + + + + 383 + + + + + 381 + + + + + 295 + + + YES + + + + + + + + + 300295 + + + + + 200295 + + + + + 100295 + + + + + 296 + + + YES + + + + + + + + 535 + + + YES + + + + + + 575 + + + + + 298 + + + YES + + + + + + 573 + + + + + 297 + + + YES + + + + + + 574 + + + + + 310 + + + YES + + + + + + 100310 + + + + + 292 + + + YES + + + + + + 100292 + + + + + 293 + + + YES + + + + + + 100293 + + + + + 300330 + + + + + 300337 + + + YES + + + + + + 300338 + + + YES + + + + + + + + + + + 300358 + + + YES + + + + + + 300359 + + + YES + + + + + + 300360 + + + + + 300361 + + + + + 300362 + + + YES + + + + + + 300363 + + + + + 300364 + + + YES + + + + + + 300365 + + + + + 300368 + + + YES + + + + + + 300369 + + + + + 300370 + + + YES + + + + + + 300371 + + + + + 300421 + + + YES + + + + + + 300422 + + + YES + + + + + + + + + + + + + 300423 + + + YES + + + + + + 300424 + + + YES + + + + + + 300440 + + + + + 300441 + + + + + 300447 + + + YES + + + + + + 300450 + + + + + 300451 + + + YES + + + + + + 300452 + + + + + 300453 + + + YES + + + + + + 300454 + + + + + 300455 + + + YES + + + + + + 300456 + + + + + 300457 + + + YES + + + + + + 300458 + + + + + 300459 + + + YES + + + + + + 300460 + + + + + 300472 + + + YES + + + + + + 300473 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + -3.ImportedFromIB2 + 100292.IBPluginDependency + 100293.IBPluginDependency + 100295.IBPluginDependency + 100295.IBShouldRemoveOnLegacySave + 100310.IBPluginDependency + 100363.IBPluginDependency + 100364.IBPluginDependency + 100365.IBPluginDependency + 100368.IBPluginDependency + 100369.IBPluginDependency + 100370.IBPluginDependency + 100371.IBPluginDependency + 100372.IBPluginDependency + 100374.IBPluginDependency + 100375.IBPluginDependency + 100376.IBPluginDependency + 100377.IBPluginDependency + 100379.IBPluginDependency + 100382.IBPluginDependency + 100385.IBPluginDependency + 100386.IBPluginDependency + 100541.IBPluginDependency + 100543.IBPluginDependency + 129.IBPluginDependency + 129.ImportedFromIB2 + 130.IBPluginDependency + 130.ImportedFromIB2 + 131.IBPluginDependency + 131.ImportedFromIB2 + 134.IBPluginDependency + 134.ImportedFromIB2 + 136.IBPluginDependency + 136.ImportedFromIB2 + 143.IBPluginDependency + 143.ImportedFromIB2 + 144.IBPluginDependency + 144.ImportedFromIB2 + 145.IBPluginDependency + 145.ImportedFromIB2 + 149.IBPluginDependency + 149.ImportedFromIB2 + 150.IBPluginDependency + 150.ImportedFromIB2 + 157.IBPluginDependency + 157.ImportedFromIB2 + 163.IBPluginDependency + 163.ImportedFromIB2 + 169.IBEditorWindowLastContentRect + 169.IBPluginDependency + 169.ImportedFromIB2 + 169.editorWindowContentRectSynchronizationRect + 19.IBPluginDependency + 19.ImportedFromIB2 + 196.IBPluginDependency + 196.ImportedFromIB2 + 200295.IBPluginDependency + 200295.IBShouldRemoveOnLegacySave + 203.IBPluginDependency + 203.ImportedFromIB2 + 204.IBPluginDependency + 204.ImportedFromIB2 + 23.IBPluginDependency + 23.ImportedFromIB2 + 24.IBEditorWindowLastContentRect + 24.IBPluginDependency + 24.ImportedFromIB2 + 24.editorWindowContentRectSynchronizationRect + 244.IBEditorWindowLastContentRect + 244.IBWindowTemplateEditedContentRect + 244.ImportedFromIB2 + 244.editorWindowContentRectSynchronizationRect + 244.windowTemplate.hasMaxSize + 244.windowTemplate.hasMinSize + 244.windowTemplate.maxSize + 244.windowTemplate.minSize + 245.IBPluginDependency + 245.ImportedFromIB2 + 269.IBPluginDependency + 269.ImportedFromIB2 + 270.IBEditorWindowLastContentRect + 270.IBPluginDependency + 270.ImportedFromIB2 + 270.editorWindowContentRectSynchronizationRect + 272.IBPluginDependency + 272.ImportedFromIB2 + 285.IBEditorWindowLastContentRect + 285.IBViewEditorWindowController.showingBoundsRectangles + 285.IBViewEditorWindowController.showingLayoutRectangles + 285.IBWindowTemplateEditedContentRect + 285.ImportedFromIB2 + 285.editorWindowContentRectSynchronizationRect + 285.windowTemplate.hasMaxSize + 285.windowTemplate.hasMinSize + 285.windowTemplate.maxSize + 285.windowTemplate.minSize + 286.IBPluginDependency + 286.ImportedFromIB2 + 29.IBEditorWindowLastContentRect + 29.IBPluginDependency + 29.ImportedFromIB2 + 29.editorWindowContentRectSynchronizationRect + 292.IBPluginDependency + 292.ImportedFromIB2 + 293.IBPluginDependency + 293.ImportedFromIB2 + 295.IBPluginDependency + 295.ImportedFromIB2 + 296.IBPluginDependency + 296.ImportedFromIB2 + 297.IBPluginDependency + 297.ImportedFromIB2 + 298.IBPluginDependency + 298.ImportedFromIB2 + 300295.IBPluginDependency + 300295.IBShouldRemoveOnLegacySave + 300330.IBPluginDependency + 300330.ImportedFromIB2 + 300337.IBPluginDependency + 300337.ImportedFromIB2 + 300338.IBPluginDependency + 300338.ImportedFromIB2 + 300358.IBPluginDependency + 300358.ImportedFromIB2 + 300359.IBPluginDependency + 300359.ImportedFromIB2 + 300360.IBPluginDependency + 300361.IBPluginDependency + 300362.IBPluginDependency + 300362.ImportedFromIB2 + 300363.IBPluginDependency + 300364.IBPluginDependency + 300364.ImportedFromIB2 + 300365.IBPluginDependency + 300368.IBPluginDependency + 300368.ImportedFromIB2 + 300369.IBPluginDependency + 300370.IBPluginDependency + 300370.ImportedFromIB2 + 300371.IBPluginDependency + 300421.IBPluginDependency + 300421.ImportedFromIB2 + 300422.IBPluginDependency + 300422.ImportedFromIB2 + 300423.IBPluginDependency + 300423.ImportedFromIB2 + 300424.IBPluginDependency + 300424.ImportedFromIB2 + 300440.IBPluginDependency + 300441.IBPluginDependency + 300447.IBPluginDependency + 300447.ImportedFromIB2 + 300450.IBPluginDependency + 300451.IBPluginDependency + 300451.ImportedFromIB2 + 300452.IBPluginDependency + 300453.IBPluginDependency + 300453.ImportedFromIB2 + 300454.IBPluginDependency + 300455.IBPluginDependency + 300455.ImportedFromIB2 + 300456.IBPluginDependency + 300457.IBPluginDependency + 300457.ImportedFromIB2 + 300458.IBPluginDependency + 300459.IBPluginDependency + 300459.ImportedFromIB2 + 300460.IBPluginDependency + 300472.IBPluginDependency + 300472.ImportedFromIB2 + 300473.IBPluginDependency + 305.IBPluginDependency + 305.ImportedFromIB2 + 310.IBPluginDependency + 310.ImportedFromIB2 + 348.IBPluginDependency + 348.ImportedFromIB2 + 349.IBPluginDependency + 349.ImportedFromIB2 + 350.IBPluginDependency + 350.ImportedFromIB2 + 351.IBPluginDependency + 351.ImportedFromIB2 + 352.IBPluginDependency + 352.ImportedFromIB2 + 353.IBPluginDependency + 353.ImportedFromIB2 + 354.IBPluginDependency + 354.ImportedFromIB2 + 363.IBPluginDependency + 363.ImportedFromIB2 + 364.IBPluginDependency + 364.ImportedFromIB2 + 365.IBPluginDependency + 365.ImportedFromIB2 + 368.IBPluginDependency + 368.ImportedFromIB2 + 369.IBPluginDependency + 369.ImportedFromIB2 + 370.IBPluginDependency + 370.ImportedFromIB2 + 371.IBPluginDependency + 371.ImportedFromIB2 + 372.IBPluginDependency + 372.ImportedFromIB2 + 374.IBPluginDependency + 374.ImportedFromIB2 + 375.IBPluginDependency + 375.ImportedFromIB2 + 376.IBPluginDependency + 376.ImportedFromIB2 + 377.IBPluginDependency + 377.ImportedFromIB2 + 379.IBPluginDependency + 379.ImportedFromIB2 + 380.IBPluginDependency + 380.ImportedFromIB2 + 381.IBPluginDependency + 381.ImportedFromIB2 + 382.IBPluginDependency + 382.ImportedFromIB2 + 383.IBPluginDependency + 383.ImportedFromIB2 + 384.IBPluginDependency + 384.ImportedFromIB2 + 385.IBPluginDependency + 385.ImportedFromIB2 + 386.IBPluginDependency + 386.ImportedFromIB2 + 419.IBPluginDependency + 419.ImportedFromIB2 + 420.IBPluginDependency + 420.ImportedFromIB2 + 421.IBPluginDependency + 421.ImportedFromIB2 + 423.IBPluginDependency + 423.ImportedFromIB2 + 435.IBPluginDependency + 435.ImportedFromIB2 + 5.IBPluginDependency + 5.ImportedFromIB2 + 524.IBPluginDependency + 524.ImportedFromIB2 + 526.IBPluginDependency + 526.ImportedFromIB2 + 527.IBPluginDependency + 527.ImportedFromIB2 + 532.IBPluginDependency + 532.ImportedFromIB2 + 533.IBPluginDependency + 533.ImportedFromIB2 + 535.IBPluginDependency + 535.ImportedFromIB2 + 536.IBPluginDependency + 536.ImportedFromIB2 + 537.IBPluginDependency + 537.ImportedFromIB2 + 538.IBPluginDependency + 538.ImportedFromIB2 + 541.IBPluginDependency + 541.ImportedFromIB2 + 543.IBPluginDependency + 543.ImportedFromIB2 + 544.IBPluginDependency + 544.ImportedFromIB2 + 545.IBPluginDependency + 545.ImportedFromIB2 + 56.IBPluginDependency + 56.ImportedFromIB2 + 57.IBEditorWindowLastContentRect + 57.IBPluginDependency + 57.ImportedFromIB2 + 57.editorWindowContentRectSynchronizationRect + 573.IBPluginDependency + 573.ImportedFromIB2 + 574.IBPluginDependency + 574.ImportedFromIB2 + 575.IBPluginDependency + 575.ImportedFromIB2 + 58.IBPluginDependency + 58.ImportedFromIB2 + 92.IBPluginDependency + 92.ImportedFromIB2 + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{168, 821}, {113, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{202, 626}, {154, 153}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{349, 858}, {315, 153}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{271, 666}, {301, 153}} + {{437, 749}, {484, 308}} + {{437, 749}, {484, 308}} + + {{184, 290}, {481, 345}} + + + {3.40282e+38, 3.40282e+38} + {320, 240} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{58, 803}, {155, 33}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{100, 746}, {155, 33}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{68, 585}, {454, 271}} + + + {{68, 585}, {454, 271}} + + {{433, 406}, {486, 327}} + + + {3.40282e+38, 3.40282e+38} + {320, 240} + com.apple.InterfaceBuilder.CocoaPlugin + + {{145, 1011}, {336, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{67, 819}, {336, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{20, 641}, {218, 203}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{79, 616}, {218, 203}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + YES + + YES + + + YES + + + + + YES + + YES + + + YES + + + + 300475 + + + + YES + + FirstResponder + NSObject + + IBUserSource + + + + + NSFormatter + NSObject + + IBUserSource + + + + + X11Controller + NSObject + + IBUserSource + + + + + + YES + + X11Controller + NSObject + + YES + + YES + apps_table_delete: + apps_table_done: + apps_table_duplicate: + apps_table_new: + apps_table_show: + bring_to_front: + close_window: + enable_fullscreen_changed: + minimize_window: + next_window: + prefs_changed: + prefs_show: + previous_window: + quit: + toggle_fullscreen: + x11_help: + zoom_window: + + + YES + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + YES + + YES + apps_separator + apps_table + click_through + copy_menu_item + depth + dock_apps_menu + dock_menu + dock_window_separator + enable_auth + enable_fullscreen + enable_fullscreen_menu + enable_keyequivs + enable_tcp + fake_buttons + focus_follows_mouse + focus_on_new_window + prefs_panel + sync_clipboard_to_pasteboard + sync_keymap + sync_pasteboard + sync_pasteboard_to_clipboard + sync_pasteboard_to_primary + sync_primary_immediately + sync_text1 + sync_text2 + toggle_fullscreen_item + use_sysbeep + window_separator + x11_about_item + + + YES + NSMenuItem + NSTableView + NSButton + NSMenuItem + NSPopUpButton + NSMenu + NSMenu + NSMenuItem + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSPanel + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSTextField + NSTextField + NSMenuItem + NSButton + NSMenuItem + NSMenuItem + + + + IBDocumentRelativeSource + ../../../X11Controller.h + + + + + 0 + ../X11.xcodeproj + 3 + + diff --git a/xorg-server/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib new file mode 100644 index 000000000..ee6cdf25e Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/French.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/Resources/French.lproj/InfoPlist.strings new file mode 100644 index 000000000..88e1f04ac Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/French.lproj/InfoPlist.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/French.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/French.lproj/Localizable.strings new file mode 100644 index 000000000..2770dfb8c Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/French.lproj/Localizable.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/French.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/French.lproj/main.nib/keyedobjects.nib new file mode 100644 index 000000000..9f9a7da67 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/French.lproj/main.nib/keyedobjects.nib differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/German.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/Resources/German.lproj/InfoPlist.strings new file mode 100644 index 000000000..aa37e7555 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/German.lproj/InfoPlist.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/German.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/German.lproj/Localizable.strings new file mode 100644 index 000000000..a5489ab5c Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/German.lproj/Localizable.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/German.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/German.lproj/main.nib/keyedobjects.nib new file mode 100644 index 000000000..19532a9c2 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/German.lproj/main.nib/keyedobjects.nib differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/Italian.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/Resources/Italian.lproj/InfoPlist.strings new file mode 100644 index 000000000..412169880 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/Italian.lproj/InfoPlist.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/Italian.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/Italian.lproj/Localizable.strings new file mode 100644 index 000000000..d05d73d44 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/Italian.lproj/Localizable.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/Italian.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/Italian.lproj/main.nib/keyedobjects.nib new file mode 100644 index 000000000..b6e2e1bb1 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/Italian.lproj/main.nib/keyedobjects.nib differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/Japanese.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/Resources/Japanese.lproj/InfoPlist.strings new file mode 100644 index 000000000..2d6330fa7 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/Japanese.lproj/InfoPlist.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/Japanese.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/Japanese.lproj/Localizable.strings new file mode 100644 index 000000000..99821ea1f Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/Japanese.lproj/Localizable.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/Japanese.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/Japanese.lproj/main.nib/keyedobjects.nib new file mode 100644 index 000000000..523fd0856 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/Japanese.lproj/main.nib/keyedobjects.nib differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/Spanish.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/Resources/Spanish.lproj/InfoPlist.strings new file mode 100644 index 000000000..0e4287d14 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/Spanish.lproj/InfoPlist.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/Spanish.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/Spanish.lproj/Localizable.strings new file mode 100644 index 000000000..652f432a5 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/Spanish.lproj/Localizable.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/Spanish.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/Spanish.lproj/main.nib/keyedobjects.nib new file mode 100644 index 000000000..029349dd0 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/Spanish.lproj/main.nib/keyedobjects.nib differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/X11.icns b/xorg-server/hw/xquartz/bundle/Resources/X11.icns new file mode 100644 index 000000000..d9d2f7696 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/X11.icns differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/da.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/Resources/da.lproj/InfoPlist.strings new file mode 100644 index 000000000..88e1f04ac Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/da.lproj/InfoPlist.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/da.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/da.lproj/Localizable.strings new file mode 100644 index 000000000..9608a2e6b Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/da.lproj/Localizable.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/da.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/da.lproj/main.nib/keyedobjects.nib new file mode 100644 index 000000000..4a2bd4bde Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/da.lproj/main.nib/keyedobjects.nib differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/fi.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/Resources/fi.lproj/InfoPlist.strings new file mode 100644 index 000000000..8e4f6474f Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/fi.lproj/InfoPlist.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/fi.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/fi.lproj/Localizable.strings new file mode 100644 index 000000000..e8420fbaa Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/fi.lproj/Localizable.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/fi.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/fi.lproj/main.nib/keyedobjects.nib new file mode 100644 index 000000000..b5039fd44 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/fi.lproj/main.nib/keyedobjects.nib differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/ko.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/Resources/ko.lproj/InfoPlist.strings new file mode 100644 index 000000000..4c738f8b2 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/ko.lproj/InfoPlist.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/ko.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/ko.lproj/Localizable.strings new file mode 100644 index 000000000..56a335859 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/ko.lproj/Localizable.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/ko.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/ko.lproj/main.nib/keyedobjects.nib new file mode 100644 index 000000000..925945c4d Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/ko.lproj/main.nib/keyedobjects.nib differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/no.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/Resources/no.lproj/InfoPlist.strings new file mode 100644 index 000000000..eb1cfb002 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/no.lproj/InfoPlist.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/no.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/no.lproj/Localizable.strings new file mode 100644 index 000000000..5157a67de Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/no.lproj/Localizable.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/no.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/no.lproj/main.nib/keyedobjects.nib new file mode 100644 index 000000000..ca25327f5 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/no.lproj/main.nib/keyedobjects.nib differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/pl.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/Resources/pl.lproj/InfoPlist.strings new file mode 100644 index 000000000..b9c950214 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/pl.lproj/InfoPlist.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/pl.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/pl.lproj/Localizable.strings new file mode 100644 index 000000000..4ae12d77f Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/pl.lproj/Localizable.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/pl.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/pl.lproj/main.nib/keyedobjects.nib new file mode 100644 index 000000000..e9ca5404b Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/pl.lproj/main.nib/keyedobjects.nib differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/pt.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/Resources/pt.lproj/InfoPlist.strings new file mode 100644 index 000000000..33c637448 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/pt.lproj/InfoPlist.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/pt.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/pt.lproj/Localizable.strings new file mode 100644 index 000000000..23ea96847 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/pt.lproj/Localizable.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/pt.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/pt.lproj/main.nib/keyedobjects.nib new file mode 100644 index 000000000..e88cccdba Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/pt.lproj/main.nib/keyedobjects.nib differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/pt_PT.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/Resources/pt_PT.lproj/InfoPlist.strings new file mode 100644 index 000000000..33c637448 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/pt_PT.lproj/InfoPlist.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/pt_PT.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/pt_PT.lproj/Localizable.strings new file mode 100644 index 000000000..71c33ad14 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/pt_PT.lproj/Localizable.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/pt_PT.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/pt_PT.lproj/main.nib/keyedobjects.nib new file mode 100644 index 000000000..a61933475 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/pt_PT.lproj/main.nib/keyedobjects.nib differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/ru.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/Resources/ru.lproj/InfoPlist.strings new file mode 100644 index 000000000..7f722e4b6 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/ru.lproj/InfoPlist.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/ru.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/ru.lproj/Localizable.strings new file mode 100644 index 000000000..3b3811234 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/ru.lproj/Localizable.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/ru.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/ru.lproj/main.nib/keyedobjects.nib new file mode 100644 index 000000000..9354e0264 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/ru.lproj/main.nib/keyedobjects.nib differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/sv.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/Resources/sv.lproj/InfoPlist.strings new file mode 100644 index 000000000..655d5ff63 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/sv.lproj/InfoPlist.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/sv.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/sv.lproj/Localizable.strings new file mode 100644 index 000000000..796f06c21 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/sv.lproj/Localizable.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/sv.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/sv.lproj/main.nib/keyedobjects.nib new file mode 100644 index 000000000..bd01c2dac Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/sv.lproj/main.nib/keyedobjects.nib differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/zh_CN.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/Resources/zh_CN.lproj/InfoPlist.strings new file mode 100644 index 000000000..b5df36885 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/zh_CN.lproj/InfoPlist.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/zh_CN.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/zh_CN.lproj/Localizable.strings new file mode 100644 index 000000000..f88a6da4b Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/zh_CN.lproj/Localizable.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/zh_CN.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/zh_CN.lproj/main.nib/keyedobjects.nib new file mode 100644 index 000000000..e36c15fb6 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/zh_CN.lproj/main.nib/keyedobjects.nib differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/zh_TW.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/Resources/zh_TW.lproj/InfoPlist.strings new file mode 100644 index 000000000..92d5473b0 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/zh_TW.lproj/InfoPlist.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/zh_TW.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/zh_TW.lproj/Localizable.strings new file mode 100644 index 000000000..f009302c2 Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/zh_TW.lproj/Localizable.strings differ diff --git a/xorg-server/hw/xquartz/bundle/Resources/zh_TW.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/zh_TW.lproj/main.nib/keyedobjects.nib new file mode 100644 index 000000000..36602c53e Binary files /dev/null and b/xorg-server/hw/xquartz/bundle/Resources/zh_TW.lproj/main.nib/keyedobjects.nib differ diff --git a/xorg-server/hw/xquartz/bundle/Spanish.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/Spanish.lproj/InfoPlist.strings deleted file mode 100644 index 0e4287d14..000000000 Binary files a/xorg-server/hw/xquartz/bundle/Spanish.lproj/InfoPlist.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/Spanish.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Spanish.lproj/Localizable.strings deleted file mode 100644 index 652f432a5..000000000 Binary files a/xorg-server/hw/xquartz/bundle/Spanish.lproj/Localizable.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/Spanish.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Spanish.lproj/main.nib/keyedobjects.nib deleted file mode 100644 index 029349dd0..000000000 Binary files a/xorg-server/hw/xquartz/bundle/Spanish.lproj/main.nib/keyedobjects.nib and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/X11.icns b/xorg-server/hw/xquartz/bundle/X11.icns deleted file mode 100644 index d770e617d..000000000 Binary files a/xorg-server/hw/xquartz/bundle/X11.icns and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/X11.sh b/xorg-server/hw/xquartz/bundle/X11.sh new file mode 100644 index 000000000..3b8b6799c --- /dev/null +++ b/xorg-server/hw/xquartz/bundle/X11.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set "$(dirname "$0")"/X11.bin "${@}" + +if [ -x ~/.x11run ]; then + exec ~/.x11run "${@}" +fi + +case $(basename "${SHELL}") in + bash) exec -l "${SHELL}" --login -c 'exec "${@}"' - "${@}" ;; + ksh|sh|zsh) exec -l "${SHELL}" -c 'exec "${@}"' - "${@}" ;; + csh|tcsh) exec -l "${SHELL}" -c 'exec $argv:q' "${@}" ;; + es|rc) exec -l "${SHELL}" -l -c 'exec $*' "${@}" ;; + *) exec "${@}" ;; +esac diff --git a/xorg-server/hw/xquartz/bundle/X11.xcodeproj/project.pbxproj b/xorg-server/hw/xquartz/bundle/X11.xcodeproj/project.pbxproj deleted file mode 100644 index ae8ec07e6..000000000 --- a/xorg-server/hw/xquartz/bundle/X11.xcodeproj/project.pbxproj +++ /dev/null @@ -1,458 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 42; - objects = { - -/* Begin PBXBuildFile section */ - 527F24190B5D938C007840A7 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0867D6AAFE840B52C02AAC07 /* InfoPlist.strings */; }; - 527F241A0B5D938C007840A7 /* main.nib in Resources */ = {isa = PBXBuildFile; fileRef = 02345980000FD03B11CA0E72 /* main.nib */; }; - 527F241B0B5D938C007840A7 /* X11.icns in Resources */ = {isa = PBXBuildFile; fileRef = 50459C5F038587C60ECA21EC /* X11.icns */; }; - 527F241D0B5D938C007840A7 /* bundle-main.c in Sources */ = {isa = PBXBuildFile; fileRef = 50EE2AB703849F0B0ECA21EC /* bundle-main.c */; }; - 527F241F0B5D938C007840A7 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50F4F0A7039D6ACA0E82C0CB /* CoreFoundation.framework */; }; - 527F24200B5D938C007840A7 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 570C5748047186C400ACF82F /* SystemConfiguration.framework */; }; - 527F24370B5D9D89007840A7 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 527F24260B5D938C007840A7 /* Info.plist */; }; - 52D9C0ED0BCDDF6B00CD2AFC /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 52D9C0EB0BCDDF6B00CD2AFC /* Localizable.strings */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 0867D6ABFE840B52C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; - 1870340FFE93FCAF11CA0CD7 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/main.nib; sourceTree = ""; }; - 3FB03E460D1B6C05005958A5 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Localizable.strings; sourceTree = ""; }; - 3FB03E470D1B6C05005958A5 /* Dutch */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Dutch; path = Dutch.lproj/Localizable.strings; sourceTree = ""; }; - 3FB03E480D1B6C05005958A5 /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/Localizable.strings; sourceTree = ""; }; - 3FB03E490D1B6C05005958A5 /* French */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = French; path = French.lproj/Localizable.strings; sourceTree = ""; }; - 3FB03E4A0D1B6C05005958A5 /* German */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = German; path = German.lproj/Localizable.strings; sourceTree = ""; }; - 3FB03E4B0D1B6C05005958A5 /* Italian */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Italian; path = Italian.lproj/Localizable.strings; sourceTree = ""; }; - 3FB03E4C0D1B6C05005958A5 /* Japanese */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Japanese; path = Japanese.lproj/Localizable.strings; sourceTree = ""; }; - 3FB03E4D0D1B6C05005958A5 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Localizable.strings; sourceTree = ""; }; - 3FB03E4E0D1B6C05005958A5 /* no */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = no; path = no.lproj/Localizable.strings; sourceTree = ""; }; - 3FB03E4F0D1B6C05005958A5 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Localizable.strings; sourceTree = ""; }; - 3FB03E500D1B6C05005958A5 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/Localizable.strings; sourceTree = ""; }; - 3FB03E510D1B6C05005958A5 /* pt_PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt_PT; path = pt_PT.lproj/Localizable.strings; sourceTree = ""; }; - 3FB03E520D1B6C05005958A5 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = ""; }; - 3FB03E530D1B6C05005958A5 /* Spanish */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Spanish; path = Spanish.lproj/Localizable.strings; sourceTree = ""; }; - 3FB03E540D1B6C05005958A5 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Localizable.strings; sourceTree = ""; }; - 3FB03E550D1B6C05005958A5 /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh_CN; path = zh_CN.lproj/Localizable.strings; sourceTree = ""; }; - 3FB03E560D1B6C05005958A5 /* zh_TW */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh_TW; path = zh_TW.lproj/Localizable.strings; sourceTree = ""; }; - 3FB03E570D1B6C17005958A5 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/InfoPlist.strings; sourceTree = ""; }; - 3FB03E580D1B6C17005958A5 /* Dutch */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Dutch; path = Dutch.lproj/InfoPlist.strings; sourceTree = ""; }; - 3FB03E590D1B6C17005958A5 /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/InfoPlist.strings; sourceTree = ""; }; - 3FB03E5A0D1B6C17005958A5 /* French */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = French; path = French.lproj/InfoPlist.strings; sourceTree = ""; }; - 3FB03E5B0D1B6C17005958A5 /* German */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = German; path = German.lproj/InfoPlist.strings; sourceTree = ""; }; - 3FB03E5C0D1B6C17005958A5 /* Italian */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Italian; path = Italian.lproj/InfoPlist.strings; sourceTree = ""; }; - 3FB03E5D0D1B6C17005958A5 /* Japanese */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Japanese; path = Japanese.lproj/InfoPlist.strings; sourceTree = ""; }; - 3FB03E5E0D1B6C17005958A5 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/InfoPlist.strings; sourceTree = ""; }; - 3FB03E5F0D1B6C17005958A5 /* no */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = no; path = no.lproj/InfoPlist.strings; sourceTree = ""; }; - 3FB03E600D1B6C17005958A5 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/InfoPlist.strings; sourceTree = ""; }; - 3FB03E610D1B6C17005958A5 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; - 3FB03E620D1B6C17005958A5 /* pt_PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt_PT; path = pt_PT.lproj/InfoPlist.strings; sourceTree = ""; }; - 3FB03E630D1B6C17005958A5 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/InfoPlist.strings; sourceTree = ""; }; - 3FB03E640D1B6C17005958A5 /* Spanish */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Spanish; path = Spanish.lproj/InfoPlist.strings; sourceTree = ""; }; - 3FB03E650D1B6C17005958A5 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/InfoPlist.strings; sourceTree = ""; }; - 3FB03E660D1B6C17005958A5 /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh_CN; path = zh_CN.lproj/InfoPlist.strings; sourceTree = ""; }; - 3FB03E670D1B6C17005958A5 /* zh_TW */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh_TW; path = zh_TW.lproj/InfoPlist.strings; sourceTree = ""; }; - 3FB03E680D1B6C34005958A5 /* da */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = da; path = da.lproj/main.nib; sourceTree = ""; }; - 3FB03E690D1B6C34005958A5 /* Dutch */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Dutch; path = Dutch.lproj/main.nib; sourceTree = ""; }; - 3FB03E6A0D1B6C34005958A5 /* fi */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = fi; path = fi.lproj/main.nib; sourceTree = ""; }; - 3FB03E6B0D1B6C34005958A5 /* French */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = French; path = French.lproj/main.nib; sourceTree = ""; }; - 3FB03E6C0D1B6C34005958A5 /* German */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = German; path = German.lproj/main.nib; sourceTree = ""; }; - 3FB03E6D0D1B6C34005958A5 /* Italian */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Italian; path = Italian.lproj/main.nib; sourceTree = ""; }; - 3FB03E6E0D1B6C34005958A5 /* Japanese */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Japanese; path = Japanese.lproj/main.nib; sourceTree = ""; }; - 3FB03E6F0D1B6C34005958A5 /* ko */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = ko; path = ko.lproj/main.nib; sourceTree = ""; }; - 3FB03E700D1B6C34005958A5 /* no */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = no; path = no.lproj/main.nib; sourceTree = ""; }; - 3FB03E710D1B6C34005958A5 /* pl */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pl; path = pl.lproj/main.nib; sourceTree = ""; }; - 3FB03E720D1B6C34005958A5 /* pt */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt; path = pt.lproj/main.nib; sourceTree = ""; }; - 3FB03E730D1B6C34005958A5 /* pt_PT */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt_PT; path = pt_PT.lproj/main.nib; sourceTree = ""; }; - 3FB03E740D1B6C34005958A5 /* ru */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = ru; path = ru.lproj/main.nib; sourceTree = ""; }; - 3FB03E750D1B6C34005958A5 /* Spanish */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Spanish; path = Spanish.lproj/main.nib; sourceTree = ""; }; - 3FB03E760D1B6C34005958A5 /* sv */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = sv; path = sv.lproj/main.nib; sourceTree = ""; }; - 3FB03E770D1B6C34005958A5 /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = zh_CN; path = zh_CN.lproj/main.nib; sourceTree = ""; }; - 3FB03E780D1B6C34005958A5 /* zh_TW */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = zh_TW; path = zh_TW.lproj/main.nib; sourceTree = ""; }; - 50459C5F038587C60ECA21EC /* X11.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = X11.icns; sourceTree = ""; }; - 50EE2AB703849F0B0ECA21EC /* bundle-main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = "bundle-main.c"; sourceTree = ""; }; - 50F4F0A7039D6ACA0E82C0CB /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; - 527F24260B5D938C007840A7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Info.plist; sourceTree = ""; }; - 527F24270B5D938C007840A7 /* X11.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = X11.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 52D9C0EC0BCDDF6B00CD2AFC /* English */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; sourceTree = ""; }; - 570C5748047186C400ACF82F /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = /System/Library/Frameworks/SystemConfiguration.framework; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 527F241E0B5D938C007840A7 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 527F241F0B5D938C007840A7 /* CoreFoundation.framework in Frameworks */, - 527F24200B5D938C007840A7 /* SystemConfiguration.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 195DF8CFFE9D517E11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 527F24270B5D938C007840A7 /* X11.app */, - ); - name = Products; - sourceTree = ""; - }; - 20286C29FDCF999611CA2CEA /* X11 */ = { - isa = PBXGroup; - children = ( - 20286C2AFDCF999611CA2CEA /* Sources */, - 20286C2CFDCF999611CA2CEA /* Resources */, - 20286C32FDCF999611CA2CEA /* External Frameworks and Libraries */, - 195DF8CFFE9D517E11CA2CBB /* Products */, - 527F24260B5D938C007840A7 /* Info.plist */, - ); - name = X11; - sourceTree = ""; - }; - 20286C2AFDCF999611CA2CEA /* Sources */ = { - isa = PBXGroup; - children = ( - 50EE2AB703849F0B0ECA21EC /* bundle-main.c */, - ); - name = Sources; - sourceTree = ""; - }; - 20286C2CFDCF999611CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - 52D9C0EB0BCDDF6B00CD2AFC /* Localizable.strings */, - 50459C5F038587C60ECA21EC /* X11.icns */, - 0867D6AAFE840B52C02AAC07 /* InfoPlist.strings */, - 02345980000FD03B11CA0E72 /* main.nib */, - ); - name = Resources; - sourceTree = ""; - }; - 20286C32FDCF999611CA2CEA /* External Frameworks and Libraries */ = { - isa = PBXGroup; - children = ( - 50F4F0A7039D6ACA0E82C0CB /* CoreFoundation.framework */, - 570C5748047186C400ACF82F /* SystemConfiguration.framework */, - ); - name = "External Frameworks and Libraries"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 527F24170B5D938C007840A7 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 527F24160B5D938C007840A7 /* X11 */ = { - isa = PBXNativeTarget; - buildConfigurationList = 527F24220B5D938C007840A7 /* Build configuration list for PBXNativeTarget "X11" */; - buildPhases = ( - 527F24170B5D938C007840A7 /* Headers */, - 527F24180B5D938C007840A7 /* Resources */, - 527F241C0B5D938C007840A7 /* Sources */, - 527F241E0B5D938C007840A7 /* Frameworks */, - 527F24210B5D938C007840A7 /* Rez */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = X11; - productName = X11; - productReference = 527F24270B5D938C007840A7 /* X11.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 20286C28FDCF999611CA2CEA /* Project object */ = { - isa = PBXProject; - buildConfigurationList = 527F24080B5D8FFC007840A7 /* Build configuration list for PBXProject "X11" */; - compatibilityVersion = "Xcode 2.4"; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - da, - Dutch, - fi, - Italian, - ko, - no, - pl, - pt, - pt_PT, - ru, - Spanish, - sv, - zh_CN, - zh_TW, - ); - mainGroup = 20286C29FDCF999611CA2CEA /* X11 */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 527F24160B5D938C007840A7 /* X11 */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 527F24180B5D938C007840A7 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 527F24370B5D9D89007840A7 /* Info.plist in Resources */, - 527F24190B5D938C007840A7 /* InfoPlist.strings in Resources */, - 527F241A0B5D938C007840A7 /* main.nib in Resources */, - 527F241B0B5D938C007840A7 /* X11.icns in Resources */, - 52D9C0ED0BCDDF6B00CD2AFC /* Localizable.strings in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXRezBuildPhase section */ - 527F24210B5D938C007840A7 /* Rez */ = { - isa = PBXRezBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXRezBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 527F241C0B5D938C007840A7 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 527F241D0B5D938C007840A7 /* bundle-main.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 02345980000FD03B11CA0E72 /* main.nib */ = { - isa = PBXVariantGroup; - children = ( - 1870340FFE93FCAF11CA0CD7 /* English */, - 3FB03E680D1B6C34005958A5 /* da */, - 3FB03E690D1B6C34005958A5 /* Dutch */, - 3FB03E6A0D1B6C34005958A5 /* fi */, - 3FB03E6B0D1B6C34005958A5 /* French */, - 3FB03E6C0D1B6C34005958A5 /* German */, - 3FB03E6D0D1B6C34005958A5 /* Italian */, - 3FB03E6E0D1B6C34005958A5 /* Japanese */, - 3FB03E6F0D1B6C34005958A5 /* ko */, - 3FB03E700D1B6C34005958A5 /* no */, - 3FB03E710D1B6C34005958A5 /* pl */, - 3FB03E720D1B6C34005958A5 /* pt */, - 3FB03E730D1B6C34005958A5 /* pt_PT */, - 3FB03E740D1B6C34005958A5 /* ru */, - 3FB03E750D1B6C34005958A5 /* Spanish */, - 3FB03E760D1B6C34005958A5 /* sv */, - 3FB03E770D1B6C34005958A5 /* zh_CN */, - 3FB03E780D1B6C34005958A5 /* zh_TW */, - ); - name = main.nib; - sourceTree = ""; - }; - 0867D6AAFE840B52C02AAC07 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 0867D6ABFE840B52C02AAC07 /* English */, - 3FB03E570D1B6C17005958A5 /* da */, - 3FB03E580D1B6C17005958A5 /* Dutch */, - 3FB03E590D1B6C17005958A5 /* fi */, - 3FB03E5A0D1B6C17005958A5 /* French */, - 3FB03E5B0D1B6C17005958A5 /* German */, - 3FB03E5C0D1B6C17005958A5 /* Italian */, - 3FB03E5D0D1B6C17005958A5 /* Japanese */, - 3FB03E5E0D1B6C17005958A5 /* ko */, - 3FB03E5F0D1B6C17005958A5 /* no */, - 3FB03E600D1B6C17005958A5 /* pl */, - 3FB03E610D1B6C17005958A5 /* pt */, - 3FB03E620D1B6C17005958A5 /* pt_PT */, - 3FB03E630D1B6C17005958A5 /* ru */, - 3FB03E640D1B6C17005958A5 /* Spanish */, - 3FB03E650D1B6C17005958A5 /* sv */, - 3FB03E660D1B6C17005958A5 /* zh_CN */, - 3FB03E670D1B6C17005958A5 /* zh_TW */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; - 52D9C0EB0BCDDF6B00CD2AFC /* Localizable.strings */ = { - isa = PBXVariantGroup; - children = ( - 52D9C0EC0BCDDF6B00CD2AFC /* English */, - 3FB03E460D1B6C05005958A5 /* da */, - 3FB03E470D1B6C05005958A5 /* Dutch */, - 3FB03E480D1B6C05005958A5 /* fi */, - 3FB03E490D1B6C05005958A5 /* French */, - 3FB03E4A0D1B6C05005958A5 /* German */, - 3FB03E4B0D1B6C05005958A5 /* Italian */, - 3FB03E4C0D1B6C05005958A5 /* Japanese */, - 3FB03E4D0D1B6C05005958A5 /* ko */, - 3FB03E4E0D1B6C05005958A5 /* no */, - 3FB03E4F0D1B6C05005958A5 /* pl */, - 3FB03E500D1B6C05005958A5 /* pt */, - 3FB03E510D1B6C05005958A5 /* pt_PT */, - 3FB03E520D1B6C05005958A5 /* ru */, - 3FB03E530D1B6C05005958A5 /* Spanish */, - 3FB03E540D1B6C05005958A5 /* sv */, - 3FB03E550D1B6C05005958A5 /* zh_CN */, - 3FB03E560D1B6C05005958A5 /* zh_TW */, - ); - name = Localizable.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 527F24090B5D8FFC007840A7 /* Development */ = { - isa = XCBuildConfiguration; - buildSettings = { - INSTALL_MODE_FLAG = "a+rX"; - }; - name = Development; - }; - 527F240A0B5D8FFC007840A7 /* Deployment */ = { - isa = XCBuildConfiguration; - buildSettings = { - INSTALL_MODE_FLAG = "a+rX"; - }; - name = Deployment; - }; - 527F240B0B5D8FFC007840A7 /* Default */ = { - isa = XCBuildConfiguration; - buildSettings = { - INSTALL_MODE_FLAG = "a+rX"; - }; - name = Default; - }; - 527F24230B5D938C007840A7 /* Development */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - FRAMEWORK_SEARCH_PATHS = ""; - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - HEADER_SEARCH_PATHS = /usr/X11/include; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = /usr/X11; - LIBRARY_SEARCH_PATHS = /usr/X11/lib; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ( - "-lXau", - "-lxcb", - "-lX11", - ); - OTHER_REZFLAGS = ""; - PRODUCT_NAME = X11; - SECTORDER_FLAGS = ""; - WARNING_CFLAGS = ( - "-Wmost", - "-Wno-four-char-constants", - "-Wno-unknown-pragmas", - ); - WRAPPER_EXTENSION = app; - }; - name = Development; - }; - 527F24240B5D938C007840A7 /* Deployment */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = YES; - FRAMEWORK_SEARCH_PATHS = ""; - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - HEADER_SEARCH_PATHS = /usr/X11/include; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = /usr/X11; - LIBRARY_SEARCH_PATHS = /usr/X11/lib; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ( - "-lXau", - "-lxcb", - "-lX11", - ); - OTHER_REZFLAGS = ""; - PRODUCT_NAME = X11; - SECTORDER_FLAGS = ""; - WARNING_CFLAGS = ( - "-Wmost", - "-Wno-four-char-constants", - "-Wno-unknown-pragmas", - ); - WRAPPER_EXTENSION = app; - }; - name = Deployment; - }; - 527F24250B5D938C007840A7 /* Default */ = { - isa = XCBuildConfiguration; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ""; - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - HEADER_SEARCH_PATHS = /usr/X11/include; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = /usr/X11; - LIBRARY_SEARCH_PATHS = /usr/X11/lib; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ( - "-lXau", - "-lxcb", - "-lX11", - ); - OTHER_REZFLAGS = ""; - PRODUCT_NAME = X11; - SECTORDER_FLAGS = ""; - WARNING_CFLAGS = ( - "-Wmost", - "-Wno-four-char-constants", - "-Wno-unknown-pragmas", - ); - WRAPPER_EXTENSION = app; - }; - name = Default; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 527F24080B5D8FFC007840A7 /* Build configuration list for PBXProject "X11" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 527F24090B5D8FFC007840A7 /* Development */, - 527F240A0B5D8FFC007840A7 /* Deployment */, - 527F240B0B5D8FFC007840A7 /* Default */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; - }; - 527F24220B5D938C007840A7 /* Build configuration list for PBXNativeTarget "X11" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 527F24230B5D938C007840A7 /* Development */, - 527F24240B5D938C007840A7 /* Deployment */, - 527F24250B5D938C007840A7 /* Default */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; - }; -/* End XCConfigurationList section */ - }; - rootObject = 20286C28FDCF999611CA2CEA /* Project object */; -} diff --git a/xorg-server/hw/xquartz/bundle/bundle-main.c b/xorg-server/hw/xquartz/bundle/bundle-main.c deleted file mode 100644 index e97770a55..000000000 --- a/xorg-server/hw/xquartz/bundle/bundle-main.c +++ /dev/null @@ -1,136 +0,0 @@ -/* main.c -- X application launcher - - Copyright (c) 2007 Jeremy Huddleston - Copyright (c) 2007 Apple Inc - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT - HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - Except as contained in this notice, the name(s) of the above - copyright holders shall not be used in advertising or otherwise to - promote the sale, use or other dealings in this Software without - prior written authorization. */ - -#include -#include -#include -#include -#include - -#include - -#define DEFAULT_CLIENT "/usr/X11/bin/xterm" -#define DEFAULT_STARTX "/usr/X11/bin/startx" -#define DEFAULT_SHELL "/bin/sh" - -static int execute(const char *command); -static char *command_from_prefs(const char *key, const char *default_value); - -int main(int argc, char **argv) { - Display *display; - const char *s; - - size_t i; - fprintf(stderr, "X11.app: main(): argc=%d\n", argc); - for(i=0; i < argc; i++) { - fprintf(stderr, "\targv[%u] = %s\n", (unsigned)i, argv[i]); - } - - /* If we have a process serial number and it's our only arg, act as if - * the user double clicked the app bundle: launch app_to_run if possible - */ - if(argc == 1 || (argc == 2 && !strncmp(argv[1], "-psn_", 5))) { - /* Now, try to open a display, if so, run the launcher */ - display = XOpenDisplay(NULL); - if(display) { - fprintf(stderr, "X11.app: Closing the display and sleeping for 2s to allow the X server to start up.\n"); - /* Could open the display, start the launcher */ - XCloseDisplay(display); - - /* Give 2 seconds for the server to start... - * TODO: *Really* fix this race condition - */ - usleep(2000); - return execute(command_from_prefs("app_to_run", DEFAULT_CLIENT)); - } - } - - /* Start the server */ - if(s = getenv("DISPLAY")) { - fprintf(stderr, "X11.app: Could not connect to server (DISPLAY=\"%s\", unsetting). Starting X server.\n", s); - unsetenv("DISPLAY"); - } else { - fprintf(stderr, "X11.app: Could not connect to server (DISPLAY is not set). Starting X server.\n"); - } - return execute(command_from_prefs("startx_script", DEFAULT_STARTX)); -} - -static int execute(const char *command) { - const char *newargv[7]; - const char **s; - - newargv[0] = "/usr/bin/login"; - newargv[1] = "-fp"; - newargv[2] = getlogin(); - newargv[3] = command_from_prefs("login_shell", DEFAULT_SHELL); - newargv[4] = "-c"; - newargv[5] = command; - newargv[6] = NULL; - - fprintf(stderr, "X11.app: Launching %s:\n", command); - for(s=newargv; *s; s++) { - fprintf(stderr, "\targv[%d] = %s\n", s - newargv, *s); - } - - execvp (newargv[0], (char * const *) newargv); - perror ("X11.app: Couldn't exec."); - return(1); -} - -static char *command_from_prefs(const char *key, const char *default_value) { - char *command = NULL; - - CFStringRef cfKey = CFStringCreateWithCString(NULL, key, kCFStringEncodingASCII); - CFPropertyListRef PlistRef = CFPreferencesCopyAppValue(cfKey, kCFPreferencesCurrentApplication); - - if ((PlistRef == NULL) || (CFGetTypeID(PlistRef) != CFStringGetTypeID())) { - CFStringRef cfDefaultValue = CFStringCreateWithCString(NULL, default_value, kCFStringEncodingASCII); - - CFPreferencesSetAppValue(cfKey, cfDefaultValue, kCFPreferencesCurrentApplication); - CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication); - - int len = strlen(default_value) + 1; - command = (char *)malloc(len * sizeof(char)); - if(!command) - return NULL; - strcpy(command, default_value); - } else { - int len = CFStringGetLength((CFStringRef)PlistRef) + 1; - command = (char *)malloc(len * sizeof(char)); - if(!command) - return NULL; - CFStringGetCString((CFStringRef)PlistRef, command, len, kCFStringEncodingASCII); - } - - if (PlistRef) - CFRelease(PlistRef); - - return command; -} diff --git a/xorg-server/hw/xquartz/bundle/cpprules.in b/xorg-server/hw/xquartz/bundle/cpprules.in new file mode 100644 index 000000000..f32eafc06 --- /dev/null +++ b/xorg-server/hw/xquartz/bundle/cpprules.in @@ -0,0 +1,37 @@ +# 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 '/XSLASHGLOB/s/XSLASHGLOB/\/\*/' \ + -e '/\@\@$$/s/\@\@$$/\\/' + +# Strings to replace in man pages +XORGRELSTRING = @PACKAGE_STRING@ + XORGMANNAME = X Version 11 + +MANDEFS = \ + -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__XSERVERNAME__=Xorg -D__XCONFIGFILE__=xorg.conf \ + -D__xinitdir__=$(XINITDIR) \ + -D__bindir__=$(bindir) \ + -DSHELL_CMD=$(SHELL_CMD) $(ARCHMANDEFS) + +SUFFIXES = .$(APP_MAN_SUFFIX) .man .cpp + +.cpp: + $(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) < $< | $(CPP_SED_MAGIC) > $@ + +.man.$(APP_MAN_SUFFIX): + $(RAWCPP) $(RAWCPPFLAGS) $(MANDEFS) $(EXTRAMANDEFS) < $< | $(CPP_SED_MAGIC) > $@ diff --git a/xorg-server/hw/xquartz/bundle/da.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/da.lproj/InfoPlist.strings deleted file mode 100644 index 88e1f04ac..000000000 Binary files a/xorg-server/hw/xquartz/bundle/da.lproj/InfoPlist.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/da.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/da.lproj/Localizable.strings deleted file mode 100644 index 9608a2e6b..000000000 Binary files a/xorg-server/hw/xquartz/bundle/da.lproj/Localizable.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/da.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/da.lproj/main.nib/keyedobjects.nib deleted file mode 100644 index 4a2bd4bde..000000000 Binary files a/xorg-server/hw/xquartz/bundle/da.lproj/main.nib/keyedobjects.nib and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/fi.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/fi.lproj/InfoPlist.strings deleted file mode 100644 index 8e4f6474f..000000000 Binary files a/xorg-server/hw/xquartz/bundle/fi.lproj/InfoPlist.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/fi.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/fi.lproj/Localizable.strings deleted file mode 100644 index e8420fbaa..000000000 Binary files a/xorg-server/hw/xquartz/bundle/fi.lproj/Localizable.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/fi.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/fi.lproj/main.nib/keyedobjects.nib deleted file mode 100644 index b5039fd44..000000000 Binary files a/xorg-server/hw/xquartz/bundle/fi.lproj/main.nib/keyedobjects.nib and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/ko.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/ko.lproj/InfoPlist.strings deleted file mode 100644 index 4c738f8b2..000000000 Binary files a/xorg-server/hw/xquartz/bundle/ko.lproj/InfoPlist.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/ko.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/ko.lproj/Localizable.strings deleted file mode 100644 index 56a335859..000000000 Binary files a/xorg-server/hw/xquartz/bundle/ko.lproj/Localizable.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/ko.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/ko.lproj/main.nib/keyedobjects.nib deleted file mode 100644 index 925945c4d..000000000 Binary files a/xorg-server/hw/xquartz/bundle/ko.lproj/main.nib/keyedobjects.nib and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/mk_bundke.sh b/xorg-server/hw/xquartz/bundle/mk_bundke.sh new file mode 100644 index 000000000..c85b21765 --- /dev/null +++ b/xorg-server/hw/xquartz/bundle/mk_bundke.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# +# 'Cause xcodebuild is hard to deal with + +SRCDIR=$1 +BUILDDIR=$2 +BUNDLE_ROOT=$3 + +localities="Dutch English French German Italian Japanese Spanish da fi ko no pl pt pt_PT ru sv zh_CN zh_TW" +for lang in ${localities} ; do + mkdir -p ${BUNDLE_ROOT}/Contents/Resources/${lang}.lproj/main.nib + [ -d ${BUNDLE_ROOT}/Contents/Resources/${lang}.lproj/main.nib ] || exit 1 + + for f in InfoPlist.strings Localizable.strings main.nib/keyedobjects.nib ; do + install -m 644 ${SRCDIR}/Resources/${lang}.lproj/$f ${BUNDLE_ROOT}/Contents/Resources/${lang}.lproj/${f} + done +done + +install -m 644 ${SRCDIR}/Resources/English.lproj/main.nib//designable.nib ${BUNDLE_ROOT}/Contents/Resources/English.lproj/main.nib +install -m 644 ${SRCDIR}/Resources/X11.icns ${BUNDLE_ROOT}/Contents/Resources + +install -m 644 ${BUILDDIR}/Info.plist ${BUNDLE_ROOT}/Contents +install -m 644 ${SRCDIR}/PkgInfo ${BUNDLE_ROOT}/Contents + +mkdir -p ${BUNDLE_ROOT}/Contents/MacOS +install -m 755 ${SRCDIR}/X11.sh ${BUNDLE_ROOT}/Contents/MacOS/X11 + +if [[ $(id -u) == 0 ]] ; then + chown -R root:admin ${BUNDLE_ROOT} +fi diff --git a/xorg-server/hw/xquartz/bundle/no.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/no.lproj/InfoPlist.strings deleted file mode 100644 index eb1cfb002..000000000 Binary files a/xorg-server/hw/xquartz/bundle/no.lproj/InfoPlist.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/no.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/no.lproj/Localizable.strings deleted file mode 100644 index 5157a67de..000000000 Binary files a/xorg-server/hw/xquartz/bundle/no.lproj/Localizable.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/no.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/no.lproj/main.nib/keyedobjects.nib deleted file mode 100644 index ca25327f5..000000000 Binary files a/xorg-server/hw/xquartz/bundle/no.lproj/main.nib/keyedobjects.nib and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/pl.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/pl.lproj/InfoPlist.strings deleted file mode 100644 index b9c950214..000000000 Binary files a/xorg-server/hw/xquartz/bundle/pl.lproj/InfoPlist.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/pl.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/pl.lproj/Localizable.strings deleted file mode 100644 index 4ae12d77f..000000000 Binary files a/xorg-server/hw/xquartz/bundle/pl.lproj/Localizable.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/pl.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/pl.lproj/main.nib/keyedobjects.nib deleted file mode 100644 index e9ca5404b..000000000 Binary files a/xorg-server/hw/xquartz/bundle/pl.lproj/main.nib/keyedobjects.nib and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/pt.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/pt.lproj/InfoPlist.strings deleted file mode 100644 index 33c637448..000000000 Binary files a/xorg-server/hw/xquartz/bundle/pt.lproj/InfoPlist.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/pt.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/pt.lproj/Localizable.strings deleted file mode 100644 index 23ea96847..000000000 Binary files a/xorg-server/hw/xquartz/bundle/pt.lproj/Localizable.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/pt.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/pt.lproj/main.nib/keyedobjects.nib deleted file mode 100644 index e88cccdba..000000000 Binary files a/xorg-server/hw/xquartz/bundle/pt.lproj/main.nib/keyedobjects.nib and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/pt_PT.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/pt_PT.lproj/InfoPlist.strings deleted file mode 100644 index 33c637448..000000000 Binary files a/xorg-server/hw/xquartz/bundle/pt_PT.lproj/InfoPlist.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/pt_PT.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/pt_PT.lproj/Localizable.strings deleted file mode 100644 index 71c33ad14..000000000 Binary files a/xorg-server/hw/xquartz/bundle/pt_PT.lproj/Localizable.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/pt_PT.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/pt_PT.lproj/main.nib/keyedobjects.nib deleted file mode 100644 index a61933475..000000000 Binary files a/xorg-server/hw/xquartz/bundle/pt_PT.lproj/main.nib/keyedobjects.nib and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/ru.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/ru.lproj/InfoPlist.strings deleted file mode 100644 index 7f722e4b6..000000000 Binary files a/xorg-server/hw/xquartz/bundle/ru.lproj/InfoPlist.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/ru.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/ru.lproj/Localizable.strings deleted file mode 100644 index 3b3811234..000000000 Binary files a/xorg-server/hw/xquartz/bundle/ru.lproj/Localizable.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/ru.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/ru.lproj/main.nib/keyedobjects.nib deleted file mode 100644 index 9354e0264..000000000 Binary files a/xorg-server/hw/xquartz/bundle/ru.lproj/main.nib/keyedobjects.nib and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/sv.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/sv.lproj/InfoPlist.strings deleted file mode 100644 index 655d5ff63..000000000 Binary files a/xorg-server/hw/xquartz/bundle/sv.lproj/InfoPlist.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/sv.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/sv.lproj/Localizable.strings deleted file mode 100644 index 796f06c21..000000000 Binary files a/xorg-server/hw/xquartz/bundle/sv.lproj/Localizable.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/sv.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/sv.lproj/main.nib/keyedobjects.nib deleted file mode 100644 index bd01c2dac..000000000 Binary files a/xorg-server/hw/xquartz/bundle/sv.lproj/main.nib/keyedobjects.nib and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/zh_CN.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/zh_CN.lproj/InfoPlist.strings deleted file mode 100644 index b5df36885..000000000 Binary files a/xorg-server/hw/xquartz/bundle/zh_CN.lproj/InfoPlist.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/zh_CN.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/zh_CN.lproj/Localizable.strings deleted file mode 100644 index f88a6da4b..000000000 Binary files a/xorg-server/hw/xquartz/bundle/zh_CN.lproj/Localizable.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/zh_CN.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/zh_CN.lproj/main.nib/keyedobjects.nib deleted file mode 100644 index e36c15fb6..000000000 Binary files a/xorg-server/hw/xquartz/bundle/zh_CN.lproj/main.nib/keyedobjects.nib and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/zh_TW.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/zh_TW.lproj/InfoPlist.strings deleted file mode 100644 index 92d5473b0..000000000 Binary files a/xorg-server/hw/xquartz/bundle/zh_TW.lproj/InfoPlist.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/zh_TW.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/zh_TW.lproj/Localizable.strings deleted file mode 100644 index f009302c2..000000000 Binary files a/xorg-server/hw/xquartz/bundle/zh_TW.lproj/Localizable.strings and /dev/null differ diff --git a/xorg-server/hw/xquartz/bundle/zh_TW.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/zh_TW.lproj/main.nib/keyedobjects.nib deleted file mode 100644 index 36602c53e..000000000 Binary files a/xorg-server/hw/xquartz/bundle/zh_TW.lproj/main.nib/keyedobjects.nib and /dev/null differ diff --git a/xorg-server/hw/xquartz/darwin.c b/xorg-server/hw/xquartz/darwin.c index 20bcee592..f01668201 100644 --- a/xorg-server/hw/xquartz/darwin.c +++ b/xorg-server/hw/xquartz/darwin.c @@ -1,10 +1,9 @@ /************************************************************** * - * Shared code for the Darwin X Server - * running with Quartz or IOKit display mode + * Xquartz initialization code * + * Copyright (c) 2007-2008 Apple Inc. * Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved. - * Copyright (c) 2007 Apple Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -47,12 +46,10 @@ #include "globals.h" #include "dix.h" -#ifdef XINPUT -# include -# include -# include "exevents.h" -# include "extinit.h" -#endif +#include +#include +#include "exevents.h" +#include "extinit.h" #include #include @@ -65,9 +62,7 @@ #include #define NO_CFPLUGIN -#include #include -#include #ifdef MITSHM #define _XSHM_SERVER_ @@ -76,10 +71,13 @@ #include "darwin.h" #include "darwinEvents.h" -#include "darwinKeyboard.h" +#include "quartzKeyboard.h" #include "quartz.h" //#include "darwinClut8.h" +#include "GL/visualConfigs.h" + + #ifdef ENABLE_DEBUG_LOG FILE *debug_log_fp = NULL; #endif @@ -88,7 +86,8 @@ FILE *debug_log_fp = NULL; * X server shared global variables */ int darwinScreensFound = 0; -DevPrivateKey darwinScreenKey = &darwinScreenKey; +static int darwinScreenKeyIndex; +DevPrivateKey darwinScreenKey = &darwinScreenKeyIndex; io_connect_t darwinParamConnect = 0; int darwinEventReadFD = -1; int darwinEventWriteFD = -1; @@ -103,16 +102,30 @@ int darwinMainScreenY = 0; unsigned int darwinDesiredWidth = 0, darwinDesiredHeight = 0; int darwinDesiredDepth = -1; int darwinDesiredRefresh = -1; -char *darwinKeymapFile = "USA.keymapping"; int darwinSyncKeymap = FALSE; -// modifier masks for faking mouse buttons +// modifier masks for faking mouse buttons - ANY of these bits trigger it (not all) +#ifdef NX_DEVICELCMDKEYMASK +int darwinFakeMouse2Mask = NX_DEVICELALTKEYMASK | NX_DEVICERALTKEYMASK; +int darwinFakeMouse3Mask = NX_DEVICELCMDKEYMASK | NX_DEVICERCMDKEYMASK; +#else int darwinFakeMouse2Mask = NX_ALTERNATEMASK; int darwinFakeMouse3Mask = NX_COMMANDMASK; +#endif + +// Modifier mask for overriding event delivery to appkit (might be useful to set this to rcommand for input menu +unsigned int darwinAppKitModMask = 0; // Any of these bits + +// Modifier mask for items in the Window menu (0 and -1 cause shortcuts to be disabled) +unsigned int windowItemModMask = NX_COMMANDMASK; // devices -DeviceIntPtr darwinPointer = NULL; DeviceIntPtr darwinKeyboard = NULL; +DeviceIntPtr darwinPointer = NULL; +DeviceIntPtr darwinTabletCurrent = NULL; +DeviceIntPtr darwinTabletStylus = NULL; +DeviceIntPtr darwinTabletCursor = NULL; +DeviceIntPtr darwinTabletEraser = NULL; // Common pixmap formats static PixmapFormatRec formats[] = { @@ -150,8 +163,7 @@ void DarwinPrintBanner(void) { // this should change depending on which specific server we are building - ErrorF("XQuartz starting:\n"); - ErrorF("X.org Release 7.2\n"); // This is here to help fink until they fix their packages. + ErrorF("Xquartz starting:\n"); ErrorF("X.Org X Server %s\nBuild Date: %s\n", XSERVER_VERSION, BUILD_DATE ); } @@ -170,7 +182,6 @@ static Bool DarwinSaveScreen(ScreenPtr pScreen, int on) return TRUE; } - /* * DarwinAddScreen * This is a callback from dix during AddScreen() from InitOutput(). @@ -206,6 +217,21 @@ static Bool DarwinAddScreen(int index, ScreenPtr pScreen, int argc, char **argv) dfb->greenMask, dfb->blueMask)) { return FALSE; } + +// TODO: Make PseudoColor visuals not suck in TrueColor mode +// if(dfb->depth > 8) +// miSetVisualTypesAndMasks(8, PseudoColorMask, 8, PseudoColor, 0, 0, 0); + +#if 0 + /* + * These aren't used anymore. xpr/xprScreen.c initializes the dfb struct + * above based on the display properties. + */ + if(dfb->depth > 15) + miSetVisualTypesAndMasks(15, LARGE_VISUALS, 5, TrueColor, 0x7c00, 0x03e0, 0x001f); + if(dfb->depth > 24) + miSetVisualTypesAndMasks(24, LARGE_VISUALS, 8, TrueColor, 0x00ff0000, 0x0000ff00, 0x000000ff); +#endif miSetPixmapDepths(); @@ -214,7 +240,7 @@ static Bool DarwinAddScreen(int index, ScreenPtr pScreen, int argc, char **argv) if (monitorResolution) dpi = monitorResolution; else - dpi = 75; + dpi = 96; // initialize fb if (! fbScreenInit(pScreen, @@ -306,89 +332,75 @@ static Bool DarwinAddScreen(int index, ScreenPtr pScreen, int argc, char **argv) ============================================================================= */ -#if 0 /* - * DarwinChangePointerControl - * Set mouse acceleration and thresholding - * FIXME: We currently ignore the threshold in ctrl->threshold. + * DarwinMouseProc: Handle the initialization, etc. of a mouse */ -static void DarwinChangePointerControl( - DeviceIntPtr device, - PtrCtrl *ctrl ) -{ - kern_return_t kr; - double acceleration; - - if (!darwinMouseAccelChange) - return; - - acceleration = ctrl->num / ctrl->den; - kr = IOHIDSetMouseAcceleration( darwinParamConnect, acceleration ); - if (kr != KERN_SUCCESS) - ErrorF( "Could not set mouse acceleration with kernel return = 0x%x.\n", kr ); +static int DarwinMouseProc(DeviceIntPtr pPointer, int what) { + // 7 buttons: left, right, middle, then four scroll wheel "buttons" + CARD8 map[8] = {0, 1, 2, 3, 4, 5, 6, 7}; + + switch (what) { + case DEVICE_INIT: + pPointer->public.on = FALSE; + + // Set button map. + InitPointerDeviceStruct((DevicePtr)pPointer, map, 7, + (PtrCtrlProcPtr)NoopDDA, + GetMotionHistorySize(), 2); + pPointer->valuator->mode = Absolute; // Relative + InitAbsoluteClassDeviceStruct(pPointer); +// InitValuatorAxisStruct(pPointer, 0, 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); +// InitValuatorAxisStruct(pPointer, 1, 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); + break; + case DEVICE_ON: + pPointer->public.on = TRUE; + AddEnabledDevice( darwinEventReadFD ); + return Success; + case DEVICE_CLOSE: + case DEVICE_OFF: + pPointer->public.on = FALSE; + RemoveEnabledDevice(darwinEventReadFD); + return Success; + } + + return Success; } -#endif - -/* - * DarwinMouseProc - * Handle the initialization, etc. of a mouse - */ -static int DarwinMouseProc( - DeviceIntPtr pPointer, - int what ) -{ - CARD8 map[6]; +static int DarwinTabletProc(DeviceIntPtr pPointer, int what) { + CARD8 map[4] = {0, 1, 2, 3}; + switch (what) { - case DEVICE_INIT: pPointer->public.on = FALSE; - + // Set button map. - map[1] = 1; - map[2] = 2; - map[3] = 3; - map[4] = 4; - map[5] = 5; - InitPointerDeviceStruct( (DevicePtr)pPointer, map, 5, - GetMotionHistory, - (PtrCtrlProcPtr)NoopDDA, - GetMotionHistorySize(), 2); - -#ifdef XINPUT - InitValuatorAxisStruct( pPointer, - 0, // X axis - 0, // min value - 16000, // max value (fixme screen size?) - 1, // resolution (fixme ?) - 1, // min resolution - 1 ); // max resolution - InitValuatorAxisStruct( pPointer, - 1, // X axis - 0, // min value - 16000, // max value (fixme screen size?) - 1, // resolution (fixme ?) - 1, // min resolution - 1 ); // max resolution -#endif + InitPointerDeviceStruct((DevicePtr)pPointer, map, 3, + (PtrCtrlProcPtr)NoopDDA, + GetMotionHistorySize(), 5); + pPointer->valuator->mode = Absolute; // Relative + InitProximityClassDeviceStruct(pPointer); + InitAbsoluteClassDeviceStruct(pPointer); + + InitValuatorAxisStruct(pPointer, 0, 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); + InitValuatorAxisStruct(pPointer, 1, 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); + InitValuatorAxisStruct(pPointer, 2, 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); + InitValuatorAxisStruct(pPointer, 3, -XQUARTZ_VALUATOR_LIMIT, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); + InitValuatorAxisStruct(pPointer, 4, -XQUARTZ_VALUATOR_LIMIT, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); +// pPointer->use = IsXExtensionDevice; break; - case DEVICE_ON: pPointer->public.on = TRUE; AddEnabledDevice( darwinEventReadFD ); return Success; - case DEVICE_CLOSE: case DEVICE_OFF: pPointer->public.on = FALSE; - RemoveEnabledDevice( darwinEventReadFD ); + RemoveEnabledDevice(darwinEventReadFD); return Success; } - return Success; } - /* * DarwinKeybdProc * Callback from X @@ -422,68 +434,11 @@ static int DarwinKeybdProc( DeviceIntPtr pDev, int onoff ) =========================================================================== */ -/* - * DarwinFindLibraryFile - * Search for a file in the standard Library paths, which are (in order): - * - * ~/Library/ user specific - * /Library/ host specific - * /Network/Library/ LAN specific - * /System/Library/ OS specific - * - * A sub-path can be specified to search in below the various Library - * directories. Returns a new character string (owned by the caller) - * containing the full path to the first file found. - */ -static char * DarwinFindLibraryFile( - const char *file, - const char *pathext ) -{ - // Library search paths - char *pathList[] = { - "", - "/Network", - "/System", - NULL - }; - char *home; - char *fullPath; - int i = 0; - - // Return the file name as is if it is already a fully qualified path. - if (!access(file, F_OK)) { - fullPath = xalloc(strlen(file)+1); - strcpy(fullPath, file); - return fullPath; - } - - fullPath = xalloc(PATH_MAX); - - home = getenv("HOME"); - if (home) { - snprintf(fullPath, PATH_MAX, "%s/Library/%s/%s", home, pathext, file); - if (!access(fullPath, F_OK)) - return fullPath; - } - - while (pathList[i]) { - snprintf(fullPath, PATH_MAX, "%s/Library/%s/%s", pathList[i++], - pathext, file); - if (!access(fullPath, F_OK)) - return fullPath; - } - - xfree(fullPath); - return NULL; -} - - /* * DarwinParseModifierList * Parse a list of modifier names and return a corresponding modifier mask */ -int DarwinParseModifierList( - const char *constmodifiers) // string containing list of modifier names +int DarwinParseModifierList(const char *constmodifiers, int separatelr) { int result = 0; @@ -495,9 +450,9 @@ int DarwinParseModifierList( while (p) { modifier = strsep(&p, " ,+&|/"); // allow lots of separators - nxkey = DarwinModifierStringToNXKey(modifier); - if (nxkey != -1) - result |= DarwinModifierNXKeyToNXMask(nxkey); + nxkey = DarwinModifierStringToNXMask(modifier, separatelr); + if(nxkey) + result |= nxkey; else ErrorF("fakebuttons: Unknown modifier \"%s\"\n", modifier); } @@ -520,13 +475,43 @@ int DarwinParseModifierList( */ void InitInput( int argc, char **argv ) { - darwinPointer = AddInputDevice(DarwinMouseProc, TRUE); + darwinKeyboard = AddInputDevice(serverClient, DarwinKeybdProc, TRUE); + RegisterKeyboardDevice( darwinKeyboard ); + darwinKeyboard->name = strdup("keyboard"); + + /* here's the snippet from the current gdk sources: + if (!strcmp (tmp_name, "pointer")) + gdkdev->info.source = GDK_SOURCE_MOUSE; + else if (!strcmp (tmp_name, "wacom") || + !strcmp (tmp_name, "pen")) + gdkdev->info.source = GDK_SOURCE_PEN; + else if (!strcmp (tmp_name, "eraser")) + gdkdev->info.source = GDK_SOURCE_ERASER; + else if (!strcmp (tmp_name, "cursor")) + gdkdev->info.source = GDK_SOURCE_CURSOR; + else + gdkdev->info.source = GDK_SOURCE_PEN; + */ + + darwinPointer = AddInputDevice(serverClient, DarwinMouseProc, TRUE); RegisterPointerDevice( darwinPointer ); + darwinPointer->name = strdup("pointer"); - darwinKeyboard = AddInputDevice(DarwinKeybdProc, TRUE); - RegisterKeyboardDevice( darwinKeyboard ); + darwinTabletStylus = AddInputDevice(serverClient, DarwinTabletProc, TRUE); + RegisterPointerDevice( darwinTabletStylus ); + darwinTabletStylus->name = strdup("pen"); + + darwinTabletCursor = AddInputDevice(serverClient, DarwinTabletProc, TRUE); + RegisterPointerDevice( darwinTabletCursor ); + darwinTabletCursor->name = strdup("cursor"); + + darwinTabletEraser = AddInputDevice(serverClient, DarwinTabletProc, TRUE); + RegisterPointerDevice( darwinTabletEraser ); + darwinTabletEraser->name = strdup("eraser"); + + darwinTabletCurrent = darwinTabletStylus; - DarwinEQInit( (DevicePtr)darwinKeyboard, (DevicePtr)darwinPointer ); + DarwinEQInit(); QuartzInitInput(argc, argv); } @@ -557,8 +542,7 @@ DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo) /* Find leftmost screen. If there's a tie, take the topmost of the two. */ for (i = 1; i < pScreenInfo->numScreens; i++) { if (dixScreenOrigins[i].x < left || - (dixScreenOrigins[i].x == left && - dixScreenOrigins[i].y < top)) + (dixScreenOrigins[i].x == left && dixScreenOrigins[i].y < top)) { left = dixScreenOrigins[i].x; top = dixScreenOrigins[i].y; @@ -567,17 +551,20 @@ DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo) darwinMainScreenX = left; darwinMainScreenY = top; + + DEBUG_LOG("top = %d, left=%d\n", top, left); /* Shift all screens so that there is a screen whose top left - is at X11 (0,0) and at global screen coordinate - (darwinMainScreenX, darwinMainScreenY). */ + * is at X11 (0,0) and at global screen coordinate + * (darwinMainScreenX, darwinMainScreenY). + */ if (darwinMainScreenX != 0 || darwinMainScreenY != 0) { for (i = 0; i < pScreenInfo->numScreens; i++) { dixScreenOrigins[i].x -= darwinMainScreenX; dixScreenOrigins[i].y -= darwinMainScreenY; - /* ErrorF("Screen %d placed at X11 coordinate (%d,%d).\n", - i, dixScreenOrigins[i].x, dixScreenOrigins[i].y); */ + DEBUG_LOG("Screen %d placed at X11 coordinate (%d,%d).\n", + i, dixScreenOrigins[i].x, dixScreenOrigins[i].y); } } } @@ -610,6 +597,10 @@ void InitOutput( ScreenInfo *pScreenInfo, int argc, char **argv ) for (i = 0; i < NUMFORMATS; i++) pScreenInfo->formats[i] = formats[i]; +#ifdef GLXEXT + setVisualConfigs(); +#endif + // Discover screens and do mode specific initialization QuartzInitOutput(argc, argv); @@ -654,27 +645,6 @@ void OsVendorInit(void) } #endif } - // DEBUG_LOG("Xquartz started at %s\n", ctime(time(NULL))); - - // Find the full path to the keymapping file. - if ( darwinKeymapFile ) { - char *tempStr = DarwinFindLibraryFile(darwinKeymapFile, "Keyboards"); - if ( !tempStr ) { - ErrorF("Could not find keymapping file %s.\n", darwinKeymapFile); - } else { - ErrorF("Using keymapping provided in %s.\n", tempStr); - } - darwinKeymapFile = tempStr; - } -} - - -/* - * ddxInitGlobals - * Called by InitGlobals() from os/util.c. - */ -void ddxInitGlobals(void) -{ } @@ -720,7 +690,7 @@ int ddxProcessArgument( int argc, char *argv[], int i ) if (!strcasecmp(argv[i+1], "none") || !strcmp(argv[i+1], "")) darwinFakeMouse2Mask = 0; else - darwinFakeMouse2Mask = DarwinParseModifierList(argv[i+1]); + darwinFakeMouse2Mask = DarwinParseModifierList(argv[i+1], 1); ErrorF("Modifier mask to fake mouse button 2 = 0x%x\n", darwinFakeMouse2Mask); return 2; @@ -733,25 +703,12 @@ int ddxProcessArgument( int argc, char *argv[], int i ) if (!strcasecmp(argv[i+1], "none") || !strcmp(argv[i+1], "")) darwinFakeMouse3Mask = 0; else - darwinFakeMouse3Mask = DarwinParseModifierList(argv[i+1]); + darwinFakeMouse3Mask = DarwinParseModifierList(argv[i+1], 1); ErrorF("Modifier mask to fake mouse button 3 = 0x%x\n", darwinFakeMouse3Mask); return 2; } - if ( !strcmp( argv[i], "-keymap" ) ) { - if ( i == argc-1 ) { - FatalError( "-keymap must be followed by a filename\n" ); - } - darwinKeymapFile = argv[i+1]; - return 2; - } - - if ( !strcmp( argv[i], "-nokeymap" ) ) { - darwinKeymapFile = NULL; - return 1; - } - if ( !strcmp( argv[i], "+synckeymap" ) ) { darwinSyncKeymap = TRUE; return 1; @@ -835,12 +792,8 @@ void ddxUseMsg( void ) ErrorF("-fakemouse2 : fake middle mouse button with modifier keys.\n"); ErrorF("-fakemouse3 : fake right mouse button with modifier keys.\n"); ErrorF(" ex: -fakemouse2 \"option,shift\" = option-shift-click is middle button.\n"); - ErrorF("-keymap : read the keymapping from a file instead of the kernel.\n"); ErrorF("-version : show the server version.\n"); ErrorF("\n"); -// ErrorF("Quartz modes (Experimental / In Development):\n"); -// ErrorF("-fullscreen : run full screen in parallel with Mac OS X window server.\n"); -// ErrorF("-rootless : run rootless inside Mac OS X window server.\n"); ErrorF("\n"); ErrorF("Options ignored in rootless mode:\n"); ErrorF("-size : use a screen resolution of x .\n"); @@ -856,10 +809,7 @@ void ddxUseMsg( void ) */ void ddxGiveUp( void ) { - ErrorF( "Quitting XQuartz...\n" ); - - //if (!quartzRootless) - // quartzProcs->ReleaseScreens(); + ErrorF( "Quitting Xquartz...\n" ); } @@ -896,16 +846,13 @@ void AbortDDX( void ) */ void -xf86SetRootClip (ScreenPtr pScreen, BOOL enable) +xf86SetRootClip (ScreenPtr pScreen, int enable) { WindowPtr pWin = WindowTable[pScreen->myNum]; WindowPtr pChild; Bool WasViewable = (Bool)(pWin->viewable); Bool anyMarked = TRUE; RegionPtr pOldClip = NULL, bsExposed; -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif WindowPtr pLayerWin; BoxRec box; @@ -976,12 +923,6 @@ xf86SetRootClip (ScreenPtr pScreen, BOOL enable) anyMarked = TRUE; } -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pLayerWin); - } -#endif /* DO_SAVE_UNDERS */ if (anyMarked) (*pScreen->ValidateTree)(pWin, NullWindow, VTOther); @@ -1013,10 +954,6 @@ xf86SetRootClip (ScreenPtr pScreen, BOOL enable) { if (anyMarked) (*pScreen->HandleExposures)(pWin); -#ifdef DO_SAVE_UNDERS - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, pLayerWin); -#endif /* DO_SAVE_UNDERS */ if (anyMarked && pScreen->PostValidateTree) (*pScreen->PostValidateTree)(pWin, NullWindow, VTOther); } diff --git a/xorg-server/hw/xquartz/darwin.h b/xorg-server/hw/xquartz/darwin.h index c5e2ed80d..7fb9396e5 100644 --- a/xorg-server/hw/xquartz/darwin.h +++ b/xorg-server/hw/xquartz/darwin.h @@ -1,4 +1,5 @@ /* + * Copyright (C) 2008 Apple, Inc. * Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -33,6 +34,8 @@ #include #include +#include "threadSafety.h" + typedef struct { void *framebuffer; int x; @@ -52,9 +55,9 @@ typedef struct { // From darwin.c void DarwinPrintBanner(void); -int DarwinParseModifierList(const char *constmodifiers); +int DarwinParseModifierList(const char *constmodifiers, int separatelr); void DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo); -void xf86SetRootClip (ScreenPtr pScreen, BOOL enable); +void xf86SetRootClip (ScreenPtr pScreen, int enable); #define SCREEN_PRIV(pScreen) ((DarwinFramebufferPtr) \ dixLookupPrivate(&pScreen->devPrivates, darwinScreenKey)) @@ -68,6 +71,10 @@ extern io_connect_t darwinParamConnect; extern int darwinEventReadFD; extern int darwinEventWriteFD; extern DeviceIntPtr darwinPointer; +extern DeviceIntPtr darwinTabletCurrent; +extern DeviceIntPtr darwinTabletCursor; +extern DeviceIntPtr darwinTabletStylus; +extern DeviceIntPtr darwinTabletEraser; extern DeviceIntPtr darwinKeyboard; // User preferences @@ -75,7 +82,8 @@ extern int darwinMouseAccelChange; extern int darwinFakeButtons; extern int darwinFakeMouse2Mask; extern int darwinFakeMouse3Mask; -extern char *darwinKeymapFile; +extern unsigned int darwinAppKitModMask; +extern unsigned int windowItemModMask; extern int darwinSyncKeymap; extern unsigned int darwinDesiredWidth, darwinDesiredHeight; extern int darwinDesiredDepth; @@ -85,48 +93,16 @@ extern int darwinDesiredRefresh; extern int darwinMainScreenX; extern int darwinMainScreenY; - -/* - * Special ddx events understood by the X server - */ -enum { - kXDarwinUpdateModifiers // update all modifier keys - = LASTEvent+1, // (from X.h list of event names) - kXDarwinUpdateButtons, // update state of mouse buttons 2 and up - kXDarwinScrollWheel, // scroll wheel event - /* - * Quartz-specific events -- not used in IOKit mode - */ - kXDarwinActivate, // restore X drawing and cursor - kXDarwinDeactivate, // clip X drawing and switch to Aqua cursor - kXDarwinSetRootClip, // enable or disable drawing to the X screen - kXDarwinQuit, // kill the X server and release the display - kXDarwinReadPasteboard, // copy Mac OS X pasteboard into X cut buffer - kXDarwinWritePasteboard, // copy X cut buffer onto Mac OS X pasteboard - kXDarwinBringAllToFront, // bring all X windows to front - kXDarwinToggleFullscreen, // Enable/Disable fullscreen mode - kXDarwinSetRootless, // Set rootless mode - /* - * AppleWM events - */ - kXDarwinControllerNotify, // send an AppleWMControllerNotify event - kXDarwinPasteboardNotify, // notify the WM to copy or paste - /* - * Xplugin notification events - */ - kXDarwinDisplayChanged, // display configuration has changed - kXDarwinWindowState, // window visibility state has changed - kXDarwinWindowMoved // window has moved on screen -}; - #define ENABLE_DEBUG_LOG 1 #ifdef ENABLE_DEBUG_LOG extern FILE *debug_log_fp; #define DEBUG_LOG_NAME "x11-debug.txt" -#define DEBUG_LOG(msg, args...) if (debug_log_fp) fprintf(debug_log_fp, "%s:%s:%d " msg, __FILE__, __FUNCTION__, __LINE__, ##args ); fflush(debug_log_fp); +#define DEBUG_LOG(msg, args...) if (debug_log_fp) fprintf(debug_log_fp, "%s:%s:%s:%d " msg, threadSafetyID(pthread_self()), __FILE__, __FUNCTION__, __LINE__, ##args ); fflush(debug_log_fp); #else #define DEBUG_LOG(msg, args...) #endif +#define TRACE() DEBUG_LOG("\n") + #endif /* _DARWIN_H */ diff --git a/xorg-server/hw/xquartz/darwinEvents.c b/xorg-server/hw/xquartz/darwinEvents.c index 827fd81b8..374c4e07e 100644 --- a/xorg-server/hw/xquartz/darwinEvents.c +++ b/xorg-server/hw/xquartz/darwinEvents.c @@ -1,7 +1,7 @@ /* Darwin event queue and event handling -Copyright 2007 Apple Inc. +Copyright 2007-2008 Apple Inc. Copyright 2004 Kaleb S. KEITHLEY. All Rights Reserved. Copyright (c) 2002-2004 Torrey T. Lyons. All Rights Reserved. @@ -30,6 +30,12 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ +#include "sanitizedCarbon.h" + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + #define NEED_EVENTS #include #include @@ -41,421 +47,534 @@ in this Software without prior written authorization from The Open Group. #include "mi.h" #include "scrnintstr.h" #include "mipointer.h" +#include "os.h" #include "darwin.h" #include "quartz.h" -#include "darwinKeyboard.h" +#include "quartzKeyboard.h" #include "darwinEvents.h" #include #include #include +#include +#include + #include /* Fake button press/release for scroll wheel move. */ -#define SCROLLWHEELUPFAKE 4 -#define SCROLLWHEELDOWNFAKE 5 +#define SCROLLWHEELUPFAKE 4 +#define SCROLLWHEELDOWNFAKE 5 +#define SCROLLWHEELLEFTFAKE 6 +#define SCROLLWHEELRIGHTFAKE 7 -#define QUEUE_SIZE 256 +#define _APPLEWM_SERVER_ +#include "applewmExt.h" +#include -typedef struct _Event { - xEvent event; - ScreenPtr pScreen; -} EventRec, *EventPtr; +/* FIXME: Abstract this better */ +void QuartzModeEQInit(void); -int input_check_zero, input_check_flag; +int darwin_modifier_flags = 0; // last known modifier state -static int old_flags = 0; // last known modifier state +#define FD_ADD_MAX 128 +static int fd_add[FD_ADD_MAX]; +int fd_add_count = 0; +static pthread_mutex_t fd_add_lock = PTHREAD_MUTEX_INITIALIZER; +static pthread_cond_t fd_add_ready_cond = PTHREAD_COND_INITIALIZER; +static pthread_t fd_add_tid = NULL; -typedef struct _EventQueue { - HWEventQueueType head, tail; /* long for SetInputCheck */ - CARD32 lastEventTime; /* to avoid time running backwards */ - Bool lastMotion; - EventRec events[QUEUE_SIZE]; /* static allocation for signals */ - DevicePtr pKbd, pPtr; /* device pointer, to get funcs */ - ScreenPtr pEnqueueScreen; /* screen events are being delivered to */ - ScreenPtr pDequeueScreen; /* screen events are being dispatched to */ -} EventQueueRec, *EventQueuePtr; +static EventList *darwinEvents = NULL; -static EventQueueRec darwinEventQueue; -xEvent *darwinEvents; +static pthread_mutex_t mieq_lock = PTHREAD_MUTEX_INITIALIZER; +static pthread_cond_t mieq_ready_cond = PTHREAD_COND_INITIALIZER; -/* - * DarwinPressModifierMask - * Press or release the given modifier key, specified by its mask. - */ -static void DarwinPressModifierMask( - int pressed, - int mask) // one of NX_*MASK constants -{ - int key = DarwinModifierNXMaskToNXKey(mask); +/*** Pthread Magics ***/ +static pthread_t create_thread(void *func, void *arg) { + pthread_attr_t attr; + pthread_t tid; - if (key != -1) { - int keycode = DarwinModifierNXKeyToNXKeycode(key, 0); - if (keycode != 0) - DarwinSendKeyboardEvents(pressed, keycode); - } -} - -#ifdef NX_DEVICELCTLKEYMASK -#define CONTROL_MASK(flags) (flags & (NX_DEVICELCTLKEYMASK|NX_DEVICERCTLKEYMASK)) -#else -#define CONTROL_MASK(flags) (NX_CONTROLMASK) -#endif /* NX_DEVICELCTLKEYMASK */ - -#ifdef NX_DEVICELSHIFTKEYMASK -#define SHIFT_MASK(flags) (flags & (NX_DEVICELSHIFTKEYMASK|NX_DEVICERSHIFTKEYMASK)) -#else -#define SHIFT_MASK(flags) (NX_SHIFTMASK) -#endif /* NX_DEVICELSHIFTKEYMASK */ - -#ifdef NX_DEVICELCMDKEYMASK -#define COMMAND_MASK(flags) (flags & (NX_DEVICELCMDKEYMASK|NX_DEVICERCMDKEYMASK)) -#else -#define COMMAND_MASK(flags) (NX_COMMANDMASK) -#endif /* NX_DEVICELCMDKEYMASK */ + pthread_attr_init (&attr); + pthread_attr_setscope (&attr, PTHREAD_SCOPE_SYSTEM); + pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED); + pthread_create (&tid, &attr, func, arg); + pthread_attr_destroy (&attr); -#ifdef NX_DEVICELALTKEYMASK -#define ALTERNATE_MASK(flags) (flags & (NX_DEVICELALTKEYMASK|NX_DEVICERALTKEYMASK)) -#else -#define ALTERNATE_MASK(flags) (NX_ALTERNATEMASK) -#endif /* NX_DEVICELALTKEYMASK */ + return tid; +} -/* - * DarwinUpdateModifiers - * Send events to update the modifier state. - */ -static void DarwinUpdateModifiers( - int pressed, // KeyPress or KeyRelease - int flags ) // modifier flags that have changed -{ - if (flags & NX_ALPHASHIFTMASK) { - DarwinPressModifierMask(pressed, NX_ALPHASHIFTMASK); - } - if (flags & NX_COMMANDMASK) { - DarwinPressModifierMask(pressed, COMMAND_MASK(flags)); - } - if (flags & NX_CONTROLMASK) { - DarwinPressModifierMask(pressed, CONTROL_MASK(flags)); - } - if (flags & NX_ALTERNATEMASK) { - DarwinPressModifierMask(pressed, ALTERNATE_MASK(flags)); - } - if (flags & NX_SHIFTMASK) { - DarwinPressModifierMask(pressed, SHIFT_MASK(flags)); +void darwinEvents_lock(void); +void darwinEvents_lock(void) { + int err; + if((err = pthread_mutex_lock(&mieq_lock))) { + ErrorF("%s:%s:%d: Failed to lock mieq_lock: %d\n", + __FILE__, __FUNCTION__, __LINE__, err); + spewCallStack(); } - if (flags & NX_SECONDARYFNMASK) { - DarwinPressModifierMask(pressed, NX_SECONDARYFNMASK); + if(darwinEvents == NULL) { + pthread_cond_wait(&mieq_ready_cond, &mieq_lock); } } -/* - * DarwinReleaseModifiers - * This hacky function releases all modifier keys. It should be called when X11.app - * is deactivated (kXDarwinDeactivate) to prevent modifiers from getting stuck if they - * are held down during a "context" switch -- otherwise, we would miss the KeyUp. - */ -static void DarwinReleaseModifiers(void) { - DarwinUpdateModifiers(KeyRelease, COMMAND_MASK(-1) | CONTROL_MASK(-1) | ALTERNATE_MASK(-1) | SHIFT_MASK(-1)); +void darwinEvents_unlock(void); +void darwinEvents_unlock(void) { + int err; + if((err = pthread_mutex_unlock(&mieq_lock))) { + ErrorF("%s:%s:%d: Failed to unlock mieq_lock: %d\n", + __FILE__, __FUNCTION__, __LINE__, err); + spewCallStack(); + } } /* - * DarwinSimulateMouseClick - * Send a mouse click to X when multiple mouse buttons are simulated - * with modifier-clicks, such as command-click for button 2. The dix - * layer is told that the previously pressed modifier key(s) are - * released, the simulated click event is sent. After the mouse button - * is released, the modifier keys are reverted to their actual state, - * which may or may not be pressed at that point. This is usually - * closest to what the user wants. Ie. the user typically wants to - * simulate a button 2 press instead of Command-button 2. + * DarwinPressModifierKey + * Press or release the given modifier key (one of NX_MODIFIERKEY_* constants) */ -static void DarwinSimulateMouseClick( - int pointer_x, - int pointer_y, - int whichButton, // mouse button to be pressed - int modifierMask) // modifiers used for the fake click -{ - // first fool X into forgetting about the keys - // for some reason, it's not enough to tell X we released the Command key -- - // it has to be the *left* Command key. - if (modifierMask & NX_COMMANDMASK) modifierMask |=NX_DEVICELCMDKEYMASK ; - DarwinUpdateModifiers(KeyRelease, modifierMask); - - // push the mouse button - DarwinSendPointerEvents(ButtonPress, whichButton, pointer_x, pointer_y); - DarwinSendPointerEvents(ButtonRelease, whichButton, pointer_x, pointer_y); - - // restore old modifiers - DarwinUpdateModifiers(KeyPress, modifierMask); -} +static void DarwinPressModifierKey(int pressed, int key) { + int keycode = DarwinModifierNXKeyToNXKeycode(key, 0); + if (keycode == 0) { + ErrorF("DarwinPressModifierKey bad keycode: key=%d\n", key); + return; + } -Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr) { - darwinEvents = (xEvent *)malloc(sizeof(xEvent) * GetMaximumEventsNum()); - mieqInit(); - darwinEventQueue.head = darwinEventQueue.tail = 0; - darwinEventQueue.lastEventTime = GetTimeInMillis (); - darwinEventQueue.pKbd = pKbd; - darwinEventQueue.pPtr = pPtr; - darwinEventQueue.pEnqueueScreen = screenInfo.screens[0]; - darwinEventQueue.pDequeueScreen = darwinEventQueue.pEnqueueScreen; - SetInputCheck(&input_check_zero, &input_check_flag); - return TRUE; + DarwinSendKeyboardEvents(pressed, keycode); } - /* - * DarwinEQEnqueue - * Must be thread safe with ProcessInputEvents. - * DarwinEQEnqueue - called from event gathering thread - * ProcessInputEvents - called from X server thread - * DarwinEQEnqueue should never be called from more than one thread. - * - * This should be deprecated in favor of miEQEnqueue -- BB + * DarwinUpdateModifiers + * Send events to update the modifier state. */ -void DarwinEQEnqueue(const xEventPtr e) { - HWEventQueueType oldtail, newtail; - - oldtail = darwinEventQueue.tail; - // mieqEnqueue() collapses successive motion events into one event. - // This is difficult to do in a thread-safe way and rarely useful. - - newtail = oldtail + 1; - if (newtail == QUEUE_SIZE) newtail = 0; - /* Toss events which come in late */ - if (newtail == darwinEventQueue.head) return; +int darwin_modifier_mask_list[] = { +#ifdef NX_DEVICELCMDKEYMASK + NX_DEVICELCTLKEYMASK, NX_DEVICERCTLKEYMASK, + NX_DEVICELSHIFTKEYMASK, NX_DEVICERSHIFTKEYMASK, + NX_DEVICELCMDKEYMASK, NX_DEVICERCMDKEYMASK, + NX_DEVICELALTKEYMASK, NX_DEVICERALTKEYMASK, +#else + NX_CONTROLMASK, NX_SHIFTMASK, NX_COMMANDMASK, NX_ALTERNATEMASK, +#endif + NX_ALPHASHIFTMASK, + 0 +}; - darwinEventQueue.events[oldtail].event = *e; +static void DarwinUpdateModifiers( + int pressed, // KeyPress or KeyRelease + int flags ) // modifier flags that have changed +{ + int *f; + int key; - /* - * Make sure that event times don't go backwards - this - * is "unnecessary", but very useful + /* Capslock is special. This mask is the state of capslock (on/off), + * not the state of the button. Hopefully we can find a better solution. */ - if (e->u.keyButtonPointer.time < darwinEventQueue.lastEventTime && - darwinEventQueue.lastEventTime - e->u.keyButtonPointer.time < 10000) - { - darwinEventQueue.events[oldtail].event.u.keyButtonPointer.time = - darwinEventQueue.lastEventTime; + if(NX_ALPHASHIFTMASK & flags) { + DarwinPressModifierKey(KeyPress, NX_MODIFIERKEY_ALPHALOCK); + DarwinPressModifierKey(KeyRelease, NX_MODIFIERKEY_ALPHALOCK); } - darwinEventQueue.events[oldtail].pScreen = darwinEventQueue.pEnqueueScreen; + + for(f=darwin_modifier_mask_list; *f; f++) + if(*f & flags && *f != NX_ALPHASHIFTMASK) { + key = DarwinModifierNXMaskToNXKey(*f); + if(key == -1) + ErrorF("DarwinUpdateModifiers: Unsupported NXMask: 0x%x\n", *f); + else + DarwinPressModifierKey(pressed, key); + } +} - // Update the tail after the event is prepared - darwinEventQueue.tail = newtail; +/* Generic handler for Xquartz-specifc events. When possible, these should + be moved into their own individual functions and set as handlers using + mieqSetHandler. */ + +static void DarwinEventHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev, int nevents) { + int i; + + TA_SERVER(); + +// DEBUG_LOG("DarwinEventHandler(%d, %p, %p, %d)\n", screenNum, xe, dev, nevents); + for (i=0; iprocessInputProc) - (e, (DeviceIntPtr)darwinEventQueue.pPtr, 1); +void DarwinListenOnOpenFD(int fd) { + ErrorF("DarwinListenOnOpenFD: %d\n", fd); + + pthread_mutex_lock(&fd_add_lock); + if(fd_add_count < FD_ADD_MAX) + fd_add[fd_add_count++] = fd; + else + ErrorF("FD Addition buffer at max. Dropping fd addition request.\n"); + + pthread_cond_broadcast(&fd_add_ready_cond); + pthread_mutex_unlock(&fd_add_lock); } +static void DarwinProcessFDAdditionQueue_thread(void *args) { + pthread_mutex_lock(&fd_add_lock); + while(true) { + while(fd_add_count) { + DarwinSendDDXEvent(kXquartzListenOnOpenFD, 1, fd_add[--fd_add_count]); + } + pthread_cond_wait(&fd_add_ready_cond, &fd_add_lock); + } +} -void DarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX) { - darwinEventQueue.pEnqueueScreen = pScreen; - if (fromDIX) - darwinEventQueue.pDequeueScreen = pScreen; +static void kXquartzListenOnOpenFDHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev, int nevents) { + size_t i; + TA_SERVER(); + + for (i=0; ievent; - - // Shift from global screen coordinates to coordinates relative to - // the origin of the current screen. - xe.u.keyButtonPointer.rootX -= darwinMainScreenX + - dixScreenOrigins[miPointerCurrentScreen()->myNum].x; - xe.u.keyButtonPointer.rootY -= darwinMainScreenY + - dixScreenOrigins[miPointerCurrentScreen()->myNum].y; - - /* ErrorF("old rootX = (%d,%d) darwinMainScreen = (%d,%d) dixScreenOrigins[%d]=(%d,%d)\n", - xe.u.keyButtonPointer.rootX, xe.u.keyButtonPointer.rootY, - darwinMainScreenX, darwinMainScreenY, - miPointerCurrentScreen()->myNum, - dixScreenOrigins[miPointerCurrentScreen()->myNum].x, - dixScreenOrigins[miPointerCurrentScreen()->myNum].y); */ - - //Assumption - screen switching can only occur on motion events - - if (e->pScreen != darwinEventQueue.pDequeueScreen) - { - darwinEventQueue.pDequeueScreen = e->pScreen; - x = xe.u.keyButtonPointer.rootX; - y = xe.u.keyButtonPointer.rootY; - if (darwinEventQueue.head == QUEUE_SIZE - 1) - darwinEventQueue.head = 0; - else - ++darwinEventQueue.head; - NewCurrentScreen (darwinEventQueue.pDequeueScreen, x, y); - } - else - { - if (darwinEventQueue.head == QUEUE_SIZE - 1) - darwinEventQueue.head = 0; - else - ++darwinEventQueue.head; - switch (xe.u.u.type) { - case KeyPress: - case KeyRelease: - ErrorF("Unexpected Keyboard event in DarwinProcessInputEvents\n"); - break; - - case ButtonPress: - ErrorF("Unexpected ButtonPress event in DarwinProcessInputEvents\n"); - break; - - case ButtonRelease: - ErrorF("Unexpected ButtonRelease event in DarwinProcessInputEvents\n"); - break; - - case MotionNotify: - ErrorF("Unexpected ButtonRelease event in DarwinProcessInputEvents\n"); - break; - - case kXDarwinUpdateModifiers: - ErrorF("Unexpected ButtonRelease event in DarwinProcessInputEvents\n"); - break; - - case kXDarwinUpdateButtons: - ErrorF("Unexpected XDarwinScrollWheel event in DarwinProcessInputEvents\n"); - break; - - case kXDarwinScrollWheel: - ErrorF("Unexpected XDarwinScrollWheel event in DarwinProcessInputEvents\n"); - break; - - case kXDarwinDeactivate: - DarwinReleaseModifiers(); - // fall through - default: - // Check for mode specific event - QuartzProcessEvent(&xe); - } - } + while (x == sizeof(xe)) { + x = read(darwinEventReadFD, &xe, sizeof(xe)); } - - // miPointerUpdate(); } /* Sends a null byte down darwinEventWriteFD, which will cause the Dispatch() event loop to check out event queue */ -void DarwinPokeEQ(void) { - char nullbyte=0; - input_check_flag++; - // bushing: oh, i ... er ... christ. - write(darwinEventWriteFD, &nullbyte, 1); +static void DarwinPokeEQ(void) { + char nullbyte=0; + // oh, i ... er ... christ. + write(darwinEventWriteFD, &nullbyte, 1); } -void DarwinSendPointerEvents(int ev_type, int ev_button, int pointer_x, int pointer_y) { - static int darwinFakeMouseButtonDown = 0; - static int darwinFakeMouseButtonMask = 0; - int i, num_events; - int valuators[2] = {pointer_x, pointer_y}; - if (ev_type == ButtonPress && darwinFakeButtons && ev_button == 1) { - // Mimic multi-button mouse with modifier-clicks - // If both sets of modifiers are pressed, - // button 2 is clicked. - if ((old_flags & darwinFakeMouse2Mask) == darwinFakeMouse2Mask) { - DarwinSimulateMouseClick(pointer_x, pointer_y, 2, darwinFakeMouse2Mask); - darwinFakeMouseButtonDown = 2; - darwinFakeMouseButtonMask = darwinFakeMouse2Mask; - } else if ((old_flags & darwinFakeMouse3Mask) == darwinFakeMouse3Mask) { - DarwinSimulateMouseClick(pointer_x, pointer_y, 3, darwinFakeMouse3Mask); - darwinFakeMouseButtonDown = 3; - darwinFakeMouseButtonMask = darwinFakeMouse3Mask; +/* Convert from Appkit pointer input values to X input values: + * Note: pointer_x and pointer_y are relative to the upper-left of primary + * display. + */ +static void DarwinPrepareValuators(DeviceIntPtr pDev, int *valuators, ScreenPtr screen, + float pointer_x, float pointer_y, + float pressure, float tilt_x, float tilt_y) { + /* Fix offset between darwin and X screens */ + pointer_x -= darwinMainScreenX + dixScreenOrigins[screen->myNum].x; + pointer_y -= darwinMainScreenY + dixScreenOrigins[screen->myNum].y; + + if(pointer_x < 0.0) + pointer_x = 0.0; + + if(pointer_y < 0.0) + pointer_y = 0.0; + + if(pDev == darwinPointer) { + valuators[0] = pointer_x; + valuators[1] = pointer_y; + valuators[2] = 0; + valuators[3] = 0; + valuators[4] = 0; + } else { + /* Setup our array of values */ + valuators[0] = XQUARTZ_VALUATOR_LIMIT * (pointer_x / (float)screenInfo.screens[0]->width); + valuators[1] = XQUARTZ_VALUATOR_LIMIT * (pointer_y / (float)screenInfo.screens[0]->height); + valuators[2] = XQUARTZ_VALUATOR_LIMIT * pressure; + valuators[3] = XQUARTZ_VALUATOR_LIMIT * tilt_x; + valuators[4] = XQUARTZ_VALUATOR_LIMIT * tilt_y; } - } - if (ev_type == ButtonRelease && darwinFakeButtons && darwinFakeMouseButtonDown) { - // If last mousedown was a fake click, don't check for - // mouse modifiers here. The user may have released the - // modifiers before the mouse button. - ev_button = darwinFakeMouseButtonDown; - darwinFakeMouseButtonDown = 0; - // Bring modifiers back up to date - DarwinUpdateModifiers(KeyPress, darwinFakeMouseButtonMask & old_flags); - darwinFakeMouseButtonMask = 0; - } - - num_events = GetPointerEvents(darwinEvents, darwinPointer, ev_type, ev_button, - POINTER_ABSOLUTE, 0, 2, valuators); - - for(i=0; i 0.0f ? 4 : 5; - int valuators[2] = {pointer_x, pointer_y}; - - for (count = fabs(count); count > 0.0; count = count - 1.0f) { - int num_events = GetPointerEvents(darwinEvents, darwinPointer, ButtonPress, ev_button, - POINTER_ABSOLUTE, 0, 2, valuators); - for(i=0; i 0.0f ? SCROLLWHEELLEFTFAKE : SCROLLWHEELRIGHTFAKE; + int sign_y = count_y > 0.0f ? SCROLLWHEELUPFAKE : SCROLLWHEELDOWNFAKE; + count_x = fabs(count_x); + count_y = fabs(count_y); + + while ((count_x > 0.0f) || (count_y > 0.0f)) { + if (count_x > 0.0f) { + DarwinSendPointerEvents(darwinPointer, ButtonPress, sign_x, pointer_x, pointer_y, pressure, tilt_x, tilt_y); + DarwinSendPointerEvents(darwinPointer, ButtonRelease, sign_x, pointer_x, pointer_y, pressure, tilt_x, tilt_y); + count_x = count_x - 1.0f; + } + if (count_y > 0.0f) { + DarwinSendPointerEvents(darwinPointer, ButtonPress, sign_y, pointer_x, pointer_y, pressure, tilt_x, tilt_y); + DarwinSendPointerEvents(darwinPointer, ButtonRelease, sign_y, pointer_x, pointer_y, pressure, tilt_x, tilt_y); + count_y = count_y - 1.0f; + } + } } /* Send the appropriate KeyPress/KeyRelease events to GetKeyboardEvents to reflect changing modifier flags (alt, control, meta, etc) */ void DarwinUpdateModKeys(int flags) { - DarwinUpdateModifiers(KeyRelease, old_flags & ~flags); - DarwinUpdateModifiers(KeyPress, ~old_flags & flags); - old_flags = flags; + DarwinUpdateModifiers(KeyRelease, darwin_modifier_flags & ~flags); + DarwinUpdateModifiers(KeyPress, ~darwin_modifier_flags & flags); + darwin_modifier_flags = flags; +} + +/* + * DarwinSendDDXEvent + * Send the X server thread a message by placing it on the event queue. + */ +void DarwinSendDDXEvent(int type, int argc, ...) { + xEvent xe; + INT32 *argv; + int i, max_args; + va_list args; + + memset(&xe, 0, sizeof(xe)); + xe.u.u.type = type; + xe.u.clientMessage.u.l.type = type; + + argv = &xe.u.clientMessage.u.l.longs0; + max_args = 4; + + if (argc > 0 && argc <= max_args) { + va_start (args, argc); + for (i = 0; i < argc; i++) + argv[i] = (int) va_arg (args, int); + va_end (args); + } + + darwinEvents_lock(); { + mieqEnqueue(darwinPointer, &xe); + DarwinPokeEQ(); + } darwinEvents_unlock(); } diff --git a/xorg-server/hw/xquartz/darwinEvents.h b/xorg-server/hw/xquartz/darwinEvents.h index 82cc26bc0..9ec3bda2f 100644 --- a/xorg-server/hw/xquartz/darwinEvents.h +++ b/xorg-server/hw/xquartz/darwinEvents.h @@ -1,4 +1,5 @@ /* + * Copyright (c) 2008 Apple, Inc. * Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -27,14 +28,57 @@ #ifndef _DARWIN_EVENTS_H #define _DARWIN_EVENTS_H -Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr); +/* For extra precision of our cursor and other valuators */ +#define XQUARTZ_VALUATOR_LIMIT (1 << 16) + +Bool DarwinEQInit(void); void DarwinEQEnqueue(const xEventPtr e); void DarwinEQPointerPost(DeviceIntPtr pDev, xEventPtr e); void DarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX); -void DarwinPokeEQ(void); -void DarwinSendPointerEvents(int ev_type, int ev_button, int pointer_x, int pointer_y); +void DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, float pointer_x, float pointer_y, + float pressure, float tilt_x, float tilt_y); +void DarwinSendProximityEvents(int ev_type, float pointer_x, float pointer_y); void DarwinSendKeyboardEvents(int ev_type, int keycode); -void DarwinSendScrollEvents(float count, int pointer_x, int pointer_y); +void DarwinSendScrollEvents(float count_x, float count_y, float pointer_x, float pointer_y, + float pressure, float tilt_x, float tilt_y); void DarwinUpdateModKeys(int flags); +void DarwinListenOnOpenFD(int fd); + +/* + * Special ddx events understood by the X server + */ +enum { + kXquartzReloadKeymap // Reload system keymap + = LASTEvent+1, // (from X.h list of event names) + kXquartzActivate, // restore X drawing and cursor + kXquartzDeactivate, // clip X drawing and switch to Aqua cursor + kXquartzSetRootClip, // enable or disable drawing to the X screen + kXquartzQuit, // kill the X server and release the display + kXquartzReadPasteboard, // copy Mac OS X pasteboard into X cut buffer + kXquartzWritePasteboard, // copy X cut buffer onto Mac OS X pasteboard + kXquartzBringAllToFront, // bring all X windows to front + kXquartzToggleFullscreen, // Enable/Disable fullscreen mode + kXquartzSetRootless, // Set rootless mode + kXquartzSpaceChanged, // Spaces changed + kXquartzListenOnOpenFD, // Listen to the launchd fd (passed as arg) + /* + * AppleWM events + */ + kXquartzControllerNotify, // send an AppleWMControllerNotify event + kXquartzPasteboardNotify, // notify the WM to copy or paste + kXquartzReloadPreferences, // send AppleWMReloadPreferences + /* + * Xplugin notification events + */ + kXquartzDisplayChanged, // display configuration has changed + kXquartzWindowState, // window visibility state has changed + kXquartzWindowMoved, // window has moved on screen +}; + +/* Send one of the above events to the server thread. */ +void DarwinSendDDXEvent(int type, int argc, ...); + +extern int darwin_modifier_mask_list[]; +extern int darwin_modifier_flags; #endif /* _DARWIN_EVENTS_H */ diff --git a/xorg-server/hw/xquartz/darwinKeyboard.c b/xorg-server/hw/xquartz/darwinKeyboard.c deleted file mode 100644 index 8d1ee8ec9..000000000 --- a/xorg-server/hw/xquartz/darwinKeyboard.c +++ /dev/null @@ -1,1009 +0,0 @@ -//============================================================================= -// -// Keyboard support for the Darwin X Server -// -// Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved. -// Copyright (c) 2003 Apple Computer, Inc. All Rights Reserved. -// Copyright 2004 Kaleb S. KEITHLEY. All Rights Reserved. -// -// The code to parse the Darwin keymap is derived from dumpkeymap.c -// by Eric Sunshine, which includes the following copyright: -// -// Copyright (C) 1999,2000 by Eric Sunshine -// All rights reserved. -// -//----------------------------------------------------------------------------- -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN -// NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -//============================================================================= - - -/* -=========================================================================== - - An X keyCode must be in the range XkbMinLegalKeyCode (8) to - XkbMaxLegalKeyCode(255). - - The keyCodes we get from the kernel range from 0 to 127, so we need to - offset the range before passing the keyCode to X. - - An X KeySym is an extended ascii code that is device independent. - - The modifier map is accessed by the keyCode, but the normal map is - accessed by keyCode - MIN_KEYCODE. Sigh. - -=========================================================================== -*/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -// Define this to get a diagnostic output to stderr which is helpful -// in determining how the X server is interpreting the Darwin keymap. -// #define DUMP_DARWIN_KEYMAP - -#include -#include -#include -#include -#include -#include -#include // For the NXSwap* -#include "darwin.h" -#include "darwinKeyboard.h" -#include "quartzKeyboard.h" -#include "quartzAudio.h" - -#ifdef NDEBUG -#undef NDEBUG -#include -#define NDEBUG 1 -#else -#include -#endif - -#define AltMask Mod1Mask -#define MetaMask Mod2Mask -#define FunctionMask Mod3Mask - -#define UK(a) NoSymbol // unknown symbol - -static KeySym const next_to_x[256] = { - NoSymbol, NoSymbol, NoSymbol, XK_KP_Enter, - NoSymbol, NoSymbol, NoSymbol, NoSymbol, - XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol, - NoSymbol, XK_Return, NoSymbol, NoSymbol, - NoSymbol, NoSymbol, NoSymbol, NoSymbol, - NoSymbol, NoSymbol, NoSymbol, NoSymbol, - NoSymbol, NoSymbol, NoSymbol, XK_Escape, - NoSymbol, NoSymbol, NoSymbol, NoSymbol, - XK_space, XK_exclam, XK_quotedbl, XK_numbersign, - XK_dollar, XK_percent, XK_ampersand, XK_apostrophe, - XK_parenleft, XK_parenright, XK_asterisk, XK_plus, - XK_comma, XK_minus, XK_period, XK_slash, - XK_0, XK_1, XK_2, XK_3, - XK_4, XK_5, XK_6, XK_7, - XK_8, XK_9, XK_colon, XK_semicolon, - XK_less, XK_equal, XK_greater, XK_question, - XK_at, XK_A, XK_B, XK_C, - XK_D, XK_E, XK_F, XK_G, - XK_H, XK_I, XK_J, XK_K, - XK_L, XK_M, XK_N, XK_O, - XK_P, XK_Q, XK_R, XK_S, - XK_T, XK_U, XK_V, XK_W, - XK_X, XK_Y, XK_Z, XK_bracketleft, - XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore, - XK_grave, XK_a, XK_b, XK_c, - XK_d, XK_e, XK_f, XK_g, - XK_h, XK_i, XK_j, XK_k, - XK_l, XK_m, XK_n, XK_o, - XK_p, XK_q, XK_r, XK_s, - XK_t, XK_u, XK_v, XK_w, - XK_x, XK_y, XK_z, XK_braceleft, - XK_bar, XK_braceright, XK_asciitilde, XK_BackSpace, -// 128 - NoSymbol, XK_Agrave, XK_Aacute, XK_Acircumflex, - XK_Atilde, XK_Adiaeresis, XK_Aring, XK_Ccedilla, - XK_Egrave, XK_Eacute, XK_Ecircumflex, XK_Ediaeresis, - XK_Igrave, XK_Iacute, XK_Icircumflex, XK_Idiaeresis, -// 144 - XK_ETH, XK_Ntilde, XK_Ograve, XK_Oacute, - XK_Ocircumflex, XK_Otilde, XK_Odiaeresis, XK_Ugrave, - XK_Uacute, XK_Ucircumflex, XK_Udiaeresis, XK_Yacute, - XK_THORN, XK_mu, XK_multiply, XK_division, -// 160 - XK_copyright, XK_exclamdown, XK_cent, XK_sterling, - UK(fraction), XK_yen, UK(fhook), XK_section, - XK_currency, XK_rightsinglequotemark, - XK_leftdoublequotemark, - XK_guillemotleft, - XK_leftanglebracket, - XK_rightanglebracket, - UK(filigature), UK(flligature), -// 176 - XK_registered, XK_endash, XK_dagger, XK_doubledagger, - XK_periodcentered,XK_brokenbar, XK_paragraph, UK(bullet), - XK_singlelowquotemark, - XK_doublelowquotemark, - XK_rightdoublequotemark, - XK_guillemotright, - XK_ellipsis, UK(permille), XK_notsign, XK_questiondown, -// 192 - XK_onesuperior, XK_dead_grave, XK_dead_acute, XK_dead_circumflex, - XK_dead_tilde, XK_dead_macron, XK_dead_breve, XK_dead_abovedot, - XK_dead_diaeresis, - XK_twosuperior, XK_dead_abovering, - XK_dead_cedilla, - XK_threesuperior, - XK_dead_doubleacute, - XK_dead_ogonek, XK_dead_caron, -// 208 - XK_emdash, XK_plusminus, XK_onequarter, XK_onehalf, - XK_threequarters, - XK_agrave, XK_aacute, XK_acircumflex, - XK_atilde, XK_adiaeresis, XK_aring, XK_ccedilla, - XK_egrave, XK_eacute, XK_ecircumflex, XK_ediaeresis, -// 224 - XK_igrave, XK_AE, XK_iacute, XK_ordfeminine, - XK_icircumflex, XK_idiaeresis, XK_eth, XK_ntilde, - XK_Lstroke, XK_Ooblique, XK_OE, XK_masculine, - XK_ograve, XK_oacute, XK_ocircumflex, XK_otilde, -// 240 - XK_odiaeresis, XK_ae, XK_ugrave, XK_uacute, - XK_ucircumflex, XK_idotless, XK_udiaeresis, XK_ygrave, - XK_lstroke, XK_ooblique, XK_oe, XK_ssharp, - XK_thorn, XK_ydiaeresis, NoSymbol, NoSymbol, - }; - -#define MIN_SYMBOL 0xAC -static KeySym const symbol_to_x[] = { - XK_Left, XK_Up, XK_Right, XK_Down - }; -static int const NUM_SYMBOL = sizeof(symbol_to_x) / sizeof(symbol_to_x[0]); - -#define MIN_FUNCKEY 0x20 -static KeySym const funckey_to_x[] = { - XK_F1, XK_F2, XK_F3, XK_F4, - XK_F5, XK_F6, XK_F7, XK_F8, - XK_F9, XK_F10, XK_F11, XK_F12, - XK_Insert, XK_Delete, XK_Home, XK_End, - XK_Page_Up, XK_Page_Down, XK_F13, XK_F14, - XK_F15 - }; -static int const NUM_FUNCKEY = sizeof(funckey_to_x) / sizeof(funckey_to_x[0]); - -typedef struct { - KeySym normalSym; - KeySym keypadSym; -} darwinKeyPad_t; - -static darwinKeyPad_t const normal_to_keypad[] = { - { XK_0, XK_KP_0 }, - { XK_1, XK_KP_1 }, - { XK_2, XK_KP_2 }, - { XK_3, XK_KP_3 }, - { XK_4, XK_KP_4 }, - { XK_5, XK_KP_5 }, - { XK_6, XK_KP_6 }, - { XK_7, XK_KP_7 }, - { XK_8, XK_KP_8 }, - { XK_9, XK_KP_9 }, - { XK_equal, XK_KP_Equal }, - { XK_asterisk, XK_KP_Multiply }, - { XK_plus, XK_KP_Add }, - { XK_comma, XK_KP_Separator }, - { XK_minus, XK_KP_Subtract }, - { XK_period, XK_KP_Decimal }, - { XK_slash, XK_KP_Divide } -}; -static int const NUM_KEYPAD = sizeof(normal_to_keypad) / sizeof(normal_to_keypad[0]); - -static void DarwinChangeKeyboardControl( DeviceIntPtr device, KeybdCtrl *ctrl ) -{ - // keyclick, bell volume / pitch, autorepead, LED's -} - -darwinKeyboardInfo keyInfo; -static FILE *fref = NULL; -static char *inBuffer = NULL; - -//----------------------------------------------------------------------------- -// Data Stream Object -// Can be configured to treat embedded "numbers" as being composed of -// either 1, 2, or 4 bytes, apiece. -//----------------------------------------------------------------------------- -typedef struct _DataStream { - unsigned char const *data; - unsigned char const *data_end; - short number_size; // Size in bytes of a "number" in the stream. -} DataStream; - -static DataStream* new_data_stream(unsigned char const* data, int size) { - DataStream* s = (DataStream*)xalloc( sizeof(DataStream) ); - if(s) { - s->data = data; - s->data_end = data + size; - s->number_size = 1; // Default to byte-sized numbers. - } - return s; -} - -static void destroy_data_stream(DataStream* s) { - xfree(s); -} - -static unsigned char get_byte(DataStream* s) { - assert(s->data + 1 <= s->data_end); - return *s->data++; -} - -static short get_word(DataStream* s) { - short hi, lo; - assert(s->data + 2 <= s->data_end); - hi = *s->data++; - lo = *s->data++; - return ((hi << 8) | lo); -} - -static int get_dword(DataStream* s) { - int b1, b2, b3, b4; - assert(s->data + 4 <= s->data_end); - b4 = *s->data++; - b3 = *s->data++; - b2 = *s->data++; - b1 = *s->data++; - return ((b4 << 24) | (b3 << 16) | (b2 << 8) | b1); -} - -static int get_number(DataStream* s) { - switch (s->number_size) { - case 4: return get_dword(s); - case 2: return get_word(s); - default: return get_byte(s); - } -} - -//----------------------------------------------------------------------------- -// Utility functions to help parse Darwin keymap -//----------------------------------------------------------------------------- - -/* - * bits_set - * Calculate number of bits set in the modifier mask. - */ -static short bits_set(short mask) { - short n = 0; - - for ( ; mask != 0; mask >>= 1) - if ((mask & 0x01) != 0) - n++; - return n; -} - -/* - * parse_next_char_code - * Read the next character code from the Darwin keymapping - * and write it to the X keymap. - */ -static void parse_next_char_code(DataStream *s, KeySym *k) { - const short charSet = get_number(s); - const short charCode = get_number(s); - - if (charSet == 0) { // ascii character - if (charCode >= 0 && charCode < 256) - *k = next_to_x[charCode]; - } else if (charSet == 0x01) { // symbol character - if (charCode >= MIN_SYMBOL && - charCode <= MIN_SYMBOL + NUM_SYMBOL) - *k = symbol_to_x[charCode - MIN_SYMBOL]; - } else if (charSet == 0xFE) { // function key - if (charCode >= MIN_FUNCKEY && - charCode <= MIN_FUNCKEY + NUM_FUNCKEY) - *k = funckey_to_x[charCode - MIN_FUNCKEY]; - } -} - - -/* - * DarwinReadKeymapFile - * Read the appropriate keymapping from a keymapping file. - */ -static Bool DarwinReadKeymapFile(NXKeyMapping *keyMap) { - struct stat st; - NXEventSystemDevice info[20]; - int interface = 0, handler_id = 0; - int map_interface, map_handler_id, map_size = 0; - unsigned int i, size; - int *bufferEnd; - union km_tag { - int *intP; - char *charP; - } km; - - fref = fopen( darwinKeymapFile, "rb" ); - if (fref == NULL) { - ErrorF("Unable to open keymapping file '%s' (%s).\n", - darwinKeymapFile, strerror(errno)); - return FALSE; - } - if (fstat(fileno(fref), &st) == -1) { - ErrorF("Could not stat keymapping file '%s' (%s).\n", - darwinKeymapFile, strerror(errno)); - return FALSE; - } - - // check to make sure we don't crash later - if (st.st_size <= 16*sizeof(int)) { - ErrorF("Keymapping file '%s' is invalid (too small).\n", - darwinKeymapFile); - return FALSE; - } - - inBuffer = (char*) xalloc( st.st_size ); - bufferEnd = (int *) (inBuffer + st.st_size); - if (fread(inBuffer, st.st_size, 1, fref) != 1) { - ErrorF("Could not read %qd bytes from keymapping file '%s' (%s).\n", - st.st_size, darwinKeymapFile, strerror(errno)); - return FALSE; - } - - if (strncmp( inBuffer, "KYM1", 4 ) == 0) { - // Magic number OK. - } else if (strncmp( inBuffer, "KYMP", 4 ) == 0) { - ErrorF("Keymapping file '%s' is intended for use with the original NeXT keyboards and cannot be used by XDarwin.\n", darwinKeymapFile); - return FALSE; - } else { - ErrorF("Keymapping file '%s' has a bad magic number and cannot be used by XDarwin.\n", darwinKeymapFile); - return FALSE; - } - - // find the keyboard interface and handler id - size = sizeof( info ) / sizeof( int ); - if (!NXEventSystemInfo( darwinParamConnect, NX_EVS_DEVICE_INFO, - (NXEventSystemInfoType) info, &size )) { - ErrorF("Error reading event status driver info.\n"); - return FALSE; - } - - size = size * sizeof( int ) / sizeof( info[0] ); - for( i = 0; i < size; i++) { - if (info[i].dev_type == NX_EVS_DEVICE_TYPE_KEYBOARD) { - Bool hasInterface = FALSE; - Bool hasMatch = FALSE; - - interface = info[i].interface; - handler_id = info[i].id; - - // Find an appropriate keymapping: - // The first time we try to match both interface and handler_id. - // If we can't match both, we take the first match for interface. - - do { - km.charP = inBuffer; - km.intP++; - while (km.intP+3 < bufferEnd) { - map_interface = NXSwapBigIntToHost(*(km.intP++)); - map_handler_id = NXSwapBigIntToHost(*(km.intP++)); - map_size = NXSwapBigIntToHost(*(km.intP++)); - if (map_interface == interface) { - if (map_handler_id == handler_id || hasInterface) { - hasMatch = TRUE; - break; - } else { - hasInterface = TRUE; - } - } - km.charP += map_size; - } - } while (hasInterface && !hasMatch); - - if (hasMatch) { - // fill in NXKeyMapping structure - keyMap->size = map_size; - keyMap->mapping = (char*) xalloc(map_size); - memcpy(keyMap->mapping, km.charP, map_size); - return TRUE; - } - } // if dev_id == keyboard device - } // foreach info struct - - // The keymapping file didn't match any of the info structs - // returned by NXEventSystemInfo. - ErrorF("Keymapping file '%s' did not contain appropriate keyboard interface.\n", darwinKeymapFile); - return FALSE; -} - - -/* - * DarwinParseNXKeyMapping - */ -static Bool DarwinParseNXKeyMapping(darwinKeyboardInfo *info) { - KeySym *k; - int i; - short numMods, numKeys, numPadKeys = 0; - Bool haveKeymap = FALSE; - NXKeyMapping keyMap; - DataStream *keyMapStream; - unsigned char const *numPadStart = 0; - - if (darwinKeymapFile) { - haveKeymap = DarwinReadKeymapFile(&keyMap); - if (fref) - fclose(fref); - if (inBuffer) - xfree(inBuffer); - if (!haveKeymap) { - ErrorF("Reverting to kernel keymapping.\n"); - } - } - - if (!haveKeymap) { - // get the Darwin keyboard map - keyMap.size = NXKeyMappingLength( darwinParamConnect ); - keyMap.mapping = (char*) xalloc( keyMap.size ); - if (!NXGetKeyMapping( darwinParamConnect, &keyMap )) { - return FALSE; - } - } - - keyMapStream = new_data_stream( (unsigned char const*)keyMap.mapping, - keyMap.size ); - - // check the type of map - if (get_word(keyMapStream)) { - keyMapStream->number_size = 2; - ErrorF("Current 16-bit keymapping may not be interpreted correctly.\n"); - } - - // Insert X modifier KeySyms into the keyboard map. - numMods = get_number(keyMapStream); - while (numMods-- > 0) { - int left = 1; // first keycode is left - short const charCode = get_number(keyMapStream); - short numKeyCodes = get_number(keyMapStream); - - // This is just a marker, not a real modifier. - // Store numeric keypad keys for later. - if (charCode == NX_MODIFIERKEY_NUMERICPAD) { - numPadStart = keyMapStream->data; - numPadKeys = numKeyCodes; - } - - while (numKeyCodes-- > 0) { - const short keyCode = get_number(keyMapStream); - if (charCode != NX_MODIFIERKEY_NUMERICPAD) { - switch (charCode) { - case NX_MODIFIERKEY_ALPHALOCK: - info->keyMap[keyCode * GLYPHS_PER_KEY] = XK_Caps_Lock; - break; - case NX_MODIFIERKEY_SHIFT: - info->keyMap[keyCode * GLYPHS_PER_KEY] = - (left ? XK_Shift_L : XK_Shift_R); - break; - case NX_MODIFIERKEY_CONTROL: - info->keyMap[keyCode * GLYPHS_PER_KEY] = - (left ? XK_Control_L : XK_Control_R); - break; - case NX_MODIFIERKEY_ALTERNATE: - // info->keyMap[keyCode * GLYPHS_PER_KEY] = XK_Mode_switch; - info->keyMap[keyCode * GLYPHS_PER_KEY] = - (left ? XK_Alt_L : XK_Alt_R); - break; - case NX_MODIFIERKEY_COMMAND: - info->keyMap[keyCode * GLYPHS_PER_KEY] = - (left ? XK_Meta_L : XK_Meta_R); - break; - case NX_MODIFIERKEY_SECONDARYFN: - info->keyMap[keyCode * GLYPHS_PER_KEY] = - (left ? XK_Control_L : XK_Control_R); - break; - case NX_MODIFIERKEY_HELP: - // Help is not an X11 modifier; treat as normal key - info->keyMap[keyCode * GLYPHS_PER_KEY] = XK_Help; - break; - } - } - left = 0; - } - } - - // Convert the Darwin keyboard mapping to an X keyboard map. - // A key can have a different character code for each combination of - // modifiers. We currently ignore all modifier combinations except - // those with Shift, AlphaLock, and Alt. - numKeys = get_number(keyMapStream); - for (i = 0, k = info->keyMap; i < numKeys; i++, k += GLYPHS_PER_KEY) { - short const charGenMask = get_number(keyMapStream); - if (charGenMask != 0xFF) { // is key bound? - short numKeyCodes = 1 << bits_set(charGenMask); - - // Record unmodified case - parse_next_char_code( keyMapStream, k ); - numKeyCodes--; - - // If AlphaLock and Shift modifiers produce different codes, - // we record the Shift case since X handles AlphaLock. - if (charGenMask & 0x01) { // AlphaLock - parse_next_char_code( keyMapStream, k+1 ); - numKeyCodes--; - } - - if (charGenMask & 0x02) { // Shift - parse_next_char_code( keyMapStream, k+1 ); - numKeyCodes--; - - if (charGenMask & 0x01) { // Shift-AlphaLock - get_number(keyMapStream); get_number(keyMapStream); - numKeyCodes--; - } - } - - // Skip the Control cases - if (charGenMask & 0x04) { // Control - get_number(keyMapStream); get_number(keyMapStream); - numKeyCodes--; - - if (charGenMask & 0x01) { // Control-AlphaLock - get_number(keyMapStream); get_number(keyMapStream); - numKeyCodes--; - } - - if (charGenMask & 0x02) { // Control-Shift - get_number(keyMapStream); get_number(keyMapStream); - numKeyCodes--; - - if (charGenMask & 0x01) { // Shift-Control-AlphaLock - get_number(keyMapStream); get_number(keyMapStream); - numKeyCodes--; - } - } - } - - // Process Alt cases - if (charGenMask & 0x08) { // Alt - parse_next_char_code( keyMapStream, k+2 ); - numKeyCodes--; - - if (charGenMask & 0x01) { // Alt-AlphaLock - parse_next_char_code( keyMapStream, k+3 ); - numKeyCodes--; - } - - if (charGenMask & 0x02) { // Alt-Shift - parse_next_char_code( keyMapStream, k+3 ); - numKeyCodes--; - - if (charGenMask & 0x01) { // Alt-Shift-AlphaLock - get_number(keyMapStream); get_number(keyMapStream); - numKeyCodes--; - } - } - } - - while (numKeyCodes-- > 0) { - get_number(keyMapStream); get_number(keyMapStream); - } - - if (k[3] == k[2]) k[3] = NoSymbol; - if (k[2] == k[1]) k[2] = NoSymbol; - if (k[1] == k[0]) k[1] = NoSymbol; - if (k[0] == k[2] && k[1] == k[3]) k[2] = k[3] = NoSymbol; - } - } - - // Now we have to go back through the list of keycodes that are on the - // numeric keypad and update the X keymap. - keyMapStream->data = numPadStart; - while(numPadKeys-- > 0) { - const short keyCode = get_number(keyMapStream); - k = &info->keyMap[keyCode * GLYPHS_PER_KEY]; - for (i = 0; i < NUM_KEYPAD; i++) { - if (*k == normal_to_keypad[i].normalSym) { - k[0] = normal_to_keypad[i].keypadSym; - break; - } - } - } - - // free Darwin keyboard map - destroy_data_stream( keyMapStream ); - xfree( keyMap.mapping ); - - return TRUE; -} - -/* - * DarwinBuildModifierMaps - * Use the keyMap field of keyboard info structure to populate - * the modMap and modifierKeycodes fields. - */ -static void DarwinBuildModifierMaps(darwinKeyboardInfo *info) { - int i; - KeySym *k; - - memset(info->modMap, NoSymbol, sizeof(info->modMap)); - memset(info->modifierKeycodes, 0, sizeof(info->modifierKeycodes)); - - for (i = 0; i < NUM_KEYCODES; i++) { - k = info->keyMap + i * GLYPHS_PER_KEY; - - switch (*k) { - case XK_Shift_L: - info->modifierKeycodes[NX_MODIFIERKEY_SHIFT][0] = i; - info->modMap[MIN_KEYCODE + i] = ShiftMask; - break; - - case XK_Shift_R: -#ifdef NX_MODIFIERKEY_RSHIFT - info->modifierKeycodes[NX_MODIFIERKEY_RSHIFT][0] = i; -#else - info->modifierKeycodes[NX_MODIFIERKEY_SHIFT][0] = i; -#endif - info->modMap[MIN_KEYCODE + i] = ShiftMask; - break; - - case XK_Control_L: - info->modifierKeycodes[NX_MODIFIERKEY_CONTROL][0] = i; - info->modMap[MIN_KEYCODE + i] = ControlMask; - break; - - case XK_Control_R: -#ifdef NX_MODIFIERKEY_RCONTROL - info->modifierKeycodes[NX_MODIFIERKEY_RCONTROL][0] = i; -#else - info->modifierKeycodes[NX_MODIFIERKEY_CONTROL][0] = i; -#endif - info->modMap[MIN_KEYCODE + i] = ControlMask; - break; - - case XK_Caps_Lock: - info->modifierKeycodes[NX_MODIFIERKEY_ALPHALOCK][0] = i; - info->modMap[MIN_KEYCODE + i] = LockMask; - break; - - case XK_Alt_L: - info->modifierKeycodes[NX_MODIFIERKEY_ALTERNATE][0] = i; - info->modMap[MIN_KEYCODE + i] = Mod1Mask; - *k = XK_Mode_switch; // Yes, this is ugly. This needs to be cleaned up when we integrate quartzKeyboard with this code and refactor. - break; - - case XK_Alt_R: -#ifdef NX_MODIFIERKEY_RALTERNATE - info->modifierKeycodes[NX_MODIFIERKEY_RALTERNATE][0] = i; -#else - info->modifierKeycodes[NX_MODIFIERKEY_ALTERNATE][0] = i; -#endif - *k = XK_Mode_switch; // Yes, this is ugly. This needs to be cleaned up when we integrate quartzKeyboard with this code and refactor. - info->modMap[MIN_KEYCODE + i] = Mod1Mask; - break; - - case XK_Mode_switch: - info->modMap[MIN_KEYCODE + i] = Mod1Mask; - break; - - case XK_Meta_L: - info->modifierKeycodes[NX_MODIFIERKEY_COMMAND][0] = i; - info->modMap[MIN_KEYCODE + i] = Mod2Mask; - break; - - case XK_Meta_R: -#ifdef NX_MODIFIERKEY_RCOMMAND - info->modifierKeycodes[NX_MODIFIERKEY_RCOMMAND][0] = i; -#else - info->modifierKeycodes[NX_MODIFIERKEY_COMMAND][0] = i; -#endif - info->modMap[MIN_KEYCODE + i] = Mod2Mask; - break; - - case XK_Num_Lock: - info->modMap[MIN_KEYCODE + i] = Mod3Mask; - break; - } - } -} - -/* - * DarwinLoadKeyboardMapping - * Load the keyboard map from a file or system and convert - * it to an equivalent X keyboard map and modifier map. - */ -static void DarwinLoadKeyboardMapping(KeySymsRec *keySyms) { - memset(keyInfo.keyMap, 0, sizeof(keyInfo.keyMap)); - - /* TODO: Clean this up - * QuartzReadSystemKeymap is in quartz/quartzKeyboard.c - * DarwinParseNXKeyMapping is here - */ - if (!DarwinParseNXKeyMapping(&keyInfo)) { - DEBUG_LOG("DarwinParseNXKeyMapping returned 0... running QuartzReadSystemKeymap().\n"); - if (!QuartzReadSystemKeymap(&keyInfo)) { - FatalError("Could not build a valid keymap."); - } - } - - DarwinBuildModifierMaps(&keyInfo); - -#ifdef DUMP_DARWIN_KEYMAP - int i; - KeySym *k; - DEBUG_LOG("Darwin -> X converted keyboard map\n"); - for (i = 0, k = keyInfo.keyMap; i < NX_NUMKEYCODES; - i++, k += GLYPHS_PER_KEY) - { - int j; - for (j = 0; j < GLYPHS_PER_KEY; j++) { - if (k[j] == NoSymbol) { - DEBUG_LOG("0x%02x:\tNoSym\n", i); - } else { - DEBUG_LOG("0x%02x:\t0x%lx\n", i, k[j]); - } - } - } -#endif - - keySyms->map = keyInfo.keyMap; - keySyms->mapWidth = GLYPHS_PER_KEY; - keySyms->minKeyCode = MIN_KEYCODE; - keySyms->maxKeyCode = MAX_KEYCODE; -} - - -/* - * DarwinKeyboardInit - * Get the Darwin keyboard map and compute an equivalent - * X keyboard map and modifier map. Set the new keyboard - * device structure. - */ -void DarwinKeyboardInit(DeviceIntPtr pDev) { - KeySymsRec keySyms; - - // Open a shared connection to the HID System. - // Note that the Event Status Driver is really just a wrapper - // for a kIOHIDParamConnectType connection. - assert( darwinParamConnect = NXOpenEventStatus() ); - - DarwinLoadKeyboardMapping(&keySyms); - // DarwinKeyboardReload(pDev); - /* Initialize the seed, so we don't reload the keymap unnecessarily - (and possibly overwrite xinitrc changes) */ - QuartzSystemKeymapSeed(); - - assert( InitKeyboardDeviceStruct( (DevicePtr)pDev, &keySyms, - keyInfo.modMap, QuartzBell, - DarwinChangeKeyboardControl )); -} - - -/* Borrowed from dix/devices.c */ -static Bool InitModMap(register KeyClassPtr keyc) { - int i, j; - CARD8 keysPerModifier[8]; - CARD8 mask; - - // darwinKeyc = keyc; - if (keyc->modifierKeyMap != NULL) - xfree (keyc->modifierKeyMap); - - keyc->maxKeysPerModifier = 0; - for (i = 0; i < 8; i++) - keysPerModifier[i] = 0; - for (i = 8; i < MAP_LENGTH; i++) - { - for (j = 0, mask = 1; j < 8; j++, mask <<= 1) - { - if (mask & keyc->modifierMap[i]) - { - if (++keysPerModifier[j] > keyc->maxKeysPerModifier) - keyc->maxKeysPerModifier = keysPerModifier[j]; - } - } - } - keyc->modifierKeyMap = (KeyCode *)xalloc(8*keyc->maxKeysPerModifier); - if (!keyc->modifierKeyMap && keyc->maxKeysPerModifier) - return (FALSE); - bzero((char *)keyc->modifierKeyMap, 8*(int)keyc->maxKeysPerModifier); - for (i = 0; i < 8; i++) - keysPerModifier[i] = 0; - for (i = 8; i < MAP_LENGTH; i++) - { - for (j = 0, mask = 1; j < 8; j++, mask <<= 1) - { - if (mask & keyc->modifierMap[i]) - { - keyc->modifierKeyMap[(j*keyc->maxKeysPerModifier) + - keysPerModifier[j]] = i; - keysPerModifier[j]++; - } - } - } - return TRUE; -} - - -void DarwinKeyboardReload(DeviceIntPtr pDev) { - KeySymsRec keySyms; - - DarwinLoadKeyboardMapping(&keySyms); - - if (SetKeySymsMap(&pDev->key->curKeySyms, &keySyms)) { - /* now try to update modifiers. */ - - memmove(pDev->key->modifierMap, keyInfo.modMap, MAP_LENGTH); - InitModMap(pDev->key); - } else DEBUG_LOG("SetKeySymsMap=0\n"); - - SendMappingNotify(MappingKeyboard, MIN_KEYCODE, NUM_KEYCODES, 0); - SendMappingNotify(MappingModifier, 0, 0, 0); -} - - -//----------------------------------------------------------------------------- -// Modifier translation functions -// -// There are three different ways to specify a Mac modifier key: -// keycode - specifies hardware key, read from keymapping -// key - NX_MODIFIERKEY_*, really an index -// mask - NX_*MASK, mask for modifier flags in event record -// Left and right side have different keycodes but the same key and mask. -//----------------------------------------------------------------------------- - -/* - * DarwinModifierNXKeyToNXKeycode - * Return the keycode for an NX_MODIFIERKEY_* modifier. - * side = 0 for left or 1 for right. - * Returns 0 if key+side is not a known modifier. - */ -int DarwinModifierNXKeyToNXKeycode(int key, int side) { - return keyInfo.modifierKeycodes[key][side]; -} - -/* - * DarwinModifierNXKeycodeToNXKey - * Returns -1 if keycode+side is not a modifier key - * outSide may be NULL, else it gets 0 for left and 1 for right. - */ -int DarwinModifierNXKeycodeToNXKey(unsigned char keycode, int *outSide) { - int key, side; - - keycode += MIN_KEYCODE; - // search modifierKeycodes for this keycode+side - for (key = 0; key < NX_NUMMODIFIERS; key++) { - for (side = 0; side <= 1; side++) { - if (keyInfo.modifierKeycodes[key][side] == keycode) break; - } - } - if (key == NX_NUMMODIFIERS) return -1; - if (outSide) *outSide = side; - return key; -} - -/* - * DarwinModifierNXMaskToNXKey - * Returns -1 if mask is not a known modifier mask. - */ -int DarwinModifierNXMaskToNXKey(int mask) { - switch (mask) { - case NX_ALPHASHIFTMASK: return NX_MODIFIERKEY_ALPHALOCK; - case NX_SHIFTMASK: return NX_MODIFIERKEY_SHIFT; -#ifdef NX_DEVICELSHIFTKEYMASK - case NX_DEVICELSHIFTKEYMASK: return NX_MODIFIERKEY_SHIFT; - case NX_DEVICERSHIFTKEYMASK: return NX_MODIFIERKEY_RSHIFT; -#endif - case NX_CONTROLMASK: return NX_MODIFIERKEY_CONTROL; -#ifdef NX_DEVICELCTLKEYMASK - case NX_DEVICELCTLKEYMASK: return NX_MODIFIERKEY_CONTROL; - case NX_DEVICERCTLKEYMASK: return NX_MODIFIERKEY_RCONTROL; -#endif - case NX_ALTERNATEMASK: return NX_MODIFIERKEY_ALTERNATE; -#ifdef NX_DEVICELALTKEYMASK - case NX_DEVICELALTKEYMASK: return NX_MODIFIERKEY_ALTERNATE; - case NX_DEVICERALTKEYMASK: return NX_MODIFIERKEY_RALTERNATE; -#endif - case NX_COMMANDMASK: return NX_MODIFIERKEY_COMMAND; -#ifdef NX_DEVICELCMDKEYMASK - case NX_DEVICELCMDKEYMASK: return NX_MODIFIERKEY_COMMAND; - case NX_DEVICERCMDKEYMASK: return NX_MODIFIERKEY_RCOMMAND; -#endif - case NX_NUMERICPADMASK: return NX_MODIFIERKEY_NUMERICPAD; - case NX_HELPMASK: return NX_MODIFIERKEY_HELP; - case NX_SECONDARYFNMASK: return NX_MODIFIERKEY_SECONDARYFN; - } - return -1; -} - -static const char *DarwinModifierNXMaskTostring(int mask) { - switch (mask) { - case NX_ALPHASHIFTMASK: return "NX_ALPHASHIFTMASK"; - case NX_SHIFTMASK: return "NX_SHIFTMASK"; - case NX_DEVICELSHIFTKEYMASK: return "NX_DEVICELSHIFTKEYMASK"; - case NX_DEVICERSHIFTKEYMASK: return "NX_DEVICERSHIFTKEYMASK"; - case NX_CONTROLMASK: return "NX_CONTROLMASK"; - case NX_DEVICELCTLKEYMASK: return "NX_DEVICELCTLKEYMASK"; - case NX_DEVICERCTLKEYMASK: return "NX_DEVICERCTLKEYMASK"; - case NX_ALTERNATEMASK: return "NX_ALTERNATEMASK"; - case NX_DEVICELALTKEYMASK: return "NX_DEVICELALTKEYMASK"; - case NX_DEVICERALTKEYMASK: return "NX_DEVICERALTKEYMASK"; - case NX_COMMANDMASK: return "NX_COMMANDMASK"; - case NX_DEVICELCMDKEYMASK: return "NX_DEVICELCMDKEYMASK"; - case NX_DEVICERCMDKEYMASK: return "NX_DEVICERCMDKEYMASK"; - case NX_NUMERICPADMASK: return "NX_NUMERICPADMASK"; - case NX_HELPMASK: return "NX_HELPMASK"; - case NX_SECONDARYFNMASK: return "NX_SECONDARYFNMASK"; - } - return "unknown mask"; -} - -/* - * DarwinModifierNXKeyToNXMask - * Returns 0 if key is not a known modifier key. - */ -int DarwinModifierNXKeyToNXMask(int key) { - switch (key) { - case NX_MODIFIERKEY_ALPHALOCK: return NX_ALPHASHIFTMASK; - case NX_MODIFIERKEY_SHIFT: return NX_SHIFTMASK; -#ifdef NX_MODIFIERKEY_RSHIFT - case NX_MODIFIERKEY_RSHIFT: return NX_SHIFTMASK; -#endif - case NX_MODIFIERKEY_CONTROL: return NX_CONTROLMASK; -#ifdef NX_MODIFIERKEY_RCONTROL - case NX_MODIFIERKEY_RCONTROL: return NX_CONTROLMASK; -#endif - case NX_MODIFIERKEY_ALTERNATE: return NX_ALTERNATEMASK; -#ifdef NX_MODIFIERKEY_RALTERNATE - case NX_MODIFIERKEY_RALTERNATE: return NX_ALTERNATEMASK; -#endif - case NX_MODIFIERKEY_COMMAND: return NX_COMMANDMASK; -#ifdef NX_MODIFIERKEY_RCOMMAND - case NX_MODIFIERKEY_RCOMMAND: return NX_COMMANDMASK; -#endif - case NX_MODIFIERKEY_NUMERICPAD: return NX_NUMERICPADMASK; - case NX_MODIFIERKEY_HELP: return NX_HELPMASK; - case NX_MODIFIERKEY_SECONDARYFN: return NX_SECONDARYFNMASK; - } - return 0; -} - -/* - * DarwinModifierStringToNXKey - * Returns -1 if string is not a known modifier. - */ -int DarwinModifierStringToNXKey(const char *str) { - if (!strcasecmp(str, "shift")) return NX_MODIFIERKEY_SHIFT; - else if (!strcasecmp(str, "control")) return NX_MODIFIERKEY_CONTROL; - else if (!strcasecmp(str, "option")) return NX_MODIFIERKEY_ALTERNATE; - else if (!strcasecmp(str, "command")) return NX_MODIFIERKEY_COMMAND; - else if (!strcasecmp(str, "fn")) return NX_MODIFIERKEY_SECONDARYFN; - else return -1; -} - -/* - * LegalModifier - * This allows the ddx layer to prevent some keys from being remapped - * as modifier keys. - */ -Bool LegalModifier(unsigned int key, DeviceIntPtr pDev) -{ - return 1; -} diff --git a/xorg-server/hw/xquartz/darwinKeyboard.h b/xorg-server/hw/xquartz/darwinKeyboard.h deleted file mode 100644 index 5cf64c7d1..000000000 --- a/xorg-server/hw/xquartz/darwinKeyboard.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2003-2004 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ - -#ifndef DARWIN_KEYBOARD_H -#define DARWIN_KEYBOARD_H 1 - -#include "quartzKeyboard.h" - -/* Provided for darwinEvents.c */ -extern darwinKeyboardInfo keyInfo; -void DarwinKeyboardReload(DeviceIntPtr pDev); -void DarwinKeyboardInit(DeviceIntPtr pDev); -int DarwinModifierNXKeycodeToNXKey(unsigned char keycode, int *outSide); -int DarwinModifierNXKeyToNXKeycode(int key, int side); -int DarwinModifierNXKeyToNXMask(int key); -int DarwinModifierNXMaskToNXKey(int mask); -int DarwinModifierStringToNXKey(const char *string); - -/* Provided for darwin.c */ -void DarwinKeyboardInit(DeviceIntPtr pDev); - -#endif /* DARWIN_KEYBOARD_H */ diff --git a/xorg-server/hw/xquartz/darwinXinput.c b/xorg-server/hw/xquartz/darwinXinput.c index e62ec0ab6..59bae6fde 100644 --- a/xorg-server/hw/xquartz/darwinXinput.c +++ b/xorg-server/hw/xquartz/darwinXinput.c @@ -1,8 +1,7 @@ - /* - * X server support of the XINPUT extension for Darwin + * X server support of the XINPUT extension for xquartz * - * This is currently a copy of mi/stubs.c, but eventually this + * This is currently a copy of Xi/stubs.c, but eventually this * should include more complete XINPUT support. */ @@ -52,100 +51,18 @@ SOFTWARE. ********************************************************/ +#define NEED_EVENTS #ifdef HAVE_DIX_CONFIG_H #include #endif -#define NEED_EVENTS #include #include #include "inputstr.h" #include #include #include "XIstubs.h" -#include "chgkbd.h" - -/*********************************************************************** - * - * Caller: ProcXChangeKeyboardDevice - * - * This procedure does the implementation-dependent portion of the work - * needed to change the keyboard device. - * - * The X keyboard device has a FocusRec. If the device that has been - * made into the new X keyboard did not have a FocusRec, - * ProcXChangeKeyboardDevice will allocate one for it. - * - * If you do not want clients to be able to focus the old X keyboard - * device, call DeleteFocusClassDeviceStruct to free the FocusRec. - * - * If you support input devices with keys that you do not want to be - * used as the X keyboard, you need to check for them here and return - * a BadDevice error. - * - * The default implementation is to do nothing (assume you do want - * clients to be able to focus the old X keyboard). The commented-out - * sample code shows what you might do if you don't want the default. - * - */ - -int ChangeKeyboardDevice (DeviceIntPtr old_dev, DeviceIntPtr new_dev) { - /*********************************************************************** - DeleteFocusClassDeviceStruct(old_dev); * defined in xchgptr.c * - **********************************************************************/ - return BadMatch; -} - - -/*********************************************************************** - * - * Caller: ProcXChangePointerDevice - * - * This procedure does the implementation-dependent portion of the work - * needed to change the pointer device. - * - * The X pointer device does not have a FocusRec. If the device that - * has been made into the new X pointer had a FocusRec, - * ProcXChangePointerDevice will free it. - * - * If you want clients to be able to focus the old pointer device that - * has now become accessible through the input extension, you need to - * add a FocusRec to it here. - * - * The XChangePointerDevice protocol request also allows the client - * to choose which axes of the new pointer device are used to move - * the X cursor in the X- and Y- directions. If the axes are different - * than the default ones, you need to keep track of that here. - * - * If you support input devices with valuators that you do not want to be - * used as the X pointer, you need to check for them here and return a - * BadDevice error. - * - * The default implementation is to do nothing (assume you don't want - * clients to be able to focus the old X pointer). The commented-out - * sample code shows what you might do if you don't want the default. - * - */ - -int -ChangePointerDevice ( - DeviceIntPtr old_dev, - DeviceIntPtr new_dev, - unsigned char x, - unsigned char y) - { - /*********************************************************************** - InitFocusClassDeviceStruct(old_dev); * allow focusing old ptr* - - x_axis = x; * keep track of new x-axis* - y_axis = y; * keep track of new y-axis* - if (x_axis != 0 || y_axis != 1) - axes_changed = TRUE; * remember axes have changed* - else - axes_changed = FALSE; - *************************************************************************/ - return BadMatch; - } +#include "darwin.h" /*********************************************************************** * @@ -161,11 +78,10 @@ ChangePointerDevice ( */ void -CloseInputDevice (d, client) - DeviceIntPtr d; - ClientPtr client; - { - } +CloseInputDevice(DeviceIntPtr d, ClientPtr client) +{ + DEBUG_LOG("CloseInputDevice(%p, %p)\n", d, client); +} /*********************************************************************** * @@ -194,8 +110,8 @@ CloseInputDevice (d, client) */ void -AddOtherInputDevices () - { +AddOtherInputDevices(void) +{ /********************************************************************** for each uninitialized device, do something like: @@ -208,8 +124,8 @@ AddOtherInputDevices () RegisterOtherDevice(dev); dev->inited = ((*dev->deviceProc)(dev, DEVICE_INIT) == Success); ************************************************************************/ - - } + DEBUG_LOG("AddOtherInputDevices\n"); +} /*********************************************************************** * @@ -234,12 +150,10 @@ AddOtherInputDevices () */ void -OpenInputDevice (dev, client, status) - DeviceIntPtr dev; - ClientPtr client; - int *status; - { - } +OpenInputDevice(DeviceIntPtr dev, ClientPtr client, int *status) +{ + DEBUG_LOG("OpenInputDevice(%p, %p, %p)\n", dev, client, status); +} /**************************************************************************** * @@ -254,13 +168,11 @@ OpenInputDevice (dev, client, status) */ int -SetDeviceMode (client, dev, mode) - register ClientPtr client; - DeviceIntPtr dev; - int mode; - { +SetDeviceMode(ClientPtr client, DeviceIntPtr dev, int mode) +{ + DEBUG_LOG("SetDeviceMode(%p, %p, %d)\n", client, dev, mode); return BadMatch; - } +} /**************************************************************************** * @@ -275,15 +187,13 @@ SetDeviceMode (client, dev, mode) */ int -SetDeviceValuators (client, dev, valuators, first_valuator, num_valuators) - register ClientPtr client; - DeviceIntPtr dev; - int *valuators; - int first_valuator; - int num_valuators; - { - return BadMatch; - } +SetDeviceValuators(ClientPtr client, DeviceIntPtr dev, + int *valuators, int first_valuator, int num_valuators) +{ + DEBUG_LOG("SetDeviceValuators(%p, %p, %p, %d, %d)\n", client, + dev, valuators, first_valuator, num_valuators); + return BadMatch; +} /**************************************************************************** * @@ -294,16 +204,48 @@ SetDeviceValuators (client, dev, valuators, first_valuator, num_valuators) */ int -ChangeDeviceControl (client, dev, control) - register ClientPtr client; - DeviceIntPtr dev; - xDeviceCtl *control; - { - switch (control->control) - { - case DEVICE_RESOLUTION: - return (BadMatch); - default: - return (BadMatch); - } +ChangeDeviceControl(ClientPtr client, DeviceIntPtr dev, + xDeviceCtl * control) +{ + + DEBUG_LOG("ChangeDeviceControl(%p, %p, %p)\n", client, dev, control); + switch (control->control) { + case DEVICE_RESOLUTION: + return (BadMatch); + case DEVICE_ABS_CALIB: + case DEVICE_ABS_AREA: + return (BadMatch); + case DEVICE_CORE: + return (BadMatch); + default: + return (BadMatch); } +} + + +/**************************************************************************** + * + * Caller: configAddDevice (and others) + * + * Add a new device with the specified options. + * + */ +int +NewInputDeviceRequest(InputOption *options, DeviceIntPtr *pdev) +{ + DEBUG_LOG("NewInputDeviceRequest(%p, %p)\n", options, pdev); + return BadValue; +} + +/**************************************************************************** + * + * Caller: configRemoveDevice (and others) + * + * Remove the specified device previously added. + * + */ +void +DeleteInputDeviceRequest(DeviceIntPtr dev) +{ + DEBUG_LOG("DeleteInputDeviceRequest(%p)\n", dev); +} diff --git a/xorg-server/hw/xquartz/doc/Makefile.am b/xorg-server/hw/xquartz/doc/Makefile.am new file mode 100644 index 000000000..b812af1cb --- /dev/null +++ b/xorg-server/hw/xquartz/doc/Makefile.am @@ -0,0 +1,14 @@ +appmandir = $(APP_MAN_DIR) +appman_PRE = Xquartz.man.pre +appman_PROCESSED = $(appman_PRE:man.pre=man) +appman_DATA = $(appman_PRE:man.pre=@APP_MAN_SUFFIX@) + +CLEANFILES = $(appman_PROCESSED) $(appman_DATA) + +include $(top_srcdir)/cpprules.in + +.man.$(APP_MAN_SUFFIX): + cp $< $@ + +EXTRA_DIST = \ + Xquartz.man.pre diff --git a/xorg-server/hw/xquartz/doc/Makefile.in b/xorg-server/hw/xquartz/doc/Makefile.in new file mode 100644 index 000000000..dcdc5f5f1 --- /dev/null +++ b/xorg-server/hw/xquartz/doc/Makefile.in @@ -0,0 +1,587 @@ +# Makefile.in generated by automake 1.10.2 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# -*- Makefile -*- +# Rules for generating files using the C pre-processor +# (Replaces CppFileTarget from Imake) + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/cpprules.in +subdir = hw/xquartz/doc +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ + $(top_builddir)/include/xorg-server.h \ + $(top_builddir)/include/dix-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 +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(appmandir)" +appmanDATA_INSTALL = $(INSTALL_DATA) +DATA = $(appman_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ +ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ +APPLE_APPLICATION_ID = @APPLE_APPLICATION_ID@ +APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASE_FONT_PATH = @BASE_FONT_PATH@ +BUILD_DATE = @BUILD_DATE@ +BUILD_TIME = @BUILD_TIME@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DARWIN_LIBS = @DARWIN_LIBS@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@ +DEFAULT_LOGPREFIX = @DEFAULT_LOGPREFIX@ +DEFAULT_MODULE_PATH = @DEFAULT_MODULE_PATH@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DGA_CFLAGS = @DGA_CFLAGS@ +DGA_LIBS = @DGA_LIBS@ +DIX_CFLAGS = @DIX_CFLAGS@ +DLLTOOL = @DLLTOOL@ +DMXEXAMPLES_DEP_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@ +DMXEXAMPLES_DEP_LIBS = @DMXEXAMPLES_DEP_LIBS@ +DMXMODULES_CFLAGS = @DMXMODULES_CFLAGS@ +DMXMODULES_LIBS = @DMXMODULES_LIBS@ +DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@ +DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@ +DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@ +DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ +DOLT_BASH = @DOLT_BASH@ +DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ +DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ +DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ +DRIPROTO_LIBS = @DRIPROTO_LIBS@ +DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ +DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ +DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ +GLX_DEFINES = @GLX_DEFINES@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +HAL_CFLAGS = @HAL_CFLAGS@ +HAL_LIBS = @HAL_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ +KDRIVE_INCS = @KDRIVE_INCS@ +KDRIVE_LIBS = @KDRIVE_LIBS@ +KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ +KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBDRM_CFLAGS = @LIBDRM_CFLAGS@ +LIBDRM_LIBS = @LIBDRM_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LINUXDOC = @LINUXDOC@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTCOMPILE = @LTCOMPILE@ +LTCXXCOMPILE = @LTCXXCOMPILE@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +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@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJC = @OBJC@ +OBJCCLD = @OBJCCLD@ +OBJCDEPMODE = @OBJCDEPMODE@ +OBJCFLAGS = @OBJCFLAGS@ +OBJCLINK = @OBJCLINK@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ +PCIACCESS_LIBS = @PCIACCESS_LIBS@ +PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PROJECTROOT = @PROJECTROOT@ +PS2PDF = @PS2PDF@ +RANLIB = @RANLIB@ +RAWCPP = @RAWCPP@ +RAWCPPFLAGS = @RAWCPPFLAGS@ +SED = sed +SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SOLARIS_ASM_CFLAGS = @SOLARIS_ASM_CFLAGS@ +SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ +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@ +VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ +VENDOR_RELEASE = @VENDOR_RELEASE@ +VERSION = @VERSION@ +X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ +X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XDMCP_CFLAGS = @XDMCP_CFLAGS@ +XDMCP_LIBS = @XDMCP_LIBS@ +XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ +XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@ +XDMX_CFLAGS = @XDMX_CFLAGS@ +XDMX_LIBS = @XDMX_LIBS@ +XDMX_SYS_LIBS = @XDMX_SYS_LIBS@ +XEPHYR_CFLAGS = @XEPHYR_CFLAGS@ +XEPHYR_INCS = @XEPHYR_INCS@ +XEPHYR_LIBS = @XEPHYR_LIBS@ +XF86CONFIGFILE = @XF86CONFIGFILE@ +XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@ +XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@ +XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@ +XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@ +XKB_COMPILED_DIR = @XKB_COMPILED_DIR@ +XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@ +XLIB_CFLAGS = @XLIB_CFLAGS@ +XLIB_LIBS = @XLIB_LIBS@ +XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ +XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ +XNEST_LIBS = @XNEST_LIBS@ +XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ +XORG_CFLAGS = @XORG_CFLAGS@ +XORG_INCS = @XORG_INCS@ +XORG_LIBS = @XORG_LIBS@ +XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@ +XORG_MODULES_LIBS = @XORG_MODULES_LIBS@ +XORG_OS = @XORG_OS@ +XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ +XORG_SYS_LIBS = @XORG_SYS_LIBS@ +XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ +XPBPROXY_LIBS = @XPBPROXY_LIBS@ +XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ +XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ +XSDL_INCS = @XSDL_INCS@ +XSDL_LIBS = @XSDL_LIBS@ +XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@ +XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@ +XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@ +XSERVERLIBS_LIBS = @XSERVERLIBS_LIBS@ +XSERVER_LIBS = @XSERVER_LIBS@ +XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@ +XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@ +XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@ +XVFB_LIBS = @XVFB_LIBS@ +XVFB_SYS_LIBS = @XVFB_SYS_LIBS@ +XWINMODULES_CFLAGS = @XWINMODULES_CFLAGS@ +XWINMODULES_LIBS = @XWINMODULES_LIBS@ +XWIN_LIBS = @XWIN_LIBS@ +XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ +XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ +YACC = @YACC@ +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@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +driverdir = @driverdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +extdir = @extdir@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +logdir = @logdir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +moduledir = @moduledir@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sdkdir = @sdkdir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +appmandir = $(APP_MAN_DIR) +appman_PRE = Xquartz.man.pre +appman_PROCESSED = $(appman_PRE:man.pre=man) +appman_DATA = $(appman_PRE:man.pre=@APP_MAN_SUFFIX@) +CLEANFILES = $(appman_PROCESSED) $(appman_DATA) +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 = \ + Xquartz.man.pre + +all: all-am + +.SUFFIXES: +.SUFFIXES: .pre .man .man.pre .$(APP_MAN_SUFFIX) +$(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*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hw/xquartz/doc/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign hw/xquartz/doc/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-appmanDATA: $(appman_DATA) + @$(NORMAL_INSTALL) + test -z "$(appmandir)" || $(MKDIR_P) "$(DESTDIR)$(appmandir)" + @list='$(appman_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(appmanDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(appmandir)/$$f'"; \ + $(appmanDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(appmandir)/$$f"; \ + done + +uninstall-appmanDATA: + @$(NORMAL_UNINSTALL) + @list='$(appman_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(appmandir)/$$f'"; \ + rm -f "$(DESTDIR)$(appmandir)/$$f"; \ + done +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(appmandir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-appmanDATA + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-appmanDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-appmanDATA install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-appmanDATA + + +.pre: + $(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) < $< | $(CPP_SED_MAGIC) > $@ + +.man.pre.man: + $(RAWCPP) $(RAWCPPFLAGS) $(MANDEFS) $(EXTRAMANDEFS) < $< | $(CPP_SED_MAGIC) > $@ + +.man.$(APP_MAN_SUFFIX): + cp $< $@ +# 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. +.NOEXPORT: diff --git a/xorg-server/hw/xquartz/doc/Xquartz.man.pre b/xorg-server/hw/xquartz/doc/Xquartz.man.pre new file mode 100644 index 000000000..04bbee30c --- /dev/null +++ b/xorg-server/hw/xquartz/doc/Xquartz.man.pre @@ -0,0 +1,159 @@ +.TH XQUARTZ 1 __vendorversion__ +.SH NAME +Xquartz \- X window system server for Mac OSX +.SH SYNOPSIS +.B Xquartz +[ options ] ... +.SH DESCRIPTION +.I Xquartz +is the X window server for Mac OS X provided by Apple. +.I Xquartz +runs in parallel with Aqua in rootless mode. In rootless mode, the X +window system and Mac OS X share your display. The root window of the +X11 display is the size of the screen and contains all the other +windows. The X11 root window is not displayed in rootless mode as Mac +OS X handles the desktop background. +.SH CUSTOMIZATION +\fIXquartz\fP can be customized using the defaults(1) command. The available options are: +.TP 8 +.B defaults write org.x.X11 enable_fake_buttons -boolean true +Emulates a 3 button mouse using modifier keys. By default, the Command modifier +is used to emulate button 2 and Option is used for button 3. Thus, clicking the +first mouse button while holding down Command will act like clicking +button 2. Holding down Option will simulate button 3. +.TP 8 +.B defaults write org.x.X11 fake_button2 \fImodifiers\fP +Change the modifier keys used to emulate the second mouse button. By default, +Command is used to emulate the second button. Any combination of the following +modifier names may be used: {l,r,}shift, {l,r,}option, {l,r,}control, {l,r,}command, fn +.TP 8 +.B defaults write org.x.X11 fake_button3 \fImodifiers\fP +Change the modifier keys used to emulate the second mouse button. By default, +Command is used to emulate the second button. Any combination of the following +modifier names may be used: {l,r,}shift, {l,r,}option, {l,r,}control, {l,r,}command, fn +.TP 8 +.B defaults write org.x.X11 fullscreen_hotkeys -boolean true +Enable OSX hotkeys while in fullscreen +.TP 8 +.B defaults write org.x.X11 fullscreen_menu -boolean true +Show the OSX menu while in fullscreen +.TP 8 +.B defaults write org.x.X11 no_quit_alert -boolean true +Disables the alert dialog displayed when attempting to quit X11. +.TP 8 +.B defaults write org.x.X11 no_auth -boolean true +Stops the X server requiring that clients authenticate themselves when +connecting. See Xsecurity(__miscmansuffix__). +.TP 8 +.B defaults write org.x.X11 nolisten_tcp -boolean false +This will tell the server to listen and accept TCP connections. Doing this without enabling +xauth is a possible security concern. See Xsecurity(__miscmansuffix__). +.TP 8 +.B defaults write org.x.X11 enable_system_beep -boolean false +Don't use the standard system beep effect for X11 alerts. +.TP 8 +.B defaults write org.x.X11 enable_key_equivalents -boolean false +Disable menu keyboard equivalents while X11 windows are focused. +.TP 8 +.B defaults write org.x.X11 depth \fIdepth\fP +Specifies the color bit depth to use. Currently only 15, and 24 color +bits per pixel are supported. If not specified, or a value of -1 is specified, +defaults to the depth of the main display. +.TP 8 +.B defaults write org.x.X11 sync_keymap -boolean true +Keep the X11 keymap up to date with the OSX system keymap. +.TP 8 +.B defaults write org.x.X11 sync_pasteboard -boolean true +Enable syncing between the OSX pasteboard and clipboard/primary selection buffers in X11. This option needs to be true for any of the other pasteboard sync options to have an effect. +.TP 8 +.B defaults write org.x.X11 sync_pasteboard_to_clipboard -boolean true +Update the X11 CLIPBOARD when the OSX NSPasteboard is updated. +.TP 8 +.B defaults write org.x.X11 sync_pasteboard_to_primary -boolean true +Update the the X11 PRIMARY buffer when the OSX NSPasteboard is updated. +.TP 8 +.B defaults write org.x.X11 sync_clipboard_to_pasteboard -boolean true +Update the the OSX NSPasteboard when the X11 CLIPBOARD is updated. Note that enabling this option causes the clipboard synchronization to act as a clipboard manager in X11. This makes it impossible to use xclipboard, klipper, or any other such clipboard managers. If you want to use any of these programs, you must disable this option. +.TP 8 +.B defaults write org.x.X11 sync_primary_on_select -boolean true +This option defaults to false and is provided only "for experts." It updates the NSPasteboard whenever a new X11 selection is made (rather than requiring you to hit cmd-c to copy the selection to the NSPasteboard). Since the X11 protocol does not require applications to send notification when they change selection, this might not work in all cases (if you run into this problem, try selecting text in another application first, then selecting the text you want). +.TP 8 +.B defaults write org.x.X11 enable_test_extensions -boolean true +This option defaults to false and is only accessible through the command line. Enable this option to turn on the DEC-XTRAP, RECORD, and XTEST extensions in the server. +.SH OPTIONS +.PP +In addition to the normal server options described in the \fIXserver(1)\fP +manual page, \fIXquartz\fP accepts the following command line switches: +.TP 8 +.B \-fakebuttons +Same as enable_fake_buttons above with value true. +.TP 8 +.B \-nofakebuttons +Same as enable_fake_buttons above with value false. +.TP 8 +.B "\-fakemouse2 \fImodifiers\fP" +Same as fake_button2 above. +.TP 8 +.B "\-fakemouse3 \fImodifiers\fP" +Same as fake_button3 above. +.TP 8 +.B "\-depth \fIdepth\fP" +Same as depth above. +.SH "SEE ALSO" +.PP +X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1) +.PP +http://xquartz.macosforge.org +.PP +.SH AUTHORS / HISTORY +X11 was originally ported to Mac OS X Server by John Carmack. Dave +Zarzycki used this as the basis of his port of XFree86 4.0 to Darwin 1.0. +Torrey T. Lyons improved and integrated this code into the XFree86 +Project's mainline for the 4.0.2 release. +.PP +The following members of the XonX Team contributed to the following +releases (in alphabetical order): +.TP 4 +XFree86 4.1.0: +.br +Rob Braun - Darwin x86 support +.br +Torrey T. Lyons - Project Lead +.br +Andreas Monitzer - Cocoa version of XDarwin front end +.br +Gregory Robert Parker - Original Quartz implementation +.br +Christoph Pfisterer - Dynamic shared X libraries +.br +Toshimitsu Tanaka - Japanese localization +.TP 4 +XFree86 4.2.0: +.br +Rob Braun - Darwin x86 support +.br +Pablo Di Noto - Spanish localization +.br +Paul Edens - Dutch localization +.br +Kyunghwan Kim - Korean localization +.br +Mario Klebsch - Non-US keyboard support +.br +Torrey T. Lyons - Project Lead +.br +Andreas Monitzer - German localization +.br +Patrik Montgomery - Swedish localization +.br +Greg Parker - Rootless support +.br +Toshimitsu Tanaka - Japanese localization +.br +Olivier Verdier - French localization +.PP +Code from Apple's X11.app (which was based on XFree86 4.1) was integrated into X.org's XDarwin DDX by Ben Byer for xorg-server-1.2. +The XDarwin DDX was renamed Xquartz to more accurately reflect its state (the pure-darwin backend was removed). +Jeremy Huddleston took over as project lead and brought the project up to the X.org 1.4 server branch. +.PP +Jeremy Huddleston is the current maintainer. diff --git a/xorg-server/hw/xquartz/mach-startup/Makefile.am b/xorg-server/hw/xquartz/mach-startup/Makefile.am new file mode 100644 index 000000000..b0112949d --- /dev/null +++ b/xorg-server/hw/xquartz/mach-startup/Makefile.am @@ -0,0 +1,74 @@ +AM_CPPFLAGS = \ + -DBUILD_DATE=\"$(BUILD_DATE)\" \ + -DXSERVER_VERSION=\"$(VERSION)\" \ + -DX11BINDIR=\"$(bindir)\" + +x11appdir = $(APPLE_APPLICATIONS_DIR)/X11.app/Contents/MacOS +x11app_PROGRAMS = X11.bin + +dist_X11_bin_SOURCES = \ + bundle-main.c + +nodist_X11_bin_SOURCES = \ + mach_startupServer.c \ + mach_startupUser.c + +X11_bin_LDADD = \ + $(top_builddir)/hw/xquartz/libXquartz.la \ + $(top_builddir)/hw/xquartz/xpr/libXquartzXpr.la \ + $(top_builddir)/dix/dixfonts.lo \ + $(top_builddir)/miext/rootless/librootless.la \ + $(top_builddir)/hw/xquartz/pbproxy/libxpbproxy.la \ + $(DARWIN_LIBS) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) -lXplugin + +X11_bin_LDFLAGS = \ + -XCClinker -Objc \ + -Wl,-u,_miDCInitialize \ + -Wl,-framework,Carbon \ + -Wl,-framework,Cocoa \ + -Wl,-framework,CoreAudio \ + -Wl,-framework,IOKit + +if GLX +X11_bin_LDADD += \ + $(top_builddir)/hw/xquartz/GL/libCGLCore.la \ + $(top_builddir)/glx/libglx.la + +X11_bin_LDFLAGS += \ + -L/System/Library/Frameworks/OpenGL.framework/Libraries -lGL \ + -Wl,-framework,OpenGL +endif + +if RECORD +X11_bin_LDADD += \ + $(top_builddir)/record/librecord.la +endif + +bin_PROGRAMS = Xquartz + +dist_Xquartz_SOURCES = \ + stub.c \ + launchd_fd.c + +nodist_Xquartz_SOURCES = \ + mach_startupUser.c + +Xquartz_LDFLAGS = \ + -Wl,-framework,CoreServices + +BUILT_SOURCES = \ + mach_startupServer.c \ + mach_startupUser.c \ + mach_startupServer.h \ + mach_startup.h + +CLEANFILES = \ + $(BUILT_SOURCES) + +$(BUILT_SOURCES): $(srcdir)/mach_startup.defs + mig -sheader mach_startupServer.h $(srcdir)/mach_startup.defs + +EXTRA_DIST = \ + launchd_fd.h \ + mach_startup.defs \ + mach_startup_types.h diff --git a/xorg-server/hw/xquartz/mach-startup/Makefile.in b/xorg-server/hw/xquartz/mach-startup/Makefile.in new file mode 100644 index 000000000..fbdedad9b --- /dev/null +++ b/xorg-server/hw/xquartz/mach-startup/Makefile.in @@ -0,0 +1,754 @@ +# Makefile.in generated by automake 1.10.2 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +x11app_PROGRAMS = X11.bin$(EXEEXT) +@GLX_TRUE@am__append_1 = \ +@GLX_TRUE@ $(top_builddir)/hw/xquartz/GL/libCGLCore.la \ +@GLX_TRUE@ $(top_builddir)/glx/libglx.la + +@GLX_TRUE@am__append_2 = \ +@GLX_TRUE@ -L/System/Library/Frameworks/OpenGL.framework/Libraries -lGL \ +@GLX_TRUE@ -Wl,-framework,OpenGL + +@RECORD_TRUE@am__append_3 = \ +@RECORD_TRUE@ $(top_builddir)/record/librecord.la + +bin_PROGRAMS = Xquartz$(EXEEXT) +subdir = hw/xquartz/mach-startup +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ + $(top_builddir)/include/xorg-server.h \ + $(top_builddir)/include/dix-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 +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(x11appdir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +x11appPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) $(x11app_PROGRAMS) +dist_X11_bin_OBJECTS = bundle-main.$(OBJEXT) +nodist_X11_bin_OBJECTS = mach_startupServer.$(OBJEXT) \ + mach_startupUser.$(OBJEXT) +X11_bin_OBJECTS = $(dist_X11_bin_OBJECTS) $(nodist_X11_bin_OBJECTS) +am__DEPENDENCIES_1 = +X11_bin_DEPENDENCIES = $(top_builddir)/hw/xquartz/libXquartz.la \ + $(top_builddir)/hw/xquartz/xpr/libXquartzXpr.la \ + $(top_builddir)/dix/dixfonts.lo \ + $(top_builddir)/miext/rootless/librootless.la \ + $(top_builddir)/hw/xquartz/pbproxy/libxpbproxy.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__append_1) $(am__append_3) +X11_bin_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(X11_bin_LDFLAGS) \ + $(LDFLAGS) -o $@ +dist_Xquartz_OBJECTS = stub.$(OBJEXT) launchd_fd.$(OBJEXT) +nodist_Xquartz_OBJECTS = mach_startupUser.$(OBJEXT) +Xquartz_OBJECTS = $(dist_Xquartz_OBJECTS) $(nodist_Xquartz_OBJECTS) +Xquartz_LDADD = $(LDADD) +Xquartz_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(Xquartz_LDFLAGS) \ + $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(dist_X11_bin_SOURCES) $(nodist_X11_bin_SOURCES) \ + $(dist_Xquartz_SOURCES) $(nodist_Xquartz_SOURCES) +DIST_SOURCES = $(dist_X11_bin_SOURCES) $(dist_Xquartz_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ +ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ +APPLE_APPLICATION_ID = @APPLE_APPLICATION_ID@ +APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASE_FONT_PATH = @BASE_FONT_PATH@ +BUILD_DATE = @BUILD_DATE@ +BUILD_TIME = @BUILD_TIME@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DARWIN_LIBS = @DARWIN_LIBS@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@ +DEFAULT_LOGPREFIX = @DEFAULT_LOGPREFIX@ +DEFAULT_MODULE_PATH = @DEFAULT_MODULE_PATH@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DGA_CFLAGS = @DGA_CFLAGS@ +DGA_LIBS = @DGA_LIBS@ +DIX_CFLAGS = @DIX_CFLAGS@ +DLLTOOL = @DLLTOOL@ +DMXEXAMPLES_DEP_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@ +DMXEXAMPLES_DEP_LIBS = @DMXEXAMPLES_DEP_LIBS@ +DMXMODULES_CFLAGS = @DMXMODULES_CFLAGS@ +DMXMODULES_LIBS = @DMXMODULES_LIBS@ +DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@ +DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@ +DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@ +DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ +DOLT_BASH = @DOLT_BASH@ +DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ +DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ +DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ +DRIPROTO_LIBS = @DRIPROTO_LIBS@ +DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ +DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ +DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ +GLX_DEFINES = @GLX_DEFINES@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +HAL_CFLAGS = @HAL_CFLAGS@ +HAL_LIBS = @HAL_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ +KDRIVE_INCS = @KDRIVE_INCS@ +KDRIVE_LIBS = @KDRIVE_LIBS@ +KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ +KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBDRM_CFLAGS = @LIBDRM_CFLAGS@ +LIBDRM_LIBS = @LIBDRM_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LINUXDOC = @LINUXDOC@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTCOMPILE = @LTCOMPILE@ +LTCXXCOMPILE = @LTCXXCOMPILE@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +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@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJC = @OBJC@ +OBJCCLD = @OBJCCLD@ +OBJCDEPMODE = @OBJCDEPMODE@ +OBJCFLAGS = @OBJCFLAGS@ +OBJCLINK = @OBJCLINK@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ +PCIACCESS_LIBS = @PCIACCESS_LIBS@ +PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PROJECTROOT = @PROJECTROOT@ +PS2PDF = @PS2PDF@ +RANLIB = @RANLIB@ +RAWCPP = @RAWCPP@ +RAWCPPFLAGS = @RAWCPPFLAGS@ +SED = @SED@ +SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SOLARIS_ASM_CFLAGS = @SOLARIS_ASM_CFLAGS@ +SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ +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@ +VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ +VENDOR_RELEASE = @VENDOR_RELEASE@ +VERSION = @VERSION@ +X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ +X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XDMCP_CFLAGS = @XDMCP_CFLAGS@ +XDMCP_LIBS = @XDMCP_LIBS@ +XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ +XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@ +XDMX_CFLAGS = @XDMX_CFLAGS@ +XDMX_LIBS = @XDMX_LIBS@ +XDMX_SYS_LIBS = @XDMX_SYS_LIBS@ +XEPHYR_CFLAGS = @XEPHYR_CFLAGS@ +XEPHYR_INCS = @XEPHYR_INCS@ +XEPHYR_LIBS = @XEPHYR_LIBS@ +XF86CONFIGFILE = @XF86CONFIGFILE@ +XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@ +XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@ +XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@ +XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@ +XKB_COMPILED_DIR = @XKB_COMPILED_DIR@ +XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@ +XLIB_CFLAGS = @XLIB_CFLAGS@ +XLIB_LIBS = @XLIB_LIBS@ +XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ +XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ +XNEST_LIBS = @XNEST_LIBS@ +XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ +XORG_CFLAGS = @XORG_CFLAGS@ +XORG_INCS = @XORG_INCS@ +XORG_LIBS = @XORG_LIBS@ +XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@ +XORG_MODULES_LIBS = @XORG_MODULES_LIBS@ +XORG_OS = @XORG_OS@ +XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ +XORG_SYS_LIBS = @XORG_SYS_LIBS@ +XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ +XPBPROXY_LIBS = @XPBPROXY_LIBS@ +XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ +XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ +XSDL_INCS = @XSDL_INCS@ +XSDL_LIBS = @XSDL_LIBS@ +XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@ +XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@ +XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@ +XSERVERLIBS_LIBS = @XSERVERLIBS_LIBS@ +XSERVER_LIBS = @XSERVER_LIBS@ +XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@ +XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@ +XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@ +XVFB_LIBS = @XVFB_LIBS@ +XVFB_SYS_LIBS = @XVFB_SYS_LIBS@ +XWINMODULES_CFLAGS = @XWINMODULES_CFLAGS@ +XWINMODULES_LIBS = @XWINMODULES_LIBS@ +XWIN_LIBS = @XWIN_LIBS@ +XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ +XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ +YACC = @YACC@ +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@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +driverdir = @driverdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +extdir = @extdir@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +logdir = @logdir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +moduledir = @moduledir@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sdkdir = @sdkdir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CPPFLAGS = \ + -DBUILD_DATE=\"$(BUILD_DATE)\" \ + -DXSERVER_VERSION=\"$(VERSION)\" \ + -DX11BINDIR=\"$(bindir)\" + +x11appdir = $(APPLE_APPLICATIONS_DIR)/X11.app/Contents/MacOS +dist_X11_bin_SOURCES = \ + bundle-main.c + +nodist_X11_bin_SOURCES = \ + mach_startupServer.c \ + mach_startupUser.c + +X11_bin_LDADD = $(top_builddir)/hw/xquartz/libXquartz.la \ + $(top_builddir)/hw/xquartz/xpr/libXquartzXpr.la \ + $(top_builddir)/dix/dixfonts.lo \ + $(top_builddir)/miext/rootless/librootless.la \ + $(top_builddir)/hw/xquartz/pbproxy/libxpbproxy.la \ + $(DARWIN_LIBS) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) -lXplugin \ + $(am__append_1) $(am__append_3) +X11_bin_LDFLAGS = -XCClinker -Objc -Wl,-u,_miDCInitialize \ + -Wl,-framework,Carbon -Wl,-framework,Cocoa \ + -Wl,-framework,CoreAudio -Wl,-framework,IOKit $(am__append_2) +dist_Xquartz_SOURCES = \ + stub.c \ + launchd_fd.c + +nodist_Xquartz_SOURCES = \ + mach_startupUser.c + +Xquartz_LDFLAGS = \ + -Wl,-framework,CoreServices + +BUILT_SOURCES = \ + mach_startupServer.c \ + mach_startupUser.c \ + mach_startupServer.h \ + mach_startup.h + +CLEANFILES = \ + $(BUILT_SOURCES) + +EXTRA_DIST = \ + launchd_fd.h \ + mach_startup.defs \ + mach_startup_types.h + +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hw/xquartz/mach-startup/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign hw/xquartz/mach-startup/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +install-x11appPROGRAMS: $(x11app_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(x11appdir)" || $(MKDIR_P) "$(DESTDIR)$(x11appdir)" + @list='$(x11app_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(x11appPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(x11appdir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(x11appPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(x11appdir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-x11appPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(x11app_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(x11appdir)/$$f'"; \ + rm -f "$(DESTDIR)$(x11appdir)/$$f"; \ + done + +clean-x11appPROGRAMS: + @list='$(x11app_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +X11.bin$(EXEEXT): $(X11_bin_OBJECTS) $(X11_bin_DEPENDENCIES) + @rm -f X11.bin$(EXEEXT) + $(X11_bin_LINK) $(X11_bin_OBJECTS) $(X11_bin_LDADD) $(LIBS) +Xquartz$(EXEEXT): $(Xquartz_OBJECTS) $(Xquartz_DEPENDENCIES) + @rm -f Xquartz$(EXEEXT) + $(Xquartz_LINK) $(Xquartz_OBJECTS) $(Xquartz_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bundle-main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd_fd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mach_startupServer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mach_startupUser.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stub.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(x11appdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool \ + clean-x11appPROGRAMS mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-x11appPROGRAMS + +install-dvi: install-dvi-am + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-x11appPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool clean-x11appPROGRAMS 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-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + install-x11appPROGRAMS 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-x11appPROGRAMS + + +$(BUILT_SOURCES): $(srcdir)/mach_startup.defs + mig -sheader mach_startupServer.h $(srcdir)/mach_startup.defs +# 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. +.NOEXPORT: diff --git a/xorg-server/hw/xquartz/mach-startup/bundle-main.c b/xorg-server/hw/xquartz/mach-startup/bundle-main.c new file mode 100644 index 000000000..fd70f26ed --- /dev/null +++ b/xorg-server/hw/xquartz/mach-startup/bundle-main.c @@ -0,0 +1,581 @@ +/* main.c -- X application launcher + + Copyright (c) 2007 Jeremy Huddleston + Copyright (c) 2007 Apple Inc + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT + HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + Except as contained in this notice, the name(s) of the above + copyright holders shall not be used in advertising or otherwise to + promote the sale, use or other dealings in this Software without + prior written authorization. */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include "mach_startup.h" +#include "mach_startupServer.h" + +#include "launchd_fd.h" +/* From darwinEvents.c ... but don't want to pull in all the server cruft */ +void DarwinListenOnOpenFD(int fd); + +extern int noPanoramiXExtension; + +extern int xquartz_resetenv_display; + +#define DEFAULT_CLIENT X11BINDIR "/xterm" +#define DEFAULT_STARTX X11BINDIR "/startx" +#define DEFAULT_SHELL "/bin/sh" + +#ifndef BUILD_DATE +#define BUILD_DATE "" +#endif +#ifndef XSERVER_VERSION +#define XSERVER_VERSION "?" +#endif + +const int __crashreporter_info__len = 4096; +const char *__crashreporter_info__base = "X.Org X Server " XSERVER_VERSION " Build Date: " BUILD_DATE; +char __crashreporter_info__buf[4096]; +char *__crashreporter_info__ = __crashreporter_info__buf; + +static char *server_bootstrap_name = "org.x.X11"; + +#define DEBUG 1 + +/* This is in quartzStartup.c */ +int server_main(int argc, char **argv, char **envp); + +static int execute(const char *command); +static char *command_from_prefs(const char *key, const char *default_value); + +/*** Pthread Magics ***/ +static pthread_t create_thread(void *func, void *arg) { + pthread_attr_t attr; + pthread_t tid; + + pthread_attr_init (&attr); + pthread_attr_setscope (&attr, PTHREAD_SCOPE_SYSTEM); + pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED); + pthread_create (&tid, &attr, func, arg); + pthread_attr_destroy (&attr); + + return tid; +} + +/*** Mach-O IPC Stuffs ***/ + +union MaxMsgSize { + union __RequestUnion__mach_startup_subsystem req; + union __ReplyUnion__mach_startup_subsystem rep; +}; + +static mach_port_t checkin_or_register(char *bname) { + kern_return_t kr; + mach_port_t mp; + + /* If we're started by launchd or the old mach_init */ + kr = bootstrap_check_in(bootstrap_port, bname, &mp); + if (kr == KERN_SUCCESS) + return mp; + + /* We probably were not started by launchd or the old mach_init */ + kr = mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &mp); + if (kr != KERN_SUCCESS) { + fprintf(stderr, "mach_port_allocate(): %s\n", mach_error_string(kr)); + exit(EXIT_FAILURE); + } + + kr = mach_port_insert_right(mach_task_self(), mp, mp, MACH_MSG_TYPE_MAKE_SEND); + if (kr != KERN_SUCCESS) { + fprintf(stderr, "mach_port_insert_right(): %s\n", mach_error_string(kr)); + exit(EXIT_FAILURE); + } + + kr = bootstrap_register(bootstrap_port, bname, mp); + if (kr != KERN_SUCCESS) { + fprintf(stderr, "bootstrap_register(): %s\n", mach_error_string(kr)); + exit(EXIT_FAILURE); + } + + return mp; +} + +/*** $DISPLAY handoff ***/ +static int accept_fd_handoff(int connected_fd) { + int launchd_fd; + + char databuf[] = "display"; + struct iovec iov[1]; + + iov[0].iov_base = databuf; + iov[0].iov_len = sizeof(databuf); + + union { + struct cmsghdr hdr; + char bytes[CMSG_SPACE(sizeof(int))]; + } buf; + + struct msghdr msg; + msg.msg_iov = iov; + msg.msg_iovlen = 1; + msg.msg_control = buf.bytes; + msg.msg_controllen = sizeof(buf); + msg.msg_name = 0; + msg.msg_namelen = 0; + msg.msg_flags = 0; + + struct cmsghdr *cmsg = CMSG_FIRSTHDR (&msg); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + cmsg->cmsg_len = CMSG_LEN(sizeof(int)); + + msg.msg_controllen = cmsg->cmsg_len; + + *((int*)CMSG_DATA(cmsg)) = -1; + + if(recvmsg(connected_fd, &msg, 0) < 0) { + fprintf(stderr, "X11.app: Error receiving $DISPLAY file descriptor. recvmsg() error: %s\n", strerror(errno)); + return -1; + } + + launchd_fd = *((int*)CMSG_DATA(cmsg)); + + return launchd_fd; +} + +typedef struct { + int fd; + string_t filename; +} socket_handoff_t; + +/* This thread accepts an incoming connection and hands off the file + * descriptor for the new connection to accept_fd_handoff() + */ +static void socket_handoff_thread(void *arg) { + socket_handoff_t *handoff_data = (socket_handoff_t *)arg; + int launchd_fd = -1; + int connected_fd; + + /* Now actually get the passed file descriptor from this connection + * If we encounter an error, keep listening. + */ + while(launchd_fd == -1) { + connected_fd = accept(handoff_data->fd, NULL, NULL); + if(connected_fd == -1) { + fprintf(stderr, "X11.app: Failed to accept incoming connection on socket (fd=%d): %s\n", handoff_data->fd, strerror(errno)); + sleep(2); + continue; + } + + launchd_fd = accept_fd_handoff(connected_fd); + if(launchd_fd == -1) + fprintf(stderr, "X11.app: Error receiving $DISPLAY file descriptor, no descriptor received? Waiting for another connection.\n"); + + close(connected_fd); + } + + close(handoff_data->fd); + unlink(handoff_data->filename); + free(handoff_data); + + /* TODO: Clean up this race better... giving xinitrc time to run... need to wait for 1.5 branch: + * + * From ajax: + * There's already an internal callback chain for setting selection [in 1.5] + * ownership. See the CallSelectionCallback at the bottom of + * ProcSetSelectionOwner, and xfixes/select.c for an example of how to hook + * into it. + */ + + unsigned remain = 3000000; + fprintf(stderr, "X11.app: Received new $DISPLAY fd: %d ... sleeping to allow xinitrc to catchup.\n", launchd_fd); + while((remain = usleep(remain)) > 0); + + fprintf(stderr, "X11.app Handing off fd to server thread via DarwinListenOnOpenFD(%d)\n", launchd_fd); + DarwinListenOnOpenFD(launchd_fd); +} + +static int create_socket(char *filename_out) { + struct sockaddr_un servaddr_un; + struct sockaddr *servaddr; + socklen_t servaddr_len; + int ret_fd; + size_t try, try_max; + + for(try=0, try_max=5; try < try_max; try++) { + tmpnam(filename_out); + + /* Setup servaddr_un */ + memset (&servaddr_un, 0, sizeof (struct sockaddr_un)); + servaddr_un.sun_family = AF_UNIX; + strlcpy(servaddr_un.sun_path, filename_out, sizeof(servaddr_un.sun_path)); + + servaddr = (struct sockaddr *) &servaddr_un; + servaddr_len = sizeof(struct sockaddr_un) - sizeof(servaddr_un.sun_path) + strlen(filename_out); + + ret_fd = socket(PF_UNIX, SOCK_STREAM, 0); + if(ret_fd == -1) { + fprintf(stderr, "X11.app: Failed to create socket (try %d / %d): %s - %s\n", (int)try+1, (int)try_max, filename_out, strerror(errno)); + continue; + } + + if(bind(ret_fd, servaddr, servaddr_len) != 0) { + fprintf(stderr, "X11.app: Failed to bind socket: %d - %s\n", errno, strerror(errno)); + close(ret_fd); + return 0; + } + + if(listen(ret_fd, 10) != 0) { + fprintf(stderr, "X11.app: Failed to listen to socket: %s - %d - %s\n", filename_out, errno, strerror(errno)); + close(ret_fd); + return 0; + } + +#ifdef DEBUG + fprintf(stderr, "X11.app: Listening on socket for fd handoff: (%d) %s\n", ret_fd, filename_out); +#endif + + return ret_fd; + } + + return 0; +} + +static int launchd_socket_handed_off = 0; + +kern_return_t do_request_fd_handoff_socket(mach_port_t port, string_t filename) { + socket_handoff_t *handoff_data; + + launchd_socket_handed_off = 1; + + handoff_data = (socket_handoff_t *)calloc(1,sizeof(socket_handoff_t)); + if(!handoff_data) { + fprintf(stderr, "X11.app: Error allocating memory for handoff_data\n"); + return KERN_FAILURE; + } + + handoff_data->fd = create_socket(handoff_data->filename); + if(!handoff_data->fd) { + return KERN_FAILURE; + } + + strlcpy(filename, handoff_data->filename, STRING_T_SIZE); + + create_thread(socket_handoff_thread, handoff_data); + +#ifdef DEBUG + fprintf(stderr, "X11.app: Thread created for handoff. Returning success to tell caller to connect and push the fd.\n"); +#endif + + return KERN_SUCCESS; +} + +kern_return_t do_request_pid(mach_port_t port, int *my_pid) { + *my_pid = getpid(); + return KERN_SUCCESS; +} + +/*** Server Startup ***/ +kern_return_t do_start_x11_server(mach_port_t port, string_array_t argv, + mach_msg_type_number_t argvCnt, + string_array_t envp, + mach_msg_type_number_t envpCnt) { + /* And now back to char ** */ + char **_argv = alloca((argvCnt + 1) * sizeof(char *)); + char **_envp = alloca((envpCnt + 1) * sizeof(char *)); + size_t i; + + /* If we didn't get handed a launchd DISPLAY socket, we shoul + * unset DISPLAY or we can run into problems with pbproxy + */ + if(!launchd_socket_handed_off) + unsetenv("DISPLAY"); + + if(!_argv || !_envp) { + return KERN_FAILURE; + } + + fprintf(stderr, "X11.app: do_start_x11_server(): argc=%d\n", argvCnt); + for(i=0; i < argvCnt; i++) { + _argv[i] = argv[i]; + fprintf(stderr, "\targv[%u] = %s\n", (unsigned)i, argv[i]); + } + _argv[argvCnt] = NULL; + + for(i=0; i < envpCnt; i++) { + _envp[i] = envp[i]; + } + _envp[envpCnt] = NULL; + + if(server_main(argvCnt, _argv, _envp) == 0) + return KERN_SUCCESS; + else + return KERN_FAILURE; +} + +int startup_trigger(int argc, char **argv, char **envp) { + Display *display; + const char *s; + + /* Take care of the case where we're called like a normal DDX */ + if(argc > 1 && argv[1][0] == ':') { + size_t i; + kern_return_t kr; + mach_port_t mp; + string_array_t newenvp; + string_array_t newargv; + + /* We need to count envp */ + int envpc; + for(envpc=0; envp[envpc]; envpc++); + + /* We have fixed-size string lengths due to limitations in IPC, + * so we need to copy our argv and envp. + */ + newargv = (string_array_t)alloca(argc * sizeof(string_t)); + newenvp = (string_array_t)alloca(envpc * sizeof(string_t)); + + if(!newargv || !newenvp) { + fprintf(stderr, "Memory allocation failure\n"); + exit(EXIT_FAILURE); + } + + for(i=0; i < argc; i++) { + strlcpy(newargv[i], argv[i], STRING_T_SIZE); + } + for(i=0; i < envpc; i++) { + strlcpy(newenvp[i], envp[i], STRING_T_SIZE); + } + + kr = bootstrap_look_up(bootstrap_port, server_bootstrap_name, &mp); + if (kr != KERN_SUCCESS) { +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 + fprintf(stderr, "bootstrap_look_up(): %s\n", bootstrap_strerror(kr)); +#else + fprintf(stderr, "bootstrap_look_up(): %ul\n", (unsigned long)kr); +#endif + exit(EXIT_FAILURE); + } + + kr = start_x11_server(mp, newargv, argc, newenvp, envpc); + if (kr != KERN_SUCCESS) { + fprintf(stderr, "start_x11_server: %s\n", mach_error_string(kr)); + exit(EXIT_FAILURE); + } + exit(EXIT_SUCCESS); + } + + /* If we have a process serial number and it's our only arg, act as if + * the user double clicked the app bundle: launch app_to_run if possible + */ + if(argc == 1 || (argc == 2 && !strncmp(argv[1], "-psn_", 5))) { + /* Now, try to open a display, if so, run the launcher */ + display = XOpenDisplay(NULL); + if(display) { + /* Could open the display, start the launcher */ + XCloseDisplay(display); + + return execute(command_from_prefs("app_to_run", DEFAULT_CLIENT)); + } + } + + /* Start the server */ + if((s = getenv("DISPLAY"))) { + fprintf(stderr, "X11.app: Could not connect to server (DISPLAY=\"%s\", unsetting). Starting X server.\n", s); + unsetenv("DISPLAY"); + + /* This tells X11Controller to not use the environment's DISPLAY and reset it based on the server's display */ + xquartz_resetenv_display = 1; + } else { + fprintf(stderr, "X11.app: Could not connect to server (DISPLAY is not set). Starting X server.\n"); + } + return execute(command_from_prefs("startx_script", DEFAULT_STARTX)); +} + +/** Setup the environment we want our child processes to inherit */ +static void ensure_path(const char *dir) { + char buf[1024], *temp; + + /* Make sure /usr/X11/bin is in the $PATH */ + temp = getenv("PATH"); + if(temp == NULL || temp[0] == 0) { + snprintf(buf, sizeof(buf), "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:%s", dir); + setenv("PATH", buf, TRUE); + } else if(strnstr(temp, X11BINDIR, sizeof(temp)) == NULL) { + snprintf(buf, sizeof(buf), "%s:%s", temp, dir); + setenv("PATH", buf, TRUE); + } +} + +static void setup_env() { + char *temp; + const char *pds = NULL; + + /* Pass on our prefs domain to startx and its inheritors (mainly for + * quartz-wm and the Xquartz stub's MachIPC) + */ + CFBundleRef bundle = CFBundleGetMainBundle(); + if(bundle) { + CFStringRef pd = CFBundleGetIdentifier(bundle); + if(pd) { + pds = CFStringGetCStringPtr(pd, 0); + if(pds) { + server_bootstrap_name = malloc(sizeof(char) * (strlen(pds) + 1)); + strcpy(server_bootstrap_name, pds); + setenv("X11_PREFS_DOMAIN", pds, 1); + } + } + } + + /* If we're not org.x.X11, we want to unset DISPLAY, so we don't + * use the launchd DISPLAY socket. + */ + if(pds == NULL || strcmp(pds, "org.x.X11") != 0) + unsetenv("DISPLAY"); + + /* Make sure PATH is right */ + ensure_path(X11BINDIR); + + /* cd $HOME */ + temp = getenv("HOME"); + if(temp != NULL && temp[0] != '\0') + chdir(temp); +} + +/*** Main ***/ +int main(int argc, char **argv, char **envp) { + Bool listenOnly = FALSE; + int i; + mach_msg_size_t mxmsgsz = sizeof(union MaxMsgSize) + MAX_TRAILER_SIZE; + mach_port_t mp; + kern_return_t kr; + + /* Setup our environment for our children */ + setup_env(); + + /* The server must not run the PanoramiX operations. */ + noPanoramiXExtension = TRUE; + + /* Setup the initial crasherporter info */ + strlcpy(__crashreporter_info__, __crashreporter_info__base, __crashreporter_info__len); + + fprintf(stderr, "X11.app: main(): argc=%d\n", argc); + for(i=0; i < argc; i++) { + fprintf(stderr, "\targv[%u] = %s\n", (unsigned)i, argv[i]); + if(!strcmp(argv[i], "--listenonly")) { + listenOnly = TRUE; + } + } + + mp = checkin_or_register(server_bootstrap_name); + if(mp == MACH_PORT_NULL) { + fprintf(stderr, "NULL mach service: %s", server_bootstrap_name); + return EXIT_FAILURE; + } + + /* Check if we need to do something other than listen, and make another + * thread handle it. + */ + if(!listenOnly) { + if(fork() == 0) { + return startup_trigger(argc, argv, envp); + } + } + + /* Main event loop */ + fprintf(stderr, "Waiting for startup parameters via Mach IPC.\n"); + kr = mach_msg_server(mach_startup_server, mxmsgsz, mp, 0); + if (kr != KERN_SUCCESS) { + fprintf(stderr, "org.x.X11(mp): %s\n", mach_error_string(kr)); + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} + +static int execute(const char *command) { + const char *newargv[4]; + const char **p; + + newargv[0] = command_from_prefs("login_shell", DEFAULT_SHELL); + newargv[1] = "-c"; + newargv[2] = command; + newargv[3] = NULL; + + fprintf(stderr, "X11.app: Launching %s:\n", command); + for(p=newargv; *p; p++) { + fprintf(stderr, "\targv[%ld] = %s\n", (long int)(p - newargv), *p); + } + + execvp (newargv[0], (char * const *) newargv); + perror ("X11.app: Couldn't exec."); + return(1); +} + +static char *command_from_prefs(const char *key, const char *default_value) { + char *command = NULL; + + CFStringRef cfKey = CFStringCreateWithCString(NULL, key, kCFStringEncodingASCII); + CFPropertyListRef PlistRef = CFPreferencesCopyAppValue(cfKey, kCFPreferencesCurrentApplication); + + if ((PlistRef == NULL) || (CFGetTypeID(PlistRef) != CFStringGetTypeID())) { + CFStringRef cfDefaultValue = CFStringCreateWithCString(NULL, default_value, kCFStringEncodingASCII); + + CFPreferencesSetAppValue(cfKey, cfDefaultValue, kCFPreferencesCurrentApplication); + CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication); + + int len = strlen(default_value) + 1; + command = (char *)malloc(len * sizeof(char)); + if(!command) + return NULL; + strcpy(command, default_value); + } else { + int len = CFStringGetLength((CFStringRef)PlistRef) + 1; + command = (char *)malloc(len * sizeof(char)); + if(!command) + return NULL; + CFStringGetCString((CFStringRef)PlistRef, command, len, kCFStringEncodingASCII); + } + + if (PlistRef) + CFRelease(PlistRef); + + return command; +} diff --git a/xorg-server/hw/xquartz/mach-startup/launchd_fd.c b/xorg-server/hw/xquartz/mach-startup/launchd_fd.c new file mode 100644 index 000000000..44a243a58 --- /dev/null +++ b/xorg-server/hw/xquartz/mach-startup/launchd_fd.c @@ -0,0 +1,82 @@ +/* Copyright (c) 2008 Apple Inc. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files + * (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT + * HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above + * copyright holders shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization. + */ + +#include +#include +#include + +#include "launchd_fd.h" + +int launchd_display_fd() { + launch_data_t sockets_dict, checkin_request, checkin_response; + launch_data_t listening_fd_array, listening_fd; + + /* Get launchd fd */ + if ((checkin_request = launch_data_new_string(LAUNCH_KEY_CHECKIN)) == NULL) { + fprintf(stderr,"launch_data_new_string(\"" LAUNCH_KEY_CHECKIN "\") Unable to create string.\n"); + return ERROR_FD; + } + + if ((checkin_response = launch_msg(checkin_request)) == NULL) { + fprintf(stderr,"launch_msg(\"" LAUNCH_KEY_CHECKIN "\") IPC failure: %s\n",strerror(errno)); + return ERROR_FD; + } + + if (LAUNCH_DATA_ERRNO == launch_data_get_type(checkin_response)) { + // ignore EACCES, which is common if we weren't started by launchd + if (launch_data_get_errno(checkin_response) != EACCES) + fprintf(stderr,"launchd check-in failed: %s\n", strerror(launch_data_get_errno(checkin_response))); + return ERROR_FD; + } + + sockets_dict = launch_data_dict_lookup(checkin_response, LAUNCH_JOBKEY_SOCKETS); + if (NULL == sockets_dict) { + fprintf(stderr,"launchd check-in: no sockets found to answer requests on!\n"); + return ERROR_FD; + } + + if (launch_data_dict_get_count(sockets_dict) > 1) { + fprintf(stderr,"launchd check-in: some sockets will be ignored!\n"); + return ERROR_FD; + } + + listening_fd_array = launch_data_dict_lookup(sockets_dict, ":0"); + if (NULL == listening_fd_array) { + fprintf(stderr,"launchd check-in: No known sockets found to answer requests on!\n"); + return ERROR_FD; + } + + if (launch_data_array_get_count(listening_fd_array)!=1) { + fprintf(stderr,"launchd check-in: Expected 1 socket from launchd, got %u)\n", + (unsigned)launch_data_array_get_count(listening_fd_array)); + return ERROR_FD; + } + + listening_fd=launch_data_array_get_index(listening_fd_array, 0); + return launch_data_get_fd(listening_fd); +} diff --git a/xorg-server/hw/xquartz/mach-startup/launchd_fd.h b/xorg-server/hw/xquartz/mach-startup/launchd_fd.h new file mode 100644 index 000000000..5083fae21 --- /dev/null +++ b/xorg-server/hw/xquartz/mach-startup/launchd_fd.h @@ -0,0 +1,36 @@ +/* Copyright (c) 2008 Apple Inc. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files + * (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT + * HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above + * copyright holders shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization. + */ + +#ifndef _XQUARTZ_LAUNCHD_FD_H_ +#define _XQUARTZ_LAUNCHD_FD_H_ + +#define ERROR_FD -1 + +int launchd_display_fd(void); + +#endif /* _XQUARTZ_LAUNCHD_FD_H_ */ \ No newline at end of file diff --git a/xorg-server/hw/xquartz/mach-startup/mach_startup.defs b/xorg-server/hw/xquartz/mach-startup/mach_startup.defs new file mode 100644 index 000000000..e47f49c3c --- /dev/null +++ b/xorg-server/hw/xquartz/mach-startup/mach_startup.defs @@ -0,0 +1,50 @@ +/* Copyright (c) 2008 Apple Inc. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files + * (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT + * HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above + * copyright holders shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization. + */ + +#include +#include +import "mach_startup_types.h"; + +subsystem mach_startup 1000; +serverprefix do_; + +type string_t = c_string[1024]; +type string_array_t = array[] of string_t; + +routine start_x11_server( + port : mach_port_t; + argv : string_array_t; + envp : string_array_t); + +routine request_fd_handoff_socket ( + port : mach_port_t; + out socket_filename : string_t); + +routine request_pid ( + port : mach_port_t; + out pid : int); diff --git a/xorg-server/hw/xquartz/mach-startup/mach_startup_types.h b/xorg-server/hw/xquartz/mach-startup/mach_startup_types.h new file mode 100644 index 000000000..459c750db --- /dev/null +++ b/xorg-server/hw/xquartz/mach-startup/mach_startup_types.h @@ -0,0 +1,9 @@ +#ifndef _MACH_STARTUP_TYPES_H_ +#define _MACH_STARTUP_TYPES_H_ + +#define STRING_T_SIZE 1024 + +typedef char string_t[STRING_T_SIZE]; +typedef string_t * string_array_t; + +#endif diff --git a/xorg-server/hw/xquartz/mach-startup/stub.c b/xorg-server/hw/xquartz/mach-startup/stub.c new file mode 100644 index 000000000..893d19c8d --- /dev/null +++ b/xorg-server/hw/xquartz/mach-startup/stub.c @@ -0,0 +1,345 @@ +/* Copyright (c) 2008 Apple Inc. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files + * (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT + * HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above + * copyright holders shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization. + */ + +#include + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include +#include +#include +#include + +#include +#include + +static char *server_bootstrap_name = "org.x.X11"; + +/* The launchd startup is only designed for the primary X11.app that is + * org.x.X11... server_bootstrap_name might be differnet if we were triggered to + * start by another X11.app. + */ +#define kX11AppBundleId "org.x.X11" +#define kX11AppBundlePath "/Contents/MacOS/X11" + +#include +#include +#include +#include "mach_startup.h" + +#include + +#include + +#include "launchd_fd.h" + +#ifndef BUILD_DATE +#define BUILD_DATE "?" +#endif +#ifndef XSERVER_VERSION +#define XSERVER_VERSION "?" +#endif + +#define DEBUG 1 + +static char x11_path[PATH_MAX + 1]; + +static pid_t x11app_pid = 0; + +static void set_x11_path() { +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 + + CFURLRef appURL = NULL; + CFBundleRef bundle = NULL; + OSStatus osstatus = LSFindApplicationForInfo(kLSUnknownCreator, CFSTR(kX11AppBundleId), nil, nil, &appURL); + UInt32 ver; + + switch (osstatus) { + case noErr: + if (appURL == NULL) { + fprintf(stderr, "Xquartz: Invalid response from LSFindApplicationForInfo(%s)\n", + kX11AppBundleId); + exit(1); + } + + bundle = CFBundleCreate(NULL, appURL); + if(!bundle) { + fprintf(stderr, "Xquartz: Null value returned from CFBundleCreate().\n"); + exit(2); + } + + if (!CFURLGetFileSystemRepresentation(appURL, true, (unsigned char *)x11_path, sizeof(x11_path))) { + fprintf(stderr, "Xquartz: Error resolving URL for %s\n", kX11AppBundleId); + exit(3); + } + + ver = CFBundleGetVersionNumber(bundle); + if(ver < 0x02308000) { + CFStringRef versionStr = CFBundleGetValueForInfoDictionaryKey(bundle, kCFBundleVersionKey); + const char * versionCStr = "Unknown"; + + if(versionStr) + versionCStr = CFStringGetCStringPtr(versionStr, kCFStringEncodingMacRoman); + + fprintf(stderr, "Xquartz: Could not find a new enough X11.app LSFindApplicationForInfo() returned\n"); + fprintf(stderr, " X11.app = %s\n", x11_path); + fprintf(stderr, " Version = %s (%x), Expected Version > 2.3.0\n", versionCStr, (unsigned)ver); + exit(9); + } + + strlcat(x11_path, kX11AppBundlePath, sizeof(x11_path)); +#ifdef DEBUG + fprintf(stderr, "Xquartz: X11.app = %s\n", x11_path); +#endif + break; + case kLSApplicationNotFoundErr: + fprintf(stderr, "Xquartz: Unable to find application for %s\n", kX11AppBundleId); + exit(10); + default: + fprintf(stderr, "Xquartz: Unable to find application for %s, error code = %d\n", + kX11AppBundleId, (int)osstatus); + exit(11); + } +#else + /* TODO: Make Tiger smarter... but TBH, this should never get called on Tiger... */ + strlcpy(x11_path, "/Applications/Utilities/X11.app/Contents/MacOS/X11", sizeof(x11_path)); +#endif +} + +static int connect_to_socket(const char *filename) { + struct sockaddr_un servaddr_un; + struct sockaddr *servaddr; + socklen_t servaddr_len; + int ret_fd; + + /* Setup servaddr_un */ + memset (&servaddr_un, 0, sizeof (struct sockaddr_un)); + servaddr_un.sun_family = AF_UNIX; + strlcpy(servaddr_un.sun_path, filename, sizeof(servaddr_un.sun_path)); + + servaddr = (struct sockaddr *) &servaddr_un; + servaddr_len = sizeof(struct sockaddr_un) - sizeof(servaddr_un.sun_path) + strlen(filename); + + ret_fd = socket(PF_UNIX, SOCK_STREAM, 0); + if(ret_fd == -1) { + fprintf(stderr, "Xquartz: Failed to create socket: %s - %s\n", filename, strerror(errno)); + return -1; + } + + if(connect(ret_fd, servaddr, servaddr_len) < 0) { + fprintf(stderr, "Xquartz: Failed to connect to socket: %s - %d - %s\n", filename, errno, strerror(errno)); + close(ret_fd); + return -1; + } + + return ret_fd; +} + +static void send_fd_handoff(int connected_fd, int launchd_fd) { + char databuf[] = "display"; + struct iovec iov[1]; + + iov[0].iov_base = databuf; + iov[0].iov_len = sizeof(databuf); + + union { + struct cmsghdr hdr; + char bytes[CMSG_SPACE(sizeof(int))]; + } buf; + + struct msghdr msg; + msg.msg_iov = iov; + msg.msg_iovlen = 1; + msg.msg_control = buf.bytes; + msg.msg_controllen = sizeof(buf); + msg.msg_name = 0; + msg.msg_namelen = 0; + msg.msg_flags = 0; + + struct cmsghdr *cmsg = CMSG_FIRSTHDR (&msg); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + cmsg->cmsg_len = CMSG_LEN(sizeof(int)); + + msg.msg_controllen = cmsg->cmsg_len; + + *((int*)CMSG_DATA(cmsg)) = launchd_fd; + + if(sendmsg(connected_fd, &msg, 0) < 0) { + fprintf(stderr, "Xquartz: Error sending $DISPLAY file descriptor over fd %d: %d -- %s\n", connected_fd, errno, strerror(errno)); + return; + } + +#ifdef DEBUG + fprintf(stderr, "Xquartz: Message sent. Closing handoff fd.\n"); +#endif + + close(connected_fd); +} + +static void signal_handler(int sig) { + if(x11app_pid) + kill(x11app_pid, sig); + _exit(0); +} + +int main(int argc, char **argv, char **envp) { + int envpc; + kern_return_t kr; + mach_port_t mp; + string_array_t newenvp; + string_array_t newargv; + size_t i; + int launchd_fd; + string_t handoff_socket_filename; + sig_t handler; + + if(argc == 2 && !strcmp(argv[1], "-version")) { + fprintf(stderr, "X.org Release 7.3\n"); + fprintf(stderr, "X.Org X Server %s\n", XSERVER_VERSION); + fprintf(stderr, "Build Date: %s\n", BUILD_DATE); + return EXIT_SUCCESS; + } + + if(getenv("X11_PREFS_DOMAIN")) + server_bootstrap_name = getenv("X11_PREFS_DOMAIN"); + + /* We don't have a mechanism in place to handle this interrupt driven + * server-start notification, so just send the signal now, so xinit doesn't + * time out waiting for it and will just poll for the server. + */ + handler = signal(SIGUSR1, SIG_IGN); + if(handler == SIG_IGN) + kill(getppid(), SIGUSR1); + signal(SIGUSR1, handler); + + /* Pass on SIGs to X11.app */ + signal(SIGINT, signal_handler); + signal(SIGTERM, signal_handler); + + /* Get the $DISPLAY FD */ + launchd_fd = launchd_display_fd(); + + kr = bootstrap_look_up(bootstrap_port, server_bootstrap_name, &mp); + if(kr != KERN_SUCCESS) { + set_x11_path(); + + /* This forking is ugly and will be cleaned up later */ + pid_t child = fork(); + if(child == -1) { + fprintf(stderr, "Xquartz: Could not fork: %s\n", strerror(errno)); + return EXIT_FAILURE; + } + + if(child == 0) { + char *_argv[3]; + _argv[0] = x11_path; + _argv[1] = "--listenonly"; + _argv[2] = NULL; + fprintf(stderr, "Xquartz: Starting X server: %s --listenonly\n", x11_path); + return execvp(x11_path, _argv); + } + + /* Try connecting for 10 seconds */ + for(i=0; i < 80; i++) { + usleep(250000); + kr = bootstrap_look_up(bootstrap_port, server_bootstrap_name, &mp); + if(kr == KERN_SUCCESS) + break; + } + + if(kr != KERN_SUCCESS) { +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 + fprintf(stderr, "Xquartz: bootstrap_look_up(): %s\n", bootstrap_strerror(kr)); +#else + fprintf(stderr, "Xquartz: bootstrap_look_up(): %ul\n", (unsigned long)kr); +#endif + return EXIT_FAILURE; + } + } + + /* Get X11.app's pid */ + request_pid(mp, &x11app_pid); + + /* Handoff the $DISPLAY FD */ + if(launchd_fd != -1) { + size_t try, try_max; + int handoff_fd = -1; + + for(try=0, try_max=5; try < try_max; try++) { + if(request_fd_handoff_socket(mp, handoff_socket_filename) != KERN_SUCCESS) { + fprintf(stderr, "Xquartz: Failed to request a socket from the server to send the $DISPLAY fd over (try %d of %d)\n", (int)try+1, (int)try_max); + continue; + } + + handoff_fd = connect_to_socket(handoff_socket_filename); + if(handoff_fd == -1) { + fprintf(stderr, "Xquartz: Failed to connect to socket (try %d of %d)\n", (int)try+1, (int)try_max); + continue; + } + +#ifdef DEBUG + fprintf(stderr, "Xquartz: Handoff connection established (try %d of %d) on fd %d, \"%s\". Sending message.\n", (int)try+1, (int)try_max, handoff_fd, handoff_socket_filename); +#endif + + send_fd_handoff(handoff_fd, launchd_fd); + close(handoff_fd); + break; + } + } + + /* Count envp */ + for(envpc=0; envp[envpc]; envpc++); + + /* We have fixed-size string lengths due to limitations in IPC, + * so we need to copy our argv and envp. + */ + newargv = (string_array_t)alloca(argc * sizeof(string_t)); + newenvp = (string_array_t)alloca(envpc * sizeof(string_t)); + + if(!newargv || !newenvp) { + fprintf(stderr, "Xquartz: Memory allocation failure\n"); + exit(EXIT_FAILURE); + } + + for(i=0; i < argc; i++) { + strlcpy(newargv[i], argv[i], STRING_T_SIZE); + } + for(i=0; i < envpc; i++) { + strlcpy(newenvp[i], envp[i], STRING_T_SIZE); + } + + kr = start_x11_server(mp, newargv, argc, newenvp, envpc); + if (kr != KERN_SUCCESS) { + fprintf(stderr, "Xquartz: start_x11_server: %s\n", mach_error_string(kr)); + return EXIT_FAILURE; + } + return EXIT_SUCCESS; +} diff --git a/xorg-server/hw/xquartz/pbproxy/Makefile.am b/xorg-server/hw/xquartz/pbproxy/Makefile.am new file mode 100644 index 000000000..e1c537fbb --- /dev/null +++ b/xorg-server/hw/xquartz/pbproxy/Makefile.am @@ -0,0 +1,23 @@ +AM_CPPFLAGS=-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks +AM_CFLAGS=$(XPBPROXY_CFLAGS) + +noinst_LTLIBRARIES = libxpbproxy.la +libxpbproxy_la_SOURCES = \ + trick_autotools.c \ + main.m \ + x-input.m \ + x-selection.m + +libxpbproxy_la_LDFLAGS=$(XPBPROXY_LIBS) + +if STANDALONE_XPBPROXY + +bin_PROGRAMS = xpbproxy +xpbproxy_SOURCES = app-main.m +xpbproxy_LDADD = libxpbproxy.la + +endif + +EXTRA_DIST = \ + pbproxy.h \ + x-selection.h diff --git a/xorg-server/hw/xquartz/pbproxy/Makefile.in b/xorg-server/hw/xquartz/pbproxy/Makefile.in new file mode 100644 index 000000000..b31445e39 --- /dev/null +++ b/xorg-server/hw/xquartz/pbproxy/Makefile.in @@ -0,0 +1,698 @@ +# Makefile.in generated by automake 1.10.2 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@STANDALONE_XPBPROXY_TRUE@bin_PROGRAMS = xpbproxy$(EXEEXT) +subdir = hw/xquartz/pbproxy +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ + $(top_builddir)/include/xorg-server.h \ + $(top_builddir)/include/dix-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 +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libxpbproxy_la_LIBADD = +am_libxpbproxy_la_OBJECTS = trick_autotools.lo main.lo x-input.lo \ + x-selection.lo +libxpbproxy_la_OBJECTS = $(am_libxpbproxy_la_OBJECTS) +libxpbproxy_la_LINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(OBJCLD) $(AM_OBJCFLAGS) $(OBJCFLAGS) \ + $(libxpbproxy_la_LDFLAGS) $(LDFLAGS) -o $@ +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am__xpbproxy_SOURCES_DIST = app-main.m +@STANDALONE_XPBPROXY_TRUE@am_xpbproxy_OBJECTS = app-main.$(OBJEXT) +xpbproxy_OBJECTS = $(am_xpbproxy_OBJECTS) +@STANDALONE_XPBPROXY_TRUE@xpbproxy_DEPENDENCIES = libxpbproxy.la +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +OBJCCOMPILE = $(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS) +LTOBJCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS) +OBJCLD = $(OBJC) +SOURCES = $(libxpbproxy_la_SOURCES) $(xpbproxy_SOURCES) +DIST_SOURCES = $(libxpbproxy_la_SOURCES) $(am__xpbproxy_SOURCES_DIST) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ +ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ +APPLE_APPLICATION_ID = @APPLE_APPLICATION_ID@ +APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASE_FONT_PATH = @BASE_FONT_PATH@ +BUILD_DATE = @BUILD_DATE@ +BUILD_TIME = @BUILD_TIME@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DARWIN_LIBS = @DARWIN_LIBS@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@ +DEFAULT_LOGPREFIX = @DEFAULT_LOGPREFIX@ +DEFAULT_MODULE_PATH = @DEFAULT_MODULE_PATH@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DGA_CFLAGS = @DGA_CFLAGS@ +DGA_LIBS = @DGA_LIBS@ +DIX_CFLAGS = @DIX_CFLAGS@ +DLLTOOL = @DLLTOOL@ +DMXEXAMPLES_DEP_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@ +DMXEXAMPLES_DEP_LIBS = @DMXEXAMPLES_DEP_LIBS@ +DMXMODULES_CFLAGS = @DMXMODULES_CFLAGS@ +DMXMODULES_LIBS = @DMXMODULES_LIBS@ +DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@ +DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@ +DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@ +DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ +DOLT_BASH = @DOLT_BASH@ +DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ +DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ +DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ +DRIPROTO_LIBS = @DRIPROTO_LIBS@ +DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ +DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ +DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ +GLX_DEFINES = @GLX_DEFINES@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +HAL_CFLAGS = @HAL_CFLAGS@ +HAL_LIBS = @HAL_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ +KDRIVE_INCS = @KDRIVE_INCS@ +KDRIVE_LIBS = @KDRIVE_LIBS@ +KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ +KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBDRM_CFLAGS = @LIBDRM_CFLAGS@ +LIBDRM_LIBS = @LIBDRM_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LINUXDOC = @LINUXDOC@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTCOMPILE = @LTCOMPILE@ +LTCXXCOMPILE = @LTCXXCOMPILE@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +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@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJC = @OBJC@ +OBJCCLD = @OBJCCLD@ +OBJCDEPMODE = @OBJCDEPMODE@ +OBJCFLAGS = @OBJCFLAGS@ +OBJCLINK = @OBJCLINK@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ +PCIACCESS_LIBS = @PCIACCESS_LIBS@ +PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PROJECTROOT = @PROJECTROOT@ +PS2PDF = @PS2PDF@ +RANLIB = @RANLIB@ +RAWCPP = @RAWCPP@ +RAWCPPFLAGS = @RAWCPPFLAGS@ +SED = @SED@ +SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SOLARIS_ASM_CFLAGS = @SOLARIS_ASM_CFLAGS@ +SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ +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@ +VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ +VENDOR_RELEASE = @VENDOR_RELEASE@ +VERSION = @VERSION@ +X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ +X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XDMCP_CFLAGS = @XDMCP_CFLAGS@ +XDMCP_LIBS = @XDMCP_LIBS@ +XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ +XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@ +XDMX_CFLAGS = @XDMX_CFLAGS@ +XDMX_LIBS = @XDMX_LIBS@ +XDMX_SYS_LIBS = @XDMX_SYS_LIBS@ +XEPHYR_CFLAGS = @XEPHYR_CFLAGS@ +XEPHYR_INCS = @XEPHYR_INCS@ +XEPHYR_LIBS = @XEPHYR_LIBS@ +XF86CONFIGFILE = @XF86CONFIGFILE@ +XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@ +XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@ +XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@ +XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@ +XKB_COMPILED_DIR = @XKB_COMPILED_DIR@ +XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@ +XLIB_CFLAGS = @XLIB_CFLAGS@ +XLIB_LIBS = @XLIB_LIBS@ +XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ +XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ +XNEST_LIBS = @XNEST_LIBS@ +XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ +XORG_CFLAGS = @XORG_CFLAGS@ +XORG_INCS = @XORG_INCS@ +XORG_LIBS = @XORG_LIBS@ +XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@ +XORG_MODULES_LIBS = @XORG_MODULES_LIBS@ +XORG_OS = @XORG_OS@ +XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ +XORG_SYS_LIBS = @XORG_SYS_LIBS@ +XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ +XPBPROXY_LIBS = @XPBPROXY_LIBS@ +XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ +XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ +XSDL_INCS = @XSDL_INCS@ +XSDL_LIBS = @XSDL_LIBS@ +XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@ +XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@ +XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@ +XSERVERLIBS_LIBS = @XSERVERLIBS_LIBS@ +XSERVER_LIBS = @XSERVER_LIBS@ +XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@ +XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@ +XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@ +XVFB_LIBS = @XVFB_LIBS@ +XVFB_SYS_LIBS = @XVFB_SYS_LIBS@ +XWINMODULES_CFLAGS = @XWINMODULES_CFLAGS@ +XWINMODULES_LIBS = @XWINMODULES_LIBS@ +XWIN_LIBS = @XWIN_LIBS@ +XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ +XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ +YACC = @YACC@ +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@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +driverdir = @driverdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +extdir = @extdir@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +logdir = @logdir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +moduledir = @moduledir@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sdkdir = @sdkdir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CPPFLAGS = -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks +AM_CFLAGS = $(XPBPROXY_CFLAGS) +noinst_LTLIBRARIES = libxpbproxy.la +libxpbproxy_la_SOURCES = \ + trick_autotools.c \ + main.m \ + x-input.m \ + x-selection.m + +libxpbproxy_la_LDFLAGS = $(XPBPROXY_LIBS) +@STANDALONE_XPBPROXY_TRUE@xpbproxy_SOURCES = app-main.m +@STANDALONE_XPBPROXY_TRUE@xpbproxy_LDADD = libxpbproxy.la +EXTRA_DIST = \ + pbproxy.h \ + x-selection.h + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .m .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hw/xquartz/pbproxy/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign hw/xquartz/pbproxy/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libxpbproxy.la: $(libxpbproxy_la_OBJECTS) $(libxpbproxy_la_DEPENDENCIES) + $(libxpbproxy_la_LINK) $(libxpbproxy_la_OBJECTS) $(libxpbproxy_la_LIBADD) $(LIBS) +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +xpbproxy$(EXEEXT): $(xpbproxy_OBJECTS) $(xpbproxy_DEPENDENCIES) + @rm -f xpbproxy$(EXEEXT) + $(OBJCLINK) $(xpbproxy_OBJECTS) $(xpbproxy_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/app-main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trick_autotools.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x-input.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x-selection.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +.m.o: +@am__fastdepOBJC_TRUE@ $(OBJCCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepOBJC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ DEPDIR=$(DEPDIR) $(OBJCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepOBJC_FALSE@ $(OBJCCOMPILE) -c -o $@ $< + +.m.obj: +@am__fastdepOBJC_TRUE@ $(OBJCCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepOBJC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ DEPDIR=$(DEPDIR) $(OBJCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepOBJC_FALSE@ $(OBJCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.m.lo: +@am__fastdepOBJC_TRUE@ $(LTOBJCCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepOBJC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ DEPDIR=$(DEPDIR) $(OBJCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepOBJC_FALSE@ $(LTOBJCCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool clean-noinstLTLIBRARIES 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-html-am \ + install-info install-info-am install-man 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 + +# 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. +.NOEXPORT: diff --git a/xorg-server/hw/xquartz/pbproxy/app-main.m b/xorg-server/hw/xquartz/pbproxy/app-main.m new file mode 100644 index 000000000..cb0fa5744 --- /dev/null +++ b/xorg-server/hw/xquartz/pbproxy/app-main.m @@ -0,0 +1,92 @@ +/* app-main.m + Copyright (c) 2002, 2008 Apple Computer, Inc. All rights reserved. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT + HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + Except as contained in this notice, the name(s) of the above + copyright holders shall not be used in advertising or otherwise to + promote the sale, use or other dealings in this Software without + prior written authorization. + */ + +#include "pbproxy.h" +#import "x-selection.h" + +#include +#include /*for getpid*/ +#include + +static const char *app_prefs_domain = "org.x.X11"; +CFStringRef app_prefs_domain_cfstr; + +char *display = NULL; + +static void signal_handler (int sig) { + switch(sig) { + case SIGHUP: + xpbproxy_prefs_reload = YES; + break; + default: + _exit(EXIT_SUCCESS); + } +} + +int main (int argc, const char *argv[]) { +#ifdef DEBUG + printf("pid: %u\n", getpid()); +#endif + + xpbproxy_is_standalone = YES; + + if((s = getenv("X11_PREFS_DOMAIN"))) + app_prefs_domain = s; + + for (i = 1; i < argc; i++) { + if(strcmp (argv[i], "--prefs-domain") == 0 && i+1 < argc) { + app_prefs_domain = argv[++i]; + } else if (strcmp (argv[i], "--help") == 0) { + printf("usage: xpbproxy OPTIONS\n" + "Pasteboard proxying for X11.\n\n" + "--prefs-domain Change the domain used for reading preferences\n" + " (default: org.x.X11)\n"); + return 0; + } else { + fprintf(stderr, "usage: xpbproxy OPTIONS...\n" + "Try 'xpbproxy --help' for more information.\n"); + return 1; + } + } + + app_prefs_domain_cfstr = CFStringCreateWithCString(NULL, app_prefs_domain, kCFStringEncodingUTF8); + + if(!xpbproxy_init()) + return EXIT_FAILURE; + + signal (SIGINT, signal_handler); + signal (SIGTERM, signal_handler); + signal (SIGHUP, signal_handler); + signal (SIGPIPE, SIG_IGN); + + [NSApplication sharedApplication]; + [NSApp run]; + + return EXIT_SUCCESS; +} diff --git a/xorg-server/hw/xquartz/pbproxy/main.m b/xorg-server/hw/xquartz/pbproxy/main.m new file mode 100644 index 000000000..5bc518243 --- /dev/null +++ b/xorg-server/hw/xquartz/pbproxy/main.m @@ -0,0 +1,164 @@ +/* main.m + Copyright (c) 2002, 2008 Apple Computer, Inc. All rights reserved. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT + HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + Except as contained in this notice, the name(s) of the above + copyright holders shall not be used in advertising or otherwise to + promote the sale, use or other dealings in this Software without + prior written authorization. + */ + +#include "pbproxy.h" +#import "x-selection.h" + +#include +#include +#include + +Display *xpbproxy_dpy; +int xpbproxy_apple_wm_event_base, xpbproxy_apple_wm_error_base; +int xpbproxy_xfixes_event_base, xpbproxy_xfixes_error_base; +BOOL xpbproxy_have_xfixes; + +extern char *display; + +#ifdef STANDALONE_XPBPROXY +BOOL xpbproxy_is_standalone = NO; +#endif + +x_selection *_selection_object; + +static int x_io_error_handler (Display *dpy) { + /* We lost our connection to the server. */ + + TRACE (); + + /* trigger the thread to restart? + * NO - this would be to a "deeper" problem, and restarts would just + * make things worse... + */ +#ifdef STANDALONE_XPBPROXY + if(xpbproxy_is_standalone) + exit(EXIT_FAILURE); +#endif + + return 0; +} + +static int x_error_handler (Display *dpy, XErrorEvent *errevent) { + return 0; +} + +static inline pthread_t create_thread(void *func, void *arg) { + pthread_attr_t attr; + pthread_t tid; + + pthread_attr_init(&attr); + pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + pthread_create(&tid, &attr, func, arg); + pthread_attr_destroy(&attr); + + return tid; +} + +static void *xpbproxy_x_thread(void *args) { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + size_t i; + + for(i=0, xpbproxy_dpy=NULL; !xpbproxy_dpy && i<5; i++) { + xpbproxy_dpy = XOpenDisplay(NULL); + + if(!xpbproxy_dpy && display) { + char _display[32]; + snprintf(_display, sizeof(_display), ":%s", display); + setenv("DISPLAY", _display, TRUE); + + xpbproxy_dpy=XOpenDisplay(_display); + } + if(!xpbproxy_dpy) + sleep(1); + } + + if (xpbproxy_dpy == NULL) { + fprintf (stderr, "xpbproxy: can't open default display\n"); + [pool release]; + return NULL; + } + + XSetIOErrorHandler (x_io_error_handler); + XSetErrorHandler (x_error_handler); + + if (!XAppleWMQueryExtension (xpbproxy_dpy, &xpbproxy_apple_wm_event_base, + &xpbproxy_apple_wm_error_base)) { + fprintf (stderr, "xpbproxy: can't open AppleWM server extension\n"); + [pool release]; + return NULL; + } + + xpbproxy_have_xfixes = XFixesQueryExtension(xpbproxy_dpy, &xpbproxy_xfixes_event_base, &xpbproxy_xfixes_error_base); + + XAppleWMSelectInput (xpbproxy_dpy, AppleWMActivationNotifyMask | + AppleWMPasteboardNotifyMask); + + _selection_object = [[x_selection alloc] init]; + + if(!xpbproxy_input_register()) { + [pool release]; + return NULL; + } + + [pool release]; + + xpbproxy_input_loop(); + return NULL; +} + +BOOL xpbproxy_init (void) { + create_thread(xpbproxy_x_thread, NULL); + return TRUE; +} + +id xpbproxy_selection_object (void) { + return _selection_object; +} + +Time xpbproxy_current_timestamp (void) { + /* FIXME: may want to fetch a timestamp from the server.. */ + return CurrentTime; +} + +void debug_printf (const char *fmt, ...) { + static int spew = -1; + + if (spew == -1) { + char *x = getenv ("DEBUG"); + spew = (x != NULL && atoi (x) != 0); + } + + if (spew) { + va_list args; + va_start(args, fmt); + vfprintf (stderr, fmt, args); + va_end(args); + } +} diff --git a/xorg-server/hw/xquartz/pbproxy/pbproxy.h b/xorg-server/hw/xquartz/pbproxy/pbproxy.h new file mode 100644 index 000000000..a6798efea --- /dev/null +++ b/xorg-server/hw/xquartz/pbproxy/pbproxy.h @@ -0,0 +1,91 @@ +/* pbproxy.h + Copyright (c) 2002, 2008 Apple Computer, Inc. All rights reserved. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT + HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + Except as contained in this notice, the name(s) of the above + copyright holders shall not be used in advertising or otherwise to + promote the sale, use or other dealings in this Software without + prior written authorization. +*/ + +#ifndef PBPROXY_H +#define PBPROXY_H 1 + +#import + +#include +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050 +#if __LP64__ || NS_BUILD_32_LIKE_64 +typedef long NSInteger; +typedef unsigned long NSUInteger; +#else +typedef int NSInteger; +typedef unsigned int NSUInteger; +#endif +#endif + +#define Cursor X_Cursor +#undef _SHAPE_H_ +#include +#include +#undef Cursor + +#ifdef STANDALONE_XPBPROXY +/* Just used for the standalone to respond to SIGHUP to reload prefs */ +extern BOOL xpbproxy_prefs_reload; + +/* Setting this to YES (for the standalone app) causes us to ignore the + * 'sync_pasteboard' defaults preference since we assume it to be on... this is + * mainly useful for debugging/developing xpbproxy with XQuartz still running. + * Just disable the one in the server with X11's preference pane, then run + * the standalone app. + */ +extern BOOL xpbproxy_is_standalone; +#endif + +/* from main.m */ +extern void xpbproxy_set_is_active (BOOL state); +extern BOOL xpbproxy_get_is_active (void); +extern id xpbproxy_selection_object (void); +extern Time xpbproxy_current_timestamp (void); +extern BOOL xpbproxy_init (void); + +extern Display *xpbproxy_dpy; +extern int xpbproxy_apple_wm_event_base, xpbproxy_apple_wm_error_base; +extern int xpbproxy_xfixes_event_base, xpbproxy_xfixes_error_base; +extern BOOL xpbproxy_have_xfixes; + +/* from x-input.m */ +extern BOOL xpbproxy_input_register (void); +extern void xpbproxy_input_loop(); + +#ifdef DEBUG +/* BEWARE: this can cause a string memory leak, according to the leaks program. */ +# define DB(msg, args...) debug_printf("%s:%s:%d " msg, __FILE__, __FUNCTION__, __LINE__, ##args) +#else +# define DB(msg, args...) do {} while (0) +#endif + +#define TRACE() DB("TRACE\n") +extern void debug_printf (const char *fmt, ...); + +#endif /* PBPROXY_H */ diff --git a/xorg-server/hw/xquartz/pbproxy/trick_autotools.c b/xorg-server/hw/xquartz/pbproxy/trick_autotools.c new file mode 100644 index 000000000..a38f077b1 --- /dev/null +++ b/xorg-server/hw/xquartz/pbproxy/trick_autotools.c @@ -0,0 +1,3 @@ +int this_is_just_here_to_make_automake_work() { + return 0; +} diff --git a/xorg-server/hw/xquartz/pbproxy/x-input.m b/xorg-server/hw/xquartz/pbproxy/x-input.m new file mode 100644 index 000000000..6ba30c610 --- /dev/null +++ b/xorg-server/hw/xquartz/pbproxy/x-input.m @@ -0,0 +1,187 @@ +/* x-input.m -- event handling + Copyright (c) 2002, 2008 Apple Computer, Inc. All rights reserved. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT + HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + Except as contained in this notice, the name(s) of the above + copyright holders shall not be used in advertising or otherwise to + promote the sale, use or other dealings in this Software without + prior written authorization. + */ + +#include "pbproxy.h" +#import "x-selection.h" + +#include +#include + +#include +#include +#include + +#include + +#include + +static CFRunLoopSourceRef xpbproxy_dpy_source; + +#ifdef STANDALONE_XPBPROXY +BOOL xpbproxy_prefs_reload = NO; +#endif + +static pthread_mutex_t xpbproxy_dpy_rdy_lock = PTHREAD_MUTEX_INITIALIZER; +static pthread_cond_t xpbproxy_dpy_rdy_cond = PTHREAD_COND_INITIALIZER; + +/* Timestamp when the X server last told us it's active */ +static Time last_activation_time; + +static void x_event_apple_wm_notify(XAppleWMNotifyEvent *e) { + int type = e->type - xpbproxy_apple_wm_event_base; + int kind = e->kind; + + /* We want to reload prefs even if we're not active */ + if(type == AppleWMActivationNotify && + kind == AppleWMReloadPreferences) + [xpbproxy_selection_object() reload_preferences]; + + if(![xpbproxy_selection_object() is_active]) + return; + + switch (type) { + case AppleWMActivationNotify: + switch (kind) { + case AppleWMIsActive: + last_activation_time = e->time; + [xpbproxy_selection_object() x_active:e->time]; + break; + + case AppleWMIsInactive: + [xpbproxy_selection_object() x_inactive:e->time]; + break; + } + break; + + case AppleWMPasteboardNotify: + switch (kind) { + case AppleWMCopyToPasteboard: + [xpbproxy_selection_object() x_copy:e->time]; + } + break; + } +} + +void xpbproxy_input_loop() { + pthread_mutex_lock(&xpbproxy_dpy_rdy_lock); + while(true) { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + if(pool == nil) { + fprintf(stderr, "unable to allocate/init auto release pool!\n"); + break; + } + + while (XPending(xpbproxy_dpy) != 0) { + XEvent e; + + pthread_mutex_unlock(&xpbproxy_dpy_rdy_lock); + XNextEvent (xpbproxy_dpy, &e); + + switch (e.type) { + case SelectionClear: + if([xpbproxy_selection_object() is_active]) + [xpbproxy_selection_object () clear_event:&e.xselectionclear]; + break; + + case SelectionRequest: + [xpbproxy_selection_object () request_event:&e.xselectionrequest]; + break; + + case SelectionNotify: + [xpbproxy_selection_object () notify_event:&e.xselection]; + break; + + case PropertyNotify: + [xpbproxy_selection_object () property_event:&e.xproperty]; + break; + + default: + if(e.type >= xpbproxy_apple_wm_event_base && + e.type < xpbproxy_apple_wm_event_base + AppleWMNumberEvents) { + x_event_apple_wm_notify((XAppleWMNotifyEvent *) &e); + } else if(e.type == xpbproxy_xfixes_event_base + XFixesSelectionNotify) { + [xpbproxy_selection_object() xfixes_selection_notify:(XFixesSelectionNotifyEvent *)&e]; + } + break; + } + + XFlush(xpbproxy_dpy); + pthread_mutex_lock(&xpbproxy_dpy_rdy_lock); + } + + [pool release]; + + pthread_cond_wait(&xpbproxy_dpy_rdy_cond, &xpbproxy_dpy_rdy_lock); + } +} + +static BOOL add_input_socket (int sock, CFOptionFlags callback_types, + CFSocketCallBack callback, const CFSocketContext *ctx, + CFRunLoopSourceRef *cf_source) { + CFSocketRef cf_sock; + + cf_sock = CFSocketCreateWithNative (kCFAllocatorDefault, sock, + callback_types, callback, ctx); + if (cf_sock == NULL) { + close (sock); + return FALSE; + } + + *cf_source = CFSocketCreateRunLoopSource (kCFAllocatorDefault, + cf_sock, 0); + CFRelease (cf_sock); + + if (*cf_source == NULL) + return FALSE; + + CFRunLoopAddSource (CFRunLoopGetMain (), + *cf_source, kCFRunLoopDefaultMode); + return TRUE; +} + +static void x_input_callback (CFSocketRef sock, CFSocketCallBackType type, + CFDataRef address, const void *data, void *info) { + +#ifdef STANDALONE_XPBPROXY + if(xpbproxy_prefs_reload) { + [xpbproxy_selection_object() reload_preferences]; + xpbproxy_prefs_reload = NO; + } +#endif + + pthread_mutex_lock(&xpbproxy_dpy_rdy_lock); + pthread_cond_broadcast(&xpbproxy_dpy_rdy_cond); + pthread_mutex_unlock(&xpbproxy_dpy_rdy_lock); +} + +BOOL xpbproxy_input_register(void) { + return add_input_socket(ConnectionNumber(xpbproxy_dpy), kCFSocketReadCallBack, + x_input_callback, NULL, &xpbproxy_dpy_source); +} diff --git a/xorg-server/hw/xquartz/pbproxy/x-selection.h b/xorg-server/hw/xquartz/pbproxy/x-selection.h new file mode 100644 index 000000000..d5bfcb5e7 --- /dev/null +++ b/xorg-server/hw/xquartz/pbproxy/x-selection.h @@ -0,0 +1,116 @@ +/* x-selection.h -- proxies between NSPasteboard and X11 selections + + Copyright (c) 2002, 2008 Apple Computer, Inc. All rights reserved. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT + HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + Except as contained in this notice, the name(s) of the above + copyright holders shall not be used in advertising or otherwise to + promote the sale, use or other dealings in this Software without + prior written authorization. +*/ + +#ifndef X_SELECTION_H +#define X_SELECTION_H 1 + +#include "pbproxy.h" + +#include + +#include + +/* This stores image data or text. */ +struct propdata { + unsigned char *data; + size_t length; +}; + +struct atom_list { + Atom primary, clipboard, text, utf8_string, string, targets, multiple, + cstring, image_png, image_jpeg, incr, atom, clipboard_manager, + compound_text, atom_pair; +}; + + +@interface x_selection : NSObject +{ +@private + + /* The unmapped window we use for fetching selections. */ + Window _selection_window; + + /* Last time we declared anything on the pasteboard. */ + int _my_last_change; + + /* Name of the selection we're proxying onto the pasteboard. */ + Atom _proxied_selection; + + /* When true, we're expecting a SelectionNotify event. */ + unsigned int _pending_notify :1; + + Atom request_atom; + + struct { + struct propdata propdata; + Window requestor; + Atom selection; + } pending; + + /* + * This is the number of times the user has requested a copy. + * Once the copy is completed, we --pending_copy, and if the + * pending_copy is > 0 we do it again. + */ + int pending_copy; + /* + * This is used for the same purpose as pending_copy, but for the + * CLIPBOARD. It also prevents a race with INCR transfers. + */ + int pending_clipboard; + + struct atom_list atoms[1]; +} + +- (void) x_active:(Time)timestamp; +- (void) x_inactive:(Time)timestamp; + +- (void) x_copy:(Time)timestamp; + +- (void) clear_event:(XSelectionClearEvent *)e; +- (void) request_event:(XSelectionRequestEvent *)e; +- (void) notify_event:(XSelectionEvent *)e; +- (void) property_event:(XPropertyEvent *)e; +- (void) xfixes_selection_notify:(XFixesSelectionNotifyEvent *)e; +- (void) handle_selection:(Atom)selection type:(Atom)type propdata:(struct propdata *)pdata; +- (void) claim_clipboard; +- (BOOL) set_clipboard_manager_status:(BOOL)value; +- (void) own_clipboard; +- (void) copy_completed:(Atom)selection; + +- (void) reload_preferences; +- (BOOL) is_active; +- (void) send_none:(XSelectionRequestEvent *)e; +@end + +/* main.m */ +extern x_selection *_selection_object; + +#endif /* X_SELECTION_H */ diff --git a/xorg-server/hw/xquartz/pbproxy/x-selection.m b/xorg-server/hw/xquartz/pbproxy/x-selection.m new file mode 100644 index 000000000..cd540be98 --- /dev/null +++ b/xorg-server/hw/xquartz/pbproxy/x-selection.m @@ -0,0 +1,1545 @@ +/* x-selection.m -- proxies between NSPasteboard and X11 selections + + Copyright (c) 2002, 2008 Apple Computer, Inc. All rights reserved. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT + HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + Except as contained in this notice, the name(s) of the above + copyright holders shall not be used in advertising or otherwise to + promote the sale, use or other dealings in this Software without + prior written authorization. +*/ + +#import "x-selection.h" + +#include +#include +#include +#include +#import +#import +#import + +/* + * The basic design of the pbproxy code is as follows. + * + * When a client selects text, say from an xterm - we only copy it when the + * X11 Edit->Copy menu item is pressed or the shortcut activated. In this + * case we take the PRIMARY selection, and set it as the NSPasteboard data. + * + * When an X11 client copies something to the CLIPBOARD, pbproxy greedily grabs + * the data, sets it as the NSPasteboard data, and finally sets itself as + * owner of the CLIPBOARD. + * + * When an X11 window is activated we check to see if the NSPasteboard has + * changed. If the NSPasteboard has changed, then we set pbproxy as owner + * of the PRIMARY and CLIPBOARD and respond to requests for text and images. + * + * The behavior is now dynamic since the information above was written. + * The behavior is now dependent on the pbproxy_prefs below. + */ + +/* + * TODO: + * 1. handle MULTIPLE - I need to study the ICCCM further, and find a test app. + * 2. Handle NSPasteboard updates immediately, not on active/inactive + * - Open xterm, run 'cat readme.txt | pbcopy' + */ + +static struct { + BOOL active ; + BOOL primary_on_grab; /* This is provided as an option for people who + * want it and has issues that won't ever be + * addressed to make it *always* work. + */ + BOOL clipboard_to_pasteboard; + BOOL pasteboard_to_primary; + BOOL pasteboard_to_clipboard; +} pbproxy_prefs = { YES, NO, YES, YES, YES }; + +@implementation x_selection + +static struct propdata null_propdata = {NULL, 0}; + +#ifdef DEBUG +static void +dump_prefs (FILE *fp) { + fprintf(fp, + "pbproxy preferences:\n" + "\tactive %u\n" + "\tprimary_on_grab %u\n" + "\tclipboard_to_pasteboard %u\n" + "\tpasteboard_to_primary %u\n" + "\tpasteboard_to_clipboard %u\n", + pbproxy_prefs.active, + pbproxy_prefs.primary_on_grab, + pbproxy_prefs.clipboard_to_pasteboard, + pbproxy_prefs.pasteboard_to_primary, + pbproxy_prefs.pasteboard_to_clipboard); +} +#endif + +extern CFStringRef app_prefs_domain_cfstr; + +static BOOL +prefs_get_bool (CFStringRef key, BOOL defaultValue) { + Boolean value, ok; + + value = CFPreferencesGetAppBooleanValue (key, app_prefs_domain_cfstr, &ok); + + return ok ? (BOOL) value : defaultValue; +} + +static void +init_propdata (struct propdata *pdata) +{ + *pdata = null_propdata; +} + +static void +free_propdata (struct propdata *pdata) +{ + free (pdata->data); + *pdata = null_propdata; +} + +/* + * Return True if an error occurs. Return False if pdata has data + * and we finished. + * The property is only deleted when bytesleft is 0 if delete is True. + */ +static Bool +get_property(Window win, Atom property, struct propdata *pdata, Bool delete, Atom *type) +{ + long offset = 0; + unsigned long numitems, bytesleft = 0; +#ifdef TEST + /* This is used to test the growth handling. */ + unsigned long length = 4UL; +#else + unsigned long length = (100000UL + 3) / 4; +#endif + unsigned char *buf = NULL, *chunk = NULL; + size_t buflen = 0, chunkbytesize = 0; + int format; + + TRACE (); + + if(None == property) + return True; + + do + { + unsigned long newbuflen = 0; + unsigned char *newbuf = NULL; + +#ifdef TEST + printf("bytesleft %lu\n", bytesleft); +#endif + + if (Success != XGetWindowProperty (xpbproxy_dpy, win, property, + offset, length, delete, + AnyPropertyType, + type, &format, &numitems, + &bytesleft, &chunk)) + { + DB ("Error while getting window property.\n"); + *pdata = null_propdata; + free (buf); + return True; + } + +#ifdef TEST + printf("format %d numitems %lu bytesleft %lu\n", + format, numitems, bytesleft); + + printf("type %s\n", XGetAtomName (xpbproxy_dpy, *type)); +#endif + + /* Format is the number of bits. */ + chunkbytesize = numitems * (format / 8); + +#ifdef TEST + printf("chunkbytesize %zu\n", chunkbytesize); +#endif + newbuflen = buflen + chunkbytesize; + if (newbuflen > 0) + { + newbuf = realloc (buf, newbuflen); + + if (NULL == newbuf) + { + XFree (chunk); + free (buf); + return True; + } + + memcpy (newbuf + buflen, chunk, chunkbytesize); + XFree (chunk); + buf = newbuf; + buflen = newbuflen; + /* offset is a multiple of 32 bits*/ + offset += chunkbytesize / 4; + } + else + { + if (chunk) + XFree (chunk); + } + +#ifdef TEST + printf("bytesleft %lu\n", bytesleft); +#endif + } while (bytesleft > 0); + + pdata->data = buf; + pdata->length = buflen; + + return /*success*/ False; +} + + +/* Implementation methods */ + +/* This finds the preferred type from a TARGETS list.*/ +- (Atom) find_preferred:(struct propdata *)pdata +{ + Atom a = None; + size_t i; + Bool png = False, jpeg = False, utf8 = False, string = False; + + TRACE (); + + if (pdata->length % sizeof (a)) + { + fprintf(stderr, "Atom list is not a multiple of the size of an atom!\n"); + return None; + } + + for (i = 0; i < pdata->length; i += sizeof (a)) + { + a = None; + memcpy (&a, pdata->data + i, sizeof (a)); + + if (a == atoms->image_png) + { + png = True; + } + else if (a == atoms->image_jpeg) + { + jpeg = True; + } + else if (a == atoms->utf8_string) + { + utf8 = True; + } + else if (a == atoms->string) + { + string = True; + } + else + { + char *type = XGetAtomName(xpbproxy_dpy, a); + if (type) + { + DB("Unhandled X11 mime type: %s", type); + XFree(type); + } + } + } + + /*We prefer PNG over strings, and UTF8 over a Latin-1 string.*/ + if (png) + return atoms->image_png; + + if (jpeg) + return atoms->image_jpeg; + + if (utf8) + return atoms->utf8_string; + + if (string) + return atoms->string; + + /* This is evidently something we don't know how to handle.*/ + return None; +} + +/* Return True if this is an INCR-style transfer. */ +- (Bool) is_incr_type:(XSelectionEvent *)e +{ + Atom seltype; + int format; + unsigned long numitems = 0UL, bytesleft = 0UL; + unsigned char *chunk; + + TRACE (); + + if (Success != XGetWindowProperty (xpbproxy_dpy, e->requestor, e->property, + /*offset*/ 0L, /*length*/ 4UL, + /*Delete*/ False, + AnyPropertyType, &seltype, &format, + &numitems, &bytesleft, &chunk)) + { + return False; + } + + if(chunk) + XFree(chunk); + + return (seltype == atoms->incr) ? True : False; +} + +/* + * This should be called after a selection has been copied, + * or when the selection is unfinished before a transfer completes. + */ +- (void) release_pending +{ + TRACE (); + + free_propdata (&pending.propdata); + pending.requestor = None; + pending.selection = None; +} + +/* Return True if an error occurs during an append.*/ +/* Return False if the append succeeds. */ +- (Bool) append_to_pending:(struct propdata *)pdata requestor:(Window)requestor +{ + unsigned char *newdata; + size_t newlength; + + TRACE (); + + if (requestor != pending.requestor) + { + [self release_pending]; + pending.requestor = requestor; + } + + newlength = pending.propdata.length + pdata->length; + newdata = realloc(pending.propdata.data, newlength); + + if(NULL == newdata) + { + perror("realloc propdata"); + [self release_pending]; + return True; + } + + memcpy(newdata + pending.propdata.length, pdata->data, pdata->length); + pending.propdata.data = newdata; + pending.propdata.length = newlength; + + return False; +} + + + +/* Called when X11 becomes active (i.e. has key focus) */ +- (void) x_active:(Time)timestamp +{ + static NSInteger changeCount; + NSInteger countNow; + NSPasteboard *pb; + + TRACE (); + + pb = [NSPasteboard generalPasteboard]; + + if (nil == pb) + return; + + countNow = [pb changeCount]; + + if (countNow != changeCount) + { + DB ("changed pasteboard!\n"); + changeCount = countNow; + + if (pbproxy_prefs.pasteboard_to_primary) + { + XSetSelectionOwner (xpbproxy_dpy, atoms->primary, _selection_window, CurrentTime); + } + + if (pbproxy_prefs.pasteboard_to_clipboard) { + [self own_clipboard]; + } + } + +#if 0 + /*gstaplin: we should perhaps investigate something like this branch above...*/ + if ([_pasteboard availableTypeFromArray: _known_types] != nil) + { + /* Pasteboard has data we should proxy; I think it makes + sense to put it on both CLIPBOARD and PRIMARY */ + + XSetSelectionOwner (xpbproxy_dpy, atoms->clipboard, + _selection_window, timestamp); + XSetSelectionOwner (xpbproxy_dpy, atoms->primary, + _selection_window, timestamp); + } +#endif +} + +/* Called when X11 loses key focus */ +- (void) x_inactive:(Time)timestamp +{ + TRACE (); +} + +/* This requests the TARGETS list from the PRIMARY selection owner. */ +- (void) x_copy_request_targets +{ + TRACE (); + + request_atom = atoms->targets; + XConvertSelection (xpbproxy_dpy, atoms->primary, atoms->targets, + atoms->primary, _selection_window, CurrentTime); +} + +/* Called when the Edit/Copy item on the main X11 menubar is selected + * and no appkit window claims it. */ +- (void) x_copy:(Time)timestamp +{ + Window w; + + TRACE (); + + w = XGetSelectionOwner (xpbproxy_dpy, atoms->primary); + + if (None != w) + { + ++pending_copy; + + if (1 == pending_copy) { + /* + * There are no other copy operations in progress, so we + * can proceed safely. Otherwise the copy_completed method + * will see that the pending_copy is > 1, and do another copy. + */ + [self x_copy_request_targets]; + } + } + else + { + XBell (xpbproxy_dpy, 0); + } +} + +/* Set pbproxy as owner of the SELECTION_MANAGER selection. + * This prevents tools like xclipboard from causing havoc. + * Returns TRUE on success + */ +- (BOOL) set_clipboard_manager_status:(BOOL)value +{ + TRACE (); + + Window owner = XGetSelectionOwner (xpbproxy_dpy, atoms->clipboard_manager); + + if(value) { + if(owner == _selection_window) + return TRUE; + + if(owner != None) { + fprintf (stderr, "A clipboard manager using window 0x%lx " + "already owns the clipboard selection. " + "pbproxy will not sync clipboard to pasteboard.\n", owner); + return FALSE; + } + + XSetSelectionOwner(xpbproxy_dpy, atoms->clipboard_manager, _selection_window, CurrentTime); + return (_selection_window == XGetSelectionOwner(xpbproxy_dpy, atoms->clipboard_manager)); + } else { + if(owner != _selection_window) + return TRUE; + + XSetSelectionOwner(xpbproxy_dpy, atoms->clipboard_manager, None, CurrentTime); + return(None == XGetSelectionOwner(xpbproxy_dpy, atoms->clipboard_manager)); + } + + return FALSE; +} + +/* + * This occurs when we previously owned a selection, + * and then lost it from another client. + */ +- (void) clear_event:(XSelectionClearEvent *)e +{ + + + TRACE (); + + DB ("e->selection %s\n", XGetAtomName (xpbproxy_dpy, e->selection)); + + if(e->selection == atoms->clipboard) { + /* + * We lost ownership of the CLIPBOARD. + */ + ++pending_clipboard; + + if (1 == pending_clipboard) { + /* Claim the clipboard contents from the new owner. */ + [self claim_clipboard]; + } + } else if(e->selection == atoms->clipboard_manager) { + if(pbproxy_prefs.clipboard_to_pasteboard) { + /* Another CLIPBOARD_MANAGER has set itself as owner. Disable syncing + * to avoid a race. + */ + fprintf(stderr, "Another clipboard manager was started! " + "xpbproxy is disabling syncing with clipboard.\n"); + pbproxy_prefs.clipboard_to_pasteboard = NO; + } + } +} + +/* + * We greedily acquire the clipboard after it changes, and on startup. + */ +- (void) claim_clipboard +{ + Window owner; + + TRACE (); + + if (!pbproxy_prefs.clipboard_to_pasteboard) + return; + + owner = XGetSelectionOwner (xpbproxy_dpy, atoms->clipboard); + if (None == owner) { + /* + * The owner probably died or we are just starting up pbproxy. + * Set pbproxy's _selection_window as the owner, and continue. + */ + DB ("No clipboard owner.\n"); + [self copy_completed:atoms->clipboard]; + return; + } else if (owner == _selection_window) { + [self copy_completed:atoms->clipboard]; + return; + } + + DB ("requesting targets\n"); + + request_atom = atoms->targets; + XConvertSelection (xpbproxy_dpy, atoms->clipboard, atoms->targets, + atoms->clipboard, _selection_window, CurrentTime); + XFlush (xpbproxy_dpy); + /* Now we will get a SelectionNotify event in the future. */ +} + +/* Greedily acquire the clipboard. */ +- (void) own_clipboard +{ + + TRACE (); + + /* We should perhaps have a boundary limit on the number of iterations... */ + do + { + XSetSelectionOwner (xpbproxy_dpy, atoms->clipboard, _selection_window, + CurrentTime); + } while (_selection_window != XGetSelectionOwner (xpbproxy_dpy, + atoms->clipboard)); +} + +- (void) init_reply:(XEvent *)reply request:(XSelectionRequestEvent *)e +{ + reply->xselection.type = SelectionNotify; + reply->xselection.selection = e->selection; + reply->xselection.target = e->target; + reply->xselection.requestor = e->requestor; + reply->xselection.time = e->time; + reply->xselection.property = None; +} + +- (void) send_reply:(XEvent *)reply +{ + /* + * We are supposed to use an empty event mask, and not propagate + * the event, according to the ICCCM. + */ + DB ("reply->xselection.requestor 0x%lx\n", reply->xselection.requestor); + + XSendEvent (xpbproxy_dpy, reply->xselection.requestor, False, 0, reply); + XFlush (xpbproxy_dpy); +} + +/* + * This responds to a TARGETS request. + * The result is a list of a ATOMs that correspond to the types available + * for a selection. + * For instance an application might provide a UTF8_STRING and a STRING + * (in Latin-1 encoding). The requestor can then make the choice based on + * the list. + */ +- (void) send_targets:(XSelectionRequestEvent *)e pasteboard:(NSPasteboard *)pb +{ + XEvent reply; + NSArray *pbtypes; + + [self init_reply:&reply request:e]; + + pbtypes = [pb types]; + if (pbtypes) + { + long list[7]; /* Don't forget to increase this if we handle more types! */ + long count = 0; + + /* + * I'm not sure if this is needed, but some toolkits/clients list + * TARGETS in response to targets. + */ + list[count] = atoms->targets; + ++count; + + if ([pbtypes containsObject:NSStringPboardType]) + { + /* We have a string type that we can convert to UTF8, or Latin-1... */ + DB ("NSStringPboardType\n"); + list[count] = atoms->utf8_string; + ++count; + list[count] = atoms->string; + ++count; + list[count] = atoms->compound_text; + ++count; + } + + /* TODO add the NSPICTPboardType back again, once we have conversion + * functionality in send_image. + */ + + if ([pbtypes containsObject:NSPICTPboardType] + || [pbtypes containsObject:NSTIFFPboardType]) + { + /* We can convert a TIFF to a PNG or JPEG. */ + DB ("NSTIFFPboardType\n"); + list[count] = atoms->image_png; + ++count; + list[count] = atoms->image_jpeg; + ++count; + } + + if (count) + { + /* We have a list of ATOMs to send. */ + XChangeProperty (xpbproxy_dpy, e->requestor, e->property, atoms->atom, 32, + PropModeReplace, (unsigned char *) list, count); + + reply.xselection.property = e->property; + } + } + + [self send_reply:&reply]; +} + + +- (void) send_string:(XSelectionRequestEvent *)e utf8:(BOOL)utf8 pasteboard:(NSPasteboard *)pb +{ + XEvent reply; + NSArray *pbtypes; + NSString *data; + const char *bytes; + NSUInteger length; + + TRACE (); + + [self init_reply:&reply request:e]; + + pbtypes = [pb types]; + + if (![pbtypes containsObject:NSStringPboardType]) + { + [self send_reply:&reply]; + return; + } + + DB ("pbtypes retainCount after containsObject: %u\n", [pbtypes retainCount]); + + data = [pb stringForType:NSStringPboardType]; + + if (nil == data) + { + [self send_reply:&reply]; + return; + } + + if (utf8) + { + bytes = [data UTF8String]; + /* + * We don't want the UTF-8 string length here. + * We want the length in bytes. + */ + length = strlen (bytes); + + if (length < 50) { + DB ("UTF-8: %s\n", bytes); + DB ("UTF-8 length: %u\n", length); + } + } + else + { + DB ("Latin-1\n"); + bytes = [data cStringUsingEncoding:NSISOLatin1StringEncoding]; + /*WARNING: bytes is not NUL-terminated. */ + length = [data lengthOfBytesUsingEncoding:NSISOLatin1StringEncoding]; + } + + DB ("e->target %s\n", XGetAtomName (xpbproxy_dpy, e->target)); + + XChangeProperty (xpbproxy_dpy, e->requestor, e->property, e->target, + 8, PropModeReplace, (unsigned char *) bytes, length); + + reply.xselection.property = e->property; + + [self send_reply:&reply]; +} + +- (void) send_compound_text:(XSelectionRequestEvent *)e pasteboard:(NSPasteboard *)pb +{ + XEvent reply; + NSArray *pbtypes; + + TRACE (); + + [self init_reply:&reply request:e]; + + pbtypes = [pb types]; + + if ([pbtypes containsObject: NSStringPboardType]) + { + NSString *data = [pb stringForType:NSStringPboardType]; + if (nil != data) + { + /* + * Cast to (void *) to avoid a const warning. + * AFAIK Xutf8TextListToTextProperty does not modify the input memory. + */ + void *utf8 = (void *)[data UTF8String]; + char *list[] = { utf8, NULL }; + XTextProperty textprop; + + textprop.value = NULL; + + if (Success == Xutf8TextListToTextProperty (xpbproxy_dpy, list, 1, + XCompoundTextStyle, + &textprop)) + { + + if (8 != textprop.format) + DB ("textprop.format is unexpectedly not 8 - it's %d instead\n", + textprop.format); + + XChangeProperty (xpbproxy_dpy, e->requestor, e->property, + atoms->compound_text, textprop.format, + PropModeReplace, textprop.value, + textprop.nitems); + + reply.xselection.property = e->property; + } + + if (textprop.value) + XFree (textprop.value); + + } + } + + [self send_reply:&reply]; +} + +/* Finding a test application that uses MULTIPLE has proven to be difficult. */ +- (void) send_multiple:(XSelectionRequestEvent *)e +{ + XEvent reply; + + TRACE (); + + [self init_reply:&reply request:e]; + + if (None != e->property) + { + + } + + [self send_reply:&reply]; +} + +/* Return nil if an error occured. */ +/* DO NOT retain the encdata for longer than the length of an event response. + * The autorelease pool will reuse/free it. + */ +- (NSData *) encode_image_data:(NSData *)data type:(NSBitmapImageFileType)enctype +{ + NSBitmapImageRep *bmimage = nil; + NSData *encdata = nil; + NSDictionary *dict = nil; + + bmimage = [[NSBitmapImageRep alloc] initWithData:data]; + + if (nil == bmimage) + return nil; + + dict = [[NSDictionary alloc] init]; + encdata = [bmimage representationUsingType:enctype properties:dict]; + + if (nil == encdata) + { + [dict autorelease]; + [bmimage autorelease]; + return nil; + } + + [dict autorelease]; + [bmimage autorelease]; + + return encdata; +} + +/* Return YES when an error has occured when trying to send the PICT. */ +/* The caller should send a default reponse with a property of None when an error occurs. */ +- (BOOL) send_image_pict_reply:(XSelectionRequestEvent *)e + pasteboard:(NSPasteboard *)pb + type:(NSBitmapImageFileType)imagetype +{ + XEvent reply; + NSImage *img = nil; + NSData *data = nil, *encdata = nil; + NSUInteger length; + const void *bytes = NULL; + + img = [[NSImage alloc] initWithPasteboard:pb]; + + if (nil == img) + { + return YES; + } + + data = [img TIFFRepresentation]; + + if (nil == data) + { + [img autorelease]; + fprintf(stderr, "unable to convert PICT to TIFF!\n"); + return YES; + } + + encdata = [self encode_image_data:data type:imagetype]; + if(nil == encdata) + { + [img autorelease]; + return YES; + } + + [self init_reply:&reply request:e]; + + length = [encdata length]; + bytes = [encdata bytes]; + + XChangeProperty (xpbproxy_dpy, e->requestor, e->property, e->target, + 8, PropModeReplace, bytes, length); + reply.xselection.property = e->property; + + [self send_reply:&reply]; + + [img autorelease]; + + return NO; /*no error*/ +} + +/* Return YES if an error occured. */ +/* The caller should send a reply with a property of None when an error occurs. */ +- (BOOL) send_image_tiff_reply:(XSelectionRequestEvent *)e + pasteboard:(NSPasteboard *)pb + type:(NSBitmapImageFileType)imagetype +{ + XEvent reply; + NSData *data = nil; + NSData *encdata = nil; + NSUInteger length; + const void *bytes = NULL; + + data = [pb dataForType:NSTIFFPboardType]; + + if (nil == data) + return YES; + + encdata = [self encode_image_data:data type:imagetype]; + + if(nil == encdata) + return YES; + + [self init_reply:&reply request:e]; + + length = [encdata length]; + bytes = [encdata bytes]; + + XChangeProperty (xpbproxy_dpy, e->requestor, e->property, e->target, + 8, PropModeReplace, bytes, length); + reply.xselection.property = e->property; + + [self send_reply:&reply]; + + return NO; /*no error*/ +} + +- (void) send_image:(XSelectionRequestEvent *)e pasteboard:(NSPasteboard *)pb +{ + NSArray *pbtypes = nil; + NSBitmapImageFileType imagetype = NSPNGFileType; + + TRACE (); + + if (e->target == atoms->image_png) + imagetype = NSPNGFileType; + else if (e->target == atoms->image_jpeg) + imagetype = NSJPEGFileType; + else + { + fprintf(stderr, "internal failure in xpbproxy! imagetype being sent isn't PNG or JPEG.\n"); + } + + pbtypes = [pb types]; + + if (pbtypes) + { + if ([pbtypes containsObject:NSTIFFPboardType]) + { + if (NO == [self send_image_tiff_reply:e pasteboard:pb type:imagetype]) + return; + } + else if ([pbtypes containsObject:NSPICTPboardType]) + { + if (NO == [self send_image_pict_reply:e pasteboard:pb type:imagetype]) + return; + + /* Fall through intentionally to the send_none: */ + } + } + + [self send_none:e]; +} + +- (void)send_none:(XSelectionRequestEvent *)e +{ + XEvent reply; + + TRACE (); + + [self init_reply:&reply request:e]; + [self send_reply:&reply]; +} + + +/* Another client requested the data or targets of data available from the clipboard. */ +- (void)request_event:(XSelectionRequestEvent *)e +{ + NSPasteboard *pb; + + TRACE (); + + /* TODO We should also keep track of the time of the selection, and + * according to the ICCCM "refuse the request" if the event timestamp + * is before we owned it. + * What should we base the time on? How can we get the current time just + * before an XSetSelectionOwner? Is it the server's time, or the clients? + * According to the XSelectionRequestEvent manual page, the Time value + * may be set to CurrentTime or a time, so that makes it a bit different. + * Perhaps we should just punt and ignore races. + */ + + /*TODO we need a COMPOUND_TEXT test app*/ + /*TODO we need a MULTIPLE test app*/ + + pb = [NSPasteboard generalPasteboard]; + if (nil == pb) + { + [self send_none:e]; + return; + } + + + if (None != e->target) + DB ("e->target %s\n", XGetAtomName (xpbproxy_dpy, e->target)); + + if (e->target == atoms->targets) + { + /* The paste requestor wants to know what TARGETS we support. */ + [self send_targets:e pasteboard:pb]; + } + else if (e->target == atoms->multiple) + { + /* + * This isn't finished, and may never be, unless I can find + * a good test app. + */ + [self send_multiple:e]; + } + else if (e->target == atoms->utf8_string) + { + [self send_string:e utf8:YES pasteboard:pb]; + } + else if (e->target == atoms->string) + { + [self send_string:e utf8:NO pasteboard:pb]; + } + else if (e->target == atoms->compound_text) + { + [self send_compound_text:e pasteboard:pb]; + } + else if (e->target == atoms->multiple) + { + [self send_multiple:e]; + } + else if (e->target == atoms->image_png || e->target == atoms->image_jpeg) + { + [self send_image:e pasteboard:pb]; + } + else + { + [self send_none:e]; + } +} + +/* This handles the events resulting from an XConvertSelection request. */ +- (void) notify_event:(XSelectionEvent *)e +{ + Atom type; + struct propdata pdata; + + TRACE (); + + [self release_pending]; + + if (None == e->property) { + DB ("e->property is None.\n"); + [self copy_completed:e->selection]; + /* Nothing is selected. */ + return; + } + +#if 0 + printf ("e->selection %s\n", XGetAtomName (xpbproxy_dpy, e->selection)); + printf ("e->property %s\n", XGetAtomName (xpbproxy_dpy, e->property)); +#endif + + if ([self is_incr_type:e]) + { + /* + * This is an INCR-style transfer, which means that we + * will get the data after a series of PropertyNotify events. + */ + DB ("is INCR\n"); + + if (get_property (e->requestor, e->property, &pdata, /*Delete*/ True, &type)) + { + /* + * An error occured, so we should invoke the copy_completed:, but + * not handle_selection:type:propdata: + */ + [self copy_completed:e->selection]; + return; + } + + free_propdata (&pdata); + + pending.requestor = e->requestor; + pending.selection = e->selection; + + DB ("set pending.requestor to 0x%lx\n", pending.requestor); + } + else + { + if (get_property (e->requestor, e->property, &pdata, /*Delete*/ True, &type)) + { + [self copy_completed:e->selection]; + return; + } + + /* We have the complete selection data.*/ + [self handle_selection:e->selection type:type propdata:&pdata]; + + DB ("handled selection with the first notify_event\n"); + } +} + +/* This is used for INCR transfers. See the ICCCM for the details. */ +/* This is used to retrieve PRIMARY and CLIPBOARD selections. */ +- (void) property_event:(XPropertyEvent *)e +{ + struct propdata pdata; + Atom type; + + TRACE (); + + if (None != e->atom) + { +#ifdef DEBUG + char *name = XGetAtomName (xpbproxy_dpy, e->atom); + + if (name) + { + DB ("e->atom %s\n", name); + XFree(name); + } +#endif + } + + if (None != pending.requestor && PropertyNewValue == e->state) + { + DB ("pending.requestor 0x%lx\n", pending.requestor); + + if (get_property (e->window, e->atom, &pdata, /*Delete*/ True, &type)) + { + [self copy_completed:pending.selection]; + [self release_pending]; + return; + } + + if (0 == pdata.length) + { + /* + * We completed the transfer. + * handle_selection will call copy_completed: for us. + */ + [self handle_selection:pending.selection type:type propdata:&pending.propdata]; + free_propdata(&pdata); + pending.propdata = null_propdata; + pending.requestor = None; + pending.selection = None; + } + else + { + [self append_to_pending:&pdata requestor:e->window]; + free_propdata (&pdata); + } + } +} + +- (void) xfixes_selection_notify:(XFixesSelectionNotifyEvent *)e { + if(!pbproxy_prefs.active) + return; + + switch(e->subtype) { + case XFixesSetSelectionOwnerNotify: + if(e->selection == atoms->primary && pbproxy_prefs.primary_on_grab) + [self x_copy:e->timestamp]; + break; + + case XFixesSelectionWindowDestroyNotify: + case XFixesSelectionClientCloseNotify: + default: + fprintf(stderr, "Unhandled XFixesSelectionNotifyEvent: subtype=%d\n", e->subtype); + break; + } +} + +- (void) handle_targets: (Atom)selection propdata:(struct propdata *)pdata +{ + /* Find a type we can handle and prefer from the list of ATOMs. */ + Atom preferred; + char *name; + + TRACE (); + + preferred = [self find_preferred:pdata]; + + if (None == preferred) + { + /* + * This isn't required by the ICCCM, but some apps apparently + * don't respond to TARGETS properly. + */ + preferred = atoms->string; + } + + (void)name; /* Avoid a warning with non-debug compiles. */ +#ifdef DEBUG + name = XGetAtomName (xpbproxy_dpy, preferred); + + if (name) + { + DB ("requesting %s\n", name); + } +#endif + request_atom = preferred; + XConvertSelection (xpbproxy_dpy, selection, preferred, selection, + _selection_window, CurrentTime); +} + +/* This handles the image type of selection (typically in CLIPBOARD). */ +/* We convert to a TIFF, so that other applications can paste more easily. */ +- (void) handle_image: (struct propdata *)pdata pasteboard:(NSPasteboard *)pb +{ + NSArray *pbtypes; + NSUInteger length; + NSData *data, *tiff; + NSBitmapImageRep *bmimage; + + TRACE (); + + length = pdata->length; + data = [[NSData alloc] initWithBytes:pdata->data length:length]; + + if (nil == data) + { + DB ("unable to create NSData object!\n"); + return; + } + + DB ("data retainCount before NSBitmapImageRep initWithData: %u\n", + [data retainCount]); + + bmimage = [[NSBitmapImageRep alloc] initWithData:data]; + + if (nil == bmimage) + { + [data autorelease]; + DB ("unable to create NSBitmapImageRep!\n"); + return; + } + + DB ("data retainCount after NSBitmapImageRep initWithData: %u\n", + [data retainCount]); + + @try + { + tiff = [bmimage TIFFRepresentation]; + } + + @catch (NSException *e) + { + DB ("NSTIFFException!\n"); + [data autorelease]; + [bmimage autorelease]; + return; + } + + DB ("bmimage retainCount after TIFFRepresentation %u\n", [bmimage retainCount]); + + pbtypes = [NSArray arrayWithObjects:NSTIFFPboardType, nil]; + + if (nil == pbtypes) + { + [data autorelease]; + [bmimage autorelease]; + return; + } + + [pb declareTypes:pbtypes owner:nil]; + if (YES != [pb setData:tiff forType:NSTIFFPboardType]) + { + DB ("writing pasteboard data failed!\n"); + } + + [data autorelease]; + + DB ("bmimage retainCount before release %u\n", [bmimage retainCount]); + [bmimage autorelease]; +} + +/* This handles the UTF8_STRING type of selection. */ +- (void) handle_utf8_string:(struct propdata *)pdata pasteboard:(NSPasteboard *)pb +{ + NSString *string; + NSArray *pbtypes; + + TRACE (); + + string = [[NSString alloc] initWithBytes:pdata->data length:pdata->length encoding:NSUTF8StringEncoding]; + + if (nil == string) + return; + + pbtypes = [NSArray arrayWithObjects:NSStringPboardType, nil]; + + if (nil == pbtypes) + { + [string autorelease]; + return; + } + + [pb declareTypes:pbtypes owner:nil]; + + if (YES != [pb setString:string forType:NSStringPboardType]) { + fprintf(stderr, "pasteboard setString:forType: failed!\n"); + } + [string autorelease]; + DB ("done handling utf8 string\n"); +} + +/* This handles the STRING type, which should be in Latin-1. */ +- (void) handle_string: (struct propdata *)pdata pasteboard:(NSPasteboard *)pb +{ + NSString *string; + NSArray *pbtypes; + + TRACE (); + + string = [[NSString alloc] initWithBytes:pdata->data length:pdata->length encoding:NSISOLatin1StringEncoding]; + + if (nil == string) + return; + + pbtypes = [NSArray arrayWithObjects:NSStringPboardType, nil]; + + if (nil == pbtypes) + { + [string autorelease]; + return; + } + + [pb declareTypes:pbtypes owner:nil]; + if (YES != [pb setString:string forType:NSStringPboardType]) { + fprintf(stderr, "pasteboard setString:forType failed in handle_string!\n"); + } + [string autorelease]; +} + +/* This is called when the selection is completely retrieved from another client. */ +/* Warning: this frees the propdata. */ +- (void) handle_selection:(Atom)selection type:(Atom)type propdata:(struct propdata *)pdata +{ + NSPasteboard *pb; + + TRACE (); + + pb = [NSPasteboard generalPasteboard]; + + if (nil == pb) + { + [self copy_completed:selection]; + free_propdata (pdata); + return; + } + + /* + * Some apps it seems set the type to TARGETS instead of ATOM, such as Eterm. + * These aren't ICCCM compliant apps, but we need these to work... + */ + if (request_atom == atoms->targets + && (type == atoms->atom || type == atoms->targets)) + { + [self handle_targets:selection propdata:pdata]; + free_propdata(pdata); + return; + } + else if (type == atoms->image_png) + { + [self handle_image:pdata pasteboard:pb]; + } + else if (type == atoms->image_jpeg) + { + [self handle_image:pdata pasteboard:pb]; + } + else if (type == atoms->utf8_string) + { + [self handle_utf8_string:pdata pasteboard:pb]; + } + else if (type == atoms->string) + { + [self handle_string:pdata pasteboard:pb]; + } + + free_propdata(pdata); + + [self copy_completed:selection]; +} + + +- (void) copy_completed:(Atom)selection +{ + TRACE (); + char *name; + + (void)name; /* Avoid warning with non-debug compiles. */ +#ifdef DEBUG + name = XGetAtomName (xpbproxy_dpy, selection); + if (name) + { + DB ("copy_completed: %s\n", name); + XFree (name); + } +#endif + + if (selection == atoms->primary && pending_copy > 0) + { + --pending_copy; + if (pending_copy > 0) + { + /* Copy PRIMARY again. */ + [self x_copy_request_targets]; + return; + } + } + else if (selection == atoms->clipboard && pending_clipboard > 0) + { + --pending_clipboard; + if (pending_clipboard > 0) + { + /* Copy CLIPBOARD. */ + [self claim_clipboard]; + return; + } + else + { + /* We got the final data. Now set pbproxy as the owner. */ + [self own_clipboard]; + return; + } + } + + /* + * We had 1 or more primary in progress, and the clipboard arrived + * while we were busy. + */ + if (pending_clipboard > 0) + { + [self claim_clipboard]; + } +} + +- (void) reload_preferences +{ + /* + * It's uncertain how we could handle the synchronization failing, so cast to void. + * The prefs_get_bool should fall back to defaults if the org.x.X11 plist doesn't exist or is invalid. + */ + (void)CFPreferencesAppSynchronize(app_prefs_domain_cfstr); +#ifdef STANDALONE_XPBPROXY + if(xpbproxy_is_standalone) + pbproxy_prefs.active = YES; + else +#endif + pbproxy_prefs.active = prefs_get_bool(CFSTR("sync_pasteboard"), pbproxy_prefs.active); + pbproxy_prefs.primary_on_grab = prefs_get_bool(CFSTR("sync_primary_on_select"), pbproxy_prefs.primary_on_grab); + pbproxy_prefs.clipboard_to_pasteboard = prefs_get_bool(CFSTR("sync_clipboard_to_pasteboard"), pbproxy_prefs.clipboard_to_pasteboard); + pbproxy_prefs.pasteboard_to_primary = prefs_get_bool(CFSTR("sync_pasteboard_to_primary"), pbproxy_prefs.pasteboard_to_primary); + pbproxy_prefs.pasteboard_to_clipboard = prefs_get_bool(CFSTR("sync_pasteboard_to_clipboard"), pbproxy_prefs.pasteboard_to_clipboard); + + /* This is used for debugging. */ + //dump_prefs(stdout); + + if(pbproxy_prefs.active && pbproxy_prefs.primary_on_grab && !xpbproxy_have_xfixes) { + fprintf(stderr, "Disabling sync_primary_on_select functionality due to missing XFixes extension.\n"); + pbproxy_prefs.primary_on_grab = NO; + } + + /* Claim or release the CLIPBOARD_MANAGER atom */ + if(![self set_clipboard_manager_status:(pbproxy_prefs.active && pbproxy_prefs.clipboard_to_pasteboard)]) + pbproxy_prefs.clipboard_to_pasteboard = NO; + + if(pbproxy_prefs.active && pbproxy_prefs.clipboard_to_pasteboard) + [self claim_clipboard]; +} + +- (BOOL) is_active +{ + return pbproxy_prefs.active; +} + +/* NSPasteboard-required methods */ + +- (void) paste:(id)sender +{ + TRACE (); +} + +- (void) pasteboard:(NSPasteboard *)pb provideDataForType:(NSString *)type +{ + TRACE (); +} + +- (void) pasteboardChangedOwner:(NSPasteboard *)pb +{ + TRACE (); + + /* Right now we don't care with this. */ +} + +/* Allocation */ + +- init +{ + unsigned long pixel; + + self = [super init]; + if (self == nil) + return nil; + + atoms->primary = XInternAtom (xpbproxy_dpy, "PRIMARY", False); + atoms->clipboard = XInternAtom (xpbproxy_dpy, "CLIPBOARD", False); + atoms->text = XInternAtom (xpbproxy_dpy, "TEXT", False); + atoms->utf8_string = XInternAtom (xpbproxy_dpy, "UTF8_STRING", False); + atoms->string = XInternAtom (xpbproxy_dpy, "STRING", False); + atoms->targets = XInternAtom (xpbproxy_dpy, "TARGETS", False); + atoms->multiple = XInternAtom (xpbproxy_dpy, "MULTIPLE", False); + atoms->cstring = XInternAtom (xpbproxy_dpy, "CSTRING", False); + atoms->image_png = XInternAtom (xpbproxy_dpy, "image/png", False); + atoms->image_jpeg = XInternAtom (xpbproxy_dpy, "image/jpeg", False); + atoms->incr = XInternAtom (xpbproxy_dpy, "INCR", False); + atoms->atom = XInternAtom (xpbproxy_dpy, "ATOM", False); + atoms->clipboard_manager = XInternAtom (xpbproxy_dpy, "CLIPBOARD_MANAGER", False); + atoms->compound_text = XInternAtom (xpbproxy_dpy, "COMPOUND_TEXT", False); + atoms->atom_pair = XInternAtom (xpbproxy_dpy, "ATOM_PAIR", False); + + pixel = BlackPixel (xpbproxy_dpy, DefaultScreen (xpbproxy_dpy)); + _selection_window = XCreateSimpleWindow (xpbproxy_dpy, DefaultRootWindow (xpbproxy_dpy), + 0, 0, 1, 1, 0, pixel, pixel); + + /* This is used to get PropertyNotify events when doing INCR transfers. */ + XSelectInput (xpbproxy_dpy, _selection_window, PropertyChangeMask); + + request_atom = None; + + init_propdata (&pending.propdata); + pending.requestor = None; + pending.selection = None; + + pending_copy = 0; + pending_clipboard = 0; + + if(xpbproxy_have_xfixes) + XFixesSelectSelectionInput(xpbproxy_dpy, _selection_window, atoms->primary, + XFixesSetSelectionOwnerNotifyMask); + + [self reload_preferences]; + + return self; +} + +- (void) dealloc +{ + if (None != _selection_window) + { + XDestroyWindow (xpbproxy_dpy, _selection_window); + _selection_window = None; + } + + free_propdata (&pending.propdata); + + [super dealloc]; +} + +@end diff --git a/xorg-server/hw/xquartz/pseudoramiX.c b/xorg-server/hw/xquartz/pseudoramiX.c index 49d5eb6d4..f4ceff32b 100644 --- a/xorg-server/hw/xquartz/pseudoramiX.c +++ b/xorg-server/hw/xquartz/pseudoramiX.c @@ -37,6 +37,7 @@ Equipment Corporation. #include #endif +#include "darwin.h" #include "pseudoramiX.h" #include "extnsionst.h" #include "dixstruct.h" @@ -45,7 +46,6 @@ Equipment Corporation. #include "globals.h" Bool noPseudoramiXExtension = FALSE; -extern int noPanoramiXExtension; extern int ProcPanoramiXQueryVersion (ClientPtr client); @@ -99,6 +99,8 @@ PseudoramiXAddScreen(int x, int y, int w, int h) sizeof(PseudoramiXScreenRec)); } + DEBUG_LOG("x: %d, y: %d, w: %d, h: %d\n", x, y, w, h); + s = &pseudoramiXScreens[pseudoramiXNumScreens++]; s->x = x; s->y = y; @@ -116,6 +118,8 @@ void PseudoramiXExtensionInit(int argc, char *argv[]) if (noPseudoramiXExtension) return; + TRACE(); + /* Even with only one screen we need to enable PseudoramiX to allow dynamic screen configuration changes. */ #if 0 @@ -126,9 +130,6 @@ void PseudoramiXExtensionInit(int argc, char *argv[]) } #endif - // The server must not run the PanoramiX operations. - noPanoramiXExtension = TRUE; - if (pseudoramiXGeneration != serverGeneration) { extEntry = AddExtension(PANORAMIX_PROTOCOL_NAME, 0, 0, ProcPseudoramiXDispatch, @@ -153,12 +154,16 @@ void PseudoramiXExtensionInit(int argc, char *argv[]) void PseudoramiXResetScreens(void) { + TRACE(); + pseudoramiXNumScreens = 0; } static void PseudoramiXResetProc(ExtensionEntry *extEntry) { + TRACE(); + PseudoramiXResetScreens(); } @@ -166,6 +171,8 @@ static void PseudoramiXResetProc(ExtensionEntry *extEntry) // was PanoramiX static int ProcPseudoramiXQueryVersion(ClientPtr client) { + TRACE(); + return ProcPanoramiXQueryVersion(client); } @@ -178,6 +185,8 @@ static int ProcPseudoramiXGetState(ClientPtr client) xPanoramiXGetStateReply rep; register int n, rc; + TRACE(); + REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) @@ -205,6 +214,8 @@ static int ProcPseudoramiXGetScreenCount(ClientPtr client) xPanoramiXGetScreenCountReply rep; register int n, rc; + TRACE(); + REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) @@ -232,6 +243,8 @@ static int ProcPseudoramiXGetScreenSize(ClientPtr client) xPanoramiXGetScreenSizeReply rep; register int n, rc; + TRACE(); + REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) @@ -262,6 +275,8 @@ static int ProcPseudoramiXIsActive(ClientPtr client) /* REQUEST(xXineramaIsActiveReq); */ xXineramaIsActiveReply rep; + TRACE(); + REQUEST_SIZE_MATCH(xXineramaIsActiveReq); rep.type = X_Reply; @@ -285,6 +300,8 @@ static int ProcPseudoramiXQueryScreens(ClientPtr client) /* REQUEST(xXineramaQueryScreensReq); */ xXineramaQueryScreensReply rep; + DEBUG_LOG("noPseudoramiXExtension=%d, pseudoramiXNumScreens=%d\n", noPseudoramiXExtension, pseudoramiXNumScreens); + REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); rep.type = X_Reply; @@ -327,6 +344,7 @@ static int ProcPseudoramiXQueryScreens(ClientPtr client) // was PanoramiX static int ProcPseudoramiXDispatch (ClientPtr client) { REQUEST(xReq); + TRACE(); switch (stuff->data) { case X_PanoramiXQueryVersion: @@ -353,6 +371,8 @@ SProcPseudoramiXQueryVersion (ClientPtr client) REQUEST(xPanoramiXQueryVersionReq); register int n; + TRACE(); + swaps(&stuff->length,n); REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq); return ProcPseudoramiXQueryVersion(client); @@ -364,6 +384,8 @@ SProcPseudoramiXGetState(ClientPtr client) REQUEST(xPanoramiXGetStateReq); register int n; + TRACE(); + swaps (&stuff->length, n); REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); return ProcPseudoramiXGetState(client); @@ -375,6 +397,8 @@ SProcPseudoramiXGetScreenCount(ClientPtr client) REQUEST(xPanoramiXGetScreenCountReq); register int n; + TRACE(); + swaps (&stuff->length, n); REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); return ProcPseudoramiXGetScreenCount(client); @@ -386,6 +410,8 @@ SProcPseudoramiXGetScreenSize(ClientPtr client) REQUEST(xPanoramiXGetScreenSizeReq); register int n; + TRACE(); + swaps (&stuff->length, n); REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); return ProcPseudoramiXGetScreenSize(client); @@ -398,6 +424,8 @@ SProcPseudoramiXIsActive(ClientPtr client) REQUEST(xXineramaIsActiveReq); register int n; + TRACE(); + swaps (&stuff->length, n); REQUEST_SIZE_MATCH(xXineramaIsActiveReq); return ProcPseudoramiXIsActive(client); @@ -410,6 +438,8 @@ SProcPseudoramiXQueryScreens(ClientPtr client) REQUEST(xXineramaQueryScreensReq); register int n; + TRACE(); + swaps (&stuff->length, n); REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); return ProcPseudoramiXQueryScreens(client); @@ -419,6 +449,9 @@ SProcPseudoramiXQueryScreens(ClientPtr client) static int SProcPseudoramiXDispatch (ClientPtr client) { REQUEST(xReq); + + TRACE(); + switch (stuff->data) { case X_PanoramiXQueryVersion: diff --git a/xorg-server/hw/xquartz/quartz.c b/xorg-server/hw/xquartz/quartz.c index 6f42c538f..1f0b0048b 100644 --- a/xorg-server/hw/xquartz/quartz.c +++ b/xorg-server/hw/xquartz/quartz.c @@ -28,15 +28,17 @@ * use or other dealings in this Software without prior written authorization. */ +#include "sanitizedCarbon.h" + #ifdef HAVE_DIX_CONFIG_H #include #endif #include "quartzCommon.h" +#include "inputstr.h" #include "quartz.h" #include "darwin.h" #include "darwinEvents.h" -#include "quartzAudio.h" #include "pseudoramiX.h" #define _APPLEWM_SERVER_ #include "applewmExt.h" @@ -51,7 +53,7 @@ #include "windowstr.h" #include "colormapst.h" #include "globals.h" -#include "rootlessWindow.h" +#include "mi.h" // System headers #include @@ -59,20 +61,24 @@ #include #include +#include +#include + #define FAKE_RANDR 1 // Shared global variables for Quartz modes int quartzEventWriteFD = -1; -int quartzRootless = -1; int quartzUseSysBeep = 0; int quartzUseAGL = 1; int quartzEnableKeyEquivalents = 1; -int quartzServerVisible = TRUE; +int quartzServerVisible = FALSE; int quartzServerQuitting = FALSE; -DevPrivateKey quartzScreenKey = &quartzScreenKey; +static int quartzScreenKeyIndex; +DevPrivateKey quartzScreenKey = &quartzScreenKeyIndex; int aquaMenuBarHeight = 0; QuartzModeProcsPtr quartzProcs = NULL; const char *quartzOpenGLBundle = NULL; +int quartzFullscreenDisableHotkeys = TRUE; #if defined(RANDR) && !defined(FAKE_RANDR) Bool QuartzRandRGetInfo (ScreenPtr pScreen, Rotation *rotations) { @@ -153,10 +159,6 @@ void QuartzInitOutput( int argc, char **argv ) { - if (serverGeneration == 0) { - QuartzAudioInit(); - } - if (!RegisterBlockAndWakeupHandlers(QuartzBlockHandler, QuartzWakeupHandler, NULL)) @@ -186,9 +188,8 @@ void QuartzInitInput( #ifdef FAKE_RANDR -extern char *ConnectionInfo; -static int padlength[4] = {0, 3, 2, 1}; +static const int padlength[4] = {0, 3, 2, 1}; static void RREditConnectionInfo (ScreenPtr pScreen) @@ -230,33 +231,27 @@ RREditConnectionInfo (ScreenPtr pScreen) } #endif -/* - * QuartzUpdateScreens - * Adjust for screen arrangement changes. - */ -static void QuartzUpdateScreens(void) -{ +static void QuartzUpdateScreens(void) { ScreenPtr pScreen; WindowPtr pRoot; int x, y, width, height, sx, sy; xEvent e; - - DEBUG_LOG("QuartzUpdateScreens()\n"); + if (noPseudoramiXExtension || screenInfo.numScreens != 1) { /* FIXME: if not using Xinerama, we have multiple screens, and - to do this properly may need to add or remove screens. Which - isn't possible. So don't do anything. Another reason why - we default to running with Xinerama. */ - + to do this properly may need to add or remove screens. Which + isn't possible. So don't do anything. Another reason why + we default to running with Xinerama. */ + return; } - + pScreen = screenInfo.screens[0]; - + PseudoramiXResetScreens(); quartzProcs->AddPseudoramiXScreens(&x, &y, &width, &height); - + dixScreenOrigins[pScreen->myNum].x = x; dixScreenOrigins[pScreen->myNum].y = y; pScreen->mmWidth = pScreen->mmWidth * ((double) width / pScreen->width); @@ -266,23 +261,25 @@ static void QuartzUpdateScreens(void) #ifndef FAKE_RANDR if(!QuartzRandRInit(pScreen)) - FatalError("Failed to init RandR extension.\n"); + FatalError("Failed to init RandR extension.\n"); #endif - + DarwinAdjustScreenOrigins(&screenInfo); quartzProcs->UpdateScreen(pScreen); - + sx = dixScreenOrigins[pScreen->myNum].x + darwinMainScreenX; sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY; - + /* Adjust the root window. */ pRoot = WindowTable[pScreen->myNum]; AppleWMSetScreenOrigin(pRoot); pScreen->ResizeWindow(pRoot, x - sx, y - sy, width, height, NULL); + //pScreen->PaintWindowBackground (pRoot, &pRoot->borderClip, PW_BACKGROUND); miPaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND); -// QuartzIgnoreNextWarpCursor(); DefineInitialRootWindow(pRoot); + DEBUG_LOG("Root Window: %dx%d @ (%d, %d) darwinMainScreen (%d, %d) xy (%d, %d) dixScreenOrigins (%d, %d)\n", width, height, x - sx, y - sy, darwinMainScreenX, darwinMainScreenY, x, y, dixScreenOrigins[pScreen->myNum].x, dixScreenOrigins[pScreen->myNum].y); + /* Send an event for the root reconfigure */ e.u.u.type = ConfigureNotify; e.u.configureNotify.window = pRoot->drawable.id; @@ -294,12 +291,73 @@ static void QuartzUpdateScreens(void) e.u.configureNotify.borderWidth = wBorderWidth(pRoot); e.u.configureNotify.override = pRoot->overrideRedirect; DeliverEvents(pRoot, &e, 1, NullWindow); - + #ifdef FAKE_RANDR RREditConnectionInfo(pScreen); -#endif +#endif +} + +/* + * QuartzDisplayChangeHandler + * Adjust for screen arrangement changes. + */ +void QuartzDisplayChangedHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev, int nevents) { + QuartzUpdateScreens(); } +void QuartzSetFullscreen(Bool state) { + + DEBUG_LOG("QuartzSetFullscreen: state=%d\n", state); + + if(quartzHasRoot == state) + return; + + quartzHasRoot = state; + + xp_disable_update (); + + if (!quartzHasRoot && !quartzEnableRootless) + RootlessHideAllWindows(); + + RootlessUpdateRooted(quartzHasRoot); + + if (quartzHasRoot && !quartzEnableRootless) + RootlessShowAllWindows (); + + if (quartzHasRoot || quartzEnableRootless) { + RootlessRepositionWindows(screenInfo.screens[0]); + } + + /* Somehow the menubar manages to interfere with our event stream + * in fullscreen mode, even though it's not visible. + */ + X11ApplicationShowHideMenubar(!quartzHasRoot); + + xp_reenable_update (); + + if (quartzFullscreenDisableHotkeys) + xp_disable_hot_keys(quartzHasRoot); +} + +void QuartzSetRootless(Bool state) { + if(quartzEnableRootless == state) + return; + + quartzEnableRootless = state; + + xp_disable_update(); + + /* When in rootless, the menubar is not part of the screen, so we need to update our screens on toggle */ + QuartzUpdateScreens(); + + if (!quartzEnableRootless && !quartzHasRoot) { + RootlessHideAllWindows(); + } else if (quartzEnableRootless && !quartzHasRoot) { + RootlessShowAllWindows(); + } + + xp_reenable_update(); +} /* * QuartzShow @@ -307,20 +365,24 @@ static void QuartzUpdateScreens(void) * Calls mode specific screen resume to restore the X clip regions * (if needed) and the X server cursor state. */ -static void QuartzShow( +void QuartzShow( int x, // cursor location int y ) { int i; - if (!quartzServerVisible) { - quartzServerVisible = TRUE; - for (i = 0; i < screenInfo.numScreens; i++) { - if (screenInfo.screens[i]) { - quartzProcs->ResumeScreen(screenInfo.screens[i], x, y); - } + if (quartzServerVisible) + return; + + quartzServerVisible = TRUE; + for (i = 0; i < screenInfo.numScreens; i++) { + if (screenInfo.screens[i]) { + quartzProcs->ResumeScreen(screenInfo.screens[i], x, y); } } + + if (!quartzEnableRootless) + QuartzSetFullscreen(TRUE); } @@ -330,7 +392,7 @@ static void QuartzShow( * hidden. Calls mode specific screen suspend to set X clip regions to * prevent drawing (if needed) and restore the Aqua cursor. */ -static void QuartzHide(void) +void QuartzHide(void) { int i; @@ -341,6 +403,8 @@ static void QuartzHide(void) } } } + + QuartzSetFullscreen(FALSE); quartzServerVisible = FALSE; } @@ -349,7 +413,7 @@ static void QuartzHide(void) * QuartzSetRootClip * Enable or disable rendering to the X screen. */ -static void QuartzSetRootClip( +void QuartzSetRootClip( BOOL enable) { int i; @@ -364,137 +428,11 @@ static void QuartzSetRootClip( } } - -/* - * QuartzMessageServerThread - * Send the X server thread a message by placing it on the event queue. - */ -void -QuartzMessageServerThread( - int type, - int argc, ...) -{ - xEvent xe; - INT32 *argv; - int i, max_args; - va_list args; - - memset(&xe, 0, sizeof(xe)); - xe.u.u.type = type; - xe.u.clientMessage.u.l.type = type; - - argv = &xe.u.clientMessage.u.l.longs0; - max_args = 4; - - if (argc > 0 && argc <= max_args) { - va_start (args, argc); - for (i = 0; i < argc; i++) - argv[i] = (int) va_arg (args, int); - va_end (args); - } - - DarwinEQEnqueue(&xe); -} - - -/* - * QuartzProcessEvent - * Process Quartz specific events. +/* + * QuartzSpaceChanged + * Unmap offscreen windows, map onscreen windows */ -void QuartzProcessEvent(xEvent *xe) { - switch (xe->u.u.type) { - case kXDarwinControllerNotify: - DEBUG_LOG("kXDarwinControllerNotify\n"); - AppleWMSendEvent(AppleWMControllerNotify, - AppleWMControllerNotifyMask, - xe->u.clientMessage.u.l.longs0, - xe->u.clientMessage.u.l.longs1); - break; - - case kXDarwinPasteboardNotify: - DEBUG_LOG("kXDarwinPasteboardNotify\n"); - AppleWMSendEvent(AppleWMPasteboardNotify, - AppleWMPasteboardNotifyMask, - xe->u.clientMessage.u.l.longs0, - xe->u.clientMessage.u.l.longs1); - break; - - case kXDarwinActivate: - DEBUG_LOG("kXDarwinActivate\n"); - QuartzShow(xe->u.keyButtonPointer.rootX, - xe->u.keyButtonPointer.rootY); - AppleWMSendEvent(AppleWMActivationNotify, - AppleWMActivationNotifyMask, - AppleWMIsActive, 0); - break; - - case kXDarwinDeactivate: - DEBUG_LOG("kXDarwinDeactivate\n"); - AppleWMSendEvent(AppleWMActivationNotify, - AppleWMActivationNotifyMask, - AppleWMIsInactive, 0); - QuartzHide(); - break; - - case kXDarwinDisplayChanged: - DEBUG_LOG("kXDarwinDisplayChanged\n"); - QuartzUpdateScreens(); - break; - - case kXDarwinWindowState: - DEBUG_LOG("kXDarwinWindowState\n"); - RootlessNativeWindowStateChanged(xe->u.clientMessage.u.l.longs0, - xe->u.clientMessage.u.l.longs1); - break; - - case kXDarwinWindowMoved: - DEBUG_LOG("kXDarwinWindowMoved\n"); - RootlessNativeWindowMoved ((WindowPtr)xe->u.clientMessage.u.l.longs0); - break; - - case kXDarwinToggleFullscreen: - DEBUG_LOG("kXDarwinToggleFullscreen\n"); -#ifdef DARWIN_DDX_MISSING - if (quartzEnableRootless) QuartzSetFullscreen(!quartzHasRoot); - else if (quartzHasRoot) QuartzHide(); - else QuartzShow(); -#else - // ErrorF("kXDarwinToggleFullscreen not implemented\n"); -#endif - break; - - case kXDarwinSetRootless: - DEBUG_LOG("kXDarwinSetRootless\n"); -#ifdef DARWIN_DDX_MISSING - QuartzSetRootless(xe->u.clientMessage.u.l.longs0); - if (!quartzEnableRootless && !quartzHasRoot) QuartzHide(); -#else - // ErrorF("kXDarwinSetRootless not implemented\n"); -#endif - break; - - case kXDarwinSetRootClip: - QuartzSetRootClip((BOOL)xe->u.clientMessage.u.l.longs0); - break; - - case kXDarwinQuit: - GiveUp(0); - break; - - case kXDarwinReadPasteboard: - QuartzReadPasteboard(); - break; - - case kXDarwinWritePasteboard: - QuartzWritePasteboard(); - break; - - case kXDarwinBringAllToFront: - DEBUG_LOG("kXDarwinBringAllToFront\n"); - RootlessOrderAllWindows(); - break; - - default: - ErrorF("Unknown application defined event type %d.\n", xe->u.u.type); - } +void QuartzSpaceChanged(uint32_t space_id) { + /* Do something special here, so we don't depend on quartz-wm for spaces to work... */ + DEBUG_LOG("Space Changed (%u) ... do something interesting...\n", space_id); } diff --git a/xorg-server/hw/xquartz/quartz.h b/xorg-server/hw/xquartz/quartz.h index fbe308a92..c5da4c510 100644 --- a/xorg-server/hw/xquartz/quartz.h +++ b/xorg-server/hw/xquartz/quartz.h @@ -54,20 +54,16 @@ typedef void (*InitInputProc)(int argc, char **argv); * Cursor functions */ typedef Bool (*InitCursorProc)(ScreenPtr pScreen); -typedef void (*CursorUpdateProc)(void); /* * Suspend and resume X11 activity */ typedef void (*SuspendScreenProc)(ScreenPtr pScreen); typedef void (*ResumeScreenProc)(ScreenPtr pScreen, int x, int y); -typedef void (*CaptureScreensProc)(void); -typedef void (*ReleaseScreensProc)(void); /* * Screen state change support */ -typedef void (*ScreenChangedProc)(void); typedef void (*AddPseudoramiXScreensProc)(int *x, int *y, int *width, int *height); typedef void (*UpdateScreenProc)(ScreenPtr pScreen); @@ -101,14 +97,10 @@ typedef struct _QuartzModeProcs { InitInputProc InitInput; InitCursorProc InitCursor; - CursorUpdateProc CursorUpdate; // Not used if NULL SuspendScreenProc SuspendScreen; ResumeScreenProc ResumeScreen; - CaptureScreensProc CaptureScreens; // Only called in fullscreen - ReleaseScreensProc ReleaseScreens; // Only called in fullscreen - ScreenChangedProc ScreenChanged; AddPseudoramiXScreensProc AddPseudoramiXScreens; UpdateScreenProc UpdateScreen; @@ -128,7 +120,16 @@ Bool QuartzAddScreen(int index, ScreenPtr pScreen); Bool QuartzSetupScreen(int index, ScreenPtr pScreen); void QuartzInitOutput(int argc,char **argv); void QuartzInitInput(int argc, char **argv); +void QuartzInitServer(int argc, char **argv, char **envp); void QuartzGiveUp(void); void QuartzProcessEvent(xEvent *xe); +void QuartzDisplayChangedHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev, int nevents); +void QuartzShow(int x, int y); // (x, y) = cursor loc +void QuartzHide(void); +void QuartzSetRootClip(BOOL enable); +void QuartzSpaceChanged(uint32_t space_id); + +void QuartzSetFullscreen(Bool state); +void QuartzSetRootless(Bool state); #endif diff --git a/xorg-server/hw/xquartz/quartzAudio.c b/xorg-server/hw/xquartz/quartzAudio.c index 5dee32f54..21232665a 100644 --- a/xorg-server/hw/xquartz/quartzAudio.c +++ b/xorg-server/hw/xquartz/quartzAudio.c @@ -36,6 +36,8 @@ * use or other dealings in this Software without prior written authorization. */ +#include "sanitizedCarbon.h" + #ifdef HAVE_DIX_CONFIG_H #include #endif @@ -45,6 +47,7 @@ #include #include +#include #include "inputstr.h" #include @@ -236,7 +239,7 @@ static void QuartzCoreAudioBell( OSStatus status; status = AudioDeviceStart(quartzAudioDevice, QuartzAudioIOProc); if (status) { - ErrorF("QuartzAudioBell: AudioDeviceStart returned %ld\n", status); + ErrorF("QuartzAudioBell: AudioDeviceStart returned %ld\n", (long)status); } else { data.playing = TRUE; } @@ -297,7 +300,7 @@ void QuartzAudioInit(void) &propertySize, &outputDevice); if (status) { ErrorF("QuartzAudioInit: AudioHardwareGetProperty returned %ld\n", - status); + (long)status); return; } if (outputDevice == kAudioDeviceUnknown) { @@ -312,7 +315,7 @@ void QuartzAudioInit(void) &propertySize, &outputStreamDescription); if (status) { ErrorF("QuartzAudioInit: GetProperty(stream format) returned %ld\n", - status); + (long)status); return; } sampleRate = outputStreamDescription.mSampleRate; @@ -335,9 +338,14 @@ void QuartzAudioInit(void) // fixme assert fadeLength= 1050 + AudioDeviceIOProcID sInputIOProcID = NULL; + status = AudioDeviceCreateIOProcID( outputDevice, QuartzAudioIOProc, &data, &sInputIOProcID ); +#else status = AudioDeviceAddIOProc(outputDevice, QuartzAudioIOProc, &data); +#endif if (status) { - ErrorF("QuartzAudioInit: AddIOProc returned %ld\n", status); + ErrorF("QuartzAudioInit: AddIOProc returned %ld\n", (long)status); return; } diff --git a/xorg-server/hw/xquartz/quartzCocoa.m b/xorg-server/hw/xquartz/quartzCocoa.m index 53e3f0897..0ab94936c 100644 --- a/xorg-server/hw/xquartz/quartzCocoa.m +++ b/xorg-server/hw/xquartz/quartzCocoa.m @@ -32,24 +32,17 @@ * use or other dealings in this Software without prior written authorization. */ +#include "sanitizedCocoa.h" + #ifdef HAVE_DIX_CONFIG_H #include #endif #include "quartzCommon.h" +#include "inputstr.h" #include "quartzPasteboard.h" -#define BOOL xBOOL #include "darwin.h" -#undef BOOL - -#include - -#include "pseudoramiX.h" - -extern void FatalError(const char *, ...); -extern char *display; -extern int noPanoramiXExtension; /* * QuartzWriteCocoaPasteboard diff --git a/xorg-server/hw/xquartz/quartzCommon.h b/xorg-server/hw/xquartz/quartzCommon.h index a0d467389..1c0eeba9c 100644 --- a/xorg-server/hw/xquartz/quartzCommon.h +++ b/xorg-server/hw/xquartz/quartzCommon.h @@ -35,17 +35,6 @@ #ifndef _QUARTZCOMMON_H #define _QUARTZCOMMON_H -// QuickDraw in ApplicationServices has the following conflicts with -// the basic X server headers. Use QD_ to use the QuickDraw -// definition of any of these symbols, or the normal name for the -// X11 definition. -#define Cursor QD_Cursor -#define WindowPtr QD_WindowPtr -#define Picture QD_Picture -#include -#undef Cursor -#undef WindowPtr -#undef Picture #include #include "privates.h" @@ -66,10 +55,11 @@ typedef struct { extern int quartzEventWriteFD; // User preferences used by Quartz modes -extern int quartzRootless; extern int quartzUseSysBeep; +extern int focusOnNewWindow; extern int quartzUseAGL; extern int quartzEnableKeyEquivalents; +extern int quartzFullscreenDisableHotkeys; // Other shared data extern int quartzServerVisible; @@ -91,17 +81,4 @@ int QuartzFSUseQDCursor(int depth); void QuartzBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadmask); void QuartzWakeupHandler(pointer blockData, int result, pointer pReadmask); -// Messages that can be sent to the main thread. -enum { - kQuartzServerHidden, - kQuartzServerStarted, - kQuartzServerDied, - kQuartzCursorUpdate, - kQuartzPostEvent, - kQuartzSetWindowMenu, - kQuartzSetWindowMenuCheck, - kQuartzSetFrontProcess, - kQuartzSetCanQuit -}; - #endif /* _QUARTZCOMMON_H */ diff --git a/xorg-server/hw/xquartz/quartzCursor.c b/xorg-server/hw/xquartz/quartzCursor.c deleted file mode 100644 index f82ccd380..000000000 --- a/xorg-server/hw/xquartz/quartzCursor.c +++ /dev/null @@ -1,646 +0,0 @@ -/************************************************************** - * - * Support for using the Quartz Window Manager cursor - * - * Copyright (c) 2001-2003 Torrey T. Lyons and Greg Parker. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "quartzCommon.h" -#include "quartzCursor.h" -#include "darwin.h" - -#include - -#include "mi.h" -#include "scrnintstr.h" -#include "cursorstr.h" -#include "mipointrst.h" -#include "globals.h" - -// Size of the QuickDraw cursor -#define CURSORWIDTH 16 -#define CURSORHEIGHT 16 - -typedef struct { - int qdCursorMode; - int qdCursorVisible; - int useQDCursor; - QueryBestSizeProcPtr QueryBestSize; - miPointerSpriteFuncPtr spriteFuncs; -} QuartzCursorScreenRec, *QuartzCursorScreenPtr; - -static DevPrivateKey darwinCursorScreenKey = &darwinCursorScreenKey; -static CursorPtr quartzLatentCursor = NULL; -static QD_Cursor gQDArrow; // QuickDraw arrow cursor - -// Cursor for the main thread to set (NULL = arrow cursor). -static CCrsrHandle currentCursor = NULL; -static pthread_mutex_t cursorMutex; -static pthread_cond_t cursorCondition; - -#define CURSOR_PRIV(pScreen) ((QuartzCursorScreenPtr) \ - dixLookupPrivate(&pScreen->devPrivates, darwinCursorScreenKey)) - -#define HIDE_QD_CURSOR(pScreen, visible) \ - if (visible) { \ - int ix; \ - for (ix = 0; ix < QUARTZ_PRIV(pScreen)->displayCount; ix++) { \ - CGDisplayHideCursor(QUARTZ_PRIV(pScreen)->displayIDs[ix]); \ - } \ - visible = FALSE; \ - } ((void)0) - -#define SHOW_QD_CURSOR(pScreen, visible) \ - { \ - int ix; \ - for (ix = 0; ix < QUARTZ_PRIV(pScreen)->displayCount; ix++) { \ - CGDisplayShowCursor(QUARTZ_PRIV(pScreen)->displayIDs[ix]); \ - } \ - visible = TRUE; \ - } ((void)0) - -#define CHANGE_QD_CURSOR(cursorH) \ - if (!quartzServerQuitting) { \ - /* Acquire lock and tell the main thread to change cursor */ \ - pthread_mutex_lock(&cursorMutex); \ - currentCursor = (CCrsrHandle) (cursorH); \ - QuartzMessageMainThread(kQuartzCursorUpdate, NULL, 0); \ - \ - /* Wait for the main thread to change the cursor */ \ - pthread_cond_wait(&cursorCondition, &cursorMutex); \ - pthread_mutex_unlock(&cursorMutex); \ - } ((void)0) - - -/* - * MakeQDCursor helpers: CTAB_ENTER, interleave - */ - -// Add a color entry to a ctab -#define CTAB_ENTER(ctab, index, r, g, b) \ - ctab->ctTable[index].value = index; \ - ctab->ctTable[index].rgb.red = r; \ - ctab->ctTable[index].rgb.green = g; \ - ctab->ctTable[index].rgb.blue = b - -// Make an unsigned short by interleaving the bits of bytes c1 and c2. -// High bit of c1 is first; low bit of c2 is last. -// Interleave is a built-in INTERCAL operator. -static unsigned short -interleave( - unsigned char c1, - unsigned char c2 ) -{ - return - ((c1 & 0x80) << 8) | ((c2 & 0x80) << 7) | - ((c1 & 0x40) << 7) | ((c2 & 0x40) << 6) | - ((c1 & 0x20) << 6) | ((c2 & 0x20) << 5) | - ((c1 & 0x10) << 5) | ((c2 & 0x10) << 4) | - ((c1 & 0x08) << 4) | ((c2 & 0x08) << 3) | - ((c1 & 0x04) << 3) | ((c2 & 0x04) << 2) | - ((c1 & 0x02) << 2) | ((c2 & 0x02) << 1) | - ((c1 & 0x01) << 1) | ((c2 & 0x01) << 0) ; -} - -/* - * MakeQDCursor - * Make a QuickDraw color cursor from the given X11 cursor. - * Warning: This code is nasty. Color cursors were meant to be read - * from resources; constructing the structures programmatically is messy. - */ -/* - QuickDraw cursor representation: - Our color cursor is a 2 bit per pixel pixmap. - Each pixel's bits are (source<<1 | mask) from the original X cursor pixel. - The cursor's color table maps the colors like this: - (2-bit value | X result | colortable | Mac result) - 00 | transparent | white | transparent (white outside mask) - 01 | back color | back color | back color - 10 | undefined | black | invert background (just for fun) - 11 | fore color | fore color | fore color -*/ -static CCrsrHandle -MakeQDCursor( - CursorPtr pCursor ) -{ - CCrsrHandle result; - CCrsrPtr curs; - int i, w, h; - unsigned short rowMask; - PixMap *pix; - ColorTable *ctab; - unsigned short *image; - - result = (CCrsrHandle) NewHandleClear(sizeof(CCrsr)); - if (!result) return NULL; - HLock((Handle)result); - curs = *result; - - // Initialize CCrsr - curs->crsrType = 0x8001; // 0x8000 = b&w, 0x8001 = color - curs->crsrMap = (PixMapHandle) NewHandleClear(sizeof(PixMap)); - if (!curs->crsrMap) goto pixAllocFailed; - HLock((Handle)curs->crsrMap); - pix = *curs->crsrMap; - curs->crsrData = NULL; // raw cursor image data (set below) - curs->crsrXData = NULL; // QD's processed data - curs->crsrXValid = 0; // zero means QD must re-process cursor data - curs->crsrXHandle = NULL; // reserved - memset(curs->crsr1Data, 0, CURSORWIDTH*CURSORHEIGHT/8); // b&w data - memset(curs->crsrMask, 0, CURSORWIDTH*CURSORHEIGHT/8); // b&w & color mask - curs->crsrHotSpot.h = min(CURSORWIDTH, pCursor->bits->xhot); // hot spot - curs->crsrHotSpot.v = min(CURSORHEIGHT, pCursor->bits->yhot); // hot spot - curs->crsrXTable = 0; // reserved - curs->crsrID = GetCTSeed(); // unique ID from Color Manager - - // Set the b&w data and mask - w = min(pCursor->bits->width, CURSORWIDTH); - h = min(pCursor->bits->height, CURSORHEIGHT); - rowMask = ~((1 << (CURSORWIDTH - w)) - 1); - for (i = 0; i < h; i++) { - curs->crsr1Data[i] = rowMask & - ((pCursor->bits->source[i*4]<<8) | pCursor->bits->source[i*4+1]); - curs->crsrMask[i] = rowMask & - ((pCursor->bits->mask[i*4]<<8) | pCursor->bits->mask[i*4+1]); - } - - // Set the color data and mask - // crsrMap: defines bit depth and size and colortable only - pix->rowBytes = (CURSORWIDTH * 2 / 8) | 0x8000; // last bit on means PixMap - SetRect(&pix->bounds, 0, 0, CURSORWIDTH, CURSORHEIGHT); // see TN 1020 - pix->pixelSize = 2; - pix->cmpCount = 1; - pix->cmpSize = 2; - // pix->pmTable set below - - // crsrData is the pixel data. crsrMap's baseAddr is not used. - curs->crsrData = NewHandleClear(CURSORWIDTH*CURSORHEIGHT * 2 / 8); - if (!curs->crsrData) goto imageAllocFailed; - HLock((Handle)curs->crsrData); - image = (unsigned short *) *curs->crsrData; - // Pixel data is just 1-bit data and mask interleaved (see above) - for (i = 0; i < h; i++) { - unsigned char s, m; - s = pCursor->bits->source[i*4] & (rowMask >> 8); - m = pCursor->bits->mask[i*4] & (rowMask >> 8); - image[2*i] = interleave(s, m); - s = pCursor->bits->source[i*4+1] & (rowMask & 0x00ff); - m = pCursor->bits->mask[i*4+1] & (rowMask & 0x00ff); - image[2*i+1] = interleave(s, m); - } - - // Build the color table (entries described above) - // NewPixMap allocates a color table handle. - pix->pmTable = (CTabHandle) NewHandleClear(sizeof(ColorTable) + 3 - * sizeof(ColorSpec)); - if (!pix->pmTable) goto ctabAllocFailed; - HLock((Handle)pix->pmTable); - ctab = *pix->pmTable; - ctab->ctSeed = GetCTSeed(); - ctab->ctFlags = 0; - ctab->ctSize = 3; // color count - 1 - CTAB_ENTER(ctab, 0, 0xffff, 0xffff, 0xffff); - CTAB_ENTER(ctab, 1, pCursor->backRed, pCursor->backGreen, - pCursor->backBlue); - CTAB_ENTER(ctab, 2, 0x0000, 0x0000, 0x0000); - CTAB_ENTER(ctab, 3, pCursor->foreRed, pCursor->foreGreen, - pCursor->foreBlue); - - HUnlock((Handle)pix->pmTable); // ctab - HUnlock((Handle)curs->crsrData); // image data - HUnlock((Handle)curs->crsrMap); // pix - HUnlock((Handle)result); // cursor - - return result; - - // "What we have here is a failure to allocate" -ctabAllocFailed: - HUnlock((Handle)curs->crsrData); - DisposeHandle((Handle)curs->crsrData); -imageAllocFailed: - HUnlock((Handle)curs->crsrMap); - DisposeHandle((Handle)curs->crsrMap); -pixAllocFailed: - HUnlock((Handle)result); - DisposeHandle((Handle)result); - return NULL; -} - - -/* - * FreeQDCursor - * Destroy a QuickDraw color cursor created with MakeQDCursor(). - * The cursor must not currently be on screen. - */ -static void FreeQDCursor(CCrsrHandle cursHandle) -{ - CCrsrPtr curs; - PixMap *pix; - - HLock((Handle)cursHandle); - curs = *cursHandle; - HLock((Handle)curs->crsrMap); - pix = *curs->crsrMap; - DisposeHandle((Handle)pix->pmTable); - HUnlock((Handle)curs->crsrMap); - DisposeHandle((Handle)curs->crsrMap); - DisposeHandle((Handle)curs->crsrData); - HUnlock((Handle)cursHandle); - DisposeHandle((Handle)cursHandle); -} - - -/* -=========================================================================== - - Pointer sprite functions - -=========================================================================== -*/ - -/* - * QuartzRealizeCursor - * Convert the X cursor representation to QuickDraw format if possible. - */ -Bool -QuartzRealizeCursor( - ScreenPtr pScreen, - CursorPtr pCursor ) -{ - CCrsrHandle qdCursor; - QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - if(!pCursor || !pCursor->bits) - return FALSE; - - // if the cursor is too big we use a software cursor - if ((pCursor->bits->height > CURSORHEIGHT) || - (pCursor->bits->width > CURSORWIDTH) || !ScreenPriv->useQDCursor) - { - if (quartzRootless) { - // rootless can't use a software cursor - return TRUE; - } else { - return (*ScreenPriv->spriteFuncs->RealizeCursor) - (pScreen, pCursor); - } - } - - // make new cursor image - qdCursor = MakeQDCursor(pCursor); - if (!qdCursor) return FALSE; - - // save the result - dixSetPrivate(&pCursor->devPrivates, pScreen, qdCursor); - - return TRUE; -} - - -/* - * QuartzUnrealizeCursor - * Free the storage space associated with a realized cursor. - */ -Bool -QuartzUnrealizeCursor( - ScreenPtr pScreen, - CursorPtr pCursor ) -{ - QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - if ((pCursor->bits->height > CURSORHEIGHT) || - (pCursor->bits->width > CURSORWIDTH) || !ScreenPriv->useQDCursor) - { - if (quartzRootless) { - return TRUE; - } else { - return (*ScreenPriv->spriteFuncs->UnrealizeCursor) - (pScreen, pCursor); - } - } else { - CCrsrHandle oldCursor = dixLookupPrivate(&pCursor->devPrivates, - pScreen); - if (currentCursor != oldCursor) { - // This should only fail when quitting, in which case we just leak. - FreeQDCursor(oldCursor); - } - dixSetPrivate(&pCursor->devPrivates, pScreen, NULL); - return TRUE; - } -} - - -/* - * QuartzSetCursor - * Set the cursor sprite and position. - * Use QuickDraw cursor if possible. - */ -static void -QuartzSetCursor( - ScreenPtr pScreen, - CursorPtr pCursor, - int x, - int y) -{ - QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - quartzLatentCursor = pCursor; - - // Don't touch Mac OS cursor if X is hidden! - if (!quartzServerVisible) - return; - - if (!pCursor) { - // Remove the cursor completely. - HIDE_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible); - if (! ScreenPriv->qdCursorMode) - (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y); - } - else if ((pCursor->bits->height <= CURSORHEIGHT) && - (pCursor->bits->width <= CURSORWIDTH) && ScreenPriv->useQDCursor) - { - // Cursor is small enough to use QuickDraw directly. - if (! ScreenPriv->qdCursorMode) // remove the X cursor - (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y); - ScreenPriv->qdCursorMode = TRUE; - - CHANGE_QD_CURSOR(dixLookupPrivate(&pCursor->devPrivates, pScreen)); - SHOW_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible); - } - else if (quartzRootless) { - // Rootless can't use a software cursor, so we just use Mac OS arrow. - CHANGE_QD_CURSOR(NULL); - SHOW_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible); - } - else { - // Cursor is too big for QuickDraw. Use X software cursor. - HIDE_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible); - ScreenPriv->qdCursorMode = FALSE; - (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, pCursor, x, y); - } -} - - -/* - * QuartzReallySetCursor - * Set the QuickDraw cursor. Called from the main thread since changing the - * cursor with QuickDraw is not thread safe on dual processor machines. - */ -void -QuartzReallySetCursor() -{ - pthread_mutex_lock(&cursorMutex); - - if (currentCursor) { - SetCCursor(currentCursor); - } else { - SetCursor(&gQDArrow); - } - - pthread_cond_signal(&cursorCondition); - pthread_mutex_unlock(&cursorMutex); -} - - -/* - * QuartzMoveCursor - * Move the cursor. This is a noop for QuickDraw. - */ -static void -QuartzMoveCursor( - ScreenPtr pScreen, - int x, - int y) -{ - QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - // only the X cursor needs to be explicitly moved - if (!ScreenPriv->qdCursorMode) - (*ScreenPriv->spriteFuncs->MoveCursor)(pScreen, x, y); -} - - -static miPointerSpriteFuncRec quartzSpriteFuncsRec = { - QuartzRealizeCursor, - QuartzUnrealizeCursor, - QuartzSetCursor, - QuartzMoveCursor -}; - - -/* -=========================================================================== - - Pointer screen functions - -=========================================================================== -*/ - -/* - * QuartzCursorOffScreen - */ -static Bool QuartzCursorOffScreen(ScreenPtr *pScreen, int *x, int *y) -{ - return FALSE; -} - - -/* - * QuartzCrossScreen - */ -static void QuartzCrossScreen(ScreenPtr pScreen, Bool entering) -{ - return; -} - - -/* - * QuartzWarpCursor - * Change the cursor position without generating an event or motion history. - * The input coordinates (x,y) are in pScreen-local X11 coordinates. - * - */ -static void -QuartzWarpCursor( - ScreenPtr pScreen, - int x, - int y) -{ - static int neverMoved = TRUE; - - if (neverMoved) { - // Don't move the cursor the first time. This is the jump-to-center - // initialization, and it's annoying because we may still be in MacOS. - neverMoved = FALSE; - return; - } - - if (quartzServerVisible) { - CGDisplayErr cgErr; - CGPoint cgPoint; - // Only need to do this for one display. Any display will do. - CGDirectDisplayID cgID = QUARTZ_PRIV(pScreen)->displayIDs[0]; - CGRect cgRect = CGDisplayBounds(cgID); - - // Convert (x,y) to CoreGraphics screen-local CG coordinates. - // This is necessary because the X11 screen and CG screen may not - // coincide. (e.g. X11 screen may be moved to dodge the menu bar) - - // Make point in X11 global coordinates - cgPoint = CGPointMake(x + dixScreenOrigins[pScreen->myNum].x, - y + dixScreenOrigins[pScreen->myNum].y); - // Shift to CoreGraphics global screen coordinates - cgPoint.x += darwinMainScreenX; - cgPoint.y += darwinMainScreenY; - // Shift to CoreGraphics screen-local coordinates - cgPoint.x -= cgRect.origin.x; - cgPoint.y -= cgRect.origin.y; - - cgErr = CGDisplayMoveCursorToPoint(cgID, cgPoint); - if (cgErr != CGDisplayNoErr) { - ErrorF("Could not set cursor position with error code 0x%x.\n", - cgErr); - } - } - - miPointerWarpCursor(pScreen, x, y); - miPointerUpdate(); -} - - -static miPointerScreenFuncRec quartzScreenFuncsRec = { - QuartzCursorOffScreen, - QuartzCrossScreen, - QuartzWarpCursor, - DarwinEQPointerPost, - DarwinEQSwitchScreen -}; - - -/* -=========================================================================== - - Other screen functions - -=========================================================================== -*/ - -/* - * QuartzCursorQueryBestSize - * Handle queries for best cursor size - */ -static void -QuartzCursorQueryBestSize( - int class, - unsigned short *width, - unsigned short *height, - ScreenPtr pScreen) -{ - QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - if (class == CursorShape) { - *width = CURSORWIDTH; - *height = CURSORHEIGHT; - } else { - (*ScreenPriv->QueryBestSize)(class, width, height, pScreen); - } -} - - -/* - * QuartzInitCursor - * Initialize cursor support - */ -Bool -QuartzInitCursor( - ScreenPtr pScreen ) -{ - QuartzCursorScreenPtr ScreenPriv; - miPointerScreenPtr PointPriv; - DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); - - // initialize software cursor handling (always needed as backup) - if (!miDCInitialize(pScreen, &quartzScreenFuncsRec)) { - return FALSE; - } - - ScreenPriv = xcalloc( 1, sizeof(QuartzCursorScreenRec) ); - if (!ScreenPriv) return FALSE; - - CURSOR_PRIV(pScreen) = ScreenPriv; - - // override some screen procedures - ScreenPriv->QueryBestSize = pScreen->QueryBestSize; - pScreen->QueryBestSize = QuartzCursorQueryBestSize; - - // initialize QuickDraw cursor handling - GetQDGlobalsArrow(&gQDArrow); - PointPriv = (miPointerScreenPtr) - dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey); - - ScreenPriv->spriteFuncs = PointPriv->spriteFuncs; - PointPriv->spriteFuncs = &quartzSpriteFuncsRec; - - if (!quartzRootless) - ScreenPriv->useQDCursor = QuartzFSUseQDCursor(dfb->colorBitsPerPixel); - else - ScreenPriv->useQDCursor = TRUE; - ScreenPriv->qdCursorMode = TRUE; - ScreenPriv->qdCursorVisible = TRUE; - - // initialize cursor mutex lock - pthread_mutex_init(&cursorMutex, NULL); - - // initialize condition for waiting - pthread_cond_init(&cursorCondition, NULL); - - return TRUE; -} - - -// X server is hiding. Restore the Aqua cursor. -void QuartzSuspendXCursor( - ScreenPtr pScreen ) -{ - QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); - - CHANGE_QD_CURSOR(NULL); - SHOW_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible); -} - - -// X server is showing. Restore the X cursor. -void QuartzResumeXCursor( - ScreenPtr pScreen, - int x, - int y ) -{ - QuartzSetCursor(pScreen, quartzLatentCursor, x, y); -} diff --git a/xorg-server/hw/xquartz/quartzCursor.h b/xorg-server/hw/xquartz/quartzCursor.h deleted file mode 100644 index 56a02098d..000000000 --- a/xorg-server/hw/xquartz/quartzCursor.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * quartzCursor.h - * - * External interface for Quartz hardware cursor - * - * Copyright (c) 2001 Torrey T. Lyons and Greg Parker. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ - -#ifndef QUARTZCURSOR_H -#define QUARTZCURSOR_H - -#include "screenint.h" - -Bool QuartzInitCursor(ScreenPtr pScreen); -void QuartzReallySetCursor(void); -void QuartzSuspendXCursor(ScreenPtr pScreen); -void QuartzResumeXCursor(ScreenPtr pScreen, int x, int y); - -#endif diff --git a/xorg-server/hw/xquartz/quartzForeground.c b/xorg-server/hw/xquartz/quartzForeground.c deleted file mode 100644 index 0e724de76..000000000 --- a/xorg-server/hw/xquartz/quartzForeground.c +++ /dev/null @@ -1,47 +0,0 @@ -/* foreground.c - Push the current process into the foreground. - - This is in a separate file because of Quartz/X type conflicts. - - Copyright (c) 2007 Jeremy Huddleston - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT - HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - Except as contained in this notice, the name(s) of the above - copyright holders shall not be used in advertising or otherwise to - promote the sale, use or other dealings in this Software without - prior written authorization. */ - -#include -#include - -#include "quartzForeground.h" - -int QuartzMoveToForeground() { - ProcessSerialNumber psn = { 0, kCurrentProcess }; - OSStatus returnCode = TransformProcessType(& psn, kProcessTransformToForegroundApplication); - if( returnCode == 0) { - fprintf(stderr, "TransformProcessType: Success\n"); - SetFrontProcess(&psn); - } else { - fprintf(stderr, "TransformProcessType: Failure\n"); - } - return (int)returnCode; -} diff --git a/xorg-server/hw/xquartz/quartzForeground.h b/xorg-server/hw/xquartz/quartzForeground.h deleted file mode 100644 index b5422ff9c..000000000 --- a/xorg-server/hw/xquartz/quartzForeground.h +++ /dev/null @@ -1,37 +0,0 @@ -/* foreground.h - Push the current process into the foreground. - - This is in a separate file because of Quartz/X type conflicts. - - Copyright (c) 2007 Jeremy Huddleston - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT - HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - Except as contained in this notice, the name(s) of the above - copyright holders shall not be used in advertising or otherwise to - promote the sale, use or other dealings in this Software without - prior written authorization. */ - -#ifndef _QUARTZ_FOREGROUND_H_ -#define _QUARTZ_FOREGROUND_H_ - -int QuartzMoveToForeground(void); - -#endif /* _QUARTZ_FOREGROUND_H_ */ diff --git a/xorg-server/hw/xquartz/quartzKeyboard.c b/xorg-server/hw/xquartz/quartzKeyboard.c index 9b899ca67..72f94b443 100644 --- a/xorg-server/hw/xquartz/quartzKeyboard.c +++ b/xorg-server/hw/xquartz/quartzKeyboard.c @@ -1,52 +1,73 @@ /* - quartzKeyboard.c - - Code to build a keymap using the Carbon Keyboard Layout API. - - Copyright (c) 2003-2007 Apple Inc. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT - HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - Except as contained in this notice, the name(s) of the above - copyright holders shall not be used in advertising or otherwise to - promote the sale, use or other dealings in this Software without - prior written authorization. + quartzKeyboard.c: Keyboard support for Xquartz + + Copyright (c) 2003-2008 Apple Inc. + Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved. + Copyright 2004 Kaleb S. KEITHLEY. All Rights Reserved. + + Copyright (C) 1999,2000 by Eric Sunshine + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "sanitizedCarbon.h" + #ifdef HAVE_DIX_CONFIG_H #include #endif -#include "quartzCommon.h" +#define HACK_MISSING 1 +#define HACK_KEYPAD 1 -#include -#include +#include +#include +#include +#include +#include + +#include "quartzCommon.h" +#include "darwin.h" #include "quartzKeyboard.h" +#include "quartzAudio.h" + +#include "threadSafety.h" + +#ifdef NDEBUG +#undef NDEBUG +#include +#define NDEBUG 1 +#else +#include +#endif +#include + +#include "xkbsrv.h" +#include "exevents.h" #include "X11/keysym.h" #include "keysym2ucs.h" -#define HACK_MISSING 1 -#define HACK_KEYPAD 1 - enum { MOD_COMMAND = 256, MOD_SHIFT = 512, @@ -124,7 +145,9 @@ const static struct { KeySym normal, dead; } dead_keys[] = { {XK_grave, XK_dead_grave}, + {XK_apostrophe, XK_dead_acute}, /* US:"=" on a Czech keyboard */ {XK_acute, XK_dead_acute}, + {UKEYSYM (0x384), XK_dead_acute}, /* US:";" on a Greek keyboard */ {XK_asciicircum, XK_dead_circumflex}, {UKEYSYM (0x2c6), XK_dead_circumflex}, /* MODIFIER LETTER CIRCUMFLEX ACCENT */ {XK_asciitilde, XK_dead_tilde}, @@ -146,16 +169,383 @@ const static struct { {UKEYSYM (0x31b), XK_dead_horn}, /* COMBINING HORN */ }; -unsigned int QuartzSystemKeymapSeed(void) { - static unsigned int seed; - static KeyboardLayoutRef last_key_layout; - KeyboardLayoutRef key_layout; +darwinKeyboardInfo keyInfo; +pthread_mutex_t keyInfo_mutex = PTHREAD_MUTEX_INITIALIZER; + +static void DarwinChangeKeyboardControl(DeviceIntPtr device, KeybdCtrl *ctrl) { + // FIXME: to be implemented + // keyclick, bell volume / pitch, autorepead, LED's +} + +//----------------------------------------------------------------------------- +// Utility functions to help parse Darwin keymap +//----------------------------------------------------------------------------- + +/* + * DarwinBuildModifierMaps + * Use the keyMap field of keyboard info structure to populate + * the modMap and modifierKeycodes fields. + */ +static void DarwinBuildModifierMaps(darwinKeyboardInfo *info) { + int i; + KeySym *k; + + memset(info->modMap, NoSymbol, sizeof(info->modMap)); + memset(info->modifierKeycodes, 0, sizeof(info->modifierKeycodes)); + + for (i = 0; i < NUM_KEYCODES; i++) { + k = info->keyMap + i * GLYPHS_PER_KEY; + + switch (*k) { + case XK_Shift_L: + info->modifierKeycodes[NX_MODIFIERKEY_SHIFT][0] = i; + info->modMap[MIN_KEYCODE + i] = ShiftMask; + break; + + case XK_Shift_R: +#ifdef NX_MODIFIERKEY_RSHIFT + info->modifierKeycodes[NX_MODIFIERKEY_RSHIFT][0] = i; +#else + info->modifierKeycodes[NX_MODIFIERKEY_SHIFT][0] = i; +#endif + info->modMap[MIN_KEYCODE + i] = ShiftMask; + break; + + case XK_Control_L: + info->modifierKeycodes[NX_MODIFIERKEY_CONTROL][0] = i; + info->modMap[MIN_KEYCODE + i] = ControlMask; + break; + + case XK_Control_R: +#ifdef NX_MODIFIERKEY_RCONTROL + info->modifierKeycodes[NX_MODIFIERKEY_RCONTROL][0] = i; +#else + info->modifierKeycodes[NX_MODIFIERKEY_CONTROL][0] = i; +#endif + info->modMap[MIN_KEYCODE + i] = ControlMask; + break; + + case XK_Caps_Lock: + info->modifierKeycodes[NX_MODIFIERKEY_ALPHALOCK][0] = i; + info->modMap[MIN_KEYCODE + i] = LockMask; + break; + + case XK_Alt_L: + info->modifierKeycodes[NX_MODIFIERKEY_ALTERNATE][0] = i; + info->modMap[MIN_KEYCODE + i] = Mod1Mask; + *k = XK_Mode_switch; // Yes, this is ugly. This needs to be cleaned up when we integrate quartzKeyboard with this code and refactor. + break; + + case XK_Alt_R: +#ifdef NX_MODIFIERKEY_RALTERNATE + info->modifierKeycodes[NX_MODIFIERKEY_RALTERNATE][0] = i; +#else + info->modifierKeycodes[NX_MODIFIERKEY_ALTERNATE][0] = i; +#endif + *k = XK_Mode_switch; // Yes, this is ugly. This needs to be cleaned up when we integrate quartzKeyboard with this code and refactor. + info->modMap[MIN_KEYCODE + i] = Mod1Mask; + break; + + case XK_Mode_switch: + info->modMap[MIN_KEYCODE + i] = Mod1Mask; + break; + + case XK_Meta_L: + info->modifierKeycodes[NX_MODIFIERKEY_COMMAND][0] = i; + info->modMap[MIN_KEYCODE + i] = Mod2Mask; + break; + + case XK_Meta_R: +#ifdef NX_MODIFIERKEY_RCOMMAND + info->modifierKeycodes[NX_MODIFIERKEY_RCOMMAND][0] = i; +#else + info->modifierKeycodes[NX_MODIFIERKEY_COMMAND][0] = i; +#endif + info->modMap[MIN_KEYCODE + i] = Mod2Mask; + break; + + case XK_Num_Lock: + info->modMap[MIN_KEYCODE + i] = Mod3Mask; + break; + } + } +} + +/* + * DarwinLoadKeyboardMapping + * Load the keyboard map from a file or system and convert + * it to an equivalent X keyboard map and modifier map. + */ +static void DarwinLoadKeyboardMapping(KeySymsRec *keySyms) { + pthread_mutex_lock(&keyInfo_mutex); + + DarwinBuildModifierMaps(&keyInfo); + + keySyms->map = keyInfo.keyMap; + keySyms->mapWidth = GLYPHS_PER_KEY; + keySyms->minKeyCode = MIN_KEYCODE; + keySyms->maxKeyCode = MAX_KEYCODE; + + pthread_mutex_unlock(&keyInfo_mutex); +} + +/* + * DarwinKeyboardSetDeviceKeyMap + * Load a keymap into the keyboard device + */ +static void DarwinKeyboardSetDeviceKeyMap(KeySymsRec *keySyms) { + DeviceIntPtr pDev; + + /* From ProcSetModifierMapping */ + SendMappingNotify(darwinKeyboard, MappingModifier, 0, 0, serverClient); + for (pDev = inputInfo.devices; pDev; pDev = pDev->next) + if (pDev->key && pDev->coreEvents) + SendDeviceMappingNotify(serverClient, MappingModifier, 0, 0, pDev); + + /* From ProcChangeKeyboardMapping */ + for (pDev = inputInfo.devices; pDev; pDev = pDev->next) + if ((pDev->coreEvents || pDev == inputInfo.keyboard) && pDev->key) + assert(SetKeySymsMap(&pDev->key->curKeySyms, keySyms)); + + SendMappingNotify(darwinKeyboard, MappingKeyboard, keySyms->minKeyCode, + keySyms->maxKeyCode - keySyms->minKeyCode + 1, serverClient); + for (pDev = inputInfo.devices; pDev; pDev = pDev->next) + if (pDev->key && pDev->coreEvents) + SendDeviceMappingNotify(serverClient, MappingKeyboard, keySyms->minKeyCode, + keySyms->maxKeyCode - keySyms->minKeyCode + 1, pDev); +} + +/* + * DarwinKeyboardInit + * Get the Darwin keyboard map and compute an equivalent + * X keyboard map and modifier map. Set the new keyboard + * device structure. + */ +void DarwinKeyboardInit(DeviceIntPtr pDev) { + KeySymsRec keySyms; + XkbComponentNamesRec names; + CFIndex value; + BOOL ok; + + // Open a shared connection to the HID System. + // Note that the Event Status Driver is really just a wrapper + // for a kIOHIDParamConnectType connection. + assert(darwinParamConnect = NXOpenEventStatus()); + + DarwinLoadKeyboardMapping(&keySyms); + + bzero(&names, sizeof(names)); + + /* We need to really have rules... or something... */ + //XkbSetRulesDflts("base", "pc105", "us", NULL, NULL); + + pthread_mutex_lock(&keyInfo_mutex); + assert(XkbInitKeyboardDeviceStruct(pDev, &names, &keySyms, keyInfo.modMap, + QuartzBell, DarwinChangeKeyboardControl)); + pthread_mutex_unlock(&keyInfo_mutex); + + /* Get our key repeat settings from GlobalPreferences */ + (void)CFPreferencesAppSynchronize(CFSTR(".GlobalPreferences")); + value = CFPreferencesGetAppIntegerValue(CFSTR("InitialKeyRepeat"), CFSTR(".GlobalPreferences"), &ok); + if(!ok) + value = 35; + + if(value == 300000) { // off + XkbSetRepeatKeys(pDev, -1, AutoRepeatModeOff); + } else { + pDev->key->xkbInfo->desc->ctrls->repeat_delay = value * 15; + + value = CFPreferencesGetAppIntegerValue(CFSTR("KeyRepeat"), CFSTR(".GlobalPreferences"), &ok); + if(!ok) + value = 6; + pDev->key->xkbInfo->desc->ctrls->repeat_interval = value * 15; + + XkbSetRepeatKeys(pDev, -1, AutoRepeatModeOn); + } + + DarwinKeyboardSetDeviceKeyMap(&keySyms); +} + +void DarwinKeyboardReloadHandler(int screenNum, xEventPtr xe, DeviceIntPtr pDev, int nevents) { + KeySymsRec keySyms; + + DEBUG_LOG("DarwinKeyboardReloadHandler\n"); + + DarwinLoadKeyboardMapping(&keySyms); + DarwinKeyboardSetDeviceKeyMap(&keySyms); +} - KLGetCurrentKeyboardLayout (&key_layout); - if (key_layout != last_key_layout) seed++; - last_key_layout = key_layout; +//----------------------------------------------------------------------------- +// Modifier translation functions +// +// There are three different ways to specify a Mac modifier key: +// keycode - specifies hardware key, read from keymapping +// key - NX_MODIFIERKEY_*, really an index +// mask - NX_*MASK, mask for modifier flags in event record +// Left and right side have different keycodes but the same key and mask. +//----------------------------------------------------------------------------- - return seed; +/* + * DarwinModifierNXKeyToNXKeycode + * Return the keycode for an NX_MODIFIERKEY_* modifier. + * side = 0 for left or 1 for right. + * Returns 0 if key+side is not a known modifier. + */ +int DarwinModifierNXKeyToNXKeycode(int key, int side) { + int retval; + pthread_mutex_lock(&keyInfo_mutex); + retval = keyInfo.modifierKeycodes[key][side]; + pthread_mutex_unlock(&keyInfo_mutex); + + return retval; +} + +/* + * DarwinModifierNXKeycodeToNXKey + * Returns -1 if keycode+side is not a modifier key + * outSide may be NULL, else it gets 0 for left and 1 for right. + */ +int DarwinModifierNXKeycodeToNXKey(unsigned char keycode, int *outSide) { + int key, side; + + pthread_mutex_lock(&keyInfo_mutex); + keycode += MIN_KEYCODE; + // search modifierKeycodes for this keycode+side + for (key = 0; key < NX_NUMMODIFIERS; key++) { + for (side = 0; side <= 1; side++) { + if (keyInfo.modifierKeycodes[key][side] == keycode) break; + } + } + if (key == NX_NUMMODIFIERS) { + pthread_mutex_unlock(&keyInfo_mutex); + return -1; + } + if (outSide) *outSide = side; + + pthread_mutex_unlock(&keyInfo_mutex); + return key; +} + +/* + * DarwinModifierNXMaskToNXKey + * Returns -1 if mask is not a known modifier mask. + */ +int DarwinModifierNXMaskToNXKey(int mask) { + switch (mask) { + case NX_ALPHASHIFTMASK: return NX_MODIFIERKEY_ALPHALOCK; + case NX_SHIFTMASK: return NX_MODIFIERKEY_SHIFT; +#ifdef NX_DEVICELSHIFTKEYMASK + case NX_DEVICELSHIFTKEYMASK: return NX_MODIFIERKEY_SHIFT; + case NX_DEVICERSHIFTKEYMASK: return NX_MODIFIERKEY_RSHIFT; +#endif + case NX_CONTROLMASK: return NX_MODIFIERKEY_CONTROL; +#ifdef NX_DEVICELCTLKEYMASK + case NX_DEVICELCTLKEYMASK: return NX_MODIFIERKEY_CONTROL; + case NX_DEVICERCTLKEYMASK: return NX_MODIFIERKEY_RCONTROL; +#endif + case NX_ALTERNATEMASK: return NX_MODIFIERKEY_ALTERNATE; +#ifdef NX_DEVICELALTKEYMASK + case NX_DEVICELALTKEYMASK: return NX_MODIFIERKEY_ALTERNATE; + case NX_DEVICERALTKEYMASK: return NX_MODIFIERKEY_RALTERNATE; +#endif + case NX_COMMANDMASK: return NX_MODIFIERKEY_COMMAND; +#ifdef NX_DEVICELCMDKEYMASK + case NX_DEVICELCMDKEYMASK: return NX_MODIFIERKEY_COMMAND; + case NX_DEVICERCMDKEYMASK: return NX_MODIFIERKEY_RCOMMAND; +#endif + case NX_NUMERICPADMASK: return NX_MODIFIERKEY_NUMERICPAD; + case NX_HELPMASK: return NX_MODIFIERKEY_HELP; + case NX_SECONDARYFNMASK: return NX_MODIFIERKEY_SECONDARYFN; + } + return -1; +} + +/* + * DarwinModifierNXKeyToNXMask + * Returns 0 if key is not a known modifier key. + */ +int DarwinModifierNXKeyToNXMask(int key) { + switch (key) { + case NX_MODIFIERKEY_ALPHALOCK: return NX_ALPHASHIFTMASK; +#ifdef NX_DEVICELSHIFTKEYMASK + case NX_MODIFIERKEY_SHIFT: return NX_DEVICELSHIFTKEYMASK; + case NX_MODIFIERKEY_RSHIFT: return NX_DEVICERSHIFTKEYMASK; + case NX_MODIFIERKEY_CONTROL: return NX_DEVICELCTLKEYMASK; + case NX_MODIFIERKEY_RCONTROL: return NX_DEVICERCTLKEYMASK; + case NX_MODIFIERKEY_ALTERNATE: return NX_DEVICELALTKEYMASK; + case NX_MODIFIERKEY_RALTERNATE: return NX_DEVICERALTKEYMASK; + case NX_MODIFIERKEY_COMMAND: return NX_DEVICELCMDKEYMASK; + case NX_MODIFIERKEY_RCOMMAND: return NX_DEVICERCMDKEYMASK; +#else + case NX_MODIFIERKEY_SHIFT: return NX_SHIFTMASK; + case NX_MODIFIERKEY_CONTROL: return NX_CONTROLMASK; + case NX_MODIFIERKEY_ALTERNATE: return NX_ALTERNATEMASK; + case NX_MODIFIERKEY_COMMAND: return NX_COMMANDMASK; +#endif + case NX_MODIFIERKEY_NUMERICPAD: return NX_NUMERICPADMASK; + case NX_MODIFIERKEY_HELP: return NX_HELPMASK; + case NX_MODIFIERKEY_SECONDARYFN: return NX_SECONDARYFNMASK; + } + return 0; +} + +/* + * DarwinModifierStringToNXMask + * Returns 0 if string is not a known modifier. + */ +int DarwinModifierStringToNXMask(const char *str, int separatelr) { +#ifdef NX_DEVICELSHIFTKEYMASK + if(separatelr) { + if (!strcasecmp(str, "shift")) return NX_DEVICELSHIFTKEYMASK | NX_DEVICERSHIFTKEYMASK; + if (!strcasecmp(str, "control")) return NX_DEVICELCTLKEYMASK | NX_DEVICERCTLKEYMASK; + if (!strcasecmp(str, "option")) return NX_DEVICELALTKEYMASK | NX_DEVICERALTKEYMASK; + if (!strcasecmp(str, "alt")) return NX_DEVICELALTKEYMASK | NX_DEVICERALTKEYMASK; + if (!strcasecmp(str, "command")) return NX_DEVICELCMDKEYMASK | NX_DEVICERCMDKEYMASK; + if (!strcasecmp(str, "lshift")) return NX_DEVICELSHIFTKEYMASK; + if (!strcasecmp(str, "rshift")) return NX_DEVICERSHIFTKEYMASK; + if (!strcasecmp(str, "lcontrol")) return NX_DEVICELCTLKEYMASK; + if (!strcasecmp(str, "rcontrol")) return NX_DEVICERCTLKEYMASK; + if (!strcasecmp(str, "loption")) return NX_DEVICELALTKEYMASK; + if (!strcasecmp(str, "roption")) return NX_DEVICERALTKEYMASK; + if (!strcasecmp(str, "lalt")) return NX_DEVICELALTKEYMASK; + if (!strcasecmp(str, "ralt")) return NX_DEVICERALTKEYMASK; + if (!strcasecmp(str, "lcommand")) return NX_DEVICELCMDKEYMASK; + if (!strcasecmp(str, "rcommand")) return NX_DEVICERCMDKEYMASK; + } else { +#endif + if (!strcasecmp(str, "shift")) return NX_SHIFTMASK; + if (!strcasecmp(str, "control")) return NX_CONTROLMASK; + if (!strcasecmp(str, "option")) return NX_ALTERNATEMASK; + if (!strcasecmp(str, "alt")) return NX_ALTERNATEMASK; + if (!strcasecmp(str, "command")) return NX_COMMANDMASK; + if (!strcasecmp(str, "lshift")) return NX_SHIFTMASK; + if (!strcasecmp(str, "rshift")) return NX_SHIFTMASK; + if (!strcasecmp(str, "lcontrol")) return NX_CONTROLMASK; + if (!strcasecmp(str, "rcontrol")) return NX_CONTROLMASK; + if (!strcasecmp(str, "loption")) return NX_ALTERNATEMASK; + if (!strcasecmp(str, "roption")) return NX_ALTERNATEMASK; + if (!strcasecmp(str, "lalt")) return NX_ALTERNATEMASK; + if (!strcasecmp(str, "ralt")) return NX_ALTERNATEMASK; + if (!strcasecmp(str, "lcommand")) return NX_COMMANDMASK; + if (!strcasecmp(str, "rcommand")) return NX_COMMANDMASK; +#ifdef NX_DEVICELSHIFTKEYMASK + } +#endif + if (!strcasecmp(str, "lock")) return NX_ALPHASHIFTMASK; + if (!strcasecmp(str, "fn")) return NX_SECONDARYFNMASK; + if (!strcasecmp(str, "help")) return NX_HELPMASK; + if (!strcasecmp(str, "numlock")) return NX_NUMERICPADMASK; + return 0; +} + +/* + * LegalModifier + * This allows the ddx layer to prevent some keys from being remapped + * as modifier keys. + */ +Bool LegalModifier(unsigned int key, DeviceIntPtr pDev) +{ + return 1; } static inline UniChar macroman2ucs(unsigned char c) { @@ -196,41 +586,78 @@ static KeySym make_dead_key(KeySym in) { } Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info) { +#if !defined(__LP64__) || MAC_OS_X_VERSION_MIN_REQUIRED < 1050 KeyboardLayoutRef key_layout; + int is_uchr = 1; +#endif const void *chr_data = NULL; int num_keycodes = NUM_KEYCODES; - UInt32 keyboard_type = 0; - int is_uchr = 1, i, j; + UInt32 keyboard_type = LMGetKbdType(); + int i, j; OSStatus err; KeySym *k; + CFDataRef currentKeyLayoutDataRef = NULL; +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 TISInputSourceRef currentKeyLayoutRef = TISCopyCurrentKeyboardLayoutInputSource(); - keyboard_type = LMGetKbdType (); + if (currentKeyLayoutRef) { - CFDataRef currentKeyLayoutDataRef = (CFDataRef )TISGetInputSourceProperty(currentKeyLayoutRef, kTISPropertyUnicodeKeyLayoutData); - if (currentKeyLayoutDataRef) chr_data = CFDataGetBytePtr(currentKeyLayoutDataRef); + currentKeyLayoutDataRef = (CFDataRef )TISGetInputSourceProperty(currentKeyLayoutRef, kTISPropertyUnicodeKeyLayoutData); + if (currentKeyLayoutDataRef) + chr_data = CFDataGetBytePtr(currentKeyLayoutDataRef); } - +#endif + +#if !defined(__LP64__) || MAC_OS_X_VERSION_MIN_REQUIRED < 1050 if (chr_data == NULL) { - KLGetCurrentKeyboardLayout (&key_layout); - KLGetKeyboardLayoutProperty (key_layout, kKLuchrData, &chr_data); +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 + ErrorF("X11.app: Error detected in determining keyboard layout. If you are using an Apple-provided keyboard layout, please report this error at http://xquartz.macosforge.org and http://bugreport.apple.com\n"); + ErrorF("X11.app: Debug Info: keyboard_type=%u, currentKeyLayoutRef=%p, currentKeyLayoutDataRef=%p, chr_data=%p\n", + (unsigned)keyboard_type, currentKeyLayoutRef, currentKeyLayoutDataRef, chr_data); +#endif + + KLGetCurrentKeyboardLayout (&key_layout); + KLGetKeyboardLayoutProperty (key_layout, kKLuchrData, &chr_data); + +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 + if(chr_data != NULL) { + ErrorF("X11.app: Fallback succeeded, but this is still a bug. Please report the above information.\n"); + } +#endif } - + if (chr_data == NULL) { - KLGetKeyboardLayoutProperty (key_layout, kKLKCHRData, &chr_data); - is_uchr = 0; - num_keycodes = 128; + ErrorF("X11.app: Debug Info: kKLuchrData failed, trying kKLKCHRData.\n"); + ErrorF("If you are using a 3rd party keyboard layout, please see http://xquartz.macosforge.org/trac/ticket/154\n"); + KLGetKeyboardLayoutProperty (key_layout, kKLKCHRData, &chr_data); + is_uchr = 0; + num_keycodes = 128; + +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 + if(chr_data != NULL) { + ErrorF("X11.app: Fallback succeeded, but this is still a bug. Please report the above information.\n"); + } +#endif } +#endif + +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 + if(currentKeyLayoutRef) + CFRelease(currentKeyLayoutRef); +#endif if (chr_data == NULL) { ErrorF ( "Couldn't get uchr or kchr resource\n"); return FALSE; } - + /* Scan the keycode range for the Unicode character that each key produces in the four shift states. Then convert that to an X11 keysym (which may just the bit that says "this is Unicode" if it can't find the real symbol.) */ + + /* KeyTranslate is not available on 64-bit platforms; UCKeyTranslate + must be used instead. */ for (i = 0; i < num_keycodes; i++) { static const int mods[4] = {0, MOD_SHIFT, MOD_OPTION, @@ -239,7 +666,9 @@ Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info) { k = info->keyMap + i * GLYPHS_PER_KEY; for (j = 0; j < 4; j++) { +#if !defined(__LP64__) || MAC_OS_X_VERSION_MIN_REQUIRED < 1050 if (is_uchr) { +#endif UniChar s[8]; UniCharCount len; UInt32 dead_key_state = 0, extra_dead = 0; @@ -263,6 +692,7 @@ Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info) { k[j] = ucs2keysym (s[0]); if (dead_key_state != 0) k[j] = make_dead_key (k[j]); } +#if !defined(__LP64__) || MAC_OS_X_VERSION_MIN_REQUIRED < 1050 } else { // kchr UInt32 c, state = 0, state2 = 0; UInt16 code; @@ -286,6 +716,7 @@ Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info) { if (state != 0) k[j] = make_dead_key (k[j]); } } +#endif } if (k[3] == k[2]) k[3] = NoSymbol; @@ -318,7 +749,6 @@ Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info) { k[0] = known_numeric_keys[i].keypad; } } - if(currentKeyLayoutRef) CFRelease(currentKeyLayoutRef); - + return TRUE; } diff --git a/xorg-server/hw/xquartz/quartzKeyboard.h b/xorg-server/hw/xquartz/quartzKeyboard.h index 0c7e70e48..215a4a9a5 100644 --- a/xorg-server/hw/xquartz/quartzKeyboard.h +++ b/xorg-server/hw/xquartz/quartzKeyboard.h @@ -32,6 +32,8 @@ #include "X11/keysym.h" #include "inputstr.h" +#include + // Each key can generate 4 glyphs. They are, in order: // unshifted, shifted, modeswitch unshifted, modeswitch shifted #define GLYPHS_PER_KEY 4 @@ -45,9 +47,20 @@ typedef struct darwinKeyboardInfo_struct { unsigned char modifierKeycodes[32][2]; } darwinKeyboardInfo; -/* These functions need to be implemented by XQuartz, XDarwin, etc. */ -void DarwinKeyboardReload(DeviceIntPtr pDev); +/* These functions need to be implemented by Xquartz, XDarwin, etc. */ Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info); -unsigned int QuartzSystemKeymapSeed(void); + +/* Provided for darwinEvents.c */ +extern darwinKeyboardInfo keyInfo; +extern pthread_mutex_t keyInfo_mutex; +void DarwinKeyboardReloadHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev, int nevents); +int DarwinModifierNXKeycodeToNXKey(unsigned char keycode, int *outSide); +int DarwinModifierNXKeyToNXKeycode(int key, int side); +int DarwinModifierNXKeyToNXMask(int key); +int DarwinModifierNXMaskToNXKey(int mask); +int DarwinModifierStringToNXMask(const char *string, int separatelr); + +/* Provided for darwin.c */ +void DarwinKeyboardInit(DeviceIntPtr pDev); #endif /* QUARTZ_KEYBOARD_H */ diff --git a/xorg-server/hw/xquartz/quartzPasteboard.c b/xorg-server/hw/xquartz/quartzPasteboard.c index 0bf84f5d5..60bcabe4c 100644 --- a/xorg-server/hw/xquartz/quartzPasteboard.c +++ b/xorg-server/hw/xquartz/quartzPasteboard.c @@ -34,6 +34,8 @@ #include #endif +#include "misc.h" +#include "inputstr.h" #include "quartzPasteboard.h" #include @@ -76,8 +78,8 @@ static char * QuartzReadCutBuffer(void) } // Write X cut buffer to Mac OS X pasteboard -// Called by ProcessInputEvents() in response to request from X server thread. -void QuartzWritePasteboard(void) +// Called by mieqProcessInputEvents() in response to request from X server thread. +void QuartzWritePasteboard(int screenNum, xEventPtr xe, DeviceIntPtr dev, int nevents) { char *text; text = QuartzReadCutBuffer(); @@ -90,8 +92,8 @@ void QuartzWritePasteboard(void) #define strequal(a, b) (0 == strcmp((a), (b))) // Read Mac OS X pasteboard into X cut buffer -// Called by ProcessInputEvents() in response to request from X server thread. -void QuartzReadPasteboard(void) +// Called by mieqProcessInputEvents() in response to request from X server thread. +void QuartzReadPasteboard(int screenNum, xEventPtr xe, DeviceIntPtr dev, int nevents) { char *oldText = QuartzReadCutBuffer(); char *text = QuartzReadCocoaPasteboard(); @@ -129,7 +131,7 @@ void QuartzReadPasteboard(void) event.u.selectionClear.time = GetTimeInMillis(); event.u.selectionClear.window = pSel->window; event.u.selectionClear.atom = pSel->selection; - TryClientEvents(pSel->client, &event, 1, NoEventMask, + TryClientEvents(pSel->client, dev, &event, 1, NoEventMask, NoEventMask /*CantBeFiltered*/, NullGrab); } diff --git a/xorg-server/hw/xquartz/quartzPasteboard.h b/xorg-server/hw/xquartz/quartzPasteboard.h index d6a8ee815..b51cd88e0 100644 --- a/xorg-server/hw/xquartz/quartzPasteboard.h +++ b/xorg-server/hw/xquartz/quartzPasteboard.h @@ -34,11 +34,11 @@ #define _QUARTZPASTEBOARD_H // Aqua->X -void QuartzReadPasteboard(void); +void QuartzReadPasteboard(int, xEventPtr, DeviceIntPtr, int); char * QuartzReadCocoaPasteboard(void); // caller must free string // X->Aqua -void QuartzWritePasteboard(void); +void QuartzWritePasteboard(int, xEventPtr, DeviceIntPtr, int); void QuartzWriteCocoaPasteboard(char *text); #endif /* _QUARTZPASTEBOARD_H */ diff --git a/xorg-server/hw/xquartz/quartzStartup.c b/xorg-server/hw/xquartz/quartzStartup.c index e25e15583..ba92ecef6 100644 --- a/xorg-server/hw/xquartz/quartzStartup.c +++ b/xorg-server/hw/xquartz/quartzStartup.c @@ -27,6 +27,8 @@ * use or other dealings in this Software without prior written authorization. */ +#include "sanitizedCarbon.h" + #ifdef HAVE_DIX_CONFIG_H #include #endif @@ -37,46 +39,69 @@ #include "quartzCommon.h" #include "X11Controller.h" #include "darwin.h" +#include "darwinEvents.h" +#include "quartzAudio.h" #include "quartz.h" #include "opaque.h" #include "micmap.h" -#ifdef NDEBUG -#undef NDEBUG -#include -#define NDEBUG 1 -#else #include -#endif -char **envpGlobal; // argcGlobal and argvGlobal - // are from dix/globals.c +#include + +int dix_main(int argc, char **argv, char **envp); -int main(int argc, char **argv, char **envp); -void _InitHLTB(void); -void DarwinHandleGUI(int argc, char **argv, char **envp); +struct arg { + int argc; + char **argv; + char **envp; +}; static void server_thread (void *arg) { - exit (main (argcGlobal, argvGlobal, envpGlobal)); + struct arg args = *((struct arg *)arg); + free(arg); + exit (dix_main(args.argc, args.argv, args.envp)); } -/* - * DarwinHandleGUI - * This function is called first from main(). The first time - * it is called we start the Mac OS X front end. The front end - * will call main() again from another thread to run the X - * server. On the second call this function loads the user - * preferences set by the Mac OS X front end. - */ -void DarwinHandleGUI(int argc, char **argv, char **envp) { - static Bool been_here = FALSE; +static pthread_t create_thread (void *func, void *arg) { + pthread_attr_t attr; + pthread_t tid; + + pthread_attr_init (&attr); + pthread_attr_setscope (&attr, PTHREAD_SCOPE_SYSTEM); + pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED); + pthread_create (&tid, &attr, func, arg); + pthread_attr_destroy (&attr); + + return tid; +} + +void QuartzInitServer(int argc, char **argv, char **envp) { + struct arg *args = (struct arg*)malloc(sizeof(struct arg)); + if(!args) + FatalError("Could not allocate memory.\n"); + + args->argc = argc; + args->argv = argv; + args->envp = envp; + + APPKIT_THREAD_ID = pthread_self(); + SERVER_THREAD_ID = create_thread(server_thread, args); + + if (!SERVER_THREAD_ID) { + FatalError("can't create secondary thread\n"); + } +} + +int server_main(int argc, char **argv, char **envp) { int i; int fd[2]; - if (been_here) { - return; - } - been_here = TRUE; + /* Unset CFProcessPath, so our children don't inherit this kludge we need + * to load our nib. If an xterm gets this set, then it fails to + * 'open hi.txt' properly. + */ + unsetenv("CFProcessPath"); // Make a pipe to pass events assert( pipe(fd) == 0 ); @@ -84,11 +109,6 @@ void DarwinHandleGUI(int argc, char **argv, char **envp) { darwinEventWriteFD = fd[1]; fcntl(darwinEventReadFD, F_SETFL, O_NONBLOCK); - // Store command line arguments to pass back to main() - argcGlobal = argc; - argvGlobal = argv; - envpGlobal = envp; - for (i = 1; i < argc; i++) { // Display version info without starting Mac OS X UI if requested if (!strcmp( argv[i], "-showconfig" ) || !strcmp( argv[i], "-version" )) { @@ -97,16 +117,9 @@ void DarwinHandleGUI(int argc, char **argv, char **envp) { } } - /* Initially I ran the X server on the main thread, and received - events on the second thread. But now we may be using Carbon, - that needs to run on the main thread. (Otherwise, when it's - prebound, it will initialize itself on the wrong thread) - - grr.. but doing that means that if the X thread gets scheduled - before the main thread when we're _not_ prebound, things fail, - so initialize by hand. */ - - _InitHLTB(); - X11ControllerMain(argc, (const char **)argv, server_thread, NULL); + /* Create the audio mutex */ + QuartzAudioInit(); + + X11ControllerMain(argc, argv, envp); exit(0); } diff --git a/xorg-server/hw/xquartz/sanitizedCarbon.h b/xorg-server/hw/xquartz/sanitizedCarbon.h new file mode 100644 index 000000000..cc6ef198d --- /dev/null +++ b/xorg-server/hw/xquartz/sanitizedCarbon.h @@ -0,0 +1,32 @@ +/* + * Don't #include any of the AppKit, etc stuff directly since it will + * pollute the X11 namespace. + */ + +#ifndef _XQ_SANITIZED_CARBON_H_ +#define _XQ_SANITIZED_CARBON_H_ + +// QuickDraw in ApplicationServices has the following conflicts with +// the basic X server headers. Use QD_ to use the QuickDraw +// definition of any of these symbols, or the normal name for the +// X11 definition. +#define Cursor QD_Cursor +#define WindowPtr QD_WindowPtr +#define Picture QD_Picture +#define BOOL OSX_BOOL +#define EventType HIT_EventType + +#include +#include +#include +#include +#include +#include // For the NXSwap* + +#undef Cursor +#undef WindowPtr +#undef Picture +#undef BOOL +#undef EventType + +#endif /* _XQ_SANITIZED_CARBON_H_ */ diff --git a/xorg-server/hw/xquartz/sanitizedCocoa.h b/xorg-server/hw/xquartz/sanitizedCocoa.h new file mode 100644 index 000000000..58de64c1c --- /dev/null +++ b/xorg-server/hw/xquartz/sanitizedCocoa.h @@ -0,0 +1,27 @@ +/* + * Don't #include any of the AppKit, etc stuff directly since it will + * pollute the X11 namespace. + */ + +#ifndef _XQ_SANITIZED_COCOA_H_ +#define _XQ_SANITIZED_COCOA_H_ + +// QuickDraw in ApplicationServices has the following conflicts with +// the basic X server headers. Use QD_ to use the QuickDraw +// definition of any of these symbols, or the normal name for the +// X11 definition. +#define Cursor QD_Cursor +#define WindowPtr QD_WindowPtr +#define Picture QD_Picture +#define BOOL OSX_BOOL +#define EventType HIT_EventType + +#include + +#undef Cursor +#undef WindowPtr +#undef Picture +#undef BOOL +#undef EventType + +#endif /* _XQ_SANITIZED_COCOA_H_ */ diff --git a/xorg-server/hw/xquartz/threadSafety.c b/xorg-server/hw/xquartz/threadSafety.c new file mode 100644 index 000000000..85f85bd0a --- /dev/null +++ b/xorg-server/hw/xquartz/threadSafety.c @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2008 Apple, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the sale, + * use or other dealings in this Software without prior written authorization. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include "threadSafety.h" +#include "os.h" + +pthread_t APPKIT_THREAD_ID; +pthread_t SERVER_THREAD_ID; + +#include + +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 +#include + +void spewCallStack(void) { + void* callstack[128]; + int i, frames = backtrace(callstack, 128); + char** strs = backtrace_symbols(callstack, frames); + + for (i = 0; i < frames; ++i) { + ErrorF("%s\n", strs[i]); + } + + free(strs); +} +#else +void spewCallStack(void) { + return; +} +#endif + +void _threadSafetyAssert(pthread_t tid, const char *file, const char *fun, int line) { + if(pthread_equal(pthread_self(), tid)) + return; + + /* NOOOO! */ + ErrorF("Thread Assertion Failed: self=%s, expected=%s\n%s:%s:%d\n", + threadSafetyID(pthread_self()), threadSafetyID(tid), + file, fun, line); + spewCallStack(); +} + +const char *threadSafetyID(pthread_t tid) { + if(pthread_equal(tid, APPKIT_THREAD_ID)) { + return "Appkit Thread"; + } else if(pthread_equal(tid, SERVER_THREAD_ID)) { + return "Xserver Thread"; + } else { + return "Unknown Thread"; + } +} diff --git a/xorg-server/hw/xquartz/threadSafety.h b/xorg-server/hw/xquartz/threadSafety.h new file mode 100644 index 000000000..7b009103a --- /dev/null +++ b/xorg-server/hw/xquartz/threadSafety.h @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2008 Apple, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the sale, + * use or other dealings in this Software without prior written authorization. + */ + +#ifndef _XQ_THREAD_SAFETY_H_ +#define _XQ_THREAD_SAFETY_H_ + +#define DEBUG_THREADS 1 + +#include + +extern pthread_t APPKIT_THREAD_ID; +extern pthread_t SERVER_THREAD_ID; + +/* Dump the call stack */ +void spewCallStack(void); + +/* Print message to ErrorF if we're in the wrong thread */ +void _threadSafetyAssert(pthread_t tid, const char *file, const char *fun, int line); + +/* Get a string that identifies our thread nicely */ +const char *threadSafetyID(pthread_t tid); + +#define threadSafetyAssert(tid) _threadSafetyAssert(tid, __FILE__, __FUNCTION__, __LINE__) + +#ifdef DEBUG_THREADS +#define TA_APPKIT() threadSafetyAssert(APPKIT_THREAD_ID) +#define TA_SERVER() threadSafetyAssert(SERVER_THREAD_ID) +#else +#define TA_SERVER() +#define TA_APPKIT() +#endif + +#endif _XQ_THREAD_SAFETY_H_ diff --git a/xorg-server/hw/xquartz/xpr/Makefile.am b/xorg-server/hw/xquartz/xpr/Makefile.am index ae1b19297..e74580f73 100644 --- a/xorg-server/hw/xquartz/xpr/Makefile.am +++ b/xorg-server/hw/xquartz/xpr/Makefile.am @@ -1,72 +1,23 @@ -bin_PROGRAMS = Xquartz +noinst_LTLIBRARIES = libXquartzXpr.la AM_CFLAGS = $(XSERVER_CFLAGS) $(DIX_CFLAGS) AM_CPPFLAGS = \ -I$(srcdir) -I$(srcdir)/.. \ -I$(top_srcdir)/miext \ - -I$(top_srcdir)/miext/rootless \ - -I$(top_srcdir)/miext/rootless/safeAlpha + -I$(top_srcdir)/miext/rootless -Xquartz_SOURCES = \ +libXquartzXpr_la_SOURCES = \ appledri.c \ dri.c \ xprAppleWM.c \ xprCursor.c \ + xprEvent.c \ xprFrame.c \ xprScreen.c \ x-hash.c \ x-hook.c \ x-list.c -Xquartz_LDADD = \ - $(top_builddir)/hw/xquartz/libXquartz.la \ - $(top_builddir)/dix/dixfonts.lo \ - $(top_builddir)/config/libconfig.a \ - $(top_builddir)/dix/libdix.la \ - $(top_builddir)/os/libos.la \ - $(top_builddir)/dix/libxpstubs.la \ - $(top_builddir)/miext/shadow/libshadow.la \ - $(top_builddir)/fb/libfb.la \ - $(top_builddir)/mi/libmi.la \ - $(top_builddir)/composite/libcomposite.la \ - $(top_builddir)/damageext/libdamageext.la \ - $(top_builddir)/miext/damage/libdamage.la \ - $(top_builddir)/xfixes/libxfixes.la \ - $(top_builddir)/miext/cw/libcw.la \ - $(top_builddir)/Xext/libXext.la \ - $(top_builddir)/xkb/libxkb.la \ - $(top_builddir)/xkb/libxkbstubs.la \ - $(top_builddir)/Xi/libXi.la \ - $(top_builddir)/dbe/libdbe.la \ - $(top_builddir)/record/librecord.la \ - $(top_builddir)/XTrap/libxtrap.la \ - $(top_builddir)/miext/rootless/librootless.la \ - $(top_builddir)/miext/rootless/safeAlpha/libsafeAlpha.la \ - $(top_builddir)/miext/rootless/accel/librlAccel.la \ - $(DARWIN_LIBS) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) -lXplugin - -Xquartz_LDFLAGS = \ - -XCClinker -Objc \ - -Wl,-u,_miDCInitialize \ - -Wl,-framework,Carbon \ - -L/System/Library/Frameworks/OpenGL.framework/Libraries -lGL \ - -Wl,-framework,OpenGL \ - -Wl,-framework,Cocoa \ - -Wl,-framework,CoreAudio \ - -Wl,-framework,IOKit - -appmandir = $(APP_MAN_DIR) -appman_PRE = Xquartz.man.pre -appman_PROCESSED = $(appman_PRE:man.pre=man) -appman_DATA = $(appman_PRE:man.pre=@APP_MAN_SUFFIX@) - -CLEANFILES = $(appman_PROCESSED) $(appman_DATA) - -include $(top_srcdir)/cpprules.in - -.man.$(APP_MAN_SUFFIX): - cp $< $@ - EXTRA_DIST = \ dri.h \ dristruct.h \ @@ -75,4 +26,5 @@ EXTRA_DIST = \ x-hash.h \ x-hook.h \ x-list.h \ - xpr.h + xpr.h \ + xprEvent.h diff --git a/xorg-server/hw/xquartz/xpr/Makefile.in b/xorg-server/hw/xquartz/xpr/Makefile.in index 6f3dcb75c..11d36bb49 100644 --- a/xorg-server/hw/xquartz/xpr/Makefile.in +++ b/xorg-server/hw/xquartz/xpr/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -14,11 +14,6 @@ @SET_MAKE@ -# -*- Makefile -*- -# Rules for generating files using the C pre-processor -# (Replaces CppFileTarget from Imake) - - VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -37,10 +32,8 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -bin_PROGRAMS = Xquartz$(EXEEXT) -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(top_srcdir)/cpprules.in subdir = hw/xquartz/xpr +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac @@ -50,68 +43,28 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-server.h \ $(top_builddir)/include/dix-config.h \ - $(top_builddir)/include/xgl-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 CONFIG_CLEAN_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)" -binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) -PROGRAMS = $(bin_PROGRAMS) -am_Xquartz_OBJECTS = appledri.$(OBJEXT) dri.$(OBJEXT) \ - xprAppleWM.$(OBJEXT) xprCursor.$(OBJEXT) xprFrame.$(OBJEXT) \ - xprScreen.$(OBJEXT) x-hash.$(OBJEXT) x-hook.$(OBJEXT) \ - x-list.$(OBJEXT) -Xquartz_OBJECTS = $(am_Xquartz_OBJECTS) -am__DEPENDENCIES_1 = -Xquartz_DEPENDENCIES = $(top_builddir)/hw/xquartz/libXquartz.la \ - $(top_builddir)/dix/dixfonts.lo \ - $(top_builddir)/config/libconfig.a \ - $(top_builddir)/dix/libdix.la $(top_builddir)/os/libos.la \ - $(top_builddir)/dix/libxpstubs.la \ - $(top_builddir)/miext/shadow/libshadow.la \ - $(top_builddir)/fb/libfb.la $(top_builddir)/mi/libmi.la \ - $(top_builddir)/composite/libcomposite.la \ - $(top_builddir)/damageext/libdamageext.la \ - $(top_builddir)/miext/damage/libdamage.la \ - $(top_builddir)/xfixes/libxfixes.la \ - $(top_builddir)/miext/cw/libcw.la \ - $(top_builddir)/Xext/libXext.la $(top_builddir)/xkb/libxkb.la \ - $(top_builddir)/xkb/libxkbstubs.la $(top_builddir)/Xi/libXi.la \ - $(top_builddir)/dbe/libdbe.la \ - $(top_builddir)/record/librecord.la \ - $(top_builddir)/XTrap/libxtrap.la \ - $(top_builddir)/miext/rootless/librootless.la \ - $(top_builddir)/miext/rootless/safeAlpha/libsafeAlpha.la \ - $(top_builddir)/miext/rootless/accel/librlAccel.la \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) -Xquartz_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(Xquartz_LDFLAGS) \ - $(LDFLAGS) -o $@ +LTLIBRARIES = $(noinst_LTLIBRARIES) +libXquartzXpr_la_LIBADD = +am_libXquartzXpr_la_OBJECTS = appledri.lo dri.lo xprAppleWM.lo \ + xprCursor.lo xprEvent.lo xprFrame.lo xprScreen.lo x-hash.lo \ + x-hook.lo x-list.lo +libXquartzXpr_la_OBJECTS = $(am_libXquartzXpr_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = $(Xquartz_SOURCES) -DIST_SOURCES = $(Xquartz_SOURCES) -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -appmanDATA_INSTALL = $(INSTALL_DATA) -DATA = $(appman_DATA) +SOURCES = $(libXquartzXpr_la_SOURCES) +DIST_SOURCES = $(libXquartzXpr_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -120,8 +73,9 @@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ -APPDEFAULTDIR = @APPDEFAULTDIR@ APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ +APPLE_APPLICATION_ID = @APPLE_APPLICATION_ID@ +APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ APP_MAN_DIR = @APP_MAN_DIR@ APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ AR = @AR@ @@ -142,10 +96,6 @@ CFLAGS = @CFLAGS@ COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DARWIN_LIBS = @DARWIN_LIBS@ DBUS_CFLAGS = @DBUS_CFLAGS@ @@ -167,6 +117,7 @@ DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@ DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@ DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ +DOLT_BASH = @DOLT_BASH@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ @@ -176,18 +127,15 @@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ -ECHO = @ECHO@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ -FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ -FREETYPE_LIBS = @FREETYPE_LIBS@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ GL_CFLAGS = @GL_CFLAGS@ @@ -206,7 +154,7 @@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ -LAUNCHD = @LAUNCHD@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ LEX = @LEX@ @@ -220,7 +168,10 @@ LIBTOOL = @LIBTOOL@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LINUXDOC = @LINUXDOC@ +LIPO = @LIPO@ LN_S = @LN_S@ +LTCOMPILE = @LTCOMPILE@ +LTCXXCOMPILE = @LTCXXCOMPILE@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ @@ -232,8 +183,7 @@ MESA_SOURCE = @MESA_SOURCE@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ -MKFONTDIR = @MKFONTDIR@ -MKFONTSCALE = @MKFONTSCALE@ +NM = @NM@ NMEDIT = @NMEDIT@ OBJC = @OBJC@ OBJCCLD = @OBJCCLD@ @@ -242,8 +192,8 @@ OBJCFLAGS = @OBJCFLAGS@ OBJCLINK = @OBJCLINK@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -261,7 +211,7 @@ PS2PDF = @PS2PDF@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ -SED = sed +SED = @SED@ SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -276,7 +226,6 @@ VENDOR_NAME = @VENDOR_NAME@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VENDOR_RELEASE = @VENDOR_RELEASE@ VERSION = @VERSION@ -X11APP_ARCHS = @X11APP_ARCHS@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ @@ -286,27 +235,12 @@ XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@ XDMX_CFLAGS = @XDMX_CFLAGS@ XDMX_LIBS = @XDMX_LIBS@ XDMX_SYS_LIBS = @XDMX_SYS_LIBS@ -XEGLMODULES_CFLAGS = @XEGLMODULES_CFLAGS@ -XEGL_LIBS = @XEGL_LIBS@ -XEGL_SYS_LIBS = @XEGL_SYS_LIBS@ XEPHYR_CFLAGS = @XEPHYR_CFLAGS@ -XEPHYR_DRI_LIBS = @XEPHYR_DRI_LIBS@ XEPHYR_INCS = @XEPHYR_INCS@ XEPHYR_LIBS = @XEPHYR_LIBS@ XF86CONFIGFILE = @XF86CONFIGFILE@ -XF86MISC_CFLAGS = @XF86MISC_CFLAGS@ -XF86MISC_LIBS = @XF86MISC_LIBS@ XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@ XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@ -XGLMODULES_CFLAGS = @XGLMODULES_CFLAGS@ -XGLMODULES_LIBS = @XGLMODULES_LIBS@ -XGLXMODULES_CFLAGS = @XGLXMODULES_CFLAGS@ -XGLXMODULES_LIBS = @XGLXMODULES_LIBS@ -XGLX_LIBS = @XGLX_LIBS@ -XGLX_SYS_LIBS = @XGLX_SYS_LIBS@ -XGL_LIBS = @XGL_LIBS@ -XGL_MODULE_PATH = @XGL_MODULE_PATH@ -XGL_SYS_LIBS = @XGL_SYS_LIBS@ XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@ XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@ XKB_COMPILED_DIR = @XKB_COMPILED_DIR@ @@ -317,10 +251,6 @@ XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ -XORGCFG_DEP_CFLAGS = @XORGCFG_DEP_CFLAGS@ -XORGCFG_DEP_LIBS = @XORGCFG_DEP_LIBS@ -XORGCONFIG_DEP_CFLAGS = @XORGCONFIG_DEP_CFLAGS@ -XORGCONFIG_DEP_LIBS = @XORGCONFIG_DEP_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ @@ -329,13 +259,8 @@ XORG_MODULES_LIBS = @XORG_MODULES_LIBS@ XORG_OS = @XORG_OS@ XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ XORG_SYS_LIBS = @XORG_SYS_LIBS@ -XPRINTMODULES_CFLAGS = @XPRINTMODULES_CFLAGS@ -XPRINTMODULES_LIBS = @XPRINTMODULES_LIBS@ -XPRINTPROTO_CFLAGS = @XPRINTPROTO_CFLAGS@ -XPRINTPROTO_LIBS = @XPRINTPROTO_LIBS@ -XPRINT_CFLAGS = @XPRINT_CFLAGS@ -XPRINT_LIBS = @XPRINT_LIBS@ -XPRINT_SYS_LIBS = @XPRINT_SYS_LIBS@ +XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ +XPBPROXY_LIBS = @XPBPROXY_LIBS@ XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ XSDL_INCS = @XSDL_INCS@ @@ -368,8 +293,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -389,7 +313,6 @@ driverdir = @driverdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ extdir = @extdir@ -ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -399,12 +322,12 @@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -launchagentsdir = @launchagentsdir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ logdir = @logdir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ @@ -422,102 +345,25 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xglmoduledir = @xglmoduledir@ -xpconfigdir = @xpconfigdir@ +noinst_LTLIBRARIES = libXquartzXpr.la AM_CFLAGS = $(XSERVER_CFLAGS) $(DIX_CFLAGS) AM_CPPFLAGS = \ -I$(srcdir) -I$(srcdir)/.. \ -I$(top_srcdir)/miext \ - -I$(top_srcdir)/miext/rootless \ - -I$(top_srcdir)/miext/rootless/safeAlpha + -I$(top_srcdir)/miext/rootless -Xquartz_SOURCES = \ +libXquartzXpr_la_SOURCES = \ appledri.c \ dri.c \ xprAppleWM.c \ xprCursor.c \ + xprEvent.c \ xprFrame.c \ xprScreen.c \ x-hash.c \ x-hook.c \ x-list.c -Xquartz_LDADD = \ - $(top_builddir)/hw/xquartz/libXquartz.la \ - $(top_builddir)/dix/dixfonts.lo \ - $(top_builddir)/config/libconfig.a \ - $(top_builddir)/dix/libdix.la \ - $(top_builddir)/os/libos.la \ - $(top_builddir)/dix/libxpstubs.la \ - $(top_builddir)/miext/shadow/libshadow.la \ - $(top_builddir)/fb/libfb.la \ - $(top_builddir)/mi/libmi.la \ - $(top_builddir)/composite/libcomposite.la \ - $(top_builddir)/damageext/libdamageext.la \ - $(top_builddir)/miext/damage/libdamage.la \ - $(top_builddir)/xfixes/libxfixes.la \ - $(top_builddir)/miext/cw/libcw.la \ - $(top_builddir)/Xext/libXext.la \ - $(top_builddir)/xkb/libxkb.la \ - $(top_builddir)/xkb/libxkbstubs.la \ - $(top_builddir)/Xi/libXi.la \ - $(top_builddir)/dbe/libdbe.la \ - $(top_builddir)/record/librecord.la \ - $(top_builddir)/XTrap/libxtrap.la \ - $(top_builddir)/miext/rootless/librootless.la \ - $(top_builddir)/miext/rootless/safeAlpha/libsafeAlpha.la \ - $(top_builddir)/miext/rootless/accel/librlAccel.la \ - $(DARWIN_LIBS) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) -lXplugin - -Xquartz_LDFLAGS = \ - -XCClinker -Objc \ - -Wl,-u,_miDCInitialize \ - -Wl,-framework,Carbon \ - -L/System/Library/Frameworks/OpenGL.framework/Libraries -lGL \ - -Wl,-framework,OpenGL \ - -Wl,-framework,Cocoa \ - -Wl,-framework,CoreAudio \ - -Wl,-framework,IOKit - -appmandir = $(APP_MAN_DIR) -appman_PRE = Xquartz.man.pre -appman_PROCESSED = $(appman_PRE:man.pre=man) -appman_DATA = $(appman_PRE:man.pre=@APP_MAN_SUFFIX@) -CLEANFILES = $(appman_PROCESSED) $(appman_DATA) -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 = \ dri.h \ dristruct.h \ @@ -526,18 +372,19 @@ EXTRA_DIST = \ x-hash.h \ x-hook.h \ x-list.h \ - xpr.h + xpr.h \ + xprEvent.h all: all-am .SUFFIXES: -.SUFFIXES: .pre .man .man.pre .$(APP_MAN_SUFFIX) .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/cpprules.in $(am__configure_deps) +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -561,37 +408,17 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - if test -f $$p \ - || test -f $$p1 \ - ; then \ - f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ - else :; fi; \ - done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ - rm -f "$(DESTDIR)$(bindir)/$$f"; \ - done -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ done -Xquartz$(EXEEXT): $(Xquartz_OBJECTS) $(Xquartz_DEPENDENCIES) - @rm -f Xquartz$(EXEEXT) - $(Xquartz_LINK) $(Xquartz_OBJECTS) $(Xquartz_LDADD) $(LIBS) +libXquartzXpr.la: $(libXquartzXpr_la_OBJECTS) $(libXquartzXpr_la_DEPENDENCIES) + $(LINK) $(libXquartzXpr_la_OBJECTS) $(libXquartzXpr_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -599,15 +426,16 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/appledri.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dri.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x-hash.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x-hook.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x-list.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xprAppleWM.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xprCursor.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xprFrame.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xprScreen.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/appledri.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dri.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x-hash.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x-hook.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x-list.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xprAppleWM.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xprCursor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xprEvent.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xprFrame.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xprScreen.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -635,30 +463,13 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs -install-appmanDATA: $(appman_DATA) - @$(NORMAL_INSTALL) - test -z "$(appmandir)" || $(MKDIR_P) "$(DESTDIR)$(appmandir)" - @list='$(appman_DATA)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(appmanDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(appmandir)/$$f'"; \ - $(appmanDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(appmandir)/$$f"; \ - done - -uninstall-appmanDATA: - @$(NORMAL_UNINSTALL) - @list='$(appman_DATA)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(appmandir)/$$f'"; \ - rm -f "$(DESTDIR)$(appmandir)/$$f"; \ - done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS @@ -728,11 +539,8 @@ distdir: $(DISTFILES) done check-am: all-am check: check-am -all-am: Makefile $(PROGRAMS) $(DATA) +all-am: Makefile $(LTLIBRARIES) installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -750,7 +558,6 @@ install-strip: mostlyclean-generic: clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) @@ -760,7 +567,8 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -778,11 +586,11 @@ info: info-am info-am: -install-data-am: install-appmanDATA +install-data-am: install-dvi: install-dvi-am -install-exec-am: install-binPROGRAMS +install-exec-am: install-html: install-html-am @@ -814,34 +622,23 @@ ps: ps-am ps-am: -uninstall-am: uninstall-appmanDATA uninstall-binPROGRAMS +uninstall-am: .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ - 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-appmanDATA install-binPROGRAMS install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man 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 - - -.pre: - $(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) < $< | $(CPP_SED_MAGIC) > $@ - -.man.pre.man: - $(RAWCPP) $(RAWCPPFLAGS) $(MANDEFS) $(EXTRAMANDEFS) < $< | $(CPP_SED_MAGIC) > $@ - -.man.$(APP_MAN_SUFFIX): - cp $< $@ +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + 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 + # 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. .NOEXPORT: diff --git a/xorg-server/hw/xquartz/xpr/appledri.c b/xorg-server/hw/xquartz/xpr/appledri.c index b4a4725e2..3667c0dea 100644 --- a/xorg-server/hw/xquartz/xpr/appledri.c +++ b/xorg-server/hw/xquartz/xpr/appledri.c @@ -56,6 +56,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "dri.h" #include "dristruct.h" #include "xpr.h" +#include "x-hash.h" static int DRIErrorBase = 0; @@ -190,7 +191,7 @@ static void surface_notify( ) { DRISurfaceNotifyArg *arg = _arg; - int client_index = (int) data; + int client_index = (int) x_cvt_vptr_to_uint(data); ClientPtr client; xAppleDRINotifyEvent se; @@ -236,7 +237,8 @@ ProcAppleDRICreateSurface( if (!DRICreateSurface( screenInfo.screens[stuff->screen], (Drawable)stuff->drawable, pDrawable, stuff->client_id, &sid, key, - surface_notify, (void *) client->index)) { + surface_notify, + x_cvt_uint_to_vptr(client->index))) { return BadValue; } diff --git a/xorg-server/hw/xquartz/xpr/dri.c b/xorg-server/hw/xquartz/xpr/dri.c index 3aacb192d..50b478b9c 100644 --- a/xorg-server/hw/xquartz/xpr/dri.c +++ b/xorg-server/hw/xquartz/xpr/dri.c @@ -71,9 +71,12 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include -static DevPrivateKey DRIScreenPrivKey = &DRIScreenPrivKey; -static DevPrivateKey DRIWindowPrivKey = &DRIWindowPrivKey; -static DevPrivateKey DRIPixmapPrivKey = &DRIPixmapPrivKey; +static int DRIScreenPrivKeyIndex; +static DevPrivateKey DRIScreenPrivKey = &DRIScreenPrivKeyIndex; +static int DRIWindowPrivKeyIndex; +static DevPrivateKey DRIWindowPrivKey = &DRIWindowPrivKeyIndex; +static int DRIPixmapPrivKeyIndex; +static DevPrivateKey DRIPixmapPrivKey = &DRIPixmapPrivKeyIndex; static RESTYPE DRIDrawablePrivResType; @@ -343,6 +346,121 @@ DRIUpdateSurface(DRIDrawablePrivPtr pDRIDrawablePriv, DrawablePtr pDraw) xp_configure_surface(pDRIDrawablePriv->sid, flags, &wc); } +/* Return NULL if an error occurs. */ +static DRIDrawablePrivPtr +CreateSurfaceForWindow(ScreenPtr pScreen, WindowPtr pWin, xp_window_id *widPtr) { + DRIDrawablePrivPtr pDRIDrawablePriv; + xp_window_id wid = 0; + + *widPtr = 0; + + pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); + + if (pDRIDrawablePriv == NULL) { + xp_error err; + xp_window_changes wc; + + /* allocate a DRI Window Private record */ + if (!(pDRIDrawablePriv = xalloc(sizeof(*pDRIDrawablePriv)))) { + return NULL; + } + + pDRIDrawablePriv->pDraw = (DrawablePtr)pWin; + pDRIDrawablePriv->pScreen = pScreen; + pDRIDrawablePriv->refCount = 0; + pDRIDrawablePriv->drawableIndex = -1; + pDRIDrawablePriv->notifiers = NULL; + + /* find the physical window */ + wid = x_cvt_vptr_to_uint(RootlessFrameForWindow(pWin, TRUE)); + + if (wid == 0) { + xfree(pDRIDrawablePriv); + return NULL; + } + + /* allocate the physical surface */ + err = xp_create_surface(wid, &pDRIDrawablePriv->sid); + + if (err != Success) { + xfree(pDRIDrawablePriv); + return NULL; + } + + /* Make it visible */ + wc.stack_mode = XP_MAPPED_ABOVE; + wc.sibling = 0; + err = xp_configure_surface(pDRIDrawablePriv->sid, XP_STACKING, &wc); + + if (err != Success) { + xp_destroy_surface(pDRIDrawablePriv->sid); + xfree(pDRIDrawablePriv); + return NULL; + } + + /* save private off of preallocated index */ + dixSetPrivate(&pWin->devPrivates, DRIWindowPrivKey, + pDRIDrawablePriv); + } + + *widPtr = wid; + + return pDRIDrawablePriv; +} + +/* Return FALSE if an error occurs. */ +static DRIDrawablePrivPtr +CreateSurfaceForPixmap(ScreenPtr pScreen, PixmapPtr pPix) { + DRIDrawablePrivPtr pDRIDrawablePriv; + + pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_PIXMAP(pPix); + + if (pDRIDrawablePriv == NULL) { + xp_error err; + xp_window_changes wc; + + /* allocate a DRI Window Private record */ + if (!(pDRIDrawablePriv = xcalloc(1, sizeof(*pDRIDrawablePriv)))) { + return NULL; + } + + pDRIDrawablePriv->pDraw = (DrawablePtr)pPix; + pDRIDrawablePriv->pScreen = pScreen; + pDRIDrawablePriv->refCount = 0; + pDRIDrawablePriv->drawableIndex = -1; + pDRIDrawablePriv->notifiers = NULL; + + /* Passing a null window id to Xplugin in 10.3+ asks for + an accelerated offscreen surface. */ + + err = xp_create_surface(0, &pDRIDrawablePriv->sid); + if (err != Success) { + xfree(pDRIDrawablePriv); + return NULL; + } + + wc.x = 0; + wc.y = 0; + wc.width = pPix->drawable.width; + wc.height = pPix->drawable.height; + + err = xp_configure_surface(pDRIDrawablePriv->sid, XP_BOUNDS, &wc); + + if(err != Success) { + xp_destroy_surface(pDRIDrawablePriv->sid); + xfree(pDRIDrawablePriv); + return NULL; + } + + /* save private off of preallocated index */ + dixSetPrivate(&pPix->devPrivates, DRIPixmapPrivKey, + pDRIDrawablePriv); + } + + return pDRIDrawablePriv; +} + + Bool DRICreateSurface(ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable, xp_client_id client_id, @@ -350,107 +468,39 @@ DRICreateSurface(ScreenPtr pScreen, Drawable id, void (*notify) (void *arg, void *data), void *notify_data) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIDrawablePrivPtr pDRIDrawablePriv; xp_window_id wid = 0; + DRIDrawablePrivPtr pDRIDrawablePriv; if (pDrawable->type == DRAWABLE_WINDOW) { - WindowPtr pWin = (WindowPtr)pDrawable; - - pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); - if (pDRIDrawablePriv == NULL) { - xp_error err; - xp_window_changes wc; - - /* allocate a DRI Window Private record */ - if (!(pDRIDrawablePriv = xalloc(sizeof(DRIDrawablePrivRec)))) { - return FALSE; - } - - pDRIDrawablePriv->pDraw = pDrawable; - pDRIDrawablePriv->pScreen = pScreen; - pDRIDrawablePriv->refCount = 0; - pDRIDrawablePriv->drawableIndex = -1; - pDRIDrawablePriv->notifiers = NULL; - - /* find the physical window */ - wid = (xp_window_id) RootlessFrameForWindow(pWin, TRUE); - if (wid == 0) { - xfree(pDRIDrawablePriv); - return FALSE; - } - - /* allocate the physical surface */ - err = xp_create_surface(wid, &pDRIDrawablePriv->sid); - if (err != Success) { - xfree(pDRIDrawablePriv); - return FALSE; - } - - /* Make it visible */ - wc.stack_mode = XP_MAPPED_ABOVE; - wc.sibling = 0; - err = xp_configure_surface(pDRIDrawablePriv->sid, XP_STACKING, &wc); - if (err != Success) - { - xp_destroy_surface(pDRIDrawablePriv->sid); - xfree(pDRIDrawablePriv); - return FALSE; - } + pDRIDrawablePriv = CreateSurfaceForWindow(pScreen, + (WindowPtr)pDrawable, &wid); - /* save private off of preallocated index */ - dixSetPrivate(&pWin->devPrivates, DRIWindowPrivKey, - pDRIDrawablePriv); - } + if(NULL == pDRIDrawablePriv) + return FALSE; /*error*/ } - #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 else if (pDrawable->type == DRAWABLE_PIXMAP) { - PixmapPtr pPix = (PixmapPtr)pDrawable; - - pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_PIXMAP(pPix); - if (pDRIDrawablePriv == NULL) { - xp_error err; + pDRIDrawablePriv = CreateSurfaceForPixmap(pScreen, + (PixmapPtr)pDrawable); - /* allocate a DRI Window Private record */ - if (!(pDRIDrawablePriv = xcalloc(1, sizeof(DRIDrawablePrivRec)))) { - return FALSE; - } - - pDRIDrawablePriv->pDraw = pDrawable; - pDRIDrawablePriv->pScreen = pScreen; - pDRIDrawablePriv->refCount = 0; - pDRIDrawablePriv->drawableIndex = -1; - pDRIDrawablePriv->notifiers = NULL; - - /* Passing a null window id to Xplugin in 10.3+ asks for - an accelerated offscreen surface. */ - - err = xp_create_surface(0, &pDRIDrawablePriv->sid); - if (err != Success) { - xfree(pDRIDrawablePriv); - return FALSE; - } - - /* save private off of preallocated index */ - dixSetPrivate(&pPix->devPrivates, DRIPixmapPrivKey, - pDRIDrawablePriv); - } + if(NULL == pDRIDrawablePriv) + return FALSE; /*error*/ } #endif - else { /* for GLX 1.3, a PBuffer */ /* NOT_DONE */ return FALSE; } + + /* Finish initialization of new surfaces */ if (pDRIDrawablePriv->refCount == 0) { unsigned int key[2] = {0}; xp_error err; /* try to give the client access to the surface */ - if (client_id != 0 && wid != 0) - { + if (client_id != 0 && wid != 0) { err = xp_export_surface(wid, pDRIDrawablePriv->sid, client_id, key); if (err != Success) { @@ -469,7 +519,7 @@ DRICreateSurface(ScreenPtr pScreen, Drawable id, if (surface_hash == NULL) surface_hash = x_hash_table_new(NULL, NULL, NULL, NULL); x_hash_table_insert(surface_hash, - (void *) pDRIDrawablePriv->sid, pDRIDrawablePriv); + x_cvt_uint_to_vptr(pDRIDrawablePriv->sid), pDRIDrawablePriv); /* track this in case this window is destroyed */ AddResource(id, DRIDrawablePrivResType, (pointer)pDrawable); @@ -551,7 +601,7 @@ DRIDrawablePrivDelete(pointer pResource, XID id) if (pDRIDrawablePriv->sid != 0) { xp_destroy_surface(pDRIDrawablePriv->sid); - x_hash_table_remove(surface_hash, (void *) pDRIDrawablePriv->sid); + x_hash_table_remove(surface_hash, x_cvt_uint_to_vptr(pDRIDrawablePriv->sid)); } if (pDRIDrawablePriv->notifiers != NULL) @@ -713,7 +763,7 @@ DRISurfaceNotify(xp_surface_id id, int kind) if (surface_hash != NULL) { pDRIDrawablePriv = x_hash_table_lookup(surface_hash, - (void *) id, NULL); + x_cvt_uint_to_vptr(id), NULL); } if (pDRIDrawablePriv == NULL) @@ -722,7 +772,7 @@ DRISurfaceNotify(xp_surface_id id, int kind) if (kind == AppleDRISurfaceNotifyDestroyed) { pDRIDrawablePriv->sid = 0; - x_hash_table_remove(surface_hash, (void *) id); + x_hash_table_remove(surface_hash, x_cvt_uint_to_vptr(id)); } x_hook_run(pDRIDrawablePriv->notifiers, &arg); diff --git a/xorg-server/hw/xquartz/xpr/dri.h b/xorg-server/hw/xquartz/xpr/dri.h index cf2638a9f..8bb2e9e80 100644 --- a/xorg-server/hw/xquartz/xpr/dri.h +++ b/xorg-server/hw/xquartz/xpr/dri.h @@ -41,7 +41,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "scrnintstr.h" #define _APPLEDRI_SERVER_ #include "appledri.h" -#include "Xplugin.h" +#include typedef void (*ClipNotifyPtr)( WindowPtr, int, int ); diff --git a/xorg-server/hw/xquartz/xpr/x-hash.c b/xorg-server/hw/xquartz/xpr/x-hash.c index 55d28bacd..7c6a67bd1 100644 --- a/xorg-server/hw/xquartz/xpr/x-hash.c +++ b/xorg-server/hw/xquartz/xpr/x-hash.c @@ -80,13 +80,13 @@ hash_table_destroy_item (x_hash_table *h, void *k, void *v) (*h->destroy_value) (v); } -static inline unsigned int +static inline size_t hash_table_hash_key (x_hash_table *h, void *k) { if (h->hash_key != 0) return (*h->hash_key) (k); else - return (unsigned int) k; + return (size_t) k; } static inline int @@ -104,7 +104,7 @@ hash_table_split (x_hash_table *h) x_list **new, **old; x_list *node, *item, *next; int new_size, old_size; - unsigned int b; + size_t b; int i; if (h->bucket_index == N_BUCKET_SIZES - 1) @@ -207,7 +207,7 @@ X_PFX (hash_table_size) (x_hash_table *h) static void hash_table_modify (x_hash_table *h, void *k, void *v, int replace) { - unsigned int hash_value; + size_t hash_value; x_list *node, *item; assert (h != NULL); @@ -266,7 +266,7 @@ X_PFX (hash_table_replace) (x_hash_table *h, void *k, void *v) X_EXTERN void X_PFX (hash_table_remove) (x_hash_table *h, void *k) { - unsigned int hash_value; + size_t hash_value; x_list **ptr, *item; assert (h != NULL); @@ -294,7 +294,7 @@ X_PFX (hash_table_remove) (x_hash_table *h, void *k) X_EXTERN void * X_PFX (hash_table_lookup) (x_hash_table *h, void *k, void **k_ret) { - unsigned int hash_value; + size_t hash_value; x_list *node, *item; assert (h != NULL); diff --git a/xorg-server/hw/xquartz/xpr/x-hash.h b/xorg-server/hw/xquartz/xpr/x-hash.h index 3456dbedf..78bc7b317 100644 --- a/xorg-server/hw/xquartz/xpr/x-hash.h +++ b/xorg-server/hw/xquartz/xpr/x-hash.h @@ -30,6 +30,9 @@ #ifndef X_HASH_H #define X_HASH_H 1 +#include +#include + typedef struct x_hash_table_struct x_hash_table; typedef int (x_compare_fun) (const void *a, const void *b); @@ -57,4 +60,32 @@ X_EXTERN void X_PFX (hash_table_foreach) (x_hash_table *h, x_hash_foreach_fun *fun, void *data); +/* Conversion between unsigned int (e.g. xp_resource_id) and void pointer */ + +/* Forward declarations */ +static __inline__ void * +X_PFX (cvt_uint_to_vptr) (unsigned int val) __attribute__((always_inline)); +static __inline__ unsigned int +X_PFX (cvt_vptr_to_uint) (void * val) __attribute__((always_inline)); + +/* Implementations */ +static __inline__ void * +X_PFX (cvt_uint_to_vptr) (unsigned int val) +{ + return (void*)((size_t)(val)); +} + +static __inline__ unsigned int +X_PFX (cvt_vptr_to_uint) (void * val) +{ + size_t sv = (size_t)val; + unsigned int uv = (unsigned int)sv; + + /* If this assert fails, chances are val actually is a pointer, + or there's been memory corruption */ + assert(sv == uv); + + return uv; +} + #endif /* X_HASH_H */ diff --git a/xorg-server/hw/xquartz/xpr/xpr.h b/xorg-server/hw/xquartz/xpr/xpr.h index b8c69df0d..ab79a42cd 100644 --- a/xorg-server/hw/xquartz/xpr/xpr.h +++ b/xorg-server/hw/xquartz/xpr/xpr.h @@ -29,7 +29,9 @@ #ifndef XPR_H #define XPR_H +#include "windowstr.h" #include "screenint.h" +#include Bool QuartzModeBundleInit(void); @@ -37,6 +39,7 @@ void AppleDRIExtensionInit(void); void xprAppleWMInit(void); Bool xprInit(ScreenPtr pScreen); Bool xprIsX11Window(void *nsWindow, int windowNumber); +WindowPtr xprGetXWindow(xp_window_id wid); void xprHideWindows(Bool hide); diff --git a/xorg-server/hw/xquartz/xpr/xprAppleWM.c b/xorg-server/hw/xquartz/xpr/xprAppleWM.c index bd82df03c..fae9a0422 100644 --- a/xorg-server/hw/xquartz/xpr/xprAppleWM.c +++ b/xorg-server/hw/xquartz/xpr/xprAppleWM.c @@ -32,10 +32,26 @@ #endif #include "xpr.h" + +#define _APPLEWM_SERVER_ +#include + #include "applewmExt.h" #include "rootless.h" -#include "Xplugin.h" +#include #include +#include "quartz.h" +#include "x-hash.h" + +/* This lookup table came straight from the Tiger X11 source. I tried to figure + * it out based on CGWindowLevel.h, but I dunno... -JH + */ +static const int normal_window_levels[AppleWMNumWindowLevels+1] = { +0, 3, 4, 5, INT_MIN + 30, INT_MIN + 29, +}; +static const int rooted_window_levels[AppleWMNumWindowLevels+1] = { +202, 203, 204, 205, 201, 200 +}; static int xprSetWindowLevel( WindowPtr pWin, @@ -44,13 +60,18 @@ static int xprSetWindowLevel( xp_window_id wid; xp_window_changes wc; - wid = (xp_window_id) RootlessFrameForWindow (pWin, TRUE); + wid = x_cvt_vptr_to_uint(RootlessFrameForWindow (pWin, TRUE)); if (wid == 0) return BadWindow; RootlessStopDrawing (pWin, FALSE); - wc.window_level = level; + //if (WINREC(WindowTable[pWin->drawable.pScreen->myNum]) == NULL) + if (quartzHasRoot) + wc.window_level = normal_window_levels[level]; + else + wc.window_level = rooted_window_levels[level]; + if (xp_configure_window (wid, XP_WINDOW_LEVEL, &wc) != Success) { return BadValue; } @@ -70,7 +91,7 @@ static int xprFrameDraw( { xp_window_id wid; - wid = (xp_window_id) RootlessFrameForWindow (pWin, FALSE); + wid = x_cvt_vptr_to_uint(RootlessFrameForWindow (pWin, FALSE)); if (wid == 0) return BadWindow; diff --git a/xorg-server/hw/xquartz/xpr/xprCursor.c b/xorg-server/hw/xquartz/xpr/xprCursor.c index e084ef90e..4345beea4 100644 --- a/xorg-server/hw/xquartz/xpr/xprCursor.c +++ b/xorg-server/hw/xquartz/xpr/xprCursor.c @@ -29,6 +29,8 @@ * use or other dealings in this Software without prior written authorization. */ +#include "sanitizedCarbon.h" + #ifdef HAVE_DIX_CONFIG_H #include #endif @@ -37,7 +39,7 @@ #include "xpr.h" #include "darwin.h" #include "darwinEvents.h" -#include "Xplugin.h" +#include #include "mi.h" #include "scrnintstr.h" @@ -47,6 +49,7 @@ #include "globals.h" #include "servermd.h" #include "dixevents.h" +#include "x-hash.h" typedef struct { int cursorVisible; @@ -54,7 +57,8 @@ typedef struct { miPointerSpriteFuncPtr spriteFuncs; } QuartzCursorScreenRec, *QuartzCursorScreenPtr; -static DevPrivateKey darwinCursorScreenKey = &darwinCursorScreenKey; +static int darwinCursorScreenKeyIndex; +static DevPrivateKey darwinCursorScreenKey = &darwinCursorScreenKeyIndex; #define CURSOR_PRIV(pScreen) ((QuartzCursorScreenPtr) \ dixLookupPrivate(&pScreen->devPrivates, darwinCursorScreenKey)) @@ -181,7 +185,7 @@ load_cursor(CursorPtr src, int screen) * Convert the X cursor representation to native format if possible. */ static Bool -QuartzRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) +QuartzRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) { if(pCursor == NULL || pCursor->bits == NULL) return FALSE; @@ -197,7 +201,7 @@ QuartzRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) * Free the storage space associated with a realized cursor. */ static Bool -QuartzUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) +QuartzUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) { return TRUE; } @@ -208,7 +212,7 @@ QuartzUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) * Set the cursor sprite and position. */ static void -QuartzSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y) +QuartzSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, int y) { QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); @@ -235,25 +239,15 @@ QuartzSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y) } } - /* * QuartzMoveCursor * Move the cursor. This is a noop for us. */ static void -QuartzMoveCursor(ScreenPtr pScreen, int x, int y) +QuartzMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { } - -static miPointerSpriteFuncRec quartzSpriteFuncsRec = { - QuartzRealizeCursor, - QuartzUnrealizeCursor, - QuartzSetCursor, - QuartzMoveCursor -}; - - /* =========================================================================== @@ -289,18 +283,8 @@ QuartzCrossScreen(ScreenPtr pScreen, Bool entering) * */ static void -QuartzWarpCursor(ScreenPtr pScreen, int x, int y) +QuartzWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { - static Bool neverMoved = TRUE; - - if (neverMoved) - { - /* Don't move the cursor the first time. This is the - jump-to-center initialization, and it's annoying. */ - neverMoved = FALSE; - return; - } - if (quartzServerVisible) { int sx, sy; @@ -311,8 +295,8 @@ QuartzWarpCursor(ScreenPtr pScreen, int x, int y) CGWarpMouseCursorPosition(CGPointMake(sx + x, sy + y)); } - miPointerWarpCursor(pScreen, x, y); - miPointerUpdate(); + miPointerWarpCursor(pDev, pScreen, x, y); + miPointerUpdateSprite(pDev); } @@ -320,8 +304,8 @@ static miPointerScreenFuncRec quartzScreenFuncsRec = { QuartzCursorOffScreen, QuartzCrossScreen, QuartzWarpCursor, - DarwinEQPointerPost, - DarwinEQSwitchScreen + NULL, + NULL }; @@ -383,13 +367,16 @@ QuartzInitCursor(ScreenPtr pScreen) PointPriv = dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey); ScreenPriv->spriteFuncs = PointPriv->spriteFuncs; - PointPriv->spriteFuncs = &quartzSpriteFuncsRec; + PointPriv->spriteFuncs->RealizeCursor = QuartzRealizeCursor; + PointPriv->spriteFuncs->UnrealizeCursor = QuartzUnrealizeCursor; + PointPriv->spriteFuncs->SetCursor = QuartzSetCursor; + PointPriv->spriteFuncs->MoveCursor = QuartzMoveCursor; + ScreenPriv->cursorVisible = TRUE; return TRUE; } - /* * QuartzSuspendXCursor * X server is hiding. Restore the Aqua cursor. @@ -410,13 +397,15 @@ QuartzResumeXCursor(ScreenPtr pScreen, int x, int y) WindowPtr pWin; CursorPtr pCursor; - pWin = GetSpriteWindow(); + /* TODO: Tablet? */ + + pWin = GetSpriteWindow(darwinPointer); if (pWin->drawable.pScreen != pScreen) return; - pCursor = GetSpriteCursor(); + pCursor = GetSpriteCursor(darwinPointer); if (pCursor == NULL) return; - QuartzSetCursor(pScreen, pCursor, x, y); + QuartzSetCursor(darwinPointer, pScreen, pCursor, x, y); } diff --git a/xorg-server/hw/xquartz/xpr/xprEvent.c b/xorg-server/hw/xquartz/xpr/xprEvent.c new file mode 100644 index 000000000..08581c0e3 --- /dev/null +++ b/xorg-server/hw/xquartz/xpr/xprEvent.c @@ -0,0 +1,91 @@ +/* Copyright (c) 2008 Apple Inc. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files + * (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT + * HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above + * copyright holders shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include "xpr.h" + +#define NEED_EVENTS +#include +#include +#include +#include "misc.h" +#include "windowstr.h" +#include "pixmapstr.h" +#include "inputstr.h" +#include "mi.h" +#include "scrnintstr.h" +#include "mipointer.h" + +#include "darwin.h" +#include "quartz.h" +#include "quartzKeyboard.h" +#include "darwinEvents.h" + +#include +#include +#include + +#include "rootlessWindow.h" +#include "xprEvent.h" + +static void xprEventHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev, int nevents) { + int i; + + TA_SERVER(); + + DEBUG_LOG("DarwinEventHandler(%d, %p, %p, %d)\n", screenNum, xe, dev, nevents); + for (i=0; i #include "x-hash.h" #include "x-list.h" #include "applewmExt.h" @@ -43,6 +43,8 @@ #include #include "windowstr.h" +#include "threadSafety.h" + #include #define DEFINE_ATOM_HELPER(func,atom_name) \ @@ -62,18 +64,35 @@ DEFINE_ATOM_HELPER(xa_native_window_id, "_NATIVE_WINDOW_ID") static x_hash_table *window_hash; static pthread_mutex_t window_hash_mutex; -static Bool no_configure_window; +/* Prototypes for static functions */ +static Bool xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen, + int newX, int newY, RegionPtr pShape); +static void xprDestroyFrame(RootlessFrameID wid); +static void xprMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY); +static void xprResizeFrame(RootlessFrameID wid, ScreenPtr pScreen, + int newX, int newY, unsigned int newW, unsigned int newH, + unsigned int gravity); +static void xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid); +static void xprReshapeFrame(RootlessFrameID wid, RegionPtr pShape); +static void xprUnmapFrame(RootlessFrameID wid); +static void xprStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow); +static void xprStopDrawing(RootlessFrameID wid, Bool flush); +static void xprUpdateRegion(RootlessFrameID wid, RegionPtr pDamage); +static void xprDamageRects(RootlessFrameID wid, int nrects, const BoxRec *rects, + int shift_x, int shift_y); +static void xprSwitchWindow(RootlessWindowPtr pFrame, WindowPtr oldWin); +static Bool xprDoReorderWindow(RootlessWindowPtr pFrame); +static void xprCopyWindow(RootlessFrameID wid, int dstNrects, const BoxRec *dstRects, + int dx, int dy); static inline xp_error xprConfigureWindow(xp_window_id id, unsigned int mask, const xp_window_changes *values) { - // ErrorF("xprConfigureWindow()\n"); - if (!no_configure_window) - return xp_configure_window(id, mask, values); - else - return XP_Success; + TA_SERVER(); + + return xp_configure_window(id, mask, values); } @@ -84,7 +103,9 @@ xprSetNativeProperty(RootlessWindowPtr pFrame) unsigned int native_id; long data; - err = xp_get_native_window((xp_window_id) pFrame->wid, &native_id); + TA_SERVER(); + + err = xp_get_native_window(x_cvt_vptr_to_uint(pFrame->wid), &native_id); if (err == Success) { /* FIXME: move this to AppleWM extension */ @@ -108,6 +129,8 @@ xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen, unsigned int mask = 0; xp_error err; + TA_SERVER(); + wc.x = newX; wc.y = newY; wc.width = pFrame->width; @@ -118,11 +141,9 @@ xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen, if (pWin->drawable.depth == 8) { wc.depth = XP_DEPTH_INDEX8; -#if 0 - wc.colormap = xprColormapCallback; + wc.colormap = RootlessColormapCallback; wc.colormap_data = pScreen; mask |= XP_COLORMAP; -#endif } else if (pWin->drawable.depth == 15) wc.depth = XP_DEPTH_RGB555; @@ -169,11 +190,13 @@ xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen, void xprDestroyFrame(RootlessFrameID wid) { + TA_SERVER(); + pthread_mutex_lock(&window_hash_mutex); x_hash_table_remove(window_hash, wid); pthread_mutex_unlock(&window_hash_mutex); - xp_destroy_window((xp_window_id) wid); + xp_destroy_window(x_cvt_vptr_to_uint(wid)); } @@ -183,12 +206,14 @@ xprDestroyFrame(RootlessFrameID wid) void xprMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY) { + TA_SERVER(); + xp_window_changes wc; wc.x = newX; wc.y = newY; // ErrorF("xprMoveFrame(%d, %p, %d, %d)\n", wid, pScreen, newX, newY); - xprConfigureWindow((xp_window_id) wid, XP_ORIGIN, &wc); + xprConfigureWindow(x_cvt_vptr_to_uint(wid), XP_ORIGIN, &wc); } @@ -202,6 +227,8 @@ xprResizeFrame(RootlessFrameID wid, ScreenPtr pScreen, { xp_window_changes wc; + TA_SERVER(); + wc.x = newX; wc.y = newY; wc.width = newW; @@ -211,7 +238,7 @@ xprResizeFrame(RootlessFrameID wid, ScreenPtr pScreen, /* It's unlikely that being async will save us anything here. But it can't hurt. */ - xprConfigureWindow((xp_window_id) wid, XP_BOUNDS, &wc); + xprConfigureWindow(x_cvt_vptr_to_uint(wid), XP_BOUNDS, &wc); } @@ -223,7 +250,9 @@ xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid) { xp_window_changes wc; - /* Stack frame below nextWid it if it exists, or raise + TA_SERVER(); + + /* Stack frame below nextWid it if it exists, or raise frame above everything otherwise. */ if (nextWid == NULL) @@ -234,10 +263,10 @@ xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid) else { wc.stack_mode = XP_MAPPED_BELOW; - wc.sibling = (xp_window_id) nextWid; + wc.sibling = x_cvt_vptr_to_uint(nextWid); } - xprConfigureWindow((xp_window_id) wid, XP_STACKING, &wc); + xprConfigureWindow(x_cvt_vptr_to_uint(wid), XP_STACKING, &wc); } @@ -249,6 +278,8 @@ xprReshapeFrame(RootlessFrameID wid, RegionPtr pShape) { xp_window_changes wc; + TA_SERVER(); + if (pShape != NULL) { wc.shape_nrects = REGION_NUM_RECTS(pShape); @@ -262,7 +293,7 @@ xprReshapeFrame(RootlessFrameID wid, RegionPtr pShape) wc.shape_tx = wc.shape_ty = 0; - xprConfigureWindow((xp_window_id) wid, XP_SHAPE, &wc); + xprConfigureWindow(x_cvt_vptr_to_uint(wid), XP_SHAPE, &wc); } @@ -274,10 +305,12 @@ xprUnmapFrame(RootlessFrameID wid) { xp_window_changes wc; + TA_SERVER(); + wc.stack_mode = XP_UNMAPPED; wc.sibling = 0; - xprConfigureWindow((xp_window_id) wid, XP_STACKING, &wc); + xprConfigureWindow(x_cvt_vptr_to_uint(wid), XP_STACKING, &wc); } @@ -292,9 +325,11 @@ xprStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow) unsigned int rowbytes[2]; xp_error err; - err = xp_lock_window((xp_window_id) wid, NULL, NULL, data, rowbytes, NULL); + TA_SERVER(); + + err = xp_lock_window(x_cvt_vptr_to_uint(wid), NULL, NULL, data, rowbytes, NULL); if (err != Success) - FatalError("Could not lock window %i for drawing.", (int) wid); + FatalError("Could not lock window %i for drawing.", (int)x_cvt_vptr_to_uint(wid)); *pixelData = data[0]; *bytesPerRow = rowbytes[0]; @@ -307,7 +342,9 @@ xprStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow) void xprStopDrawing(RootlessFrameID wid, Bool flush) { - xp_unlock_window((xp_window_id) wid, flush); + TA_SERVER(); + + xp_unlock_window(x_cvt_vptr_to_uint(wid), flush); } @@ -317,7 +354,9 @@ xprStopDrawing(RootlessFrameID wid, Bool flush) void xprUpdateRegion(RootlessFrameID wid, RegionPtr pDamage) { - xp_flush_window((xp_window_id) wid); + TA_SERVER(); + + xp_flush_window(x_cvt_vptr_to_uint(wid)); } @@ -328,7 +367,9 @@ void xprDamageRects(RootlessFrameID wid, int nrects, const BoxRec *rects, int shift_x, int shift_y) { - xp_mark_window((xp_window_id) wid, nrects, rects, shift_x, shift_y); + TA_SERVER(); + + xp_mark_window(x_cvt_vptr_to_uint(wid), nrects, rects, shift_x, shift_y); } @@ -341,6 +382,8 @@ xprSwitchWindow(RootlessWindowPtr pFrame, WindowPtr oldWin) { DeleteProperty(serverClient, oldWin, xa_native_window_id()); + TA_SERVER(); + xprSetNativeProperty(pFrame); } @@ -352,6 +395,8 @@ Bool xprDoReorderWindow(RootlessWindowPtr pFrame) { WindowPtr pWin = pFrame->win; + TA_SERVER(); + return AppleWMDoReorderWindow(pWin); } @@ -364,7 +409,9 @@ void xprCopyWindow(RootlessFrameID wid, int dstNrects, const BoxRec *dstRects, int dx, int dy) { - xp_copy_window((xp_window_id) wid, (xp_window_id) wid, + TA_SERVER(); + + xp_copy_window(x_cvt_vptr_to_uint(wid), x_cvt_vptr_to_uint(wid), dstNrects, dstRects, dx, dy); } @@ -398,13 +445,13 @@ xprInit(ScreenPtr pScreen) { RootlessInit(pScreen, &xprRootlessProcs); + TA_SERVER(); + rootless_CopyBytes_threshold = xp_copy_bytes_threshold; rootless_FillBytes_threshold = xp_fill_bytes_threshold; rootless_CompositePixels_threshold = xp_composite_area_threshold; rootless_CopyWindow_threshold = xp_scroll_area_threshold; - no_configure_window = FALSE; - return TRUE; } @@ -421,7 +468,7 @@ xprGetXWindow(xp_window_id wid) if (window_hash == NULL) return NULL; - winRec = x_hash_table_lookup(window_hash, (void *) wid, NULL); + winRec = x_hash_table_lookup(window_hash, x_cvt_uint_to_vptr(wid), NULL); return winRec != NULL ? winRec->win : NULL; } @@ -452,7 +499,7 @@ xprGetXWindowFromAppKit(int windowNumber) pthread_mutex_unlock(&window_hash_mutex); if (!ret) return NULL; - winRec = x_hash_table_lookup(window_hash, (void *) wid, NULL); + winRec = x_hash_table_lookup(window_hash, x_cvt_uint_to_vptr(wid), NULL); return winRec != NULL ? winRec->win : NULL; } @@ -498,6 +545,8 @@ xprHideWindows(Bool hide) int screen; WindowPtr pRoot, pWin; + TA_SERVER(); + for (screen = 0; screen < screenInfo.numScreens; screen++) { pRoot = WindowTable[screenInfo.screens[screen]->myNum]; RootlessFrameID prevWid = NULL; diff --git a/xorg-server/hw/xquartz/xpr/xprScreen.c b/xorg-server/hw/xquartz/xpr/xprScreen.c index e4e1fda7e..da262f654 100644 --- a/xorg-server/hw/xquartz/xpr/xprScreen.c +++ b/xorg-server/hw/xquartz/xpr/xprScreen.c @@ -27,26 +27,27 @@ * use or other dealings in this Software without prior written authorization. */ +#include "sanitizedCarbon.h" + #ifdef HAVE_DIX_CONFIG_H #include #endif #include "quartzCommon.h" +#include "inputstr.h" #include "quartz.h" #include "xpr.h" +#include "xprEvent.h" #include "pseudoramiX.h" #include "darwin.h" +#include "darwinEvents.h" #include "rootless.h" -#include "safeAlpha/safeAlpha.h" #include "dri.h" #include "globals.h" -#include "Xplugin.h" +#include #include "applewmExt.h" #include "micmap.h" -// From xprFrame.c -WindowPtr xprGetXWindow(xp_window_id wid); - #ifdef DAMAGE # include "damage.h" #endif @@ -64,10 +65,11 @@ static const char *xprOpenGLBundle = "glxCGL.bundle"; */ static void eventHandler(unsigned int type, const void *arg, unsigned int arg_size, void *data) { + switch (type) { case XP_EVENT_DISPLAY_CHANGED: DEBUG_LOG("XP_EVENT_DISPLAY_CHANGED\n"); - QuartzMessageServerThread(kXDarwinDisplayChanged, 0); + DarwinSendDDXEvent(kXquartzDisplayChanged, 0); break; case XP_EVENT_WINDOW_STATE_CHANGED: @@ -75,7 +77,7 @@ static void eventHandler(unsigned int type, const void *arg, const xp_window_state_event *ws_arg = arg; DEBUG_LOG("XP_EVENT_WINDOW_STATE_CHANGED: id=%d, state=%d\n", ws_arg->id, ws_arg->state); - QuartzMessageServerThread(kXDarwinWindowState, 2, + DarwinSendDDXEvent(kXquartzWindowState, 2, ws_arg->id, ws_arg->state); } else { DEBUG_LOG("XP_EVENT_WINDOW_STATE_CHANGED: ignored\n"); @@ -86,8 +88,7 @@ static void eventHandler(unsigned int type, const void *arg, DEBUG_LOG("XP_EVENT_WINDOW_MOVED\n"); if (arg_size == sizeof(xp_window_id)) { xp_window_id id = * (xp_window_id *) arg; - WindowPtr pWin = xprGetXWindow(id); - QuartzMessageServerThread(kXDarwinWindowMoved, 1, pWin); + DarwinSendDDXEvent(kXquartzWindowMoved, 1, id); } break; @@ -106,6 +107,15 @@ static void eventHandler(unsigned int type, const void *arg, DRISurfaceNotify(*(xp_surface_id *) arg, kind); } break; +#ifdef XP_EVENT_SPACE_CHANGED + case XP_EVENT_SPACE_CHANGED: + DEBUG_LOG("XP_EVENT_SPACE_CHANGED\n"); + if(arg_size == sizeof(uint32_t)) { + uint32_t space_id = *(uint32_t *)arg; + DarwinSendDDXEvent(kXquartzSpaceChanged, 1, space_id); + } + break; +#endif default: ErrorF("Unknown XP_EVENT type (%d) in xprScreen:eventHandler\n", type); } @@ -140,14 +150,21 @@ displayScreenBounds(CGDirectDisplayID id) frame = CGDisplayBounds(id); + DEBUG_LOG(" %dx%d @ (%d,%d).\n", + (int)frame.size.width, (int)frame.size.height, + (int)frame.origin.x, (int)frame.origin.y); + /* Remove menubar to help standard X11 window managers. */ - - if (frame.origin.x == 0 && frame.origin.y == 0) - { + if (quartzEnableRootless && + frame.origin.x == 0 && frame.origin.y == 0) { frame.origin.y += aquaMenuBarHeight; frame.size.height -= aquaMenuBarHeight; } + DEBUG_LOG(" %dx%d @ (%d,%d).\n", + (int)frame.size.width, (int)frame.size.height, + (int)frame.origin.x, (int)frame.origin.y); + return frame; } @@ -169,8 +186,7 @@ xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height) CGGetActiveDisplayList(displayCount, displayList, &displayCount); /* Get the union of all screens */ - for (i = 0; i < displayCount; i++) - { + for (i = 0; i < displayCount; i++) { CGDirectDisplayID dpy = displayList[i]; frame = displayScreenBounds(dpy); unionRect = CGRectUnion(unionRect, frame); @@ -182,22 +198,20 @@ xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height) *width = unionRect.size.width; *height = unionRect.size.height; + DEBUG_LOG(" screen union origin: (%d,%d) size: (%d,%d).\n", + *x, *y, *width, *height); + /* Tell PseudoramiX about the real screens. */ for (i = 0; i < displayCount; i++) { CGDirectDisplayID dpy = displayList[i]; frame = displayScreenBounds(dpy); - - /* ErrorF("PseudoramiX screen %d added: %dx%d @ (%d,%d).\n", i, - (int)frame.size.width, (int)frame.size.height, - (int)frame.origin.x, (int)frame.origin.y); */ - frame.origin.x -= unionRect.origin.x; frame.origin.y -= unionRect.origin.y; - /* ErrorF("PseudoramiX screen %d placed at X11 coordinate (%d,%d).\n", - i, (int)frame.origin.x, (int)frame.origin.y); */ + DEBUG_LOG(" placed at X11 coordinate (%d,%d).\n", + (int)frame.origin.x, (int)frame.origin.y); PseudoramiXAddScreen(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height); @@ -215,7 +229,7 @@ xprDisplayInit(void) { CGDisplayCount displayCount; - // ErrorF("Display mode: Rootless Quartz -- Xplugin implementation\n"); + DEBUG_LOG(""); CGGetActiveDisplayList(0, NULL, &displayCount); @@ -233,6 +247,9 @@ xprDisplayInit(void) xp_select_events(XP_EVENT_DISPLAY_CHANGED | XP_EVENT_WINDOW_STATE_CHANGED | XP_EVENT_WINDOW_MOVED +#ifdef XP_EVENT_SPACE_CHANGED + | XP_EVENT_SPACE_CHANGED +#endif | XP_EVENT_SURFACE_CHANGED | XP_EVENT_SURFACE_DESTROYED, eventHandler, NULL); @@ -250,6 +267,8 @@ xprAddScreen(int index, ScreenPtr pScreen) { DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); int depth = darwinDesiredDepth; + + DEBUG_LOG("index=%d depth=%d\n", index, depth); if(depth == -1) { depth = CGDisplaySamplesPerPixel(kCGDirectMainDisplay) * CGDisplayBitsPerSample(kCGDirectMainDisplay); @@ -259,18 +278,17 @@ xprAddScreen(int index, ScreenPtr pScreen) } switch(depth) { - case -8: // broken - FatalError("Unsupported color depth %d\n", darwinDesiredDepth); - dfb->visuals = (1 << StaticGray) | (1 << GrayScale); - dfb->preferredCVC = GrayScale; - dfb->depth = 8; - dfb->bitsPerRGB = 8; - dfb->bitsPerPixel = 8; - dfb->redMask = 0; - dfb->greenMask = 0; - dfb->blueMask = 0; - break; - case 8: // broken +// case -8: // broken +// dfb->visuals = (1 << StaticGray) | (1 << GrayScale); +// dfb->preferredCVC = GrayScale; +// dfb->depth = 8; +// dfb->bitsPerRGB = 8; +// dfb->bitsPerPixel = 8; +// dfb->redMask = 0; +// dfb->greenMask = 0; +// dfb->blueMask = 0; +// break; + case 8: // pseudo-working dfb->visuals = PseudoColorMask; dfb->preferredCVC = PseudoColor; dfb->depth = 8; @@ -290,7 +308,10 @@ xprAddScreen(int index, ScreenPtr pScreen) dfb->greenMask = 0x03e0; dfb->blueMask = 0x001f; break; - case 24: +// case 24: + default: + if(depth != 24) + ErrorF("Unsupported color depth requested. Defaulting to 24bit. (depth=%d darwinDesiredDepth=%d CGDisplaySamplesPerPixel=%d CGDisplayBitsPerSample=%d)\n", darwinDesiredDepth, depth, (int)CGDisplaySamplesPerPixel(kCGDirectMainDisplay), (int)CGDisplayBitsPerSample(kCGDirectMainDisplay)); dfb->visuals = LARGE_VISUALS; dfb->preferredCVC = TrueColor; dfb->depth = 24; @@ -300,12 +321,12 @@ xprAddScreen(int index, ScreenPtr pScreen) dfb->greenMask = 0x0000ff00; dfb->blueMask = 0x000000ff; break; - default: - FatalError("Unsupported color depth %d\n", darwinDesiredDepth); } if (noPseudoramiXExtension) { + ErrorF("Warning: noPseudoramiXExtension!\n"); + CGDirectDisplayID dpy; CGRect frame; @@ -341,18 +362,11 @@ xprAddScreen(int index, ScreenPtr pScreen) static Bool xprSetupScreen(int index, ScreenPtr pScreen) { - // Add alpha protecting replacements for fb screen functions - -#ifdef RENDER - { - PictureScreenPtr ps = GetPictureScreen(pScreen); - ps->Composite = SafeAlphaComposite; - } -#endif /* RENDER */ - // Initialize accelerated rootless drawing // Note that this must be done before DamageSetup(). - RootlessAccelInit(pScreen); + + // These are crashing ugly... better to be stable and not crash for now. + //RootlessAccelInit(pScreen); #ifdef DAMAGE // The Damage extension needs to wrap underneath the @@ -409,12 +423,8 @@ static QuartzModeProcsRec xprModeProcs = { xprSetupScreen, xprInitInput, QuartzInitCursor, - NULL, // No need to update cursor QuartzSuspendXCursor, QuartzResumeXCursor, - NULL, // No capture or release in rootless mode - NULL, - NULL, // Xplugin sends screen change events directly xprAddPseudoramiXScreens, xprUpdateScreen, xprIsX11Window, -- cgit v1.2.3