summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore38
-rw-r--r--GL/Makefile.am11
-rw-r--r--GL/apple/Makefile.am14
-rw-r--r--GL/apple/aglGlx.c103
-rw-r--r--GL/apple/indirect.c1667
-rw-r--r--GL/glx/glxscreens.c2
-rw-r--r--GL/glx/indirect_dispatch_swap.c5
-rw-r--r--GL/glx/indirect_program.c6
-rw-r--r--GL/glx/indirect_texture_compression.c5
-rw-r--r--GL/glx/indirect_util.c5
-rw-r--r--GL/glx/swap_interval.c5
-rw-r--r--Xext/EVI.c15
-rw-r--r--Xext/cup.c3
-rw-r--r--Xext/panoramiXSwap.c4
-rw-r--r--Xext/sampleEVI.c29
-rw-r--r--Xext/security.c6
-rw-r--r--Xext/shm.c50
-rw-r--r--Xi/chgfctl.c7
-rw-r--r--Xi/chgkmap.c14
-rw-r--r--Xi/chgprop.c10
-rw-r--r--Xi/grabdev.c12
-rw-r--r--Xi/grabdevb.c10
-rw-r--r--Xi/grabdevk.c9
-rw-r--r--Xi/selectev.c11
-rw-r--r--Xi/sendexev.c14
-rw-r--r--configure.ac368
-rwxr-xr-xdamageext/damageext.c22
-rw-r--r--damageext/damageext.h2
-rw-r--r--damageext/damageextint.h16
-rw-r--r--dix/dispatch.c38
-rw-r--r--dix/dixfonts.c11
-rw-r--r--dix/events.c7
-rw-r--r--dix/main.c6
-rw-r--r--dix/window.c3
-rw-r--r--fb/Makefile.am30
-rw-r--r--fb/fb.h161
-rw-r--r--fb/fb24_32.c74
-rw-r--r--fb/fb24_32.h2
-rw-r--r--fb/fballpriv.c11
-rw-r--r--fb/fbarc.c3
-rw-r--r--fb/fbbits.c18
-rw-r--r--fb/fbbits.h37
-rw-r--r--fb/fbblt.c140
-rw-r--r--fb/fbbltone.c98
-rw-r--r--fb/fbbstore.c2
-rw-r--r--fb/fbcmap.c91
-rw-r--r--fb/fbcmap_mi.c123
-rw-r--r--fb/fbcompose.c3676
-rw-r--r--fb/fbcopy.c37
-rw-r--r--fb/fbedge.c314
-rw-r--r--fb/fbedgeimp.h143
-rw-r--r--fb/fbfill.c59
-rw-r--r--fb/fbfillrect.c2
-rw-r--r--fb/fbfillsp.c2
-rw-r--r--fb/fbgc.c15
-rw-r--r--fb/fbgetsp.c4
-rw-r--r--fb/fbglyph.c18
-rw-r--r--fb/fbimage.c8
-rw-r--r--fb/fbline.c2
-rw-r--r--fb/fbmmx.c2314
-rw-r--r--fb/fbmmx.h220
-rw-r--r--fb/fboverlay.c6
-rw-r--r--fb/fbpict.c1704
-rw-r--r--fb/fbpict.h277
-rw-r--r--fb/fbpixmap.c18
-rw-r--r--fb/fbpoint.c9
-rw-r--r--fb/fbpseudocolor.c6
-rw-r--r--fb/fbpush.c9
-rw-r--r--fb/fbrop.h2
-rw-r--r--fb/fbscreen.c71
-rw-r--r--fb/fbseg.c30
-rw-r--r--fb/fbsetsp.c3
-rw-r--r--fb/fbsolid.c44
-rw-r--r--fb/fbstipple.c8
-rw-r--r--fb/fbtile.c18
-rw-r--r--fb/fbtrap.c102
-rw-r--r--fb/fbutil.c2
-rw-r--r--fb/fbwindow.c51
-rw-r--r--fb/wfbrename.h201
-rw-r--r--hw/Makefile.am19
-rw-r--r--hw/darwin/Makefile.am117
-rw-r--r--hw/darwin/XDarwin.man205
-rw-r--r--hw/darwin/bundle/Dutch.lproj/Credits.rtf168
-rw-r--r--hw/darwin/bundle/Dutch.lproj/Localizable.stringsbin1426 -> 0 bytes
-rw-r--r--hw/darwin/bundle/Dutch.lproj/MainMenu.nib/classes.nib72
-rw-r--r--hw/darwin/bundle/Dutch.lproj/MainMenu.nib/objects.nibbin22024 -> 0 bytes
-rw-r--r--hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp103
-rw-r--r--hw/darwin/bundle/English.lproj/Credits.rtf168
-rw-r--r--hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp5
-rw-r--r--hw/darwin/bundle/English.lproj/Localizable.strings23
-rw-r--r--hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib72
-rw-r--r--hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nibbin20829 -> 0 bytes
-rw-r--r--hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp96
-rw-r--r--hw/darwin/bundle/French.lproj/Credits.rtf166
-rw-r--r--hw/darwin/bundle/French.lproj/Localizable.stringsbin1492 -> 0 bytes
-rw-r--r--hw/darwin/bundle/French.lproj/MainMenu.nib/classes.nib72
-rw-r--r--hw/darwin/bundle/French.lproj/MainMenu.nib/objects.nibbin21114 -> 0 bytes
-rw-r--r--hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp101
-rw-r--r--hw/darwin/bundle/German.lproj/Credits.rtf168
-rw-r--r--hw/darwin/bundle/German.lproj/Localizable.stringsbin1458 -> 0 bytes
-rw-r--r--hw/darwin/bundle/German.lproj/MainMenu.nib/classes.nib72
-rw-r--r--hw/darwin/bundle/German.lproj/MainMenu.nib/objects.nibbin21182 -> 0 bytes
-rw-r--r--hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp96
-rw-r--r--hw/darwin/bundle/Japanese.lproj/Credits.rtf193
-rw-r--r--hw/darwin/bundle/Japanese.lproj/Localizable.stringsbin1152 -> 0 bytes
-rw-r--r--hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib72
-rw-r--r--hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nibbin21854 -> 0 bytes
-rw-r--r--hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp141
-rw-r--r--hw/darwin/bundle/Portuguese.lproj/Credits.rtf171
-rw-r--r--hw/darwin/bundle/Portuguese.lproj/Localizable.stringsbin1504 -> 0 bytes
-rw-r--r--hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/classes.nib72
-rw-r--r--hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/objects.nibbin21112 -> 0 bytes
-rw-r--r--hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp211
-rw-r--r--hw/darwin/bundle/Spanish.lproj/Credits.rtf168
-rw-r--r--hw/darwin/bundle/Spanish.lproj/Localizable.stringsbin1480 -> 0 bytes
-rw-r--r--hw/darwin/bundle/Spanish.lproj/MainMenu.nib/classes.nib72
-rw-r--r--hw/darwin/bundle/Spanish.lproj/MainMenu.nib/objects.nibbin20952 -> 0 bytes
-rw-r--r--hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp111
-rw-r--r--hw/darwin/bundle/Swedish.lproj/Credits.rtf168
-rw-r--r--hw/darwin/bundle/Swedish.lproj/Localizable.stringsbin1464 -> 0 bytes
-rw-r--r--hw/darwin/bundle/Swedish.lproj/MainMenu.nib/classes.nib72
-rw-r--r--hw/darwin/bundle/Swedish.lproj/MainMenu.nib/objects.nibbin20858 -> 0 bytes
-rw-r--r--hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp103
-rw-r--r--hw/darwin/bundle/XDarwin.icnsbin69465 -> 0 bytes
-rw-r--r--hw/darwin/bundle/ko.lproj/Credits.rtf168
-rw-r--r--hw/darwin/bundle/ko.lproj/Localizable.stringsbin1332 -> 0 bytes
-rw-r--r--hw/darwin/bundle/ko.lproj/MainMenu.nib/classes.nib72
-rw-r--r--hw/darwin/bundle/ko.lproj/MainMenu.nib/objects.nibbin21433 -> 0 bytes
-rw-r--r--hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp96
-rw-r--r--hw/darwin/bundle/startXClients.cpp24
-rw-r--r--hw/darwin/iokit/xfIOKit.c770
-rw-r--r--hw/darwin/iokit/xfIOKit.h56
-rw-r--r--hw/darwin/iokit/xfIOKitCursor.c734
-rw-r--r--hw/darwin/iokit/xfIOKitStartup.c125
-rw-r--r--hw/darwin/quartz/Preferences.h137
-rw-r--r--hw/darwin/quartz/Preferences.m597
-rw-r--r--hw/darwin/quartz/XApplication.h47
-rw-r--r--hw/darwin/quartz/XApplication.m47
-rw-r--r--hw/darwin/quartz/XDarwin.pbproj/project.pbxproj2519
-rw-r--r--hw/darwin/quartz/XDarwinStartup.c163
-rw-r--r--hw/darwin/quartz/XDarwinStartup.man75
-rw-r--r--hw/darwin/quartz/XServer.h136
-rw-r--r--hw/darwin/quartz/XServer.m1539
-rw-r--r--hw/darwin/quartz/cr/XView.m74
-rw-r--r--hw/darwin/quartz/cr/cr.h62
-rw-r--r--hw/darwin/quartz/cr/crAppleWM.m157
-rw-r--r--hw/darwin/quartz/cr/crFrame.m439
-rw-r--r--hw/darwin/quartz/cr/crScreen.m381
-rw-r--r--hw/darwin/quartz/fullscreen/fullscreen.c567
-rw-r--r--hw/darwin/quartz/fullscreen/quartzCursor.c652
-rw-r--r--hw/darwin/quartz/fullscreen/quartzCursor.h43
-rw-r--r--hw/darwin/quartz/quartzCursor.c652
-rw-r--r--hw/darwin/quartz/quartzCursor.h42
-rw-r--r--hw/darwin/quartz/quartzStartup.c290
-rw-r--r--hw/darwin/quartz/xpr/Xplugin.h590
-rw-r--r--hw/darwin/utils/README.txt111
-rw-r--r--hw/darwin/utils/dumpkeymap.c1453
-rw-r--r--hw/darwin/utils/dumpkeymap.man1004
-rw-r--r--hw/vfb/InitOutput.c2
-rw-r--r--hw/xfree86/os-support/Makefile.am2
-rwxr-xr-x[-rw-r--r--]hw/xfree86/scanpci/pciid2c.pl0
-rw-r--r--hw/xnest/Init.c2
-rw-r--r--hw/xprint/attributes.c2
-rw-r--r--hw/xprint/ddxInit.c2
-rw-r--r--hw/xquartz/Makefile.am53
-rw-r--r--hw/xquartz/X11Application.h105
-rw-r--r--hw/xquartz/X11Application.m1015
-rw-r--r--hw/xquartz/X11Controller.h105
-rw-r--r--hw/xquartz/X11Controller.m763
-rw-r--r--hw/xquartz/applewm.c (renamed from hw/darwin/quartz/applewm.c)25
-rw-r--r--hw/xquartz/applewmExt.h (renamed from hw/darwin/quartz/applewmExt.h)0
-rw-r--r--hw/xquartz/bundle/Dutch.lproj/InfoPlist.stringsbin0 -> 274 bytes
-rw-r--r--hw/xquartz/bundle/Dutch.lproj/Localizable.stringsbin0 -> 1084 bytes
-rw-r--r--hw/xquartz/bundle/Dutch.lproj/main.nib/keyedobjects.nibbin0 -> 32654 bytes
-rw-r--r--hw/xquartz/bundle/English.lproj/InfoPlist.stringsbin0 -> 276 bytes
-rw-r--r--hw/xquartz/bundle/English.lproj/Localizable.stringsbin0 -> 1094 bytes
-rw-r--r--hw/xquartz/bundle/English.lproj/main.nib/designable.nib3734
-rw-r--r--hw/xquartz/bundle/English.lproj/main.nib/keyedobjects.nibbin0 -> 37918 bytes
-rw-r--r--hw/xquartz/bundle/French.lproj/InfoPlist.stringsbin0 -> 276 bytes
-rw-r--r--hw/xquartz/bundle/French.lproj/Localizable.stringsbin0 -> 1168 bytes
-rw-r--r--hw/xquartz/bundle/French.lproj/main.nib/keyedobjects.nibbin0 -> 36404 bytes
-rw-r--r--hw/xquartz/bundle/German.lproj/InfoPlist.stringsbin0 -> 276 bytes
-rw-r--r--hw/xquartz/bundle/German.lproj/Localizable.stringsbin0 -> 1096 bytes
-rw-r--r--hw/xquartz/bundle/German.lproj/main.nib/keyedobjects.nibbin0 -> 34995 bytes
-rw-r--r--hw/xquartz/bundle/Info.plist39
-rw-r--r--hw/xquartz/bundle/Italian.lproj/InfoPlist.stringsbin0 -> 278 bytes
-rw-r--r--hw/xquartz/bundle/Italian.lproj/Localizable.stringsbin0 -> 1146 bytes
-rw-r--r--hw/xquartz/bundle/Italian.lproj/main.nib/keyedobjects.nibbin0 -> 33677 bytes
-rw-r--r--hw/xquartz/bundle/Japanese.lproj/InfoPlist.stringsbin0 -> 272 bytes
-rw-r--r--hw/xquartz/bundle/Japanese.lproj/Localizable.stringsbin0 -> 916 bytes
-rw-r--r--hw/xquartz/bundle/Japanese.lproj/main.nib/keyedobjects.nibbin0 -> 33095 bytes
-rw-r--r--hw/xquartz/bundle/Makefile.am77
-rw-r--r--hw/xquartz/bundle/Spanish.lproj/InfoPlist.stringsbin0 -> 276 bytes
-rw-r--r--hw/xquartz/bundle/Spanish.lproj/Localizable.stringsbin0 -> 1134 bytes
-rw-r--r--hw/xquartz/bundle/Spanish.lproj/main.nib/keyedobjects.nibbin0 -> 35294 bytes
-rw-r--r--hw/xquartz/bundle/X11.icnsbin0 -> 65908 bytes
-rw-r--r--hw/xquartz/bundle/X11.xcodeproj/project.pbxproj458
-rw-r--r--hw/xquartz/bundle/Xquartz.plist27
-rw-r--r--hw/xquartz/bundle/bundle-main.c136
-rw-r--r--hw/xquartz/bundle/da.lproj/InfoPlist.stringsbin0 -> 276 bytes
-rw-r--r--hw/xquartz/bundle/da.lproj/Localizable.stringsbin0 -> 1090 bytes
-rw-r--r--hw/xquartz/bundle/da.lproj/main.nib/keyedobjects.nibbin0 -> 34164 bytes
-rw-r--r--hw/xquartz/bundle/fi.lproj/InfoPlist.stringsbin0 -> 274 bytes
-rw-r--r--hw/xquartz/bundle/fi.lproj/Localizable.stringsbin0 -> 1102 bytes
-rw-r--r--hw/xquartz/bundle/fi.lproj/main.nib/keyedobjects.nibbin0 -> 34765 bytes
-rw-r--r--hw/xquartz/bundle/ko.lproj/InfoPlist.stringsbin0 -> 266 bytes
-rw-r--r--hw/xquartz/bundle/ko.lproj/Localizable.stringsbin0 -> 916 bytes
-rw-r--r--hw/xquartz/bundle/ko.lproj/main.nib/keyedobjects.nibbin0 -> 32690 bytes
-rw-r--r--hw/xquartz/bundle/no.lproj/InfoPlist.stringsbin0 -> 276 bytes
-rw-r--r--hw/xquartz/bundle/no.lproj/Localizable.stringsbin0 -> 1084 bytes
-rw-r--r--hw/xquartz/bundle/no.lproj/main.nib/keyedobjects.nibbin0 -> 33581 bytes
-rw-r--r--hw/xquartz/bundle/pl.lproj/InfoPlist.stringsbin0 -> 274 bytes
-rw-r--r--hw/xquartz/bundle/pl.lproj/Localizable.stringsbin0 -> 1116 bytes
-rw-r--r--hw/xquartz/bundle/pl.lproj/main.nib/keyedobjects.nibbin0 -> 35113 bytes
-rw-r--r--hw/xquartz/bundle/pt.lproj/InfoPlist.stringsbin0 -> 274 bytes
-rw-r--r--hw/xquartz/bundle/pt.lproj/Localizable.stringsbin0 -> 1192 bytes
-rw-r--r--hw/xquartz/bundle/pt.lproj/main.nib/keyedobjects.nibbin0 -> 34533 bytes
-rw-r--r--hw/xquartz/bundle/pt_PT.lproj/InfoPlist.stringsbin0 -> 274 bytes
-rw-r--r--hw/xquartz/bundle/pt_PT.lproj/Localizable.stringsbin0 -> 1140 bytes
-rw-r--r--hw/xquartz/bundle/pt_PT.lproj/main.nib/keyedobjects.nibbin0 -> 35485 bytes
-rw-r--r--hw/xquartz/bundle/ru.lproj/InfoPlist.stringsbin0 -> 274 bytes
-rw-r--r--hw/xquartz/bundle/ru.lproj/Localizable.stringsbin0 -> 1122 bytes
-rw-r--r--hw/xquartz/bundle/ru.lproj/main.nib/keyedobjects.nibbin0 -> 36593 bytes
-rw-r--r--hw/xquartz/bundle/sv.lproj/InfoPlist.stringsbin0 -> 260 bytes
-rw-r--r--hw/xquartz/bundle/sv.lproj/Localizable.stringsbin0 -> 1106 bytes
-rw-r--r--hw/xquartz/bundle/sv.lproj/main.nib/keyedobjects.nibbin0 -> 35017 bytes
-rw-r--r--hw/xquartz/bundle/zh_CN.lproj/InfoPlist.stringsbin0 -> 260 bytes
-rw-r--r--hw/xquartz/bundle/zh_CN.lproj/Localizable.stringsbin0 -> 884 bytes
-rw-r--r--hw/xquartz/bundle/zh_CN.lproj/main.nib/keyedobjects.nibbin0 -> 31481 bytes
-rw-r--r--hw/xquartz/bundle/zh_TW.lproj/InfoPlist.stringsbin0 -> 266 bytes
-rw-r--r--hw/xquartz/bundle/zh_TW.lproj/Localizable.stringsbin0 -> 890 bytes
-rw-r--r--hw/xquartz/bundle/zh_TW.lproj/main.nib/keyedobjects.nibbin0 -> 31748 bytes
-rw-r--r--hw/xquartz/darwin.c (renamed from hw/darwin/darwin.c)325
-rw-r--r--hw/xquartz/darwin.h (renamed from hw/darwin/darwin.h)94
-rw-r--r--hw/xquartz/darwinClut8.h (renamed from hw/darwin/darwinClut8.h)0
-rw-r--r--hw/xquartz/darwinEvents.c (renamed from hw/darwin/darwinEvents.c)261
-rw-r--r--hw/xquartz/darwinEvents.h (renamed from hw/darwin/quartz/cr/XView.h)22
-rw-r--r--hw/xquartz/darwinKeyboard.c (renamed from hw/darwin/darwinKeyboard.c)201
-rw-r--r--hw/xquartz/darwinKeyboard.h (renamed from miext/rootless/safeAlpha/safeAlpha.h)31
-rw-r--r--hw/xquartz/darwinXinput.c (renamed from hw/darwin/darwinXinput.c)4
-rw-r--r--hw/xquartz/keysym2ucs.c (renamed from hw/darwin/quartz/keysym2ucs.c)2
-rw-r--r--hw/xquartz/keysym2ucs.h (renamed from hw/darwin/quartz/keysym2ucs.h)3
-rw-r--r--hw/xquartz/pseudoramiX.c (renamed from hw/darwin/quartz/pseudoramiX.c)45
-rw-r--r--hw/xquartz/pseudoramiX.h (renamed from hw/darwin/quartz/pseudoramiX.h)0
-rw-r--r--hw/xquartz/quartz.c (renamed from hw/darwin/quartz/quartz.c)272
-rw-r--r--hw/xquartz/quartz.h (renamed from hw/darwin/quartz/quartz.h)13
-rw-r--r--hw/xquartz/quartzAudio.c (renamed from hw/darwin/quartz/quartzAudio.c)9
-rw-r--r--hw/xquartz/quartzAudio.h (renamed from hw/darwin/quartz/quartzAudio.h)0
-rw-r--r--hw/xquartz/quartzCocoa.m (renamed from hw/darwin/quartz/quartzCocoa.m)82
-rw-r--r--hw/xquartz/quartzCommon.h (renamed from hw/darwin/quartz/quartzCommon.h)20
-rw-r--r--hw/xquartz/quartzForeground.c45
-rw-r--r--hw/xquartz/quartzForeground.h37
-rw-r--r--hw/xquartz/quartzKeyboard.c (renamed from hw/darwin/quartz/quartzKeyboard.c)193
-rw-r--r--hw/xquartz/quartzKeyboard.h (renamed from hw/darwin/darwinKeyboard.h)13
-rw-r--r--hw/xquartz/quartzPasteboard.c (renamed from hw/darwin/quartz/quartzPasteboard.c)4
-rw-r--r--hw/xquartz/quartzPasteboard.h (renamed from hw/darwin/quartz/quartzPasteboard.h)0
-rw-r--r--hw/xquartz/quartzStartup.c117
-rw-r--r--hw/xquartz/xpr/Makefile.am57
-rw-r--r--hw/xquartz/xpr/Xquartz.man.pre156
-rw-r--r--hw/xquartz/xpr/appledri.c (renamed from hw/darwin/quartz/xpr/appledri.c)6
-rw-r--r--hw/xquartz/xpr/appledri.h106
-rw-r--r--hw/xquartz/xpr/appledristr.h175
-rw-r--r--hw/xquartz/xpr/dri.c (renamed from hw/darwin/quartz/xpr/dri.c)11
-rw-r--r--hw/xquartz/xpr/dri.h (renamed from hw/darwin/quartz/xpr/dri.h)2
-rw-r--r--hw/xquartz/xpr/dristruct.h (renamed from hw/darwin/quartz/xpr/dristruct.h)0
-rw-r--r--hw/xquartz/xpr/x-hash.c (renamed from hw/darwin/quartz/xpr/x-hash.c)5
-rw-r--r--hw/xquartz/xpr/x-hash.h (renamed from hw/darwin/quartz/xpr/x-hash.h)1
-rw-r--r--hw/xquartz/xpr/x-hook.c (renamed from hw/darwin/quartz/xpr/x-hook.c)7
-rw-r--r--hw/xquartz/xpr/x-hook.h (renamed from hw/darwin/quartz/xpr/x-hook.h)2
-rw-r--r--hw/xquartz/xpr/x-list.c (renamed from hw/darwin/quartz/xpr/x-list.c)5
-rw-r--r--hw/xquartz/xpr/x-list.h (renamed from hw/darwin/quartz/xpr/x-list.h)1
-rw-r--r--hw/xquartz/xpr/xpr.h (renamed from hw/darwin/quartz/xpr/xpr.h)6
-rw-r--r--hw/xquartz/xpr/xprAppleWM.c (renamed from hw/darwin/quartz/xpr/xprAppleWM.c)10
-rw-r--r--hw/xquartz/xpr/xprCursor.c (renamed from hw/darwin/quartz/xpr/xprCursor.c)23
-rw-r--r--hw/xquartz/xpr/xprFrame.c (renamed from hw/darwin/quartz/xpr/xprFrame.c)63
-rw-r--r--hw/xquartz/xpr/xprScreen.c (renamed from hw/darwin/quartz/xpr/xprScreen.c)274
-rw-r--r--include/cursor.h2
-rw-r--r--include/dix-config.h.in6
-rw-r--r--include/dixfont.h2
-rw-r--r--include/resource.h2
-rw-r--r--include/window.h4
-rw-r--r--include/windowstr.h3
-rw-r--r--mi/miinitext.c23
-rw-r--r--miext/Makefile.am3
-rwxr-xr-xmiext/damage/damage.c30
-rwxr-xr-xmiext/damage/damage.h2
-rwxr-xr-xmiext/damage/damagestr.h8
-rw-r--r--miext/rootless/Makefile.am34
-rw-r--r--miext/rootless/README.txt4
-rw-r--r--miext/rootless/accel/Makefile.am15
-rw-r--r--miext/rootless/accel/rlBlt.c45
-rw-r--r--miext/rootless/accel/rlFill.c6
-rw-r--r--miext/rootless/rootless.h7
-rw-r--r--miext/rootless/rootlessCommon.c84
-rw-r--r--miext/rootless/rootlessCommon.h23
-rw-r--r--miext/rootless/rootlessConfig.h7
-rw-r--r--miext/rootless/rootlessGC.c59
-rw-r--r--miext/rootless/rootlessScreen.c72
-rw-r--r--miext/rootless/rootlessValTree.c1
-rw-r--r--miext/rootless/rootlessWindow.c279
-rw-r--r--miext/rootless/rootlessWindow.h3
-rw-r--r--miext/rootless/safeAlpha/safeAlphaPicture.c642
-rw-r--r--miext/rootless/safeAlpha/safeAlphaWindow.c173
-rw-r--r--os/connection.c10
-rw-r--r--render/animcur.c4
-rw-r--r--render/filter.c2
-rw-r--r--render/glyph.c10
-rw-r--r--render/glyphstr.h2
-rw-r--r--render/mipict.c58
-rw-r--r--render/mipict.h6
-rw-r--r--render/picture.c142
-rw-r--r--render/picture.h174
-rw-r--r--render/picturestr.h66
-rw-r--r--render/render.c12
-rw-r--r--render/renderedge.c120
-rw-r--r--render/renderedge.h17
316 files changed, 12130 insertions, 29074 deletions
diff --git a/.gitignore b/.gitignore
index 4118cd001..b23158550 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,11 @@ Makefile.in
*.a
*.o
*~
+.*.swp
+*.pbxuser
+*.mode1v3
+obj*
+build*
aclocal.m4
autom4te.cache
compile
@@ -16,11 +21,13 @@ config.log
config.status
config.sub
configure
+configure.lineno
depcomp
install-sh
libtool
ltmain.sh
missing
+ylwrap
xorg-server.pc
stamp-h?
do-not-use-config.h
@@ -90,6 +97,8 @@ cfb32/cfbzerarcG.c
cfb32/cfbzerarcX.c
doc/Xserver.1x
doc/Xserver.man
+doc/SecurityPolicy.5
+doc/SecurityPolicy.man
hw/dmx/Xdmx
hw/dmx/Xdmx.1x
hw/dmx/config/dmxtodmx
@@ -205,31 +214,58 @@ hw/xfree86/xaa/mf3-xaaBitmap.c
hw/xfree86/xaa/mf3-xaaStipple.c
hw/xfree86/xaa/s-xaaDashLine.c
hw/xfree86/xaa/s-xaaLine.c
+hw/xfree86/xf1bpp/maskbits.c
+hw/xfree86/xf1bpp/mfbbitblt.c
hw/xfree86/xf1bpp/mfbbltC.c
hw/xfree86/xf1bpp/mfbbltCI.c
hw/xfree86/xf1bpp/mfbbltG.c
hw/xfree86/xf1bpp/mfbbltO.c
hw/xfree86/xf1bpp/mfbbltX.c
+hw/xfree86/xf1bpp/mfbbres.c
+hw/xfree86/xf1bpp/mfbbresd.c
+hw/xfree86/xf1bpp/mfbclip.c
+hw/xfree86/xf1bpp/mfbcmap.c
+hw/xfree86/xf1bpp/mfbfillarc.c
+hw/xfree86/xf1bpp/mfbfillrct.c
+hw/xfree86/xf1bpp/mfbfillsp.c
+hw/xfree86/xf1bpp/mfbfont.c
+hw/xfree86/xf1bpp/mfbgc.c
+hw/xfree86/xf1bpp/mfbgetsp.c
hw/xfree86/xf1bpp/mfbigbblak.c
hw/xfree86/xf1bpp/mfbigbwht.c
+hw/xfree86/xf1bpp/mfbhrzvert.c
+hw/xfree86/xf1bpp/mfbimage.c
+hw/xfree86/xf1bpp/mfbline.c
+hw/xfree86/xf1bpp/mfbmisc.c
hw/xfree86/xf1bpp/mfbpablack.c
hw/xfree86/xf1bpp/mfbpainv.c
hw/xfree86/xf1bpp/mfbpawhite.c
hw/xfree86/xf1bpp/mfbpgbblak.c
hw/xfree86/xf1bpp/mfbpgbinv.c
hw/xfree86/xf1bpp/mfbpgbwht.c
+hw/xfree86/xf1bpp/mfbpixmap.c
hw/xfree86/xf1bpp/mfbplyblack.c
hw/xfree86/xf1bpp/mfbplyinv.c
hw/xfree86/xf1bpp/mfbplywhite.c
+hw/xfree86/xf1bpp/mfbpntwin.c
+hw/xfree86/xf1bpp/mfbpolypnt.c
+hw/xfree86/xf1bpp/mfbpushpxl.c
+hw/xfree86/xf1bpp/mfbscrclse.c
+hw/xfree86/xf1bpp/mfbscrinit.c
hw/xfree86/xf1bpp/mfbseg.c
+hw/xfree86/xf1bpp/mfbsetsp.c
hw/xfree86/xf1bpp/mfbteblack.c
hw/xfree86/xf1bpp/mfbtewhite.c
hw/xfree86/xf1bpp/mfbtileC.c
hw/xfree86/xf1bpp/mfbtileG.c
+hw/xfree86/xf1bpp/mfbwindow.c
+hw/xfree86/xf1bpp/mfbzerarc.c
hw/xfree86/xf4bpp/mfbseg.c
hw/xfree86/xf8_32bpp/cfbgc32.c
hw/xfree86/xf8_32bpp/cfbgc8.c
hw/xfree86/xorg.c
+hw/xfree86/xorg.conf.example
+hw/xfree86/xorg.conf.example.pre
hw/xnest/Xnest
hw/xnest/Xnest.1x
hw/xnest/Xnest.man
@@ -239,6 +275,8 @@ hw/xprint/doc/Xprt.1x
hw/xprint/doc/Xprt.man
hw/xprint/dpmsstubs-wrapper.c
hw/xprint/miinitext-wrapper.c
+hw/xquartz/xpr/Xquartz
+hw/xquartz/xpr/Xquartz.1
include/dix-config.h
include/kdrive-config.h
include/xgl-config.h
diff --git a/GL/Makefile.am b/GL/Makefile.am
index b9337ba69..4e8337a7c 100644
--- a/GL/Makefile.am
+++ b/GL/Makefile.am
@@ -1,16 +1,9 @@
-SUBDIRS = glx mesa
+SUBDIRS = glx mesa apple
-# someone could get really crazy someday and add support for the SI...
-
-# xwin/darwin/xfree86 have their accel support under the DDX
-
-APPLE_EXTRAS = \
- apple/aglGlx.c \
- apple/indirect.c
WINDOWS_EXTRAS = \
windows/ChangeLog \
windows/glwindows.h \
windows/glwrap.c \
windows/indirect.c
-EXTRA_DIST = symlink-mesa.sh $(APPLE_EXTRAS) $(WINDOWS_EXTRAS)
+EXTRA_DIST = symlink-mesa.sh $(WINDOWS_EXTRAS)
diff --git a/GL/apple/Makefile.am b/GL/apple/Makefile.am
new file mode 100644
index 000000000..7ad9140cc
--- /dev/null
+++ b/GL/apple/Makefile.am
@@ -0,0 +1,14 @@
+AM_CFLAGS = $(DIX_CFLAGS)
+AM_CPPFLAGS = \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/GL/glx \
+ -I$(top_srcdir)/GL/include \
+ -I$(top_srcdir)/GL/mesa/glapi \
+ -I$(top_srcdir)/hw/xquartz \
+ -I$(top_srcdir)/hw/xquartz/xpr \
+ -I$(top_srcdir)/miext/damage
+
+noinst_LIBRARIES = libCGLcore.a
+libCGLcore_a_SOURCES = \
+ indirect.c \
+ $(top_srcdir)/hw/dmx/glxProxy/compsize.c
diff --git a/GL/apple/aglGlx.c b/GL/apple/aglGlx.c
index 900a9a96e..0bc9f6127 100644
--- a/GL/apple/aglGlx.c
+++ b/GL/apple/aglGlx.c
@@ -1008,6 +1008,7 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp,
return TRUE;
}
+Bool enable_stereo = false;
/* based on code in i830_dri.c
This ends calling glAquaSetVisualConfigs to set the static
numconfigs, etc. */
@@ -1022,16 +1023,18 @@ glAquaInitVisualConfigs(void)
int 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)
- = 32 configs */
+ = 64 configs with stereo, or 32 without */
- lclNumConfigs = 2 * 2 * 2 * 2 * 2; /* 32 */
+ 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);
@@ -1040,54 +1043,55 @@ glAquaInitVisualConfigs(void)
/* fill in configs */
if (NULL != lclVisualConfigs) {
i = 0; /* current buffer */
- for (depth = 0; depth < 2; depth++) {
+ 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;
- }
- lclVisualConfigs[i].doubleBuffer = buffers ? TRUE : FALSE;
- lclVisualConfigs[i].stereo = 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++;
- }
- }
- }
+ 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;
+ }
+ 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");
@@ -1095,7 +1099,6 @@ glAquaInitVisualConfigs(void)
GlxSetVisualConfigs(lclNumConfigs, lclVisualConfigs, lclVisualPrivates);
}
-
static void glAquaSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
void **privates)
{
diff --git a/GL/apple/indirect.c b/GL/apple/indirect.c
index 8cba1c63d..2729ab0ba 100644
--- a/GL/apple/indirect.c
+++ b/GL/apple/indirect.c
@@ -1,11 +1,10 @@
/*
* GLX implementation that uses Apple's OpenGL.framework
* (Indirect rendering path)
- */
-/*
- * Copyright (c) 2002 Greg Parker. All Rights Reserved.
- * Copyright (c) 2002 Apple Computer, Inc.
+ *
+ * Copyright (c) 2007 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:
@@ -37,14 +36,30 @@
#endif
#include "dri.h"
-#include "quartz.h"
-#include <CoreGraphics/CoreGraphics.h>
+#define GL_EXT_histogram 1
+#define GL_EXT_polygon_offset 1
+#define GL_SGIS_pixel_texture 1
+#define GL_SGIX_pixel_texture 1
+#define GL_EXT_multisample 1
+#define GL_SGIS_multisample 1
+#define GL_EXT_vertex_array 1
+#define GL_ARB_point_parameters 1
+#define GL_NV_vertex_array_range 1
+#define GL_MESA_resize_buffers 1
+#define GL_ARB_window_pos 1
+#define GL_EXT_cull_vertex 1
+#define GL_NV_vertex_program 1
+#define GL_APPLE_fence 1
+#define GL_IBM_multimode_draw_arrays 1
+#define GL_EXT_fragment_shader 1
+
#include <OpenGL/OpenGL.h>
#include <OpenGL/CGLContext.h>
// X11 and X11's glx
-#include <miscstruct.h>
+#include <GL/gl.h>
+#include <GL/glxproto.h>
#include <windowstr.h>
#include <resource.h>
#include <GL/glxint.h>
@@ -61,11 +76,18 @@
#include "x-hash.h"
#include "x-list.h"
+#include <dispatch.h>
+#define GLAPIENTRYP *
+typedef unsigned long long GLuint64EXT;
+typedef long long GLint64EXT;
+#include <Xplugin.h>
#include "glcontextmodes.h"
+#include <glapi.h>
+#include <glapitable.h>
// ggs: needed to call back to glx with visual configs
extern void GlxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, void **configprivs);
-
+__GLXprovider * GlxGetMesaProvider (void);
// Write debugging output, or not
#ifdef GLAQUA_DEBUG
@@ -74,182 +96,163 @@ extern void GlxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, void *
#define GLAQUA_DEBUG_MSG(a, ...)
#endif
-
-// The following GL functions don't have an EXT suffix in OpenGL.framework.
-GLboolean glAreTexturesResidentEXT(GLsizei a, const GLuint *b, GLboolean *c) {
- return glAreTexturesResident(a, b, c);
-}
-void glDeleteTexturesEXT(GLsizei d, const GLuint *e) {
- glDeleteTextures(d, e);
-}
-void glGenTexturesEXT(GLsizei f, GLuint *g) {
- glGenTextures(f, g);
-}
-GLboolean glIsTextureEXT(GLuint h) {
- return glIsTexture(h);
-}
+static void setup_dispatch_table(void);
+GLuint __glFloorLog2(GLuint val);
+void warn_func(void * p1, char *format, ...);
// some prototypes
-static Bool glAquaScreenProbe(int screen);
+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 __GLinterface *glAquaCreateContext(__GLimports *imports,
- __GLcontextModes *mode,
- __GLinterface *shareGC);
-static void glAquaCreateBuffer(__GLXdrawablePrivate *glxPriv);
-static void glAquaResetExtension(void);
-
-/*
- * This structure is statically allocated in the __glXScreens[]
- * structure. This struct is not used anywhere other than in
- * __glXScreenInit to initialize each of the active screens
- * (__glXActiveScreens[]). Several of the fields must be initialized by
- * the screenProbe routine before they are copied to the active screens
- * struct. In particular, the contextCreate, modes, numVisuals,
- * and numUsableVisuals fields must be initialized.
- */
-static __GLXscreenInfo __glDDXScreenInfo = {
- glAquaScreenProbe, /* Must be generic and handle all screens */
- glAquaCreateContext, /* Substitute screen's createContext routine */
- glAquaCreateBuffer, /* Substitute screen's createBuffer routine */
- NULL, /* Set up modes in probe */
- NULL, /* Set up pVisualPriv in probe */
- 0, /* Set up numVisuals in probe */
- 0, /* Set up numUsableVisuals in probe */
- "Vendor String", /* GLXvendor is overwritten by __glXScreenInit */
- "Version String", /* GLXversion is overwritten by __glXScreenInit */
- "Extensions String", /* GLXextensions is overwritten by __glXScreenInit */
- NULL /* WrappedPositionWindow is overwritten */
-};
-
-void *__glXglDDXScreenInfo(void) {
- return &__glDDXScreenInfo;
-}
-static __GLXextensionInfo __glDDXExtensionInfo = {
- GL_CORE_APPLE,
- glAquaResetExtension,
- glAquaInitVisuals,
- glAquaSetVisualConfigs
+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);
+
+__GLXprovider __glXMesaProvider = {
+ __glXAquaScreenProbe,
+ "Core OpenGL",
+ NULL
};
-void *__glXglDDXExtensionInfo(void) {
- return &__glDDXExtensionInfo;
+__GLXprovider *
+GlxGetMesaProvider (void)
+{
+ GLAQUA_DEBUG_MSG("GlxGetMesaProvider\n");
+ return &__glXMesaProvider;
}
-// prototypes
-
-static GLboolean glAquaDestroyContext(__GLcontext *gc);
-static GLboolean glAquaLoseCurrent(__GLcontext *gc);
-static GLboolean glAquaMakeCurrent(__GLcontext *gc);
-static GLboolean glAquaShareContext(__GLcontext *gc, __GLcontext *gcShare);
-static GLboolean glAquaCopyContext(__GLcontext *dst, const __GLcontext *src,
- GLuint mask);
-static GLboolean glAquaForceCurrent(__GLcontext *gc);
-
-/* Drawing surface notification callbacks */
-static GLboolean glAquaNotifyResize(__GLcontext *gc);
-static void glAquaNotifyDestroy(__GLcontext *gc);
-static void glAquaNotifySwapBuffers(__GLcontext *gc);
-
-/* Dispatch table override control for external agents like libGLS */
-static struct __GLdispatchStateRec* glAquaDispatchExec(__GLcontext *gc);
-static void glAquaBeginDispatchOverride(__GLcontext *gc);
-static void glAquaEndDispatchOverride(__GLcontext *gc);
-
-static __GLexports glAquaExports = {
- glAquaDestroyContext,
- glAquaLoseCurrent,
- glAquaMakeCurrent,
- glAquaShareContext,
- glAquaCopyContext,
- glAquaForceCurrent,
-
- glAquaNotifyResize,
- glAquaNotifyDestroy,
- glAquaNotifySwapBuffers,
-
- glAquaDispatchExec,
- glAquaBeginDispatchOverride,
- glAquaEndDispatchOverride
-};
+typedef struct __GLXAquaScreen __GLXAquaScreen;
+typedef struct __GLXAquaContext __GLXAquaContext;
+typedef struct __GLXAquaDrawable __GLXAquaDrawable;
-typedef struct {
+struct __GLXAquaScreen {
+ __GLXscreen base;
+ int index;
int num_vis;
__GLcontextModes *modes;
- void **priv;
+};
- // wrapped screen functions
- RealizeWindowProcPtr RealizeWindow;
- UnrealizeWindowProcPtr UnrealizeWindow;
-} glAquaScreenRec;
+static __GLXAquaScreen glAquaScreens[MAXSCREENS];
-static glAquaScreenRec glAquaScreens[MAXSCREENS];
+struct __GLXAquaContext {
+ __GLXcontext base;
+ CGLContextObj ctx;
+ CGLPixelFormatObj pixelFormat;
+ xp_surface_id sid;
+ unsigned isAttached :1;
+};
-// __GLdrawablePrivate->private
-typedef struct {
+struct __GLXAquaDrawable {
+ __GLXdrawable base;
DrawablePtr pDraw;
xp_surface_id sid;
-} GLAquaDrawableRec;
-
-struct __GLcontextRec {
- struct __GLinterfaceRec interface; // required to be first
-
- CGLContextObj ctx;
- CGLPixelFormatObj pixelFormat;
+};
- /* set when attached */
- xp_surface_id sid;
+static __GLXcontext *
+__glXAquaScreenCreateContext(__GLXscreen *screen,
+ __GLcontextModes *modes,
+ __GLXcontext *baseShareContext)
+{
+ __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;
+
+ context->pixelFormat = makeFormat(modes);
+ if (!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);
+ free(context);
+ return NULL;
+ }
+ setup_dispatch_table();
+ GLAQUA_DEBUG_MSG("glAquaCreateContext done\n");
+ return &context->base;
+}
- unsigned isAttached :1;
+static __GLXextensionInfo __glDDXExtensionInfo = {
+ GL_CORE_APPLE,
+ glAquaResetExtension,
+ glAquaInitVisuals,
+ glAquaSetVisualConfigs
};
+void *__glXglDDXExtensionInfo(void) {
+ GLAQUA_DEBUG_MSG("glXAglDDXExtensionInfo\n");
+ return &__glDDXExtensionInfo;
+}
+
/* maps from surface id -> list of __GLcontext */
static x_hash_table *surface_hash;
-
-// Context manipulation; return GL_FALSE on failure
-static GLboolean glAquaDestroyContext(__GLcontext *gc)
-{
+static void __glXAquaContextDestroy(__GLXcontext *baseContext) {
x_list *lst;
- GLAQUA_DEBUG_MSG("glAquaDestroyContext (ctx 0x%x)\n",
- (unsigned int) gc->ctx);
-
- if (gc != NULL)
- {
- if (gc->sid != 0 && surface_hash != NULL)
- {
- lst = x_hash_table_lookup(surface_hash, (void *) gc->sid, NULL);
- lst = x_list_remove(lst, gc);
- x_hash_table_insert(surface_hash, (void *) gc->sid, lst);
- }
+ __GLXAquaContext *context = (__GLXAquaContext *) baseContext;
- if (gc->ctx != NULL)
- CGLDestroyContext(gc->ctx);
+ 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_list_remove(lst, context);
+ x_hash_table_insert(surface_hash, (void *) context->sid, lst);
+ }
- if (gc->pixelFormat != NULL)
- CGLDestroyPixelFormat(gc->pixelFormat);
+ if (context->ctx != NULL) CGLDestroyContext(context->ctx);
- free(gc);
+ if (context->pixelFormat != NULL) CGLDestroyPixelFormat(context->pixelFormat);
+
+ free(context);
}
-
- return GL_TRUE;
}
-static GLboolean glAquaLoseCurrent(__GLcontext *gc)
-{
+static int __glXAquaContextLoseCurrent(__GLXcontext *baseContext) {
CGLError gl_err;
- GLAQUA_DEBUG_MSG("glAquaLoseCurrent (ctx 0x%x)\n", (unsigned int) gc->ctx);
+ GLAQUA_DEBUG_MSG("glAquaLoseCurrent (ctx 0x%p)\n", baseContext);
gl_err = CGLSetCurrentContext(NULL);
if (gl_err != 0)
- ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err));
+ ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err));
__glXLastContext = NULL; // Mesa does this; why?
@@ -258,141 +261,134 @@ static GLboolean glAquaLoseCurrent(__GLcontext *gc)
/* Called when a surface is destroyed as a side effect of destroying
the window it's attached to. */
-static void surface_notify(void *_arg, void *data)
-{
- DRISurfaceNotifyArg *arg = _arg;
- GLAquaDrawableRec *aquaPriv = data;
- __GLcontext *gc;
+static void surface_notify(void *_arg, void *data) {
+ DRISurfaceNotifyArg *arg = (DRISurfaceNotifyArg *)_arg;
+ __GLXAquaDrawable *draw = (__GLXAquaDrawable *)data;
+ __GLXAquaContext *context;
x_list *lst;
-
- switch (arg->kind)
- {
+ 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);
-
- aquaPriv->pDraw = NULL;
- aquaPriv->sid = 0;
+ draw->base.pDraw = NULL;
+ draw->sid = 0;
break;
case AppleDRISurfaceNotifyChanged:
- if (surface_hash != NULL)
- {
+ if (surface_hash != NULL) {
lst = x_hash_table_lookup(surface_hash, (void *) arg->id, NULL);
for (; lst != NULL; lst = lst->next)
{
- gc = lst->data;
- xp_update_gl_context(gc->ctx);
+ context = lst->data;
+ xp_update_gl_context(context->ctx);
}
}
break;
+ default:
+ ErrorF("surface_notify: unknown kind %d\n", arg->kind);
+ break;
}
}
-static void unattach(__GLcontext *gc)
-{
- x_list *lst;
-
- if (gc->isAttached)
- {
- GLAQUA_DEBUG_MSG("unattaching\n");
-
- if (surface_hash != NULL)
- {
- lst = x_hash_table_lookup(surface_hash, (void *) gc->sid, NULL);
- lst = x_list_remove(lst, gc);
- x_hash_table_insert(surface_hash, (void *) gc->sid, lst);
- }
-
- CGLClearDrawable(gc->ctx);
- gc->isAttached = FALSE;
- gc->sid = 0;
- }
-}
-
-static void attach(__GLcontext *gc, __GLdrawablePrivate *glPriv)
-{
- __GLXdrawablePrivate *glxPriv;
- GLAquaDrawableRec *aquaPriv;
+static void attach(__GLXAquaContext *context, __GLXAquaDrawable *draw) {
DrawablePtr pDraw;
-
- glxPriv = (__GLXdrawablePrivate *)glPriv->other;
- aquaPriv = (GLAquaDrawableRec *)glPriv->private;
- pDraw = glxPriv->pDraw;
-
- if (aquaPriv->sid == 0)
- {
- if (!quartzProcs->CreateSurface(pDraw->pScreen, pDraw->id, pDraw,
- 0, &aquaPriv->sid, NULL,
- surface_notify, aquaPriv))
- {
+ GLAQUA_DEBUG_MSG("attach(%p, %p)\n", context, draw);
+ pDraw = draw->base.pDraw;
+
+ if (draw->sid == 0) {
+// if (!quartzProcs->CreateSurface(pDraw->pScreen, pDraw->id, pDraw,
+ if (!DRICreateSurface(pDraw->pScreen, pDraw->id, pDraw,
+ 0, &draw->sid, NULL,
+ surface_notify, draw))
return;
- }
- aquaPriv->pDraw = pDraw;
- }
+ draw->pDraw = pDraw;
+ }
- if (!gc->isAttached || gc->sid != aquaPriv->sid)
- {
+ if (!context->isAttached || context->sid != draw->sid) {
x_list *lst;
- if (xp_attach_gl_context(gc->ctx, aquaPriv->sid) != Success)
- {
- quartzProcs->DestroySurface(pDraw->pScreen, pDraw->id, pDraw,
- surface_notify, aquaPriv);
+ if (xp_attach_gl_context(context->ctx, draw->sid) != Success) {
+// quartzProcs->DestroySurface(pDraw->pScreen, pDraw->id, pDraw,
+ DRIDestroySurface(pDraw->pScreen, pDraw->id, pDraw,
+ surface_notify, draw);
if (surface_hash != NULL)
- x_hash_table_remove(surface_hash, (void *) aquaPriv->sid);
+ x_hash_table_remove(surface_hash, (void *) draw->sid);
- aquaPriv->sid = 0;
+ draw->sid = 0;
return;
}
- gc->isAttached = TRUE;
- gc->sid = aquaPriv->sid;
+ 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 *) gc->sid, NULL);
- if (x_list_find(lst, gc) == NULL)
- {
- lst = x_list_prepend(lst, gc);
- x_hash_table_insert(surface_hash, (void *) gc->sid, lst);
+ lst = x_hash_table_lookup(surface_hash, (void *) 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);
}
GLAQUA_DEBUG_MSG("attached 0x%x to 0x%x\n", (unsigned int) pDraw->id,
- (unsigned int) aquaPriv->sid);
+ (unsigned int) draw->sid);
+ }
+}
+
+#if 0 // unused
+static void unattach(__GLXAquaContext *context) {
+ x_list *lst;
+ GLAQUA_DEBUG_MSG("unattach\n");
+ if (context == NULL) {
+ ErrorF("Tried to unattach a null context\n");
+ return;
+ }
+ if (context->isAttached) {
+ GLAQUA_DEBUG_MSG("unattaching\n");
+
+ if (surface_hash != NULL) {
+ lst = x_hash_table_lookup(surface_hash, (void *) context->sid, NULL);
+ lst = x_list_remove(lst, context);
+ x_hash_table_insert(surface_hash, (void *) context->sid, lst);
+ }
+
+ CGLClearDrawable(context->ctx);
+ context->isAttached = FALSE;
+ context->sid = 0;
}
}
+#endif
-static GLboolean glAquaMakeCurrent(__GLcontext *gc)
-{
- __GLdrawablePrivate *glPriv = gc->interface.imports.getDrawablePrivate(gc);
+static int __glXAquaContextMakeCurrent(__GLXcontext *baseContext) {
CGLError gl_err;
+ __GLXAquaContext *context = (__GLXAquaContext *) baseContext;
+ __GLXAquaDrawable *drawPriv = (__GLXAquaDrawable *) context->base.drawPriv;
- GLAQUA_DEBUG_MSG("glAquaMakeCurrent (ctx 0x%x)\n", (unsigned int) gc->ctx);
-
- attach(gc, glPriv);
+ GLAQUA_DEBUG_MSG("glAquaMakeCurrent (ctx 0x%p)\n", baseContext);
+
+ attach(context, drawPriv);
- gl_err = CGLSetCurrentContext(gc->ctx);
+ gl_err = CGLSetCurrentContext(context->ctx);
if (gl_err != 0)
ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err));
-
+
return gl_err == 0;
}
-static GLboolean glAquaShareContext(__GLcontext *gc, __GLcontext *gcShare)
-{
- GLAQUA_DEBUG_MSG("glAquaShareContext unimplemented\n");
-
- return GL_TRUE;
-}
-
-static GLboolean glAquaCopyContext(__GLcontext *dst, const __GLcontext *src,
- GLuint mask)
+static int __glXAquaContextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc, unsigned long mask)
{
CGLError gl_err;
- GLAQUA_DEBUG_MSG("glAquaCopyContext\n");
+ __GLXAquaContext *dst = (__GLXAquaContext *) baseDst;
+ __GLXAquaContext *src = (__GLXAquaContext *) baseSrc;
+
+ GLAQUA_DEBUG_MSG("GLXAquaContextCopy\n");
gl_err = CGLCopyContext(src->ctx, dst->ctx, mask);
if (gl_err != 0)
@@ -401,14 +397,13 @@ static GLboolean glAquaCopyContext(__GLcontext *dst, const __GLcontext *src,
return gl_err == 0;
}
-static GLboolean glAquaForceCurrent(__GLcontext *gc)
+static int __glXAquaContextForceCurrent(__GLXcontext *baseContext)
{
CGLError gl_err;
+ __GLXAquaContext *context = (__GLXAquaContext *) baseContext;
+ GLAQUA_DEBUG_MSG("glAquaForceCurrent (ctx %p)\n", context->ctx);
- GLAQUA_DEBUG_MSG("glAquaForceCurrent (ctx 0x%x)\n",
- (unsigned int) gc->ctx);
-
- gl_err = CGLSetCurrentContext(gc->ctx);
+ gl_err = CGLSetCurrentContext(context->ctx);
if (gl_err != 0)
ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err));
@@ -417,45 +412,36 @@ static GLboolean glAquaForceCurrent(__GLcontext *gc)
/* Drawing surface notification callbacks */
-static GLboolean glAquaNotifyResize(__GLcontext *gc)
-{
- GLAQUA_DEBUG_MSG("unimplemented glAquaNotifyResize");
+static GLboolean __glXAquaDrawableResize(__GLXdrawable *base) {
+ GLAQUA_DEBUG_MSG("unimplemented glAquaDrawableResize\n");
return GL_TRUE;
}
-static void glAquaNotifyDestroy(__GLcontext *gc)
-{
- GLAQUA_DEBUG_MSG("unimplemented glAquaNotifyDestroy");
-}
-
-static void glAquaNotifySwapBuffers(__GLcontext *gc)
-{
- GLAQUA_DEBUG_MSG("unimplemented glAquaNotifySwapBuffers");
-}
-
-/* Dispatch table override control for external agents like libGLS */
-static struct __GLdispatchStateRec* glAquaDispatchExec(__GLcontext *gc)
-{
- GLAQUA_DEBUG_MSG("unimplemented glAquaDispatchExec");
- return NULL;
-}
-
-static void glAquaBeginDispatchOverride(__GLcontext *gc)
-{
- GLAQUA_DEBUG_MSG("unimplemented glAquaBeginDispatchOverride");
-}
-
-static void glAquaEndDispatchOverride(__GLcontext *gc)
-{
- GLAQUA_DEBUG_MSG("unimplemented glAquaEndDispatchOverride");
+static GLboolean __glXAquaDrawableSwapBuffers(__GLXdrawable *base) {
+ CGLError gl_err;
+ __GLXAquaContext * drawableCtx;
+// 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));
+ }
+ return GL_TRUE;
}
-static CGLPixelFormatObj makeFormat(__GLcontextModes *mode)
-{
+static CGLPixelFormatObj makeFormat(__GLcontextModes *mode) {
int i;
CGLPixelFormatAttribute attr[64]; // currently uses max of 30
CGLPixelFormatObj result;
- long n_formats;
+ GLint n_formats;
CGLError gl_err;
GLAQUA_DEBUG_MSG("makeFormat\n");
@@ -491,10 +477,12 @@ static CGLPixelFormatObj makeFormat(__GLcontextModes *mode)
attr[i++] = mode->accumRedBits + mode->accumGreenBits
+ mode->accumBlueBits + mode->accumAlphaBits;
}
+
if (mode->haveDepthBuffer) {
attr[i++] = kCGLPFADepthSize;
attr[i++] = mode->depthBits;
}
+
if (mode->haveStencilBuffer) {
attr[i++] = kCGLPFAStencilSize;
attr[i++] = mode->stencilBits;
@@ -521,129 +509,6 @@ static CGLPixelFormatObj makeFormat(__GLcontextModes *mode)
return result;
}
-static __GLinterface *glAquaCreateContext(__GLimports *imports,
- __GLcontextModes *mode,
- __GLinterface *shareGC)
-{
- __GLcontext *result;
- __GLcontext *sharectx = (__GLcontext *)shareGC;
- CGLError gl_err;
-
- GLAQUA_DEBUG_MSG("glAquaCreateContext\n");
-
- result = (__GLcontext *)calloc(1, sizeof(__GLcontext));
- if (!result) return NULL;
-
- result->interface.imports = *imports;
- result->interface.exports = glAquaExports;
-
- result->pixelFormat = makeFormat(mode);
- if (!result->pixelFormat) {
- free(result);
- return NULL;
- }
-
- result->ctx = NULL;
- gl_err = CGLCreateContext(result->pixelFormat,
- sharectx ? sharectx->ctx : NULL,
- &result->ctx);
-
- if (gl_err != 0) {
- ErrorF("CGLCreateContext error: %s\n", CGLErrorString(gl_err));
- CGLDestroyPixelFormat(result->pixelFormat);
- free(result);
- return NULL;
- }
-
- GLAQUA_DEBUG_MSG("glAquaCreateContext done\n");
- return (__GLinterface *)result;
-}
-
-Bool
-glAquaRealizeWindow(WindowPtr pWin)
-{
- // If this window has GL contexts, tell them to reattach
- Bool result;
- ScreenPtr pScreen = pWin->drawable.pScreen;
- glAquaScreenRec *screenPriv = &glAquaScreens[pScreen->myNum];
- __GLXdrawablePrivate *glxPriv;
-
- GLAQUA_DEBUG_MSG("glAquaRealizeWindow\n");
-
- // Allow the window to be created (RootlessRealizeWindow is inside our wrap)
- pScreen->RealizeWindow = screenPriv->RealizeWindow;
- result = pScreen->RealizeWindow(pWin);
- pScreen->RealizeWindow = glAquaRealizeWindow;
-
- // The Aqua window will already have been created (windows are
- // realized from top down)
-
- // Re-attach this window's GL contexts, if any.
- glxPriv = __glXFindDrawablePrivate(pWin->drawable.id);
- if (glxPriv) {
- __GLXcontext *gx;
- __GLcontext *gc;
- __GLdrawablePrivate *glPriv = &glxPriv->glPriv;
- GLAQUA_DEBUG_MSG("glAquaRealizeWindow is GL drawable!\n");
-
- // GL contexts bound to this window for drawing
- for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->next) {
- gc = (__GLcontext *)gx->gc;
- attach(gc, glPriv);
- }
-
- // GL contexts bound to this window for reading
- for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->next) {
- gc = (__GLcontext *)gx->gc;
- attach(gc, glPriv);
- }
- }
-
- return result;
-}
-
-Bool
-glAquaUnrealizeWindow(WindowPtr pWin)
-{
- // If this window has GL contexts, tell them to unattach
- Bool result;
- ScreenPtr pScreen = pWin->drawable.pScreen;
- glAquaScreenRec *screenPriv = &glAquaScreens[pScreen->myNum];
- __GLXdrawablePrivate *glxPriv;
-
- GLAQUA_DEBUG_MSG("glAquaUnrealizeWindow\n");
-
- // The Aqua window may have already been destroyed (windows
- // are unrealized from top down)
-
- // Unattach this window's GL contexts, if any.
- glxPriv = __glXFindDrawablePrivate(pWin->drawable.id);
- if (glxPriv) {
- __GLXcontext *gx;
- __GLcontext *gc;
- GLAQUA_DEBUG_MSG("glAquaUnealizeWindow is GL drawable!\n");
-
- // GL contexts bound to this window for drawing
- for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->next) {
- gc = (__GLcontext *)gx->gc;
- unattach(gc);
- }
-
- // GL contexts bound to this window for reading
- for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->next) {
- gc = (__GLcontext *)gx->gc;
- unattach(gc);
- }
- }
-
- pScreen->UnrealizeWindow = screenPriv->UnrealizeWindow;
- result = pScreen->UnrealizeWindow(pWin);
- pScreen->UnrealizeWindow = glAquaUnrealizeWindow;
-
- return result;
-}
-
-
// Originally copied from Mesa
static int numConfigs = 0;
@@ -821,15 +686,15 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp,
/* Alloc space for the list of new GLX visuals */
pNewVisualConfigs = (__GLXvisualConfig *)
- __glXMalloc(numNewConfigs * sizeof(__GLXvisualConfig));
+ malloc(numNewConfigs * sizeof(__GLXvisualConfig));
if (!pNewVisualConfigs) {
return FALSE;
}
/* Alloc space for the list of new GLX visual privates */
- pNewVisualPriv = (void **) __glXMalloc(numNewConfigs * sizeof(void *));
+ pNewVisualPriv = (void **) malloc(numNewConfigs * sizeof(void *));
if (!pNewVisualPriv) {
- __glXFree(pNewVisualConfigs);
+ free(pNewVisualConfigs);
return FALSE;
}
@@ -879,40 +744,40 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp,
numConfigs = 0;
/* Alloc temp space for the list of orig VisualIDs for each new visual */
- orig_vid = (VisualID *)__glXMalloc(numNewVisuals * sizeof(VisualID));
+ orig_vid = (VisualID *)malloc(numNewVisuals * sizeof(VisualID));
if (!orig_vid) {
- __glXFree(pNewVisualPriv);
- __glXFree(pNewVisualConfigs);
+ free(pNewVisualPriv);
+ free(pNewVisualConfigs);
return FALSE;
}
/* Alloc space for the list of glXVisuals */
modes = _gl_context_modes_create(numNewVisuals, sizeof(__GLcontextModes));
if (modes == NULL) {
- __glXFree(orig_vid);
- __glXFree(pNewVisualPriv);
- __glXFree(pNewVisualConfigs);
+ free(orig_vid);
+ free(pNewVisualPriv);
+ free(pNewVisualConfigs);
return FALSE;
}
/* Alloc space for the list of glXVisualPrivates */
- glXVisualPriv = (void **)__glXMalloc(numNewVisuals * sizeof(void *));
+ glXVisualPriv = (void **)malloc(numNewVisuals * sizeof(void *));
if (!glXVisualPriv) {
_gl_context_modes_destroy( modes );
- __glXFree(orig_vid);
- __glXFree(pNewVisualPriv);
- __glXFree(pNewVisualConfigs);
+ free(orig_vid);
+ free(pNewVisualPriv);
+ free(pNewVisualConfigs);
return FALSE;
}
/* Alloc space for the new list of the X server's visuals */
- pVisualNew = (VisualPtr)__glXMalloc(numNewVisuals * sizeof(VisualRec));
+ pVisualNew = (VisualPtr)malloc(numNewVisuals * sizeof(VisualRec));
if (!pVisualNew) {
- __glXFree(glXVisualPriv);
+ free(glXVisualPriv);
_gl_context_modes_destroy( modes );
- __glXFree(orig_vid);
- __glXFree(pNewVisualPriv);
- __glXFree(pNewVisualConfigs);
+ free(orig_vid);
+ free(pNewVisualPriv);
+ free(pNewVisualConfigs);
return FALSE;
}
@@ -1007,9 +872,9 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp,
/* Save the GLX visuals in the screen structure */
glAquaScreens[screenInfo.numScreens-1].num_vis = numNewVisuals;
- glAquaScreens[screenInfo.numScreens-1].priv = glXVisualPriv;
+ // glAquaScreens[screenInfo.numScreens-1].priv = glXVisualPriv;
- /* Set up depth's VisualIDs */
+ /* set up depth's VisualIDs */
for (i = 0; i < ndepth; i++) {
int numVids = 0;
VisualID *pVids = NULL;
@@ -1022,7 +887,7 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp,
numVids++;
/* Allocate a new list of VisualIDs for this depth */
- pVids = (VisualID *)__glXMalloc(numVids * sizeof(VisualID));
+ pVids = (VisualID *)malloc(numVids * sizeof(VisualID));
/* Initialize the new list of VisualIDs for this depth */
for (j = 0; j < pdepth[i].numVids; j++)
@@ -1031,7 +896,7 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp,
pVids[n++] = pVisualNew[k].vid;
/* Update this depth's list of VisualIDs */
- __glXFree(pdepth[i].vids);
+ free(pdepth[i].vids);
pdepth[i].vids = pVids;
pdepth[i].numVids = numVids;
}
@@ -1041,21 +906,22 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp,
*visualp = pVisualNew;
/* Free the old list of the X server's visuals */
- __glXFree(pVisual);
+ free(pVisual);
/* Clean up temporary allocations */
- __glXFree(orig_vid);
- __glXFree(pNewVisualPriv);
- __glXFree(pNewVisualConfigs);
+ free(orig_vid);
+ free(pNewVisualPriv);
+ free(pNewVisualConfigs);
/* Free the private list created by DDX HW driver */
if (visualPrivates)
- xfree(visualPrivates);
+ free(visualPrivates);
visualPrivates = NULL;
return TRUE;
}
+Bool enable_stereo = FALSE;
/* based on code in i830_dri.c
This ends calling glAquaSetVisualConfigs to set the static
numconfigs, etc. */
@@ -1066,20 +932,22 @@ glAquaInitVisualConfigs(void)
__GLXvisualConfig *lclVisualConfigs = NULL;
void **lclVisualPrivates = NULL;
- int depth, aux, buffers, stencil, accum;
+ int stereo, depth, aux, buffers, stencil, accum;
int 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)
- = 32 configs */
+ = 64 configs with stereo, or 32 without */
- lclNumConfigs = 2 * 2 * 2 * 2 * 2; /* 32 */
+ 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);
@@ -1088,54 +956,55 @@ glAquaInitVisualConfigs(void)
/* fill in configs */
if (NULL != lclVisualConfigs) {
i = 0; /* current buffer */
- for (depth = 0; depth < 2; depth++) {
+ 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;
- }
- lclVisualConfigs[i].doubleBuffer = buffers ? TRUE : FALSE;
- lclVisualConfigs[i].stereo = 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++;
- }
- }
- }
+ 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;
+ }
+ 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");
@@ -1165,13 +1034,13 @@ static Bool glAquaInitVisuals(VisualPtr *visualp, DepthPtr *depthp,
glAquaInitVisualConfigs(); /* ensure the visual configs are setup */
/*
- * Setup the visuals supported by this particular screen.
+ * 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];
@@ -1204,27 +1073,35 @@ static void fixup_visuals(int screen)
}
}
}
+#endif
+static void __glXAquaScreenDestroy(__GLXscreen *screen) {
-static void init_screen_visuals(int screen)
-{
- ScreenPtr pScreen = screenInfo.screens[screen];
- __GLcontextModes *modes;
- int *used;
- int i, j;
+ 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: __glXMalloc / __glXFree. If nothing else, convert 'used' to
+ * FIXME: malloc / free. If nothing else, convert 'used' to
* FIXME: array of bytes instead of ints!
*/
- used = (int *)__glXMalloc(pScreen->numVisuals * sizeof(int));
- __glXMemset(used, 0, pScreen->numVisuals * sizeof(int));
+ used = (int *)malloc(pScreen->numVisuals * sizeof(int));
+ memset(used, 0, pScreen->numVisuals * sizeof(int));
i = 0;
- for ( modes = glAquaScreens[screen].modes
+ for ( modes = screen -> base.modes
; modes != NULL
; modes = modes->next ) {
const int vis_class = _gl_convert_to_x_visual_type( modes->visualType );
@@ -1239,7 +1116,7 @@ static void init_screen_visuals(int screen)
pVis[j].blueMask == modes->blueMask &&
!used[j]) {
- /* Set the VisualID */
+ /* set the VisualID */
modes->visualID = pVis[j].vid;
/* Mark this visual used */
@@ -1261,102 +1138,63 @@ static void init_screen_visuals(int screen)
i++;
}
- __glXFree(used);
+ free(used);
}
-static Bool glAquaScreenProbe(int screen)
-{
- ScreenPtr pScreen;
- glAquaScreenRec *screenPriv;
+static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen) {
+ __GLXAquaScreen *screen;
+ GLAQUA_DEBUG_MSG("glXAquaScreenProbe\n");
+ if (screen == NULL) return NULL;
- GLAQUA_DEBUG_MSG("glAquaScreenProbe\n");
+ screen = malloc(sizeof *screen);
- /*
- * Set up the current screen's visuals.
- */
- __glDDXScreenInfo.modes = glAquaScreens[screen].modes;
- __glDDXScreenInfo.pVisualPriv = glAquaScreens[screen].priv;
- __glDDXScreenInfo.numVisuals =
- __glDDXScreenInfo.numUsableVisuals = glAquaScreens[screen].num_vis;
+ __glXScreenInit(&screen->base, pScreen);
- /*
- * Set the current screen's createContext routine. This could be
- * wrapped by a DDX GLX context creation routine.
- */
- __glDDXScreenInfo.createContext = glAquaCreateContext;
+ screen->base.destroy = __glXAquaScreenDestroy;
+ screen->base.createContext = __glXAquaScreenCreateContext;
+ screen->base.createDrawable = __glXAquaScreenCreateDrawable;
+ screen->base.pScreen = pScreen;
- /*
- * The ordering of the rgb compenents might have been changed by the
- * driver after mi initialized them.
- */
- fixup_visuals(screen);
+ init_screen_visuals(screen);
- /*
- * Find the GLX visuals that are supported by this screen and create
- * XMesa's visuals.
- */
- init_screen_visuals(screen);
-
- /*
- * Wrap RealizeWindow and UnrealizeWindow on this screen
- */
- pScreen = screenInfo.screens[screen];
- screenPriv = &glAquaScreens[screen];
- screenPriv->RealizeWindow = pScreen->RealizeWindow;
- pScreen->RealizeWindow = glAquaRealizeWindow;
- screenPriv->UnrealizeWindow = pScreen->UnrealizeWindow;
- pScreen->UnrealizeWindow = glAquaUnrealizeWindow;
-
- return TRUE;
+ return &screen->base;
}
-static GLboolean glAquaSwapBuffers(__GLXdrawablePrivate *glxPriv)
-{
- // swap buffers on only *one* of the contexts
- // (e.g. the last one for drawing)
- __GLcontext *gc = (__GLcontext *)glxPriv->drawGlxc->gc;
- CGLError gl_err;
-
- GLAQUA_DEBUG_MSG("glAquaSwapBuffers\n");
-
- if (gc != NULL && gc->ctx != NULL)
- {
- gl_err = CGLFlushDrawable(gc->ctx);
- if (gl_err != 0)
- ErrorF("CGLFlushDrawable error: %s\n", CGLErrorString(gl_err));
- }
-
- return GL_TRUE;
-}
-
-static void glAquaDestroyDrawablePrivate(__GLdrawablePrivate *glPriv)
-{
+static void __glXAquaDrawableDestroy(__GLXdrawable *base) {
GLAQUA_DEBUG_MSG("glAquaDestroyDrawablePrivate\n");
/* 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(glPriv->private);
- glPriv->private = NULL;
+ free(base);
}
-static void glAquaCreateBuffer(__GLXdrawablePrivate *glxPriv)
-{
- GLAquaDrawableRec *aquaPriv = malloc(sizeof(GLAquaDrawableRec));
- __GLdrawablePrivate *glPriv = &glxPriv->glPriv;
+static __GLXdrawable *
+__glXAquaScreenCreateDrawable(__GLXscreen *screen,
+ DrawablePtr pDraw,
+ XID drawId,
+ __GLcontextModes *modes) {
+ __GLXAquaDrawable *glxPriv;
+
+ GLAQUA_DEBUG_MSG("glAquaScreenCreateDrawable(%p,%p,%d,%p)\n", context, pDraw, drawId, modes);
- aquaPriv->sid = 0;
- aquaPriv->pDraw = NULL;
+ glxPriv = xalloc(sizeof *glxPriv);
+ if (glxPriv == NULL) return NULL;
- GLAQUA_DEBUG_MSG("glAquaCreateBuffer\n");
+ memset(glxPriv, 0, sizeof *glxPriv);
- // replace swapBuffers (original is never called)
- glxPriv->swapBuffers = glAquaSwapBuffers;
+ if (!__glXDrawableInit(&glxPriv->base, screen, pDraw, drawId, modes)) {
+ xfree(glxPriv);
+ return NULL;
+ }
+
+ glxPriv->base.destroy = __glXAquaDrawableDestroy;
+ glxPriv->base.resize = __glXAquaDrawableResize;
+ glxPriv->base.swapBuffers = __glXAquaDrawableSwapBuffers;
+ // glxPriv->base.copySubBuffer = __glXAquaDrawableCopySubBuffer;
- // stash private data
- glPriv->private = aquaPriv;
- glPriv->freePrivate = glAquaDestroyDrawablePrivate;
+ return &glxPriv->base;
}
static void glAquaResetExtension(void)
@@ -1377,3 +1215,724 @@ GLuint __glFloorLog2(GLuint val)
}
return c;
}
+
+void warn_func(void * p1, char *format, ...) {
+ va_list v;
+ va_start(v, format);
+ vfprintf(stderr, format, v);
+ va_end(v);
+}
+
+static void setup_dispatch_table(void) {
+ struct _glapi_table *disp=_glapi_get_dispatch();
+ _glapi_set_warning_func((_glapi_warning_func)warn_func);
+ _glapi_noop_enable_warnings(TRUE);
+
+ SET_Accum(disp, glAccum);
+ SET_ActiveStencilFaceEXT(disp, glActiveStencilFaceEXT);
+ SET_ActiveTextureARB(disp, glActiveTextureARB);
+//SET_AlphaFragmentOp1ATI(disp, glAlphaFragmentOp1EXT); // <-- EXT -> ATI
+//SET_AlphaFragmentOp2ATI(disp, glAlphaFragmentOp2EXT);
+//SET_AlphaFragmentOp3ATI(disp, glAlphaFragmentOp3EXT);
+ SET_AlphaFunc(disp, glAlphaFunc);
+//SET_AreProgramsResidentNV(disp, glAreProgramsResidentNV);
+ SET_AreTexturesResident(disp, glAreTexturesResident);
+ SET_ArrayElement(disp, glArrayElement);
+ SET_AttachObjectARB(disp, glAttachObjectARB);
+ SET_Begin(disp, glBegin);
+//SET_BeginFragmentShaderATI(disp, glBeginFragmentShaderEXT); // <-- EXT -> ATI
+ SET_BeginQueryARB(disp, glBeginQueryARB);
+ SET_BindAttribLocationARB(disp, glBindAttribLocationARB);
+ SET_BindBufferARB(disp, glBindBufferARB);
+//SET_BindFragmentShaderATI(disp, glBindFragmentShaderEXT); // <-- EXT -> ATI
+ SET_BindFramebufferEXT(disp, glBindFramebufferEXT);
+//SET_BindProgramNV(disp, glBindProgramNV);
+ SET_BindRenderbufferEXT(disp, glBindRenderbufferEXT);
+ SET_BindTexture(disp, glBindTexture);
+ SET_Bitmap(disp, glBitmap);
+ SET_BlendColor(disp, glBlendColor);
+ SET_BlendEquation(disp, glBlendEquation);
+ SET_BlendEquationSeparateEXT(disp, glBlendEquationSeparateEXT);
+ SET_BlendFunc(disp, glBlendFunc);
+ SET_BlendFuncSeparateEXT(disp, glBlendFuncSeparateEXT);
+ SET_BlitFramebufferEXT(disp, glBlitFramebufferEXT);
+ SET_BufferDataARB(disp, glBufferDataARB);
+ SET_BufferSubDataARB(disp, glBufferSubDataARB);
+ SET_CallList(disp, glCallList);
+ SET_CallLists(disp, glCallLists);
+ SET_CheckFramebufferStatusEXT(disp, glCheckFramebufferStatusEXT);
+ SET_Clear(disp, glClear);
+ SET_ClearAccum(disp, glClearAccum);
+ SET_ClearColor(disp, glClearColor);
+ SET_ClearDepth(disp, glClearDepth);
+ SET_ClearIndex(disp, glClearIndex);
+ SET_ClearStencil(disp, glClearStencil);
+ SET_ClientActiveTextureARB(disp, glClientActiveTextureARB);
+ SET_ClipPlane(disp, glClipPlane);
+ SET_Color3b(disp, glColor3b);
+ SET_Color3bv(disp, glColor3bv);
+ SET_Color3d(disp, glColor3d);
+ SET_Color3dv(disp, glColor3dv);
+ SET_Color3f(disp, glColor3f);
+ SET_Color3fv(disp, glColor3fv);
+ SET_Color3i(disp, glColor3i);
+ SET_Color3iv(disp, glColor3iv);
+ SET_Color3s(disp, glColor3s);
+ SET_Color3sv(disp, glColor3sv);
+ SET_Color3ub(disp, glColor3ub);
+ SET_Color3ubv(disp, glColor3ubv);
+ SET_Color3ui(disp, glColor3ui);
+ SET_Color3uiv(disp, glColor3uiv);
+ SET_Color3us(disp, glColor3us);
+ SET_Color3usv(disp, glColor3usv);
+ SET_Color4b(disp, glColor4b);
+ SET_Color4bv(disp, glColor4bv);
+ SET_Color4d(disp, glColor4d);
+ SET_Color4dv(disp, glColor4dv);
+ SET_Color4f(disp, glColor4f);
+ SET_Color4fv(disp, glColor4fv);
+ SET_Color4i(disp, glColor4i);
+ SET_Color4iv(disp, glColor4iv);
+ SET_Color4s(disp, glColor4s);
+ SET_Color4sv(disp, glColor4sv);
+ SET_Color4ub(disp, glColor4ub);
+ SET_Color4ubv(disp, glColor4ubv);
+ SET_Color4ui(disp, glColor4ui);
+ SET_Color4uiv(disp, glColor4uiv);
+ SET_Color4us(disp, glColor4us);
+ SET_Color4usv(disp, glColor4usv);
+//SET_ColorFragmentOp1ATI(disp, glColorFragmentOp1EXT); // <-- EXT -> ATI
+//SET_ColorFragmentOp2ATI(disp, glColorFragmentOp2EXT);
+//SET_ColorFragmentOp3ATI(disp, glColorFragmentOp3EXT);
+ SET_ColorMask(disp, glColorMask);
+ SET_ColorMaterial(disp, glColorMaterial);
+ SET_ColorPointer(disp, glColorPointer);
+//SET_ColorPointerEXT(disp, glColorPointerEXT);
+ SET_ColorSubTable(disp, glColorSubTable);
+ SET_ColorTable(disp, glColorTable);
+ SET_ColorTableParameterfv(disp, glColorTableParameterfv);
+ SET_ColorTableParameteriv(disp, glColorTableParameteriv);
+ SET_CombinerInputNV(disp, glCombinerInputNV);
+ SET_CombinerOutputNV(disp, glCombinerOutputNV);
+ SET_CombinerParameterfNV(disp, glCombinerParameterfNV);
+ SET_CombinerParameterfvNV(disp, glCombinerParameterfvNV);
+ SET_CombinerParameteriNV(disp, glCombinerParameteriNV);
+ SET_CombinerParameterivNV(disp, glCombinerParameterivNV);
+ SET_CompileShaderARB(disp, glCompileShaderARB);
+ SET_CompressedTexImage1DARB(disp, glCompressedTexImage1DARB);
+ SET_CompressedTexImage2DARB(disp, glCompressedTexImage2DARB);
+ SET_CompressedTexImage3DARB(disp, glCompressedTexImage3DARB);
+ SET_CompressedTexSubImage1DARB(disp, glCompressedTexSubImage1DARB);
+ SET_CompressedTexSubImage2DARB(disp, glCompressedTexSubImage2DARB);
+ SET_CompressedTexSubImage3DARB(disp, glCompressedTexSubImage3DARB);
+ SET_ConvolutionFilter1D(disp, glConvolutionFilter1D);
+ SET_ConvolutionFilter2D(disp, glConvolutionFilter2D);
+ SET_ConvolutionParameterf(disp, glConvolutionParameterf);
+ SET_ConvolutionParameterfv(disp, glConvolutionParameterfv);
+ SET_ConvolutionParameteri(disp, glConvolutionParameteri);
+ SET_ConvolutionParameteriv(disp, glConvolutionParameteriv);
+ SET_CopyColorSubTable(disp, glCopyColorSubTable);
+ SET_CopyColorTable(disp, glCopyColorTable);
+ SET_CopyConvolutionFilter1D(disp, glCopyConvolutionFilter1D);
+ SET_CopyConvolutionFilter2D(disp, glCopyConvolutionFilter2D);
+ SET_CopyPixels(disp, glCopyPixels);
+ SET_CopyTexImage1D(disp, glCopyTexImage1D);
+ SET_CopyTexImage2D(disp, glCopyTexImage2D);
+ SET_CopyTexSubImage1D(disp, glCopyTexSubImage1D);
+ SET_CopyTexSubImage2D(disp, glCopyTexSubImage2D);
+ SET_CopyTexSubImage3D(disp, glCopyTexSubImage3D);
+ SET_CreateProgramObjectARB(disp, glCreateProgramObjectARB);
+ SET_CreateShaderObjectARB(disp, glCreateShaderObjectARB);
+ SET_CullFace(disp, glCullFace);
+//SET_CullParameterdvEXT(disp, glCullParameterdvEXT);
+//SET_CullParameterfvEXT(disp, glCullParameterfvEXT);
+ SET_DeleteBuffersARB(disp, glDeleteBuffersARB);
+ SET_DeleteFencesNV(disp, glDeleteFencesAPPLE);
+//SET_DeleteFragmentShaderATI(disp, glDeleteFragmentShaderEXT); // <-- EXT -> ATI
+ SET_DeleteFramebuffersEXT(disp, glDeleteFramebuffersEXT);
+ SET_DeleteLists(disp, glDeleteLists);
+ SET_DeleteObjectARB(disp, glDeleteObjectARB);
+//SET_DeleteProgramsNV(disp, glDeleteProgramsNV);
+ SET_DeleteQueriesARB(disp, glDeleteQueriesARB);
+ SET_DeleteRenderbuffersEXT(disp, glDeleteRenderbuffersEXT);
+ SET_DeleteTextures(disp, glDeleteTextures);
+ SET_DepthBoundsEXT(disp, glDepthBoundsEXT);
+ SET_DepthFunc(disp, glDepthFunc);
+ SET_DepthMask(disp, glDepthMask);
+ SET_DepthRange(disp, glDepthRange);
+ SET_DetachObjectARB(disp, glDetachObjectARB);
+ SET_Disable(disp, glDisable);
+ SET_DisableClientState(disp, glDisableClientState);
+ SET_DisableVertexAttribArrayARB(disp, glDisableVertexAttribArrayARB);
+ SET_DrawArrays(disp, glDrawArrays);
+ SET_DrawBuffer(disp, glDrawBuffer);
+ SET_DrawBuffersARB(disp, glDrawBuffersARB);
+ SET_DrawElements(disp, glDrawElements);
+ SET_DrawPixels(disp, glDrawPixels);
+ SET_DrawRangeElements(disp, glDrawRangeElements);
+ SET_EdgeFlag(disp, glEdgeFlag);
+ SET_EdgeFlagPointer(disp, glEdgeFlagPointer);
+//SET_EdgeFlagPointerEXT(disp, glEdgeFlagPointerEXT);
+ SET_EdgeFlagv(disp, glEdgeFlagv);
+ SET_Enable(disp, glEnable);
+ SET_EnableClientState(disp, glEnableClientState);
+ SET_EnableVertexAttribArrayARB(disp, glEnableVertexAttribArrayARB);
+ SET_End(disp, glEnd);
+//SET_EndFragmentShaderATI(disp, glEndFragmentShaderEXT); // <-- EXT -> ATI
+ SET_EndList(disp, glEndList);
+ SET_EndQueryARB(disp, glEndQueryARB);
+ SET_EvalCoord1d(disp, glEvalCoord1d);
+ SET_EvalCoord1dv(disp, glEvalCoord1dv);
+ SET_EvalCoord1f(disp, glEvalCoord1f);
+ SET_EvalCoord1fv(disp, glEvalCoord1fv);
+ SET_EvalCoord2d(disp, glEvalCoord2d);
+ SET_EvalCoord2dv(disp, glEvalCoord2dv);
+ SET_EvalCoord2f(disp, glEvalCoord2f);
+ SET_EvalCoord2fv(disp, glEvalCoord2fv);
+ SET_EvalMesh1(disp, glEvalMesh1);
+ SET_EvalMesh2(disp, glEvalMesh2);
+ SET_EvalPoint1(disp, glEvalPoint1);
+ SET_EvalPoint2(disp, glEvalPoint2);
+//SET_ExecuteProgramNV(disp, glExecuteProgramNV);
+ SET_FeedbackBuffer(disp, glFeedbackBuffer);
+ SET_FinalCombinerInputNV(disp, glFinalCombinerInputNV);
+ SET_Finish(disp, glFinish);
+ SET_FinishFenceNV(disp, glFinishFenceAPPLE); // <-- APPLE -> NV
+ SET_Flush(disp, glFlush);
+//SET_FlushVertexArrayRangeNV(disp, glFlushVertexArrayRangeNV);
+ SET_FogCoordPointerEXT(disp, glFogCoordPointerEXT);
+ SET_FogCoorddEXT(disp, glFogCoorddEXT);
+ SET_FogCoorddvEXT(disp, glFogCoorddvEXT);
+ SET_FogCoordfEXT(disp, glFogCoordfEXT);
+ SET_FogCoordfvEXT(disp, glFogCoordfvEXT);
+ SET_Fogf(disp, glFogf);
+ SET_Fogfv(disp, glFogfv);
+ SET_Fogi(disp, glFogi);
+ SET_Fogiv(disp, glFogiv);
+ SET_FramebufferRenderbufferEXT(disp, glFramebufferRenderbufferEXT);
+ SET_FramebufferTexture1DEXT(disp, glFramebufferTexture1DEXT);
+ SET_FramebufferTexture2DEXT(disp, glFramebufferTexture2DEXT);
+ SET_FramebufferTexture3DEXT(disp, glFramebufferTexture3DEXT);
+ SET_FrontFace(disp, glFrontFace);
+ SET_Frustum(disp, glFrustum);
+ SET_GenBuffersARB(disp, glGenBuffersARB);
+ SET_GenFencesNV(disp, glGenFencesAPPLE); // <-- APPLE -> NV
+//SET_GenFragmentShadersATI(disp, glGenFragmentShadersEXT); // <-- EXT -> ATI
+ SET_GenFramebuffersEXT(disp, glGenFramebuffersEXT);
+ SET_GenLists(disp, glGenLists);
+//SET_GenProgramsNV(disp, glGenProgramsNV);
+ SET_GenQueriesARB(disp, glGenQueriesARB);
+ SET_GenRenderbuffersEXT(disp, glGenRenderbuffersEXT);
+ SET_GenTextures(disp, glGenTextures);
+ SET_GenerateMipmapEXT(disp, glGenerateMipmapEXT);
+ SET_GetActiveAttribARB(disp, glGetActiveAttribARB);
+ SET_GetActiveUniformARB(disp, glGetActiveUniformARB);
+ SET_GetAttachedObjectsARB(disp, glGetAttachedObjectsARB);
+ SET_GetAttribLocationARB(disp, glGetAttribLocationARB);
+ SET_GetBooleanv(disp, glGetBooleanv);
+ SET_GetBufferParameterivARB(disp, glGetBufferParameterivARB);
+ SET_GetBufferPointervARB(disp, glGetBufferPointervARB);
+ SET_GetBufferSubDataARB(disp, glGetBufferSubDataARB);
+ SET_GetClipPlane(disp, glGetClipPlane);
+ SET_GetColorTable(disp, glGetColorTable);
+ SET_GetColorTableParameterfv(disp, glGetColorTableParameterfv);
+ SET_GetColorTableParameteriv(disp, glGetColorTableParameteriv);
+ SET_GetCombinerInputParameterfvNV(disp, glGetCombinerInputParameterfvNV);
+ SET_GetCombinerInputParameterivNV(disp, glGetCombinerInputParameterivNV);
+ SET_GetCombinerOutputParameterfvNV(disp, glGetCombinerOutputParameterfvNV);
+ SET_GetCombinerOutputParameterivNV(disp, glGetCombinerOutputParameterivNV);
+ SET_GetCompressedTexImageARB(disp, glGetCompressedTexImageARB);
+ SET_GetConvolutionFilter(disp, glGetConvolutionFilter);
+ SET_GetConvolutionParameterfv(disp, glGetConvolutionParameterfv);
+ SET_GetConvolutionParameteriv(disp, glGetConvolutionParameteriv);
+ SET_GetDoublev(disp, glGetDoublev);
+ SET_GetError(disp, glGetError);
+//SET_GetFenceivNV(disp, glGetFenceivNV);
+ SET_GetFinalCombinerInputParameterfvNV(disp, glGetFinalCombinerInputParameterfvNV);
+ SET_GetFinalCombinerInputParameterivNV(disp, glGetFinalCombinerInputParameterivNV);
+ SET_GetFloatv(disp, glGetFloatv);
+ SET_GetFramebufferAttachmentParameterivEXT(disp, glGetFramebufferAttachmentParameterivEXT);
+ SET_GetHandleARB(disp, glGetHandleARB);
+ SET_GetHistogram(disp, glGetHistogram);
+ SET_GetHistogramParameterfv(disp, glGetHistogramParameterfv);
+ SET_GetHistogramParameteriv(disp, glGetHistogramParameteriv);
+ SET_GetInfoLogARB(disp, glGetInfoLogARB);
+ SET_GetIntegerv(disp, glGetIntegerv);
+ SET_GetLightfv(disp, glGetLightfv);
+ SET_GetLightiv(disp, glGetLightiv);
+ SET_GetMapdv(disp, glGetMapdv);
+ SET_GetMapfv(disp, glGetMapfv);
+ SET_GetMapiv(disp, glGetMapiv);
+ SET_GetMaterialfv(disp, glGetMaterialfv);
+ SET_GetMaterialiv(disp, glGetMaterialiv);
+ SET_GetMinmax(disp, glGetMinmax);
+ SET_GetMinmaxParameterfv(disp, glGetMinmaxParameterfv);
+ SET_GetMinmaxParameteriv(disp, glGetMinmaxParameteriv);
+ SET_GetObjectParameterfvARB(disp, glGetObjectParameterfvARB);
+ SET_GetObjectParameterivARB(disp, glGetObjectParameterivARB);
+ SET_GetPixelMapfv(disp, glGetPixelMapfv);
+ SET_GetPixelMapuiv(disp, glGetPixelMapuiv);
+ SET_GetPixelMapusv(disp, glGetPixelMapusv);
+//SET_GetPixelTexGenParameterfvSGIS(disp, glGetPixelTexGenParameterfvSGIS);
+//SET_GetPixelTexGenParameterivSGIS(disp, glGetPixelTexGenParameterivSGIS);
+ SET_GetPointerv(disp, glGetPointerv);
+ SET_GetPolygonStipple(disp, glGetPolygonStipple);
+ SET_GetProgramEnvParameterdvARB(disp, glGetProgramEnvParameterdvARB);
+ SET_GetProgramEnvParameterfvARB(disp, glGetProgramEnvParameterfvARB);
+ SET_GetProgramLocalParameterdvARB(disp, glGetProgramLocalParameterdvARB);
+ SET_GetProgramLocalParameterfvARB(disp, glGetProgramLocalParameterfvARB);
+//SET_GetProgramNamedParameterdvNV(disp, glGetProgramNamedParameterdvNV);
+//SET_GetProgramNamedParameterfvNV(disp, glGetProgramNamedParameterfvNV);
+//SET_GetProgramParameterdvNV(disp, glGetProgramParameterdvNV);
+//SET_GetProgramParameterfvNV(disp, glGetProgramParameterfvNV);
+ SET_GetProgramStringARB(disp, glGetProgramStringARB);
+//SET_GetProgramStringNV(disp, glGetProgramStringNV);
+ SET_GetProgramivARB(disp, glGetProgramivARB);
+//SET_GetProgramivNV(disp, glGetProgramivNV);
+//SET_GetQueryObjecti64vEXT(disp, glGetQueryObjecti64vEXT);
+ SET_GetQueryObjectivARB(disp, glGetQueryObjectivARB);
+//SET_GetQueryObjectui64vEXT(disp, glGetQueryObjectui64vEXT);
+ SET_GetQueryObjectuivARB(disp, glGetQueryObjectuivARB);
+ SET_GetQueryivARB(disp, glGetQueryivARB);
+ SET_GetRenderbufferParameterivEXT(disp, glGetRenderbufferParameterivEXT);
+ SET_GetSeparableFilter(disp, glGetSeparableFilter);
+ SET_GetShaderSourceARB(disp, glGetShaderSourceARB);
+ SET_GetString(disp, glGetString);
+ SET_GetTexEnvfv(disp, glGetTexEnvfv);
+ SET_GetTexEnviv(disp, glGetTexEnviv);
+ SET_GetTexGendv(disp, glGetTexGendv);
+ SET_GetTexGenfv(disp, glGetTexGenfv);
+ SET_GetTexGeniv(disp, glGetTexGeniv);
+ SET_GetTexImage(disp, glGetTexImage);
+ SET_GetTexLevelParameterfv(disp, glGetTexLevelParameterfv);
+ SET_GetTexLevelParameteriv(disp, glGetTexLevelParameteriv);
+ SET_GetTexParameterfv(disp, glGetTexParameterfv);
+ SET_GetTexParameteriv(disp, glGetTexParameteriv);
+//SET_GetTrackMatrixivNV(disp, glGetTrackMatrixivNV);
+ SET_GetUniformLocationARB(disp, glGetUniformLocationARB);
+ SET_GetUniformfvARB(disp, glGetUniformfvARB);
+ SET_GetUniformivARB(disp, glGetUniformivARB);
+//SET_GetVertexAttribPointervNV(disp, glGetVertexAttribPointervNV);
+ SET_GetVertexAttribdvARB(disp, glGetVertexAttribdvARB);
+//SET_GetVertexAttribdvNV(disp, glGetVertexAttribdvNV);
+ SET_GetVertexAttribfvARB(disp, glGetVertexAttribfvARB);
+//SET_GetVertexAttribfvNV(disp, glGetVertexAttribfvNV);
+ SET_GetVertexAttribivARB(disp, glGetVertexAttribivARB);
+//SET_GetVertexAttribivNV(disp, glGetVertexAttribivNV);
+ SET_Hint(disp, glHint);
+ SET_Histogram(disp, glHistogram);
+ SET_IndexMask(disp, glIndexMask);
+ SET_IndexPointer(disp, glIndexPointer);
+//SET_IndexPointerEXT(disp, glIndexPointerEXT);
+ SET_Indexd(disp, glIndexd);
+ SET_Indexdv(disp, glIndexdv);
+ SET_Indexf(disp, glIndexf);
+ SET_Indexfv(disp, glIndexfv);
+ SET_Indexi(disp, glIndexi);
+ SET_Indexiv(disp, glIndexiv);
+ SET_Indexs(disp, glIndexs);
+ SET_Indexsv(disp, glIndexsv);
+ SET_Indexub(disp, glIndexub);
+ SET_Indexubv(disp, glIndexubv);
+ SET_InitNames(disp, glInitNames);
+ SET_InterleavedArrays(disp, glInterleavedArrays);
+ SET_IsBufferARB(disp, glIsBufferARB);
+ SET_IsEnabled(disp, glIsEnabled);
+ SET_IsFenceNV(disp, glIsFenceAPPLE); // <-- APPLE -> NV
+ SET_IsFramebufferEXT(disp, glIsFramebufferEXT);
+ SET_IsList(disp, glIsList);
+//SET_IsProgramNV(disp, glIsProgramNV);
+ SET_IsQueryARB(disp, glIsQueryARB);
+ SET_IsRenderbufferEXT(disp, glIsRenderbufferEXT);
+ SET_IsTexture(disp, glIsTexture);
+ SET_LightModelf(disp, glLightModelf);
+ SET_LightModelfv(disp, glLightModelfv);
+ SET_LightModeli(disp, glLightModeli);
+ SET_LightModeliv(disp, glLightModeliv);
+ SET_Lightf(disp, glLightf);
+ SET_Lightfv(disp, glLightfv);
+ SET_Lighti(disp, glLighti);
+ SET_Lightiv(disp, glLightiv);
+ SET_LineStipple(disp, glLineStipple);
+ SET_LineWidth(disp, glLineWidth);
+ SET_LinkProgramARB(disp, glLinkProgramARB);
+ SET_ListBase(disp, glListBase);
+ SET_LoadIdentity(disp, glLoadIdentity);
+ SET_LoadMatrixd(disp, glLoadMatrixd);
+ SET_LoadMatrixf(disp, glLoadMatrixf);
+ SET_LoadName(disp, glLoadName);
+//SET_LoadProgramNV(disp, glLoadProgramNV);
+ SET_LoadTransposeMatrixdARB(disp, glLoadTransposeMatrixdARB);
+ SET_LoadTransposeMatrixfARB(disp, glLoadTransposeMatrixfARB);
+ SET_LockArraysEXT(disp, glLockArraysEXT);
+ SET_LogicOp(disp, glLogicOp);
+ SET_Map1d(disp, glMap1d);
+ SET_Map1f(disp, glMap1f);
+ SET_Map2d(disp, glMap2d);
+ SET_Map2f(disp, glMap2f);
+ SET_MapBufferARB(disp, glMapBufferARB);
+ SET_MapGrid1d(disp, glMapGrid1d);
+ SET_MapGrid1f(disp, glMapGrid1f);
+ SET_MapGrid2d(disp, glMapGrid2d);
+ SET_MapGrid2f(disp, glMapGrid2f);
+ SET_Materialf(disp, glMaterialf);
+ SET_Materialfv(disp, glMaterialfv);
+ SET_Materiali(disp, glMateriali);
+ SET_Materialiv(disp, glMaterialiv);
+ SET_MatrixMode(disp, glMatrixMode);
+ SET_Minmax(disp, glMinmax);
+ SET_MultMatrixd(disp, glMultMatrixd);
+ SET_MultMatrixf(disp, glMultMatrixf);
+ SET_MultTransposeMatrixdARB(disp, glMultTransposeMatrixdARB);
+ SET_MultTransposeMatrixfARB(disp, glMultTransposeMatrixfARB);
+ SET_MultiDrawArraysEXT(disp, glMultiDrawArraysEXT);
+ SET_MultiDrawElementsEXT(disp, glMultiDrawElementsEXT);
+//SET_MultiModeDrawArraysIBM(disp, glMultiModeDrawArraysIBM);
+//SET_MultiModeDrawElementsIBM(disp, glMultiModeDrawElementsIBM);
+ SET_MultiTexCoord1dARB(disp, glMultiTexCoord1dARB);
+ SET_MultiTexCoord1dvARB(disp, glMultiTexCoord1dvARB);
+ SET_MultiTexCoord1fARB(disp, glMultiTexCoord1fARB);
+ SET_MultiTexCoord1fvARB(disp, glMultiTexCoord1fvARB);
+ SET_MultiTexCoord1iARB(disp, glMultiTexCoord1iARB);
+ SET_MultiTexCoord1ivARB(disp, glMultiTexCoord1ivARB);
+ SET_MultiTexCoord1sARB(disp, glMultiTexCoord1sARB);
+ SET_MultiTexCoord1svARB(disp, glMultiTexCoord1svARB);
+ SET_MultiTexCoord2dARB(disp, glMultiTexCoord2dARB);
+ SET_MultiTexCoord2dvARB(disp, glMultiTexCoord2dvARB);
+ SET_MultiTexCoord2fARB(disp, glMultiTexCoord2fARB);
+ SET_MultiTexCoord2fvARB(disp, glMultiTexCoord2fvARB);
+ SET_MultiTexCoord2iARB(disp, glMultiTexCoord2iARB);
+ SET_MultiTexCoord2ivARB(disp, glMultiTexCoord2ivARB);
+ SET_MultiTexCoord2sARB(disp, glMultiTexCoord2sARB);
+ SET_MultiTexCoord2svARB(disp, glMultiTexCoord2svARB);
+ SET_MultiTexCoord3dARB(disp, glMultiTexCoord3dARB);
+ SET_MultiTexCoord3dvARB(disp, glMultiTexCoord3dvARB);
+ SET_MultiTexCoord3fARB(disp, glMultiTexCoord3fARB);
+ SET_MultiTexCoord3fvARB(disp, glMultiTexCoord3fvARB);
+ SET_MultiTexCoord3iARB(disp, glMultiTexCoord3iARB);
+ SET_MultiTexCoord3ivARB(disp, glMultiTexCoord3ivARB);
+ SET_MultiTexCoord3sARB(disp, glMultiTexCoord3sARB);
+ SET_MultiTexCoord3svARB(disp, glMultiTexCoord3svARB);
+ SET_MultiTexCoord4dARB(disp, glMultiTexCoord4dARB);
+ SET_MultiTexCoord4dvARB(disp, glMultiTexCoord4dvARB);
+ SET_MultiTexCoord4fARB(disp, glMultiTexCoord4fARB);
+ SET_MultiTexCoord4fvARB(disp, glMultiTexCoord4fvARB);
+ SET_MultiTexCoord4iARB(disp, glMultiTexCoord4iARB);
+ SET_MultiTexCoord4ivARB(disp, glMultiTexCoord4ivARB);
+ SET_MultiTexCoord4sARB(disp, glMultiTexCoord4sARB);
+ SET_MultiTexCoord4svARB(disp, glMultiTexCoord4svARB);
+ SET_NewList(disp, glNewList);
+ SET_Normal3b(disp, glNormal3b);
+ SET_Normal3bv(disp, glNormal3bv);
+ SET_Normal3d(disp, glNormal3d);
+ SET_Normal3dv(disp, glNormal3dv);
+ SET_Normal3f(disp, glNormal3f);
+ SET_Normal3fv(disp, glNormal3fv);
+ SET_Normal3i(disp, glNormal3i);
+ SET_Normal3iv(disp, glNormal3iv);
+ SET_Normal3s(disp, glNormal3s);
+ SET_Normal3sv(disp, glNormal3sv);
+ SET_NormalPointer(disp, glNormalPointer);
+//SET_NormalPointerEXT(disp, glNormalPointerEXT);
+ SET_Ortho(disp, glOrtho);
+//SET_PassTexCoordATI(disp, glPassTexCoordEXT); // <-- EXT -> ATI
+ SET_PassThrough(disp, glPassThrough);
+ SET_PixelMapfv(disp, glPixelMapfv);
+ SET_PixelMapuiv(disp, glPixelMapuiv);
+ SET_PixelMapusv(disp, glPixelMapusv);
+ SET_PixelStoref(disp, glPixelStoref);
+ SET_PixelStorei(disp, glPixelStorei);
+//SET_PixelTexGenParameterfSGIS(disp, glPixelTexGenParameterfSGIS);
+//SET_PixelTexGenParameterfvSGIS(disp, glPixelTexGenParameterfvSGIS);
+//SET_PixelTexGenParameteriSGIS(disp, glPixelTexGenParameteriSGIS);
+//SET_PixelTexGenParameterivSGIS(disp, glPixelTexGenParameterivSGIS);
+// SET_PixelTexGenSGIX(disp, glPixelTexGenSGIX);
+ SET_PixelTransferf(disp, glPixelTransferf);
+ SET_PixelTransferi(disp, glPixelTransferi);
+ SET_PixelZoom(disp, glPixelZoom);
+ SET_PointParameterfEXT(disp, glPointParameterfARB); // <-- ARB -> EXT
+ SET_PointParameterfvEXT(disp, glPointParameterfvARB); // <-- ARB -> EXT
+ SET_PointParameteriNV(disp, glPointParameteriNV);
+ SET_PointParameterivNV(disp, glPointParameterivNV);
+ SET_PointSize(disp, glPointSize);
+ SET_PolygonMode(disp, glPolygonMode);
+ SET_PolygonOffset(disp, glPolygonOffset);
+//SET_PolygonOffsetEXT(disp, glPolygonOffsetEXT);
+ SET_PolygonStipple(disp, glPolygonStipple);
+ SET_PopAttrib(disp, glPopAttrib);
+ SET_PopClientAttrib(disp, glPopClientAttrib);
+ SET_PopMatrix(disp, glPopMatrix);
+ SET_PopName(disp, glPopName);
+ SET_PrioritizeTextures(disp, glPrioritizeTextures);
+ SET_ProgramEnvParameter4dARB(disp, glProgramEnvParameter4dARB);
+ SET_ProgramEnvParameter4dvARB(disp, glProgramEnvParameter4dvARB);
+ SET_ProgramEnvParameter4fARB(disp, glProgramEnvParameter4fARB);
+ SET_ProgramEnvParameter4fvARB(disp, glProgramEnvParameter4fvARB);
+ SET_ProgramLocalParameter4dARB(disp, glProgramLocalParameter4dARB);
+ SET_ProgramLocalParameter4dvARB(disp, glProgramLocalParameter4dvARB);
+ SET_ProgramLocalParameter4fARB(disp, glProgramLocalParameter4fARB);
+ SET_ProgramLocalParameter4fvARB(disp, glProgramLocalParameter4fvARB);
+//SET_ProgramNamedParameter4dNV(disp, glProgramNamedParameter4dNV);
+//SET_ProgramNamedParameter4dvNV(disp, glProgramNamedParameter4dvNV);
+//SET_ProgramNamedParameter4fNV(disp, glProgramNamedParameter4fNV);
+//SET_ProgramNamedParameter4fvNV(disp, glProgramNamedParameter4fvNV);
+//SET_ProgramParameter4dNV(disp, glProgramParameter4dNV);
+//SET_ProgramParameter4dvNV(disp, glProgramParameter4dvNV);
+//SET_ProgramParameter4fNV(disp, glProgramParameter4fNV);
+//SET_ProgramParameter4fvNV(disp, glProgramParameter4fvNV);
+//SET_ProgramParameters4dvNV(disp, glProgramParameters4dvNV);
+//SET_ProgramParameters4fvNV(disp, glProgramParameters4fvNV);
+ SET_ProgramStringARB(disp, glProgramStringARB);
+ SET_PushAttrib(disp, glPushAttrib);
+ SET_PushClientAttrib(disp, glPushClientAttrib);
+ SET_PushMatrix(disp, glPushMatrix);
+ SET_PushName(disp, glPushName);
+ SET_RasterPos2d(disp, glRasterPos2d);
+ SET_RasterPos2dv(disp, glRasterPos2dv);
+ SET_RasterPos2f(disp, glRasterPos2f);
+ SET_RasterPos2fv(disp, glRasterPos2fv);
+ SET_RasterPos2i(disp, glRasterPos2i);
+ SET_RasterPos2iv(disp, glRasterPos2iv);
+ SET_RasterPos2s(disp, glRasterPos2s);
+ SET_RasterPos2sv(disp, glRasterPos2sv);
+ SET_RasterPos3d(disp, glRasterPos3d);
+ SET_RasterPos3dv(disp, glRasterPos3dv);
+ SET_RasterPos3f(disp, glRasterPos3f);
+ SET_RasterPos3fv(disp, glRasterPos3fv);
+ SET_RasterPos3i(disp, glRasterPos3i);
+ SET_RasterPos3iv(disp, glRasterPos3iv);
+ SET_RasterPos3s(disp, glRasterPos3s);
+ SET_RasterPos3sv(disp, glRasterPos3sv);
+ SET_RasterPos4d(disp, glRasterPos4d);
+ SET_RasterPos4dv(disp, glRasterPos4dv);
+ SET_RasterPos4f(disp, glRasterPos4f);
+ SET_RasterPos4fv(disp, glRasterPos4fv);
+ SET_RasterPos4i(disp, glRasterPos4i);
+ SET_RasterPos4iv(disp, glRasterPos4iv);
+ SET_RasterPos4s(disp, glRasterPos4s);
+ SET_RasterPos4sv(disp, glRasterPos4sv);
+ SET_ReadBuffer(disp, glReadBuffer);
+ SET_ReadPixels(disp, glReadPixels);
+ SET_Rectd(disp, glRectd);
+ SET_Rectdv(disp, glRectdv);
+ SET_Rectf(disp, glRectf);
+ SET_Rectfv(disp, glRectfv);
+ SET_Recti(disp, glRecti);
+ SET_Rectiv(disp, glRectiv);
+ SET_Rects(disp, glRects);
+ SET_Rectsv(disp, glRectsv);
+ SET_RenderMode(disp, glRenderMode);
+ SET_RenderbufferStorageEXT(disp, glRenderbufferStorageEXT);
+//SET_RequestResidentProgramsNV(disp, glRequestResidentProgramsNV);
+ SET_ResetHistogram(disp, glResetHistogram);
+ SET_ResetMinmax(disp, glResetMinmax);
+//SET_ResizeBuffersMESA(disp, glResizeBuffersMESA);
+ SET_Rotated(disp, glRotated);
+ SET_Rotatef(disp, glRotatef);
+ SET_SampleCoverageARB(disp, glSampleCoverageARB);
+//SET_SampleMapATI(disp, glSampleMapEXT); // <-- EXT -> ATI
+//SET_SampleMaskSGIS(disp, glSampleMaskSGIS);
+//SET_SamplePatternSGIS(disp, glSamplePatternSGIS);
+ SET_Scaled(disp, glScaled);
+ SET_Scalef(disp, glScalef);
+ SET_Scissor(disp, glScissor);
+ SET_SecondaryColor3bEXT(disp, glSecondaryColor3bEXT);
+ SET_SecondaryColor3bvEXT(disp, glSecondaryColor3bvEXT);
+ SET_SecondaryColor3dEXT(disp, glSecondaryColor3dEXT);
+ SET_SecondaryColor3dvEXT(disp, glSecondaryColor3dvEXT);
+ SET_SecondaryColor3fEXT(disp, glSecondaryColor3fEXT);
+ SET_SecondaryColor3fvEXT(disp, glSecondaryColor3fvEXT);
+ SET_SecondaryColor3iEXT(disp, glSecondaryColor3iEXT);
+ SET_SecondaryColor3ivEXT(disp, glSecondaryColor3ivEXT);
+ SET_SecondaryColor3sEXT(disp, glSecondaryColor3sEXT);
+ SET_SecondaryColor3svEXT(disp, glSecondaryColor3svEXT);
+ SET_SecondaryColor3ubEXT(disp, glSecondaryColor3ubEXT);
+ SET_SecondaryColor3ubvEXT(disp, glSecondaryColor3ubvEXT);
+ SET_SecondaryColor3uiEXT(disp, glSecondaryColor3uiEXT);
+ SET_SecondaryColor3uivEXT(disp, glSecondaryColor3uivEXT);
+ SET_SecondaryColor3usEXT(disp, glSecondaryColor3usEXT);
+ SET_SecondaryColor3usvEXT(disp, glSecondaryColor3usvEXT);
+ SET_SecondaryColorPointerEXT(disp, glSecondaryColorPointerEXT);
+ SET_SelectBuffer(disp, glSelectBuffer);
+ SET_SeparableFilter2D(disp, glSeparableFilter2D);
+ SET_SetFenceNV(disp, glSetFenceAPPLE); // <-- APPLE -> NV
+//SET_SetFragmentShaderConstantATI(disp, glSetFragmentShaderConstantEXT); // <-- EXT -> ATI
+ SET_ShadeModel(disp, glShadeModel);
+ SET_ShaderSourceARB(disp, glShaderSourceARB);
+ SET_StencilFunc(disp, glStencilFunc);
+ SET_StencilFuncSeparate(disp, glStencilFuncSeparate);
+ SET_StencilMask(disp, glStencilMask);
+ SET_StencilMaskSeparate(disp, glStencilMaskSeparate);
+ SET_StencilOp(disp, glStencilOp);
+ SET_StencilOpSeparate(disp, glStencilOpSeparate);
+ SET_TestFenceNV(disp, glTestFenceAPPLE); // <-- APPLE -> NV
+ SET_TexCoord1d(disp, glTexCoord1d);
+ SET_TexCoord1dv(disp, glTexCoord1dv);
+ SET_TexCoord1f(disp, glTexCoord1f);
+ SET_TexCoord1fv(disp, glTexCoord1fv);
+ SET_TexCoord1i(disp, glTexCoord1i);
+ SET_TexCoord1iv(disp, glTexCoord1iv);
+ SET_TexCoord1s(disp, glTexCoord1s);
+ SET_TexCoord1sv(disp, glTexCoord1sv);
+ SET_TexCoord2d(disp, glTexCoord2d);
+ SET_TexCoord2dv(disp, glTexCoord2dv);
+ SET_TexCoord2f(disp, glTexCoord2f);
+ SET_TexCoord2fv(disp, glTexCoord2fv);
+ SET_TexCoord2i(disp, glTexCoord2i);
+ SET_TexCoord2iv(disp, glTexCoord2iv);
+ SET_TexCoord2s(disp, glTexCoord2s);
+ SET_TexCoord2sv(disp, glTexCoord2sv);
+ SET_TexCoord3d(disp, glTexCoord3d);
+ SET_TexCoord3dv(disp, glTexCoord3dv);
+ SET_TexCoord3f(disp, glTexCoord3f);
+ SET_TexCoord3fv(disp, glTexCoord3fv);
+ SET_TexCoord3i(disp, glTexCoord3i);
+ SET_TexCoord3iv(disp, glTexCoord3iv);
+ SET_TexCoord3s(disp, glTexCoord3s);
+ SET_TexCoord3sv(disp, glTexCoord3sv);
+ SET_TexCoord4d(disp, glTexCoord4d);
+ SET_TexCoord4dv(disp, glTexCoord4dv);
+ SET_TexCoord4f(disp, glTexCoord4f);
+ SET_TexCoord4fv(disp, glTexCoord4fv);
+ SET_TexCoord4i(disp, glTexCoord4i);
+ SET_TexCoord4iv(disp, glTexCoord4iv);
+ SET_TexCoord4s(disp, glTexCoord4s);
+ SET_TexCoord4sv(disp, glTexCoord4sv);
+ SET_TexCoordPointer(disp, glTexCoordPointer);
+//SET_TexCoordPointerEXT(disp, glTexCoordPointerEXT);
+ SET_TexEnvf(disp, glTexEnvf);
+ SET_TexEnvfv(disp, glTexEnvfv);
+ SET_TexEnvi(disp, glTexEnvi);
+ SET_TexEnviv(disp, glTexEnviv);
+ SET_TexGend(disp, glTexGend);
+ SET_TexGendv(disp, glTexGendv);
+ SET_TexGenf(disp, glTexGenf);
+ SET_TexGenfv(disp, glTexGenfv);
+ SET_TexGeni(disp, glTexGeni);
+ SET_TexGeniv(disp, glTexGeniv);
+ SET_TexImage1D(disp, glTexImage1D);
+ SET_TexImage2D(disp, glTexImage2D);
+ SET_TexImage3D(disp, glTexImage3D);
+ SET_TexParameterf(disp, glTexParameterf);
+ SET_TexParameterfv(disp, glTexParameterfv);
+ SET_TexParameteri(disp, glTexParameteri);
+ SET_TexParameteriv(disp, glTexParameteriv);
+ SET_TexSubImage1D(disp, glTexSubImage1D);
+ SET_TexSubImage2D(disp, glTexSubImage2D);
+ SET_TexSubImage3D(disp, glTexSubImage3D);
+//SET_TrackMatrixNV(disp, glTrackMatrixNV);
+ SET_Translated(disp, glTranslated);
+ SET_Translatef(disp, glTranslatef);
+ SET_Uniform1fARB(disp, glUniform1fARB);
+ SET_Uniform1fvARB(disp, glUniform1fvARB);
+ SET_Uniform1iARB(disp, glUniform1iARB);
+ SET_Uniform1ivARB(disp, glUniform1ivARB);
+ SET_Uniform2fARB(disp, glUniform2fARB);
+ SET_Uniform2fvARB(disp, glUniform2fvARB);
+ SET_Uniform2iARB(disp, glUniform2iARB);
+ SET_Uniform2ivARB(disp, glUniform2ivARB);
+ SET_Uniform3fARB(disp, glUniform3fARB);
+ SET_Uniform3fvARB(disp, glUniform3fvARB);
+ SET_Uniform3iARB(disp, glUniform3iARB);
+ SET_Uniform3ivARB(disp, glUniform3ivARB);
+ SET_Uniform4fARB(disp, glUniform4fARB);
+ SET_Uniform4fvARB(disp, glUniform4fvARB);
+ SET_Uniform4iARB(disp, glUniform4iARB);
+ SET_Uniform4ivARB(disp, glUniform4ivARB);
+ SET_UniformMatrix2fvARB(disp, glUniformMatrix2fvARB);
+ SET_UniformMatrix3fvARB(disp, glUniformMatrix3fvARB);
+ SET_UniformMatrix4fvARB(disp, glUniformMatrix4fvARB);
+ SET_UnlockArraysEXT(disp, glUnlockArraysEXT);
+ SET_UnmapBufferARB(disp, glUnmapBufferARB);
+ SET_UseProgramObjectARB(disp, glUseProgramObjectARB);
+ SET_ValidateProgramARB(disp, glValidateProgramARB);
+ SET_Vertex2d(disp, glVertex2d);
+ SET_Vertex2dv(disp, glVertex2dv);
+ SET_Vertex2f(disp, glVertex2f);
+ SET_Vertex2fv(disp, glVertex2fv);
+ SET_Vertex2i(disp, glVertex2i);
+ SET_Vertex2iv(disp, glVertex2iv);
+ SET_Vertex2s(disp, glVertex2s);
+ SET_Vertex2sv(disp, glVertex2sv);
+ SET_Vertex3d(disp, glVertex3d);
+ SET_Vertex3dv(disp, glVertex3dv);
+ SET_Vertex3f(disp, glVertex3f);
+ SET_Vertex3fv(disp, glVertex3fv);
+ SET_Vertex3i(disp, glVertex3i);
+ SET_Vertex3iv(disp, glVertex3iv);
+ SET_Vertex3s(disp, glVertex3s);
+ SET_Vertex3sv(disp, glVertex3sv);
+ SET_Vertex4d(disp, glVertex4d);
+ SET_Vertex4dv(disp, glVertex4dv);
+ SET_Vertex4f(disp, glVertex4f);
+ SET_Vertex4fv(disp, glVertex4fv);
+ SET_Vertex4i(disp, glVertex4i);
+ SET_Vertex4iv(disp, glVertex4iv);
+ SET_Vertex4s(disp, glVertex4s);
+ SET_Vertex4sv(disp, glVertex4sv);
+//SET_VertexArrayRangeNV(disp, glVertexArrayRangeNV);
+ SET_VertexAttrib1dARB(disp, glVertexAttrib1dARB);
+ SET_VertexAttrib1dvARB(disp, glVertexAttrib1dvARB);
+ SET_VertexAttrib1fARB(disp, glVertexAttrib1fARB);
+ SET_VertexAttrib1fvARB(disp, glVertexAttrib1fvARB);
+ SET_VertexAttrib1sARB(disp, glVertexAttrib1sARB);
+ SET_VertexAttrib1svARB(disp, glVertexAttrib1svARB);
+ SET_VertexAttrib2dARB(disp, glVertexAttrib2dARB);
+ SET_VertexAttrib2dvARB(disp, glVertexAttrib2dvARB);
+ SET_VertexAttrib2fARB(disp, glVertexAttrib2fARB);
+ SET_VertexAttrib2fvARB(disp, glVertexAttrib2fvARB);
+ SET_VertexAttrib2sARB(disp, glVertexAttrib2sARB);
+ SET_VertexAttrib2svARB(disp, glVertexAttrib2svARB);
+ SET_VertexAttrib3dARB(disp, glVertexAttrib3dARB);
+ SET_VertexAttrib3dvARB(disp, glVertexAttrib3dvARB);
+ SET_VertexAttrib3fARB(disp, glVertexAttrib3fARB);
+ SET_VertexAttrib3fvARB(disp, glVertexAttrib3fvARB);
+ SET_VertexAttrib3sARB(disp, glVertexAttrib3sARB);
+ SET_VertexAttrib3svARB(disp, glVertexAttrib3svARB);
+ SET_VertexAttrib4NbvARB(disp, glVertexAttrib4NbvARB);
+ SET_VertexAttrib4NivARB(disp, glVertexAttrib4NivARB);
+ SET_VertexAttrib4NsvARB(disp, glVertexAttrib4NsvARB);
+ SET_VertexAttrib4NubARB(disp, glVertexAttrib4NubARB);
+ SET_VertexAttrib4NubvARB(disp, glVertexAttrib4NubvARB);
+ SET_VertexAttrib4NuivARB(disp, glVertexAttrib4NuivARB);
+ SET_VertexAttrib4NusvARB(disp, glVertexAttrib4NusvARB);
+ SET_VertexAttrib4bvARB(disp, glVertexAttrib4bvARB);
+ SET_VertexAttrib4dARB(disp, glVertexAttrib4dARB);
+ SET_VertexAttrib4dvARB(disp, glVertexAttrib4dvARB);
+ SET_VertexAttrib4fARB(disp, glVertexAttrib4fARB);
+ SET_VertexAttrib4fvARB(disp, glVertexAttrib4fvARB);
+ SET_VertexAttrib4ivARB(disp, glVertexAttrib4ivARB);
+ SET_VertexAttrib4sARB(disp, glVertexAttrib4sARB);
+ SET_VertexAttrib4svARB(disp, glVertexAttrib4svARB);
+ SET_VertexAttrib4ubvARB(disp, glVertexAttrib4ubvARB);
+ SET_VertexAttrib4uivARB(disp, glVertexAttrib4uivARB);
+ SET_VertexAttrib4usvARB(disp, glVertexAttrib4usvARB);
+ SET_VertexAttribPointerARB(disp, glVertexAttribPointerARB);
+ SET_VertexPointer(disp, glVertexPointer);
+// SET_VertexPointerEXT(disp, glVertexPointerEXT);
+ SET_Viewport(disp, glViewport);
+ SET_WindowPos2dMESA(disp, glWindowPos2dARB);
+ SET_WindowPos2dvMESA(disp, glWindowPos2dvARB);
+ SET_WindowPos2fMESA(disp, glWindowPos2fARB);
+ SET_WindowPos2fvMESA(disp, glWindowPos2fvARB);
+ SET_WindowPos2iMESA(disp, glWindowPos2iARB);
+ SET_WindowPos2ivMESA(disp, glWindowPos2ivARB);
+ SET_WindowPos2sMESA(disp, glWindowPos2sARB);
+ SET_WindowPos2svMESA(disp, glWindowPos2svARB);
+ SET_WindowPos3dMESA(disp, glWindowPos3dARB);
+ SET_WindowPos3dvMESA(disp, glWindowPos3dvARB);
+ SET_WindowPos3fMESA(disp, glWindowPos3fARB);
+ SET_WindowPos3fvMESA(disp, glWindowPos3fvARB);
+ SET_WindowPos3iMESA(disp, glWindowPos3iARB);
+ SET_WindowPos3ivMESA(disp, glWindowPos3ivARB);
+ SET_WindowPos3sMESA(disp, glWindowPos3sARB);
+ SET_WindowPos3svMESA(disp, glWindowPos3svARB);
+//SET_WindowPos4dMESA(disp, glWindowPos4dMESA);
+//SET_WindowPos4dvMESA(disp, glWindowPos4dvMESA);
+//SET_WindowPos4fMESA(disp, glWindowPos4fMESA);
+//SET_WindowPos4fvMESA(disp, glWindowPos4fvMESA);
+//SET_WindowPos4iMESA(disp, glWindowPos4iMESA);
+//SET_WindowPos4ivMESA(disp, glWindowPos4ivMESA);
+//SET_WindowPos4sMESA(disp, glWindowPos4sMESA);
+//SET_WindowPos4svMESA(disp, glWindowPos4svMESA);
+}
diff --git a/GL/glx/glxscreens.c b/GL/glx/glxscreens.c
index 43447a4e4..a2d14d54d 100644
--- a/GL/glx/glxscreens.c
+++ b/GL/glx/glxscreens.c
@@ -170,7 +170,7 @@ static char GLXServerExtensions[] =
"GLX_EXT_texture_from_pixmap "
"GLX_OML_swap_method "
"GLX_SGI_make_current_read "
-#ifndef __DARWIN__
+#ifndef __APPLE__
"GLX_SGIS_multisample "
"GLX_SGIX_hyperpipe "
"GLX_SGIX_swap_barrier "
diff --git a/GL/glx/indirect_dispatch_swap.c b/GL/glx/indirect_dispatch_swap.c
index 136f0d010..f8519dc18 100644
--- a/GL/glx/indirect_dispatch_swap.c
+++ b/GL/glx/indirect_dispatch_swap.c
@@ -35,6 +35,11 @@
#define bswap_16 __swap16
#define bswap_32 __swap32
#define bswap_64 __swap64
+#elif defined(__APPLE__)
+#include <libkern/OSByteOrder.h>
+#define bswap_16 OSSwapInt16
+#define bswap_32 OSSwapInt32
+#define bswap_64 OSSwapInt64
#else
#include <sys/endian.h>
#define bswap_16 bswap16
diff --git a/GL/glx/indirect_program.c b/GL/glx/indirect_program.c
index eae128a26..7bcdb7d5a 100644
--- a/GL/glx/indirect_program.c
+++ b/GL/glx/indirect_program.c
@@ -53,6 +53,12 @@
#define bswap_16 __swap16
#define bswap_32 __swap32
#define bswap_64 __swap64
+ #define bswap_64 __swap64
+#elif defined(__APPLE__)
+#include <libkern/OSByteOrder.h>
+#define bswap_16 OSSwapInt16
+#define bswap_32 OSSwapInt32
+#define bswap_64 OSSwapInt64
#else
#include <sys/endian.h>
#define bswap_16 bswap16
diff --git a/GL/glx/indirect_texture_compression.c b/GL/glx/indirect_texture_compression.c
index 11f63c2f0..359aae01f 100644
--- a/GL/glx/indirect_texture_compression.c
+++ b/GL/glx/indirect_texture_compression.c
@@ -46,6 +46,11 @@
#define bswap_16 __swap16
#define bswap_32 __swap32
#define bswap_64 __swap64
+#elif defined(__APPLE__)
+#include <libkern/OSByteOrder.h>
+#define bswap_16 OSSwapInt16
+#define bswap_32 OSSwapInt32
+#define bswap_64 OSSwapInt64
#else
#include <sys/endian.h>
#define bswap_16 bswap16
diff --git a/GL/glx/indirect_util.c b/GL/glx/indirect_util.c
index 09b7ab87c..efc84c78d 100644
--- a/GL/glx/indirect_util.c
+++ b/GL/glx/indirect_util.c
@@ -35,6 +35,11 @@
#define bswap_16 __swap16
#define bswap_32 __swap32
#define bswap_64 __swap64
+#elif defined(__APPLE__)
+#include <libkern/OSByteOrder.h>
+#define bswap_16 OSSwapInt16
+#define bswap_32 OSSwapInt32
+#define bswap_64 OSSwapInt64
#else
#include <sys/endian.h>
#define bswap_16 bswap16
diff --git a/GL/glx/swap_interval.c b/GL/glx/swap_interval.c
index f049ce51d..73f3d9227 100644
--- a/GL/glx/swap_interval.c
+++ b/GL/glx/swap_interval.c
@@ -47,6 +47,11 @@
#define bswap_16 __swap16
#define bswap_32 __swap32
#define bswap_64 __swap64
+#elif defined(__APPLE__)
+#include <libkern/OSByteOrder.h>
+#define bswap_16 OSSwapInt16
+#define bswap_32 OSSwapInt32
+#define bswap_64 OSSwapInt64
#else
#include <sys/endian.h>
#define bswap_16 bswap16
diff --git a/Xext/EVI.c b/Xext/EVI.c
index 8fe3481d4..13bd32aee 100644
--- a/Xext/EVI.c
+++ b/Xext/EVI.c
@@ -34,6 +34,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <X11/extensions/XEVIstr.h>
#include "EVIstruct.h"
#include "modinit.h"
+#include "scrnintstr.h"
#if 0
static unsigned char XEVIReqCode = 0;
@@ -87,10 +88,22 @@ ProcEVIGetVisualInfo(ClientPtr client)
{
REQUEST(xEVIGetVisualInfoReq);
xEVIGetVisualInfoReply rep;
- int n, n_conflict, n_info, sz_info, sz_conflict;
+ int i, n, n_conflict, n_info, sz_info, sz_conflict;
VisualID32 *conflict;
+ unsigned int total_visuals = 0;
xExtendedVisualInfo *eviInfo;
int status;
+
+ /*
+ * do this first, otherwise REQUEST_FIXED_SIZE can overflow. we assume
+ * here that you don't have more than 2^32 visuals over all your screens;
+ * this seems like a safe assumption.
+ */
+ for (i = 0; i < screenInfo.numScreens; i++)
+ total_visuals += screenInfo.screens[i]->numVisuals;
+ if (stuff->n_visual > total_visuals)
+ return BadValue;
+
REQUEST_FIXED_SIZE(xEVIGetVisualInfoReq, stuff->n_visual * sz_VisualID32);
status = eviPriv->getVisualInfo((VisualID32 *)&stuff[1], (int)stuff->n_visual,
&eviInfo, &n_info, &conflict, &n_conflict);
diff --git a/Xext/cup.c b/Xext/cup.c
index 10d13bae0..631bc2450 100644
--- a/Xext/cup.c
+++ b/Xext/cup.c
@@ -196,6 +196,9 @@ int ProcGetReservedColormapEntries(
REQUEST_SIZE_MATCH (xXcupGetReservedColormapEntriesReq);
+ if (stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
#ifndef HAVE_SPECIAL_DESKTOP_COLORS
citems[CUP_BLACK_PIXEL].pixel =
screenInfo.screens[stuff->screen]->blackPixel;
diff --git a/Xext/panoramiXSwap.c b/Xext/panoramiXSwap.c
index da445ffe1..0487471aa 100644
--- a/Xext/panoramiXSwap.c
+++ b/Xext/panoramiXSwap.c
@@ -70,6 +70,7 @@ SProcPanoramiXGetState(ClientPtr client)
swaps (&stuff->length, n);
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
+ swapl (&stuff->window, n);
return ProcPanoramiXGetState(client);
}
@@ -81,6 +82,7 @@ SProcPanoramiXGetScreenCount(ClientPtr client)
swaps (&stuff->length, n);
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
+ swapl (&stuff->window, n);
return ProcPanoramiXGetScreenCount(client);
}
@@ -92,6 +94,8 @@ SProcPanoramiXGetScreenSize(ClientPtr client)
swaps (&stuff->length, n);
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
+ swapl (&stuff->window, n);
+ swapl (&stuff->screen, n);
return ProcPanoramiXGetScreenSize(client);
}
diff --git a/Xext/sampleEVI.c b/Xext/sampleEVI.c
index d9c569609..60095f423 100644
--- a/Xext/sampleEVI.c
+++ b/Xext/sampleEVI.c
@@ -35,6 +35,13 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <X11/extensions/XEVIstr.h>
#include "EVIstruct.h"
#include "scrnintstr.h"
+
+#if HAVE_STDINT_H
+#include <stdint.h>
+#elif !defined(UINT32_MAX)
+#define UINT32_MAX 0xffffffffU
+#endif
+
static int sampleGetVisualInfo(
VisualID32 *visual,
int n_visual,
@@ -43,24 +50,36 @@ static int sampleGetVisualInfo(
VisualID32 **conflict_rn,
int *n_conflict_rn)
{
- int max_sz_evi = n_visual * sz_xExtendedVisualInfo * screenInfo.numScreens;
+ unsigned int max_sz_evi;
VisualID32 *temp_conflict;
xExtendedVisualInfo *evi;
- int max_visuals = 0, max_sz_conflict, sz_conflict = 0;
+ unsigned int max_visuals = 0, max_sz_conflict, sz_conflict = 0;
register int visualI, scrI, sz_evi = 0, conflictI, n_conflict;
- *evi_rn = evi = (xExtendedVisualInfo *)xalloc(max_sz_evi);
- if (!*evi_rn)
- return BadAlloc;
+
+ if (n_visual > UINT32_MAX/(sz_xExtendedVisualInfo * screenInfo.numScreens))
+ return BadAlloc;
+ max_sz_evi = n_visual * sz_xExtendedVisualInfo * screenInfo.numScreens;
+
for (scrI = 0; scrI < screenInfo.numScreens; scrI++) {
if (screenInfo.screens[scrI]->numVisuals > max_visuals)
max_visuals = screenInfo.screens[scrI]->numVisuals;
}
+
+ if (n_visual > UINT32_MAX/(sz_VisualID32 * screenInfo.numScreens
+ * max_visuals))
+ return BadAlloc;
max_sz_conflict = n_visual * sz_VisualID32 * screenInfo.numScreens * max_visuals;
+
+ *evi_rn = evi = (xExtendedVisualInfo *)xalloc(max_sz_evi);
+ if (!*evi_rn)
+ return BadAlloc;
+
temp_conflict = (VisualID32 *)xalloc(max_sz_conflict);
if (!temp_conflict) {
xfree(*evi_rn);
return BadAlloc;
}
+
for (scrI = 0; scrI < screenInfo.numScreens; scrI++) {
for (visualI = 0; visualI < n_visual; visualI++) {
evi[sz_evi].core_visual_id = visual[visualI];
diff --git a/Xext/security.c b/Xext/security.c
index 7e8a06e38..bd229e73d 100644
--- a/Xext/security.c
+++ b/Xext/security.c
@@ -1571,9 +1571,9 @@ SecurityLoadPropertyAccessList(void)
return;
#ifndef __UNIXOS2__
- f = fopen(SecurityPolicyFile, "r");
+ f = Fopen(SecurityPolicyFile, "r");
#else
- f = fopen((char*)__XOS2RedirRoot(SecurityPolicyFile), "r");
+ f = Fopen((char*)__XOS2RedirRoot(SecurityPolicyFile), "r");
#endif
if (!f)
{
@@ -1657,7 +1657,7 @@ SecurityLoadPropertyAccessList(void)
}
#endif /* PROPDEBUG */
- fclose(f);
+ Fclose(f);
} /* SecurityLoadPropertyAccessList */
diff --git a/Xext/shm.c b/Xext/shm.c
index e3fa2d33d..9f9ed209d 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -723,6 +723,8 @@ ProcPanoramiXShmCreatePixmap(
int i, j, result;
ShmDescPtr shmdesc;
REQUEST(xShmCreatePixmapReq);
+ unsigned int width, height, depth;
+ unsigned long size;
PanoramiXRes *newPix;
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
@@ -732,11 +734,18 @@ ProcPanoramiXShmCreatePixmap(
LEGAL_NEW_RESOURCE(stuff->pid, client);
VERIFY_GEOMETRABLE(pDraw, stuff->drawable, client);
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
- if (!stuff->width || !stuff->height)
+
+ width = stuff->width;
+ height = stuff->height;
+ depth = stuff->depth;
+ if (!width || !height || !depth)
{
client->errorValue = 0;
return BadValue;
}
+ if (width > 32767 || height > 32767)
+ return BadAlloc;
+
if (stuff->depth != 1)
{
pDepth = pDraw->pScreen->allowedDepths;
@@ -746,10 +755,18 @@ ProcPanoramiXShmCreatePixmap(
client->errorValue = stuff->depth;
return BadValue;
}
+
CreatePmap:
- VERIFY_SHMSIZE(shmdesc, stuff->offset,
- PixmapBytePad(stuff->width, stuff->depth) * stuff->height,
- client);
+ size = PixmapBytePad(width, depth) * height;
+ if (sizeof(size) == 4 && BitsPerPixel(depth) > 8) {
+ if (size < width * height)
+ return BadAlloc;
+ }
+ /* thankfully, offset is unsigned */
+ if (stuff->offset + size < size)
+ return BadAlloc;
+
+ VERIFY_SHMSIZE(shmdesc, stuff->offset, size, client);
if(!(newPix = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
return BadAlloc;
@@ -1056,6 +1073,8 @@ ProcShmCreatePixmap(client)
register int i;
ShmDescPtr shmdesc;
REQUEST(xShmCreatePixmapReq);
+ unsigned int width, height, depth;
+ unsigned long size;
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
client->errorValue = stuff->pid;
@@ -1064,11 +1083,18 @@ ProcShmCreatePixmap(client)
LEGAL_NEW_RESOURCE(stuff->pid, client);
VERIFY_GEOMETRABLE(pDraw, stuff->drawable, client);
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
- if (!stuff->width || !stuff->height)
+
+ width = stuff->width;
+ height = stuff->height;
+ depth = stuff->depth;
+ if (!width || !height || !depth)
{
client->errorValue = 0;
return BadValue;
}
+ if (width > 32767 || height > 32767)
+ return BadAlloc;
+
if (stuff->depth != 1)
{
pDepth = pDraw->pScreen->allowedDepths;
@@ -1078,10 +1104,18 @@ ProcShmCreatePixmap(client)
client->errorValue = stuff->depth;
return BadValue;
}
+
CreatePmap:
- VERIFY_SHMSIZE(shmdesc, stuff->offset,
- PixmapBytePad(stuff->width, stuff->depth) * stuff->height,
- client);
+ size = PixmapBytePad(width, depth) * height;
+ if (sizeof(size) == 4 && BitsPerPixel(depth) > 8) {
+ if (size < width * height)
+ return BadAlloc;
+ }
+ /* thankfully, offset is unsigned */
+ if (stuff->offset + size < size)
+ return BadAlloc;
+
+ VERIFY_SHMSIZE(shmdesc, stuff->offset, size, client);
pMap = (*shmFuncs[pDraw->pScreen->myNum]->CreatePixmap)(
pDraw->pScreen, stuff->width,
stuff->height, stuff->depth,
diff --git a/Xi/chgfctl.c b/Xi/chgfctl.c
index d0acc593b..ef9b115fd 100644
--- a/Xi/chgfctl.c
+++ b/Xi/chgfctl.c
@@ -451,18 +451,13 @@ ChangeStringFeedback(ClientPtr client, DeviceIntPtr dev,
xStringFeedbackCtl * f)
{
register char n;
- register long *p;
int i, j;
KeySym *syms, *sup_syms;
syms = (KeySym *) (f + 1);
if (client->swapped) {
swaps(&f->length, n); /* swapped num_keysyms in calling proc */
- p = (long *)(syms);
- for (i = 0; i < f->num_keysyms; i++) {
- swapl(p, n);
- p++;
- }
+ SwapLongs((CARD32 *) syms, f->num_keysyms);
}
if (f->num_keysyms > s->ctrl.max_symbols) {
diff --git a/Xi/chgkmap.c b/Xi/chgkmap.c
index 047b899ed..09286dfb4 100644
--- a/Xi/chgkmap.c
+++ b/Xi/chgkmap.c
@@ -79,18 +79,14 @@ int
SProcXChangeDeviceKeyMapping(register ClientPtr client)
{
register char n;
- register long *p;
- register int i, count;
+ register unsigned int count;
REQUEST(xChangeDeviceKeyMappingReq);
swaps(&stuff->length, n);
REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
- p = (long *)&stuff[1];
count = stuff->keyCodes * stuff->keySymsPerKeyCode;
- for (i = 0; i < count; i++) {
- swapl(p, n);
- p++;
- }
+ REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32));
+ SwapLongs((CARD32 *) (&stuff[1]), count);
return (ProcXChangeDeviceKeyMapping(client));
}
@@ -106,10 +102,14 @@ ProcXChangeDeviceKeyMapping(register ClientPtr client)
int ret;
unsigned len;
DeviceIntPtr dev;
+ unsigned int count;
REQUEST(xChangeDeviceKeyMappingReq);
REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
+ count = stuff->keyCodes * stuff->keySymsPerKeyCode;
+ REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32));
+
dev = LookupDeviceIntRec(stuff->deviceid);
if (dev == NULL) {
SendErrorToClient(client, IReqCode, X_ChangeDeviceKeyMapping, 0,
diff --git a/Xi/chgprop.c b/Xi/chgprop.c
index 52c38838d..8d111c4fd 100644
--- a/Xi/chgprop.c
+++ b/Xi/chgprop.c
@@ -81,19 +81,15 @@ int
SProcXChangeDeviceDontPropagateList(register ClientPtr client)
{
register char n;
- register long *p;
- register int i;
REQUEST(xChangeDeviceDontPropagateListReq);
swaps(&stuff->length, n);
REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
swapl(&stuff->window, n);
swaps(&stuff->count, n);
- p = (long *)&stuff[1];
- for (i = 0; i < stuff->count; i++) {
- swapl(p, n);
- p++;
- }
+ REQUEST_FIXED_SIZE(xChangeDeviceDontPropagateListReq,
+ stuff->count * sizeof(CARD32));
+ SwapLongs((CARD32 *) (&stuff[1]), stuff->count);
return (ProcXChangeDeviceDontPropagateList(client));
}
diff --git a/Xi/grabdev.c b/Xi/grabdev.c
index 3af2346e3..9abad3dbf 100644
--- a/Xi/grabdev.c
+++ b/Xi/grabdev.c
@@ -82,8 +82,6 @@ int
SProcXGrabDevice(register ClientPtr client)
{
register char n;
- register long *p;
- register int i;
REQUEST(xGrabDeviceReq);
swaps(&stuff->length, n);
@@ -91,11 +89,11 @@ SProcXGrabDevice(register ClientPtr client)
swapl(&stuff->grabWindow, n);
swapl(&stuff->time, n);
swaps(&stuff->event_count, n);
- p = (long *)&stuff[1];
- for (i = 0; i < stuff->event_count; i++) {
- swapl(p, n);
- p++;
- }
+
+ if (stuff->length != (sizeof(xGrabDeviceReq) >> 2) + stuff->event_count)
+ return BadLength;
+
+ SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
return (ProcXGrabDevice(client));
}
diff --git a/Xi/grabdevb.c b/Xi/grabdevb.c
index 4333550f1..7f1ab5c7b 100644
--- a/Xi/grabdevb.c
+++ b/Xi/grabdevb.c
@@ -80,8 +80,6 @@ int
SProcXGrabDeviceButton(register ClientPtr client)
{
register char n;
- register long *p;
- register int i;
REQUEST(xGrabDeviceButtonReq);
swaps(&stuff->length, n);
@@ -89,11 +87,9 @@ SProcXGrabDeviceButton(register ClientPtr client)
swapl(&stuff->grabWindow, n);
swaps(&stuff->modifiers, n);
swaps(&stuff->event_count, n);
- p = (long *)&stuff[1];
- for (i = 0; i < stuff->event_count; i++) {
- swapl(p, n);
- p++;
- }
+ REQUEST_FIXED_SIZE(xGrabDeviceButtonReq,
+ stuff->event_count * sizeof(CARD32));
+ SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
return (ProcXGrabDeviceButton(client));
}
diff --git a/Xi/grabdevk.c b/Xi/grabdevk.c
index 71e72d56f..3090e9398 100644
--- a/Xi/grabdevk.c
+++ b/Xi/grabdevk.c
@@ -80,8 +80,6 @@ int
SProcXGrabDeviceKey(register ClientPtr client)
{
register char n;
- register long *p;
- register int i;
REQUEST(xGrabDeviceKeyReq);
swaps(&stuff->length, n);
@@ -89,11 +87,8 @@ SProcXGrabDeviceKey(register ClientPtr client)
swapl(&stuff->grabWindow, n);
swaps(&stuff->modifiers, n);
swaps(&stuff->event_count, n);
- p = (long *)&stuff[1];
- for (i = 0; i < stuff->event_count; i++) {
- swapl(p, n);
- p++;
- }
+ REQUEST_FIXED_SIZE(xGrabDeviceKeyReq, stuff->event_count * sizeof(CARD32));
+ SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
return (ProcXGrabDeviceKey(client));
}
diff --git a/Xi/selectev.c b/Xi/selectev.c
index 3483804b1..4c8126d30 100644
--- a/Xi/selectev.c
+++ b/Xi/selectev.c
@@ -84,19 +84,16 @@ int
SProcXSelectExtensionEvent(register ClientPtr client)
{
register char n;
- register long *p;
- register int i;
REQUEST(xSelectExtensionEventReq);
swaps(&stuff->length, n);
REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
swapl(&stuff->window, n);
swaps(&stuff->count, n);
- p = (long *)&stuff[1];
- for (i = 0; i < stuff->count; i++) {
- swapl(p, n);
- p++;
- }
+ REQUEST_FIXED_SIZE(xSelectExtensionEventReq,
+ stuff->count * sizeof(CARD32));
+ SwapLongs((CARD32 *) (&stuff[1]), stuff->count);
+
return (ProcXSelectExtensionEvent(client));
}
diff --git a/Xi/sendexev.c b/Xi/sendexev.c
index c2763bb22..70415af26 100644
--- a/Xi/sendexev.c
+++ b/Xi/sendexev.c
@@ -83,7 +83,7 @@ int
SProcXSendExtensionEvent(register ClientPtr client)
{
register char n;
- register long *p;
+ register CARD32 *p;
register int i;
xEvent eventT;
xEvent *eventP;
@@ -94,6 +94,11 @@ SProcXSendExtensionEvent(register ClientPtr client)
REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
swapl(&stuff->destination, n);
swaps(&stuff->count, n);
+
+ if (stuff->length != (sizeof(xSendExtensionEventReq) >> 2) + stuff->count +
+ (stuff->num_events * (sizeof(xEvent) >> 2)))
+ return BadLength;
+
eventP = (xEvent *) & stuff[1];
for (i = 0; i < stuff->num_events; i++, eventP++) {
proc = EventSwapVector[eventP->u.u.type & 0177];
@@ -103,11 +108,8 @@ SProcXSendExtensionEvent(register ClientPtr client)
*eventP = eventT;
}
- p = (long *)(((xEvent *) & stuff[1]) + stuff->num_events);
- for (i = 0; i < stuff->count; i++) {
- swapl(p, n);
- p++;
- }
+ p = (CARD32 *)(((xEvent *) & stuff[1]) + stuff->num_events);
+ SwapLongs(p, stuff->count);
return (ProcXSendExtensionEvent(client));
}
diff --git a/configure.ac b/configure.ac
index 9e3c0a089..8f91fea83 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,31 +1,34 @@
-dnl $Id$
+dnl Copyright © 2003-2007 Keith Packard, Daniel Stone
dnl
-dnl Copyright © 2003-2005 Keith Packard, Daniel Stone
+dnl Permission is hereby granted, free of charge, to any person obtaining a
+dnl copy of this software and associated documentation files (the "Software"),
+dnl to deal in the Software without restriction, including without limitation
+dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
+dnl and/or sell copies of the Software, and to permit persons to whom the
+dnl Software is furnished to do so, subject to the following conditions:
dnl
-dnl Permission to use, copy, modify, distribute, and sell this software and its
-dnl documentation for any purpose is hereby granted without fee, provided that
-dnl the above copyright notice appear in all copies and that both that
-dnl copyright notice and this permission notice appear in supporting
-dnl documentation, and that the names of Keith Packard and Daniel Stone not be
-dnl used in advertising or publicity pertaining to distribution of the software
-dnl without specific, written prior permission. Keith Packard and Daniel Stone
-dnl make no representations about the suitability of this software for any
-dnl purpose. It is provided "as is" without express or implied warranty.
+dnl The above copyright notice and this permission notice (including the next
+dnl paragraph) shall be included in all copies or substantial portions of the
+dnl Software.
dnl
-dnl KEITH PACKARD AND DANIEL STONE DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
-dnl SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
-dnl IN NO EVENT SHALL KEITH PACKARD OR DANIEL STONE BE LIABLE FOR ANY SPECIAL,
-dnl INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-dnl LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-dnl OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-dnl PERFORMANCE OF THIS SOFTWARE.
+dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+dnl DEALINGS IN THE SOFTWARE.
+dnl
+dnl Authors: Keith Packard <keithp@keithp.com>
+dnl Daniel Stone <daniel@fooishbar.org>
+dnl an unwitting cast of miscellaneous others
dnl
dnl Process this file with autoconf to create configure.
AC_PREREQ(2.57)
dnl This is the not the Xorg version number, it's the server version number.
dnl Yes, that's weird.
-AC_INIT([xorg-server], 1.3.0.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+AC_INIT([xorg-server], 1.3.0-apple20, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
AC_CONFIG_SRCDIR([Makefile.am])
AM_INIT_AUTOMAKE([dist-bzip2 foreign])
AM_MAINTAINER_MODE
@@ -92,6 +95,67 @@ fi
AC_TYPE_PID_T
+# Checks for headers/macros for byte swapping
+# Known variants:
+# <byteswap.h> bswap_16, bswap_32, bswap_64 (glibc)
+# <sys/endian.h> __swap16, __swap32, __swap64 (OpenBSD)
+# <sys/endian.h> bswap16, bswap32, bswap64 (other BSD's)
+# and a fallback to local macros if none of the above are found
+
+# if <byteswap.h> is found, assume it's the correct version
+AC_CHECK_HEADERS([byteswap.h])
+
+# if <sys/endian.h> is found, have to check which version
+AC_CHECK_HEADER([sys/endian.h], [HAVE_SYS_ENDIAN_H="yes"], [HAVE_SYS_ENDIAN_H="no"])
+
+if test "x$HAVE_SYS_ENDIAN_H" = "xyes" ; then
+ AC_MSG_CHECKING([for __swap16 variant of <sys/endian.h> byteswapping macros])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([
+#include <sys/endian.h>
+ ], [
+int a = 1, b;
+b = __swap16(a);
+ ])
+], [SYS_ENDIAN__SWAP='yes'], [SYS_ENDIAN__SWAP='no'])
+ AC_MSG_RESULT([$SYS_ENDIAN__SWAP])
+
+ AC_MSG_CHECKING([for bswap16 variant of <sys/endian.h> byteswapping macros])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([
+#include <sys/endian.h>
+ ], [
+int a = 1, b;
+b = bswap16(a);
+ ])
+], [SYS_ENDIAN_BSWAP='yes'], [SYS_ENDIAN_BSWAP='no'])
+ AC_MSG_RESULT([$SYS_ENDIAN_BSWAP])
+
+ if test "$SYS_ENDIAN_BSWAP" = "yes" ; then
+ USE_SYS_ENDIAN_H=yes
+ BSWAP=bswap
+ else
+ if test "$SYS_ENDIAN__SWAP" = "yes" ; then
+ USE_SYS_ENDIAN_H=yes
+ BSWAP=__swap
+ else
+ USE_SYS_ENDIAN_H=no
+ fi
+ fi
+
+ if test "$USE_SYS_ENDIAN_H" = "yes" ; then
+ AC_DEFINE([USE_SYS_ENDIAN_H], 1,
+ [Define to use byteswap macros from <sys/endian.h>])
+ AC_DEFINE_UNQUOTED([bswap_16], ${BSWAP}16,
+ [Define to 16-bit byteswap macro])
+ AC_DEFINE_UNQUOTED([bswap_32], ${BSWAP}32,
+ [Define to 32-bit byteswap macro])
+ AC_DEFINE_UNQUOTED([bswap_64], ${BSWAP}64,
+ [Define to 64-bit byteswap macro])
+ fi
+fi
+
+AC_CHECK_FUNC([dlopen], [],
+ AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl"))
+
dnl Checks for library functions.
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp strchr strrchr \
@@ -100,23 +164,25 @@ AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp strchr strrchr \
AC_FUNC_ALLOCA
dnl Old HAS_* names used in os/*.c.
AC_CHECK_FUNC([getdtablesize],
- AC_DEFINE(HAS_GETDTABLESIZE, 1, [Have the `getdtablesize' function.]))
+ AC_DEFINE(HAS_GETDTABLESIZE, 1, [Have the 'getdtablesize' function.]))
AC_CHECK_FUNC([getifaddrs],
- AC_DEFINE(HAS_GETIFADDRS, 1, [Have the `getifaddrs' function.]))
+ AC_DEFINE(HAS_GETIFADDRS, 1, [Have the 'getifaddrs' function.]))
AC_CHECK_FUNC([getpeereid],
- AC_DEFINE(HAS_GETPEEREID, 1, [Have the `getpeereid' function.]))
+ AC_DEFINE(HAS_GETPEEREID, 1, [Have the 'getpeereid' function.]))
AC_CHECK_FUNC([getpeerucred],
- AC_DEFINE(HAS_GETPEERUCRED, 1, [Have the `getpeerucred' function.]))
+ AC_DEFINE(HAS_GETPEERUCRED, 1, [Have the 'getpeerucred' function.]))
AC_CHECK_FUNC([strlcat], HAVE_STRLCAT=yes, HAVE_STRLCAT=no)
AM_CONDITIONAL(NEED_STRLCAT, [test x$HAVE_STRLCAT = xno])
+AC_CHECK_FUNC([strlcpy], AC_DEFINE(HAS_STRLCPY, 1, [Have the 'strlcpy' function]))
AM_CONDITIONAL(NEED_VSNPRINTF, [test x$HAVE_VSNPRINTF = xno])
dnl Check for mmap support for Xvfb
-AC_CHECK_FUNC([mmap], AC_DEFINE(HAS_MMAP, 1, [Have the `mmap' function.]))
+AC_CHECK_FUNC([mmap], AC_DEFINE(HAS_MMAP, 1, [Have the 'mmap' function.]))
dnl Find the math libary
AC_CHECK_LIB(m, sqrt)
+AC_CHECK_LIB(m, cbrt, AC_DEFINE(HAVE_CBRT, 1, [Have the 'cbrt' function]))
AC_CHECK_HEADERS([ndbm.h dbm.h rpcsvc/dbm.h])
@@ -215,6 +281,7 @@ case $host_cpu in
use_x86_asm="yes"
I386_VIDEO=yes
case $host_os in
+ darwin*) use_x86_asm="no" ;;
*linux*) DEFAULT_INT10=vm86 ;;
*freebsd*) AC_DEFINE(USE_DEV_IO) ;;
*netbsd*) AC_DEFINE(USE_I386_IOPL)
@@ -240,6 +307,7 @@ case $host_cpu in
use_x86_asm="yes"
I386_VIDEO=yes
case $host_os in
+ darwin*) use_x86_asm="no" ;;
*freebsd*) AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;;
*netbsd*) AC_DEFINE(USE_I386_IOPL, 1, [BSD i386 iopl])
SYS_LIBS=-lx86_64
@@ -369,13 +437,17 @@ AC_ARG_WITH(os-name, AS_HELP_STRING([--with-os-name=OSNAME], [Name of OS
AC_ARG_WITH(os-vendor, AS_HELP_STRING([--with-os-vendor=OSVENDOR], [Name of OS vendor]),
[ OSVENDOR="$withval" ],
[ OSVENDOR="" ])
+AC_ARG_VAR([MESA_SOURCE],[Path to Mesa source tree])
AC_ARG_WITH(mesa-source, AS_HELP_STRING([--with-mesa-source=MESA_SOURCE], [Path to Mesa source tree]),
[ MESA_SOURCE="$withval" ],
- [ MESA_SOURCE="" ])
+ [ MESA_SOURCE="${MESA_SOURCE}" ])
AC_ARG_WITH(fontdir, AS_HELP_STRING([--with-fontdir=FONTDIR], [Path to top level dir where fonts are installed (default: ${libdir}/X11/fonts)]),
[ FONTDIR="$withval" ],
[ FONTDIR="${libdir}/X11/fonts" ])
DEFAULT_FONT_PATH="${FONTDIR}/misc/,${FONTDIR}/TTF/,${FONTDIR}/OTF,${FONTDIR}/Type1/,${FONTDIR}/100dpi/,${FONTDIR}/75dpi/"
+case $host_os in
+ darwin*) DEFAULT_FONT_PATH="${DEFAULT_FONT_PATH},/Library/Fonts,/System/Library/Fonts" ;;
+esac
AC_ARG_WITH(default-font-path, AS_HELP_STRING([--with-default-font-path=PATH], [Comma separated list of font dirs]),
[ FONTPATH="$withval" ],
[ FONTPATH="${DEFAULT_FONT_PATH}" ])
@@ -391,6 +463,15 @@ AC_ARG_WITH(rgb-path, AS_HELP_STRING([--with-rgb-path=PATH], [Path to RG
AC_ARG_WITH(dri-driver-path, AS_HELP_STRING([--with-dri-driver-path=PATH], [Path to DRI drivers (default: ${libdir}/dri)]),
[ DRI_DRIVER_PATH="$withval" ],
[ DRI_DRIVER_PATH="${libdir}/dri" ])
+AC_ARG_WITH(apple-applications-dir,AS_HELP_STRING([--with-apple-applications-dir=PATH], [Path to the Applications directory (default: /Applications/Utilities)]),
+ [ APPLE_APPLICATIONS_DIR="${withval}" ],
+ [ APPLE_APPLICATIONS_DIR="/Applications/Utilities" ])
+AC_SUBST([APPLE_APPLICATIONS_DIR])
+AC_ARG_WITH(launchd, AS_HELP_STRING([--with-launchd], [Build with support for Apple's launchd (default: auto)]), [LAUNCHD=$withval], [LAUNCHD=auto])
+AC_ARG_WITH(launchagents-dir,AS_HELP_STRING([--with-launchagents-dir=PATH], [Path to launchd's LaunchAgents directory (default: /Library/LaunchAgents)]),
+ [ launchagentsdir="${withval}" ],
+ [ launchagentsdir="/Library/LaunchAgents" ])
+AC_SUBST([launchagentsdir])
AC_ARG_ENABLE(builddocs, AS_HELP_STRING([--enable-builddocs], [Build docs (default: disabled)]),
[BUILDDOCS=$enableval],
[BUILDDOCS=no])
@@ -401,11 +482,11 @@ AC_ARG_ENABLE(install-libxf86config,
[INSTALL_LIBXF86CONFIG=no])
dnl Extensions.
-AC_ARG_ENABLE(composite, AS_HELP_STRING([--disable-composite], [Build Composite extension (default: enabled)]), [COMPOSITE=$enableval], [COMPOSITE=yes])
+AC_ARG_ENABLE(composite, AS_HELP_STRING([--disable-composite], [Build Composite extension (default: enabled)]), [COMPOSITE=$enableval], [COMPOSITE=auto])
AC_ARG_ENABLE(mitshm, AS_HELP_STRING([--disable-shm], [Build SHM extension (default: enabled)]), [MITSHM=$enableval], [MITSHM=yes])
AC_ARG_ENABLE(xres, AS_HELP_STRING([--disable-xres], [Build XRes extension (default: enabled)]), [RES=$enableval], [RES=yes])
AC_ARG_ENABLE(xtrap, AS_HELP_STRING([--disable-xtrap], [Build XTrap extension (default: enabled)]), [XTRAP=$enableval], [XTRAP=yes])
-AC_ARG_ENABLE(record, AS_HELP_STRING([--disable-record], [Build Record extension (default: enabled)]), [RECORD=$enableval], [RECORD=yes])
+AC_ARG_ENABLE(record, AS_HELP_STRING([--disable-record], [Build Record extension (default: enabled)]), [RECORD=$enableval], [RECORD=no])
AC_ARG_ENABLE(xv, AS_HELP_STRING([--disable-xv], [Build Xv extension (default: enabled)]), [XV=$enableval], [XV=yes])
AC_ARG_ENABLE(xvmc, AS_HELP_STRING([--disable-xvmc], [Build XvMC extension (default: enabled)]), [XVMC=$enableval], [XVMC=yes])
AC_ARG_ENABLE(dga, AS_HELP_STRING([--disable-dga], [Build DGA extension (default: enabled)]), [DGA=$enableval], [DGA=yes])
@@ -417,9 +498,9 @@ AC_ARG_ENABLE(aiglx, AS_HELP_STRING([--enable-aiglx], [Build accelerate
AC_ARG_ENABLE(glx-tls, AS_HELP_STRING([--enable-glx-tls], [Build GLX with TLS support (default: disabled)]), [GLX_USE_TLS=$enableval], [GLX_USE_TLS=no])
AC_ARG_ENABLE(dri, AS_HELP_STRING([--enable-dri], [Build DRI extension (default: auto)]), [DRI=$enableval])
AC_ARG_ENABLE(xinerama, AS_HELP_STRING([--disable-xinerama], [Build Xinerama extension (default: enabled)]), [XINERAMA=$enableval], [XINERAMA=yes])
-AC_ARG_ENABLE(xf86vidmode, AS_HELP_STRING([--disable-xf86vidmode], [Build XF86VidMode extension (default: enabled)]), [XF86VIDMODE=$enableval], [XF86VIDMODE=yes])
-AC_ARG_ENABLE(xf86misc, AS_HELP_STRING([--disable-xf86misc], [Build XF86Misc extension (default: enabled)]), [XF86MISC=$enableval], [XF86MISC=yes])
-AC_ARG_ENABLE(xace, AS_HELP_STRING([--disable-xace], [Build X-ACE extension (default: enabled)]), [XACE=$enableval], [XACE=yes])
+AC_ARG_ENABLE(xf86vidmode, AS_HELP_STRING([--disable-xf86vidmode], [Build XF86VidMode extension (default: auto)]), [XF86VIDMODE=$enableval], [XF86VIDMODE=auto])
+AC_ARG_ENABLE(xf86misc, AS_HELP_STRING([--disable-xf86misc], [Build XF86Misc extension (default: auto)]), [XF86MISC=$enableval], [XF86MISC=auto])
+AC_ARG_ENABLE(xace, AS_HELP_STRING([--disable-xace], [Build X-ACE extension (default: enabled)]), [XACE=$enableval], [XACE=yes])
AC_ARG_ENABLE(xcsecurity, AS_HELP_STRING([--disable-xcsecurity], [Build Security extension (default: enabled)]), [XCSECURITY=$enableval], [XCSECURITY=$XACE])
AC_ARG_ENABLE(appgroup, AS_HELP_STRING([--disable-appgroup], [Build XC-APPGROUP extension (default: enabled)]), [APPGROUP=$enableval], [APPGROUP=$XCSECURITY])
AC_ARG_ENABLE(xcalibrate, AS_HELP_STRING([--enable-xcalibrate], [Build XCalibrate extension (default: disabled)]), [XCALIBRATE=$enableval], [XCALIBRATE=no])
@@ -430,18 +511,22 @@ AC_ARG_ENABLE(evi, AS_HELP_STRING([--disable-evi], [Build Extended-Vi
AC_ARG_ENABLE(multibuffer, AS_HELP_STRING([--enable-multibuffer], [Build Multibuffer extension (default: disabled)]), [MULTIBUFFER=$enableval], [MULTIBUFFER=no])
AC_ARG_ENABLE(fontcache, AS_HELP_STRING([--enable-fontcache], [Build FontCache extension (default: disabled)]), [FONTCACHE=$enableval], [FONTCACHE=no])
AC_ARG_ENABLE(dbe, AS_HELP_STRING([--disable-dbe], [Build DBE extension (default: enabled)]), [DBE=$enableval], [DBE=yes])
-AC_ARG_ENABLE(xf86bigfont, AS_HELP_STRING([--disable-xf86bigfont], [Build XF86 Big Font extension (default: enabled)]), [XF86BIGFONT=$enableval], [XF86BIGFONT=yes])
+AC_ARG_ENABLE(xf86bigfont, AS_HELP_STRING([--enable-xf86bigfont], [Build XF86 Big Font extension (default: disabled)]), [XF86BIGFONT=$enableval], [XF86BIGFONT=no])
AC_ARG_ENABLE(dpms, AS_HELP_STRING([--disable-dpms], [Build DPMS extension (default: enabled)]), [DPMSExtension=$enableval], [DPMSExtension=yes])
AC_ARG_ENABLE(xinput, AS_HELP_STRING([--disable-xinput], [Build XInput Extension (default: enabled)]), [XINPUT=$enableval], [XINPUT=yes])
AC_ARG_ENABLE(xfree86-utils, AS_HELP_STRING([--enable-xfree86-utils], [Build xfree86 DDX utilities (default: enabled)]), [XF86UTILS=$enableval], [XF86UTILS=yes])
dnl DDXes.
AC_ARG_ENABLE(xorg, AS_HELP_STRING([--enable-xorg], [Build Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto])
-AC_ARG_ENABLE(dmx, AS_HELP_STRING([--enable-dmx], [Build DMX server (default: auto)]), [DMX=$enableval], [DMX=auto])
-AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server (default: yes)]), [XVFB=$enableval], [XVFB=yes])
-AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto])
+AC_ARG_ENABLE(dmx, AS_HELP_STRING([--enable-dmx], [Build DMX server (default: no)]), [DMX=$enableval], [DMX=no])
+AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server (default: no)]), [XVFB=$enableval], [XVFB=no])
+AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: no)]), [XNEST=$enableval], [XNEST=no])
+AC_ARG_ENABLE(xquartz, AS_HELP_STRING([--enable-xquartz], [Build Xquartz server for OS-X (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto])
+AC_ARG_ENABLE(x11app, AS_HELP_STRING([--enable-x11app], [Build Apple's X11.app for Xquartz (default: auto)]), [X11APP=$enableval], [X11APP=auto])
+AC_ARG_WITH(x11app-archs, AS_HELP_STRING([--with-x11app-archs=ARCHS], [Architectures to build X11.app for, space delimeted (default: "ppc i386")]), [X11APP_ARCHS=$enableval], [X11APP_ARCHS="ppc i386"])
+AC_SUBST([X11APP_ARCHS])
AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto])
-AC_ARG_ENABLE(xprint, AS_HELP_STRING([--enable-xprint], [Build Xprint extension and server (default: auto)]), [XPRINT=$enableval], [XPRINT=auto])
+AC_ARG_ENABLE(xprint, AS_HELP_STRING([--enable-xprint], [Build Xprint extension and server (default: no)]), [XPRINT=$enableval], [XPRINT=no])
AC_ARG_ENABLE(xgl, AS_HELP_STRING([--enable-xgl], [Build Xgl server (default: no)]), [XGL=$enableval], [XGL=no])
AC_ARG_ENABLE(xglx, AS_HELP_STRING([--enable-xglx], [Build Xglx xgl module (default: no)]), [XGLX=$enableval], [XGLX=no])
AC_ARG_ENABLE(xegl, AS_HELP_STRING([--enable-xegl], [Build Xegl xgl module (default: no)]), [XEGL=$enableval], [XEGL=no])
@@ -468,7 +553,7 @@ if test "x$SETUID" = "xauto" ; then
case $host_cpu in
sparc) SETUID="no" ;;
*) SETUID="yes" ;;
- esac
+ esac ;;
esac
if test "x$SETUID" = xyes; then
touch testfile
@@ -519,9 +604,13 @@ XEXT_INC='-I$(top_srcdir)/Xext'
XEXT_LIB='$(top_builddir)/Xext/libXext.la'
XEXTXORG_LIB='$(top_builddir)/Xext/libXextbuiltin.la'
+PIXMAN="[pixman-1 >= 0.9.5]"
+PKG_CHECK_MODULES(PIXMAN, $PIXMAN)
+AC_SUBST(PIXMAN_CFLAGS)
+
dnl Core modules for most extensions, et al.
-REQUIRED_MODULES="[randrproto >= 1.2] renderproto [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto xextproto xproto xtrans xf86miscproto xf86vidmodeproto xf86bigfontproto [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto inputproto xf86dgaproto [kbproto >= 1.0.3]"
-REQUIRED_LIBS="xfont xau fontenc"
+REQUIRED_MODULES="[randrproto >= 1.2] renderproto [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto xextproto xproto xtrans xf86miscproto xf86vidmodeproto [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto inputproto xf86dgaproto [kbproto >= 1.0.3]"
+REQUIRED_LIBS="xfont xau fontenc $PIXMAN"
AM_CONDITIONAL(XV, [test "x$XV" = xyes])
if test "x$XV" = xyes; then
@@ -537,9 +626,13 @@ if test "x$XVMC" = xyes; then
AC_DEFINE(XvMCExtension, 1, [Build XvMC extension])
fi
-AM_CONDITIONAL(DGA, [test "x$DGA" = xyes])
-if test "x$DGA" = xyes; then
- AC_DEFINE(DGA, 1, [Support DGA extension])
+dnl XQuartz DDX Detection... Yes, it's ugly to have it here... but we need to disable COMPOSITE for
+if test "x$COMPOSITE" = xauto; then
+ case $host_os in
+ darwin*)
+ test "x$XQUARTZ" = xyes -o "x$XQUARTZ" = xauto && COMPOSITE=no
+ ;;
+ esac
fi
AM_CONDITIONAL(COMPOSITE, [test "x$COMPOSITE" = xyes])
@@ -702,14 +795,6 @@ if test "x$DPMSExtension" = xyes; then
AC_DEFINE(DPMSExtension, 1, [Support DPMS extension])
fi
-if test "x$XF86VIDMODE" = xyes; then
- AC_DEFINE(XF86VIDMODE, 1, [Support XFree86 Video Mode extension])
-fi
-
-if test "x$XF86MISC" = xyes; then
- AC_DEFINE(XF86MISC, 1, [Support XFree86 miscellaneous extensions])
-fi
-
if test "x$XPRINT" = xauto; then
PKG_CHECK_MODULES([XPRINTPROTO], [printproto], [XPRINT=yes], [XPRINT=no])
fi
@@ -841,7 +926,7 @@ AC_SUBST([VENDOR_STRING])
AC_SUBST([VENDOR_STRING_SHORT])
AC_SUBST([VENDOR_RELEASE])
AC_SUBST([VENDOR_MAN_VERSION])
-
+AC_SUBST([XORG_DATE])
AC_DEFINE(DDXOSINIT, 1, [Use OsVendorInit])
AC_DEFINE(SERVER_LOCK, 1, [Use a lock to prevent multiple servers on a display])
AC_DEFINE(SMART_SCHEDULE, 1, [Include time-based scheduler])
@@ -932,7 +1017,19 @@ AC_DEFINE([SVR4],1,[Define to 1 on systems derived from System V Release 4])
AC_MSG_RESULT([yes])], AC_MSG_RESULT([no]))
XSERVER_CFLAGS="$XSERVER_CFLAGS $CORE_INCS $XEXT_INC $COMPOSITE_INC $DAMAGE_INC $FIXES_INC $XI_INC $MI_INC $MIEXT_SHADOW_INC $MIEXT_LAYER_INC $MIEXT_DAMAGE_INC $RENDER_INC $RANDR_INC $FB_INC"
-AC_DEFINE_UNQUOTED(X_BYTE_ORDER,[$ENDIAN],[Endian order])
+AC_DEFINE_UNQUOTED(_X_BYTE_ORDER,[$ENDIAN],[Endian order])
+AH_VERBATIM([X_BYTE_ORDER],[
+/* Deal with multiple architecture compiles on Mac OS X */
+#ifndef __APPLE_CC__
+#define X_BYTE_ORDER _X_BYTE_ORDER
+#else
+#ifdef __BIG_ENDIAN__
+#define X_BYTE_ORDER X_BIG_ENDIAN
+#else
+#define X_BYTE_ORDER X_LITTLE_ENDIAN
+#endif
+#endif
+])
AC_SUBST([XSERVER_LIBS])
@@ -943,7 +1040,7 @@ dnl ---------------------------------------------------------------------------
dnl DMX DDX
AC_MSG_CHECKING([whether to build Xdmx DDX])
-PKG_CHECK_MODULES([DMXMODULES], [xmuu xext x11 xrender xfixes xfont xi dmxproto xau $XDMCP_MODULES], [have_dmx=yes], [have_dmx=no])
+PKG_CHECK_MODULES([DMXMODULES], [xmuu xext x11 xrender xfixes xfont xi dmxproto xau $XDMCP_MODULES $PIXMAN], [have_dmx=yes], [have_dmx=no])
if test "x$DMX" = xauto; then
DMX="$have_dmx"
fi
@@ -1247,11 +1344,14 @@ int main () {
case $host_cpu in
i*86)
- xorg_bus_ix86pci=yes
+ case $host_os in
+ darwin*) ;;
+ *) xorg_bus_ix86pci=yes ;;
+ esac
;;
powerpc*)
case $host_os in
- linux*|freebsd*|netbsd*|openbsd*|kfreebsd*-gnu)
+ darwin*|linux*|freebsd*|netbsd*|openbsd*|kfreebsd*-gnu)
;;
*)
xorg_bus_ppcpci="yes"
@@ -1264,7 +1364,7 @@ int main () {
;;
x86_64*|amd64*)
case $host_os in
- freebsd*|kfreebsd*-gnu)
+ darwin*|freebsd*|kfreebsd*-gnu)
# FreeBSD uses the system pci interface
;;
*)
@@ -1277,6 +1377,40 @@ int main () {
if test "x$XORG_OS_PCI" = x ; then
XORG_OS_PCI=$XORG_OS
fi
+ if test "x$DGA" = xauto; then
+ PKG_CHECK_MODULES(DGA, xf86dgaproto, [DGA=yes], [DGA=no])
+ fi
+ if test "x$DGA" = xyes; then
+ XORG_MODULES="$XORG_MODULES xf86dgaproto"
+ PKG_CHECK_MODULES(DGA, xf86dgaproto)
+ AC_DEFINE(DGA, 1, [Support DGA extension])
+ AC_DEFINE(XFreeXDGA, 1, [Build XDGA support])
+ fi
+
+ if test "x$XF86MISC" = xauto; then
+ PKG_CHECK_MODULES(XF86MISC, xf86miscproto, [XF86MISC=yes], [XF86MISC=no])
+ fi
+ if test "x$XF86MISC" = xyes; then
+ XORG_MODULES="$XORG_MODULES xf86miscproto"
+ PKG_CHECK_MODULES(XF86MISC, xf86miscproto)
+ AC_DEFINE(XF86MISC, 1, [Support XFree86 miscellaneous extensions])
+ fi
+
+ if test "x$XF86VIDMODE" = xauto; then
+ PKG_CHECK_MODULES(XF86VIDMODE, xf86vidmodeproto, [XF86VIDMODE=yes], [XF86VIDMODE=no])
+ fi
+ if test "x$XF86VIDMODE" = xyes; then
+ XORG_MODULES="$XORG_MODULES xf86vidmodeproto"
+ PKG_CHECK_MODULES(XF86VIDMODE, xf86vidmodeproto)
+ AC_DEFINE(XF86VIDMODE, 1, [Support XFree86 Video Mode extension])
+ fi
+
+ if test -n "$XORG_MODULES"; then
+ PKG_CHECK_MODULES(XORG_MODULES, [$XORG_MODULES])
+ XORG_CFLAGS="$XORG_CFLAGS $XORG_MODULES_CFLAGS"
+ XORG_SYS_LIBS="$XORG_SYS_LIBS $XORG_MODULES_LIBS"
+ fi
+
AC_SUBST([XORG_LIBS])
AC_SUBST([XORG_INCS])
AC_SUBST([XORG_OS])
@@ -1304,7 +1438,13 @@ int main () {
GCC_WARNINGS="${GCC_WARNINGS} -Werror"
fi
XSERVER_CFLAGS="$GCC_WARNINGS $XSERVER_CFLAGS"
- LD_EXPORT_SYMBOLS_FLAG="-rdynamic"
+ case $host_os in
+ darwin*) ;; # Symbols are exported by default, no need
+ # to do anything special. I think that the following
+ # is wrong anyway when using libtool. Should be using
+ # the libtool flag -export-dynamic?
+ *)LD_EXPORT_SYMBOLS_FLAG="-rdynamic" ;;
+ esac
fi
case $host_os in
openbsd*)
@@ -1362,6 +1502,7 @@ AM_CONDITIONAL([SOLARIS_ASM_INLINE], [test "x$solaris_asm_inline" = xyes])
AM_CONDITIONAL(MFB, [test "x$XORG" = xyes])
AM_CONDITIONAL(CFB, [test "x$XORG" = xyes])
AM_CONDITIONAL(AFB, [test "x$XORG" = xyes])
+AM_CONDITIONAL([BUILD_DARWIN],[test "X$build_darwin" = Xyes])
dnl Xprint DDX
@@ -1369,9 +1510,9 @@ AC_MSG_CHECKING([whether to build Xprint DDX])
AC_MSG_RESULT([$XPRINT])
if test "x$XPRINT" = xyes; then
- PKG_CHECK_MODULES([XPRINT], [printproto x11 xfont $XDMCP_MODULES xau])
+ PKG_CHECK_MODULES([XPRINT], [printproto x11 xfont $XDMCP_MODULES xau $PIXMAN])
XPRINT_EXTENSIONS="$XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $RENDER_LIB $COMPOSITE_LIB $RANDR_LIB $XI_LIB $FIXES_LIB $DAMAGE_LIB $XI_LIB $GLX_LIBS"
- XPRINT_LIBS="$XPRINT_LIBS $DIX_LIB $XKB_LIB $XKB_STUB_LIB $XPRINT_EXTENSIONS $MI_LIB $MIEXT_DAMAGE_LIB $CWRAP_LIB $OS_LIB $LIBS"
+ XPRINT_LIBS="$DIX_LIB $XPRINT_LIBS $XKB_LIB $XKB_STUB_LIB $XPRINT_EXTENSIONS $MI_LIB $MIEXT_DAMAGE_LIB $CWRAP_LIB $OS_LIB"
AC_SUBST([XPRINT_CFLAGS])
AC_SUBST([XPRINT_LIBS])
@@ -1416,7 +1557,6 @@ if test "x$XPRINT" = xyes; then
fi
AM_CONDITIONAL(XP_USE_FREETYPE, [test "x$XPRINT" = xyes && test "x$XP_USE_FREETYPE" = xyes])
-
dnl XWin DDX
AC_MSG_CHECKING([whether to build XWin DDX])
@@ -1485,10 +1625,104 @@ AM_CONDITIONAL(XWIN_PRIMARYFB, [test "x$XWIN" = xyes && false])
AM_CONDITIONAL(XWIN_RANDR, [test "x$XWIN" = xyes])
AM_CONDITIONAL(XWIN_XV, [test "x$XWIN" = xyes && test "x$XV" = xyes])
+dnl Darwin / OS X DDX
+if test "X$XQUARTZ" = Xauto; then
+ AC_CACHE_CHECK([whether to build Xquartz],xorg_cv_Carbon_framework,[
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -framework Carbon"
+ AC_LINK_IFELSE([char FSFindFolder(); int main() { FSFindFolder(); return 0;}],
+ [xorg_cv_Carbon_framework=yes],
+ [xorg_cv_Carbon_framework=no])
+ LDFLAGS=$save_LDFLAGS])
+
+ if test "X$xorg_cv_Carbon_framework" = Xyes; then
+ XQUARTZ=yes
+ else
+ XQUARTZ=no
+ fi
+fi
+
+if test "x$XQUARTZ" = xyes; then
+ AC_DEFINE(XQUARTZ,1,[Have Quartz])
+ AC_DEFINE(ROOTLESS,1,[Build Rootless code])
+
+#glxAGL / glxCGL don't work yet
+# AC_CACHE_CHECK([for AGL framework],xorg_cv_AGL_framework,[
+# save_LDFLAGS=$LDFLAGS
+# LDFLAGS="$LDFLAGS -framework AGL"
+# AC_LINK_IFELSE(
+# [char aglEnable(); int main() { aglEnable(); return 0;}],
+# [xorg_cv_AGL_framework=yes],
+# [xorg_cv_AGL_framework=no])
+# LDFLAGS=$save_LDFLAGS
+# ])
+ xorg_cv_AGL_framework=no
+ DARWIN_GLX_LIBS='$(top_builddir)/GL/apple/indirect.o $(top_builddir)/GL/glx/libglx.la'
+ DARWIN_LIBS="$MI_LIB $OS_LIB $DIX_LIB $FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $DARWIN_GLX_LIBS"
+ AC_SUBST([DARWIN_LIBS])
+ AC_CHECK_LIB([Xplugin],[xp_init],[:])
+ CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DNO_ALLOCA"
+ if test "x$XF86MISC" = xyes || test "x$XF86MISC" = xauto; then
+ AC_MSG_NOTICE([Disabling XF86Misc extension])
+ XF86MISC=no
+ fi
+ if test "x$XF86VIDMODE" = xyes || test "x$XF86VIDMODE" = xauto; then
+ AC_MSG_NOTICE([Disabling XF86VidMode extension])
+ XF86VIDMODE=no
+ fi
+ if test "x$XF86BIGFONT" = xyes || test "x$XF86BIGFONT" = xauto; then
+ AC_MSG_NOTICE([Disabling XF86BigFont extension])
+ XF86BIGFONT=no
+ fi
+ if test "x$DGA" = xyes || test "x$DGA" = xauto; then
+ AC_MSG_NOTICE([Disabling DGA extension])
+ DGA=no
+ fi
+fi
+
+# Support for objc in autotools is minimal and not documented.
+OBJC='$(CC)'
+OBJCLD='$(CCLD)'
+OBJCLINK='$(LINK)'
+OBJCFLAGS='$(CFLAGS)'
+AC_SUBST([OBJC])
+AC_SUBST([OBJCCLD])
+AC_SUBST([OBJCLINK])
+AC_SUBST([OBJCFLAGS])
+# internal, undocumented automake func follows :(
+_AM_DEPENDENCIES([OBJC])
+AM_CONDITIONAL(HAVE_XPLUGIN, [test "x$ac_cv_lib_Xplugin_xp_init" = xyes])
+AM_CONDITIONAL(HAVE_AGL_FRAMEWORK, [test "x$xorg_cv_AGL_framework" = xyes])
+AM_CONDITIONAL(XQUARTZ, [test "x$XQUARTZ" = xyes])
+
+if test "x$X11APP" = xauto; then
+ AC_MSG_CHECKING([whether to build X11.app])
+ if test "x$XQUARTZ" = xyes ; then
+ X11APP=yes
+ else
+ X11APP=no
+ fi
+ AC_MSG_RESULT([$X11APP])
+fi
+AM_CONDITIONAL(X11APP,[test "X$X11APP" = Xyes])
+
+if test "x$LAUNCHD" = "xauto"; then
+ if test "x$XQUARTZ" = "xyes" ; then
+ LAUNCHD=yes
+ else
+ unset LAUNCHD
+ AC_CHECK_PROG(LAUNCHD, [launchd], [yes], [no])
+ fi
+fi
+
+if test "x$LAUNCHD" = "xyes" ; then
+ AC_DEFINE(HAVE_LAUNCHD, 1, [launchd support available])
+fi
+AM_CONDITIONAL(LAUNCHD, [test "x$LAUNCHD" = "xyes"])
dnl kdrive DDX
-XEYPHR_LIBS=
+XEPHYR_LIBS=
XEPHYR_INCS=
XSDL_LIBS=
XSDL_INCS=
@@ -1524,7 +1758,7 @@ if test "$KDRIVE" = yes; then
KDRIVE_OS_INC='-I$(top_srcdir)/hw/kdrive/linux'
KDRIVE_INCS="$KDRIVE_PURE_INCS $KDRIVE_OS_INC"
- KDRIVE_CFLAGS="$XSERVER_CFLAGS -DHAVE_KDRIVE_CONFIG_H $TSLIB_CFLAGS"
+ KDRIVE_CFLAGS="$XSERVER_CFLAGS -DHAVE_KDRIVE_CONFIG_H $TSLIB_CFLAGS -fno-common"
# dix os fb mi extension glx (NOTYET) damage shadow xpstubs
#KDRIVE_PURE_LIBS="$DIX_LIB $OS_LIB $FB_LIB $XEXT_LIB $MIEXT_DAMAGE_LIB \
@@ -1602,8 +1836,11 @@ AC_DEFINE_DIR(XKM_OUTPUT_DIR, XKBOUTPUT, [Path to XKB output dir])
AC_SUBST(XKB_COMPILED_DIR)
+AM_CONDITIONAL(DGA, [test "x$DGA" = xyes])
+if test "x$DGA" = xyes; then
+ AC_DEFINE(DGA, 1, [Support DGA extension])
+fi
dnl and the rest of these are generic, so they're in config.h
-AC_DEFINE(XFreeXDGA, 1, [Build XDGA support])
AC_DEFINE(XResExtension, 1, [Build XRes extension])
AC_TRY_COMPILE([
@@ -1628,6 +1865,7 @@ AC_ARG_ENABLE(xorgcfg, AS_HELP_STRING([--enable-xorgcfg],
if test x$XORGCFG = xyes ; then
PKG_CHECK_MODULES([XORGCFG_DEP],
[xkbui >= 1.0.2 xkbfile xxf86misc xxf86vm xaw7 xmu xt xpm xext x11])
+ XORGCFG_DEP_CFLAGS="$XORGCFG_DEP_CFLAGS $PIXMAN_CFLAGS"
AC_CHECK_LIB([curses],[waddstr],
[XORGCFG_DEP_LIBS="$XORGCFG_DEP_LIBS -lcurses"; CURSES=yes],
AC_CHECK_LIB([ncurses],[waddstr],
@@ -1685,6 +1923,7 @@ XORG_RELEASE_VERSION
AC_OUTPUT([
Makefile
GL/Makefile
+GL/apple/Makefile
GL/glx/Makefile
GL/mesa/Makefile
GL/mesa/array_cache/Makefile
@@ -1717,6 +1956,7 @@ miext/damage/Makefile
miext/shadow/Makefile
miext/cw/Makefile
miext/rootless/Makefile
+miext/rootless/accel/Makefile
os/Makefile
randr/Makefile
render/Makefile
@@ -1793,7 +2033,9 @@ hw/xgl/glxext/Makefile
hw/xgl/glxext/module/Makefile
hw/xnest/Makefile
hw/xwin/Makefile
-hw/darwin/Makefile
+hw/xquartz/Makefile
+hw/xquartz/bundle/Makefile
+hw/xquartz/xpr/Makefile
hw/kdrive/Makefile
hw/kdrive/ati/Makefile
hw/kdrive/chips/Makefile
diff --git a/damageext/damageext.c b/damageext/damageext.c
index a27ca2250..b7f613bc6 100755
--- a/damageext/damageext.c
+++ b/damageext/damageext.c
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Copyright © 2002 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -28,12 +26,12 @@
#include "damageextint.h"
-unsigned char DamageReqCode;
-int DamageEventBase;
-int DamageErrorBase;
-int DamageClientPrivateIndex;
-RESTYPE DamageExtType;
-RESTYPE DamageExtWinType;
+static unsigned char DamageReqCode;
+static int DamageEventBase;
+static int DamageErrorBase;
+static int DamageClientPrivateIndex;
+static RESTYPE DamageExtType;
+static RESTYPE DamageExtWinType;
/* Version of the damage extension supported by the server, as opposed to the
* DAMAGE_* defines from damageproto for what version the proto header
@@ -186,7 +184,7 @@ ProcDamageCreate (ClientPtr client)
REQUEST_SIZE_MATCH(xDamageCreateReq);
LEGAL_NEW_RESOURCE(stuff->damage, client);
SECURITY_VERIFY_DRAWABLE (pDrawable, stuff->drawable, client,
- SecurityReadAccess);
+ SecurityReadAccess);
switch (stuff->level) {
case XDamageReportRawRectangles:
level = DamageReportRawRegion;
@@ -311,7 +309,7 @@ static const int version_requests[] = {
#define NUM_VERSION_REQUESTS (sizeof (version_requests) / sizeof (version_requests[0]))
-int (*ProcDamageVector[XDamageNumberRequests])(ClientPtr) = {
+static int (*ProcDamageVector[XDamageNumberRequests])(ClientPtr) = {
/*************** Version 1 ******************/
ProcDamageQueryVersion,
ProcDamageCreate,
@@ -400,7 +398,7 @@ SProcDamageAdd (ClientPtr client)
return (*ProcDamageVector[stuff->damageReqType]) (client);
}
-int (*SProcDamageVector[XDamageNumberRequests])(ClientPtr) = {
+static int (*SProcDamageVector[XDamageNumberRequests])(ClientPtr) = {
/*************** Version 1 ******************/
SProcDamageQueryVersion,
SProcDamageCreate,
@@ -470,7 +468,7 @@ FreeDamageExtWin (pointer value, XID wid)
return Success;
}
-void
+static void
SDamageNotifyEvent (xDamageNotifyEvent *from,
xDamageNotifyEvent *to)
{
diff --git a/damageext/damageext.h b/damageext/damageext.h
index fb58483a0..642800bd2 100644
--- a/damageext/damageext.h
+++ b/damageext/damageext.h
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Copyright © 2002 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
diff --git a/damageext/damageextint.h b/damageext/damageextint.h
index 6f14e4e97..dfafc9319 100644
--- a/damageext/damageextint.h
+++ b/damageext/damageextint.h
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Copyright © 2002 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -44,13 +42,6 @@
#include "damage.h"
#include "xfixes.h"
-extern unsigned char DamageReqCode;
-extern int DamageEventBase;
-extern int DamageErrorBase;
-extern int DamageClientPrivateIndex;
-extern RESTYPE DamageExtType;
-extern RESTYPE DamageExtWinType;
-
typedef struct _DamageClient {
CARD32 major_version;
CARD32 minor_version;
@@ -67,9 +58,6 @@ typedef struct _DamageExt {
XID id;
} DamageExtRec, *DamageExtPtr;
-extern int (*ProcDamageVector[/*XDamageNumberRequests*/])(ClientPtr);
-extern int (*SProcDamageVector[/*XDamageNumberRequests*/])(ClientPtr);
-
#define VERIFY_DAMAGEEXT(pDamageExt, rid, client, mode) { \
pDamageExt = SecurityLookupIDByType (client, rid, DamageExtType, mode); \
if (!pDamageExt) { \
@@ -79,10 +67,6 @@ extern int (*SProcDamageVector[/*XDamageNumberRequests*/])(ClientPtr);
}
void
-SDamageNotifyEvent (xDamageNotifyEvent *from,
- xDamageNotifyEvent *to);
-
-void
DamageExtSetCritical (ClientPtr pClient, Bool critical);
#endif /* _DAMAGEEXTINT_H_ */
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 05795407f..225c4cae0 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -368,7 +368,7 @@ Dispatch(void)
InitSelections();
nClients = 0;
- clientReady = (int *) ALLOCATE_LOCAL(sizeof(int) * MaxClients);
+ clientReady = (int *) xalloc(sizeof(int) * MaxClients);
if (!clientReady)
return;
@@ -489,7 +489,7 @@ Dispatch(void)
ddxBeforeReset ();
#endif
KillAllClients();
- DEALLOCATE_LOCAL(clientReady);
+ xfree(clientReady);
dispatchException &= ~DE_RESET;
}
@@ -873,7 +873,7 @@ ProcQueryTree(register ClientPtr client)
{
int curChild = 0;
- childIDs = (Window *) ALLOCATE_LOCAL(numChildren * sizeof(Window));
+ childIDs = (Window *) xalloc(numChildren * sizeof(Window));
if (!childIDs)
return BadAlloc;
for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib)
@@ -888,7 +888,7 @@ ProcQueryTree(register ClientPtr client)
{
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, numChildren * sizeof(Window), childIDs);
- DEALLOCATE_LOCAL(childIDs);
+ xfree(childIDs);
}
return(client->noClientException);
@@ -1366,7 +1366,7 @@ ProcQueryFont(register ClientPtr client)
rlength = sizeof(xQueryFontReply) +
FONTINFONPROPS(FONTCHARSET(pFont)) * sizeof(xFontProp) +
nprotoxcistructs * sizeof(xCharInfo);
- reply = (xQueryFontReply *)ALLOCATE_LOCAL(rlength);
+ reply = (xQueryFontReply *)xalloc(rlength);
if(!reply)
{
return(BadAlloc);
@@ -1378,7 +1378,7 @@ ProcQueryFont(register ClientPtr client)
QueryFont( pFont, reply, nprotoxcistructs);
WriteReplyToClient(client, rlength, reply);
- DEALLOCATE_LOCAL(reply);
+ xfree(reply);
return(client->noClientException);
}
}
@@ -2203,7 +2203,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable,
length += widthBytesLine;
}
}
- if(!(pBuf = (char *) ALLOCATE_LOCAL(length)))
+ if(!(pBuf = (char *)xalloc(length)))
return (BadAlloc);
WriteReplyToClient(client, sizeof (xGetImageReply), &xgi);
}
@@ -2312,7 +2312,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable,
REGION_DESTROY(pDraw->pScreen, pVisibleRegion);
#endif
if (!im_return)
- DEALLOCATE_LOCAL(pBuf);
+ xfree(pBuf);
return (client->noClientException);
}
@@ -2572,7 +2572,7 @@ ProcListInstalledColormaps(register ClientPtr client)
return(BadWindow);
preply = (xListInstalledColormapsReply *)
- ALLOCATE_LOCAL(sizeof(xListInstalledColormapsReply) +
+ xalloc(sizeof(xListInstalledColormapsReply) +
pWin->drawable.pScreen->maxInstalledCmaps *
sizeof(Colormap));
if(!preply)
@@ -2587,7 +2587,7 @@ ProcListInstalledColormaps(register ClientPtr client)
WriteReplyToClient(client, sizeof (xListInstalledColormapsReply), preply);
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, nummaps * sizeof(Colormap), &preply[1]);
- DEALLOCATE_LOCAL(preply);
+ xfree(preply);
return(client->noClientException);
}
@@ -2714,7 +2714,7 @@ ProcAllocColorCells (register ClientPtr client)
}
nmasks = stuff->planes;
length = ((long)npixels + (long)nmasks) * sizeof(Pixel);
- ppixels = (Pixel *)ALLOCATE_LOCAL(length);
+ ppixels = (Pixel *)xalloc(length);
if(!ppixels)
return(BadAlloc);
pmasks = ppixels + npixels;
@@ -2722,7 +2722,7 @@ ProcAllocColorCells (register ClientPtr client)
if( (retval = AllocColorCells(client->index, pcmp, npixels, nmasks,
(Bool)stuff->contiguous, ppixels, pmasks)) )
{
- DEALLOCATE_LOCAL(ppixels);
+ xfree(ppixels);
if (client->noClientException != Success)
return(client->noClientException);
else
@@ -2741,7 +2741,7 @@ ProcAllocColorCells (register ClientPtr client)
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, length, ppixels);
}
- DEALLOCATE_LOCAL(ppixels);
+ xfree(ppixels);
return (client->noClientException);
}
else
@@ -2782,7 +2782,7 @@ ProcAllocColorPlanes(register ClientPtr client)
acpr.sequenceNumber = client->sequence;
acpr.nPixels = npixels;
length = (long)npixels * sizeof(Pixel);
- ppixels = (Pixel *)ALLOCATE_LOCAL(length);
+ ppixels = (Pixel *)xalloc(length);
if(!ppixels)
return(BadAlloc);
if( (retval = AllocColorPlanes(client->index, pcmp, npixels,
@@ -2790,7 +2790,7 @@ ProcAllocColorPlanes(register ClientPtr client)
(Bool)stuff->contiguous, ppixels,
&acpr.redMask, &acpr.greenMask, &acpr.blueMask)) )
{
- DEALLOCATE_LOCAL(ppixels);
+ xfree(ppixels);
if (client->noClientException != Success)
return(client->noClientException);
else
@@ -2805,7 +2805,7 @@ ProcAllocColorPlanes(register ClientPtr client)
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, length, ppixels);
}
- DEALLOCATE_LOCAL(ppixels);
+ xfree(ppixels);
return (client->noClientException);
}
else
@@ -2934,12 +2934,12 @@ ProcQueryColors(register ClientPtr client)
xQueryColorsReply qcr;
count = ((client->req_len << 2) - sizeof(xQueryColorsReq)) >> 2;
- prgbs = (xrgb *)ALLOCATE_LOCAL(count * sizeof(xrgb));
+ prgbs = (xrgb *)xalloc(count * sizeof(xrgb));
if(!prgbs && count)
return(BadAlloc);
if( (retval = QueryColors(pcmp, count, (Pixel *)&stuff[1], prgbs)) )
{
- if (prgbs) DEALLOCATE_LOCAL(prgbs);
+ if (prgbs) xfree(prgbs);
if (client->noClientException != Success)
return(client->noClientException);
else
@@ -2958,7 +2958,7 @@ ProcQueryColors(register ClientPtr client)
client->pSwapReplyFunc = (ReplySwapPtr) SQColorsExtend;
WriteSwappedDataToClient(client, count * sizeof(xrgb), prgbs);
}
- if (prgbs) DEALLOCATE_LOCAL(prgbs);
+ if (prgbs) xfree(prgbs);
return(client->noClientException);
}
diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index f10011e4b..ad540c68c 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -329,6 +329,13 @@ doOpenFont(ClientPtr client, OFclosurePtr c)
err = BadFontName;
goto bail;
}
+ /* check values for firstCol, lastCol, firstRow, and lastRow */
+ if (pfont->info.firstCol > pfont->info.lastCol ||
+ pfont->info.firstRow > pfont->info.lastRow ||
+ pfont->info.lastCol - pfont->info.firstCol > 255) {
+ err = AllocError;
+ goto bail;
+ }
if (!pfont->fpe)
pfont->fpe = fpe;
pfont->refcnt++;
@@ -1632,9 +1639,9 @@ FreeFontPath(FontPathElementPtr *list, int n, Bool force)
found++;
}
if (list[i]->refcount != found) {
- ErrorF("FreeFontPath: FPE \"%.*s\" refcount is %d, should be %d; fixing.\n",
+ /* ErrorF("FreeFontPath: FPE \"%.*s\" refcount is %d, should be %d; fixing.\n",
list[i]->name_length, list[i]->name,
- list[i]->refcount, found);
+ list[i]->refcount, found); */
list[i]->refcount = found; /* ensure it will get freed */
}
}
diff --git a/dix/events.c b/dix/events.c
index c57a30ed8..84a802a1b 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1970,6 +1970,13 @@ XYToWindow(int x, int y)
x - pWin->drawable.x,
y - pWin->drawable.y, &box))
#endif
+#ifdef ROOTLESS
+ /* In rootless mode windows may be offscreen, even when
+ * they're in X's stack. (E.g. if the native window system
+ * implements some form of virtual desktop system).
+ */
+ && !pWin->rootlessUnhittable
+#endif
)
{
if (spriteTraceGood >= spriteTraceSize)
diff --git a/dix/main.c b/dix/main.c
index f3cde189c..d3e21f1d1 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -242,6 +242,10 @@ static int indexForScanlinePad[ 65 ] = {
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#endif
+#ifdef __APPLE__
+void DarwinHandleGUI(int argc, char **argv, char **envp);
+#endif
+
int
main(int argc, char *argv[], char *envp[])
{
@@ -256,10 +260,10 @@ main(int argc, char *argv[], char *envp[])
PrinterInitGlobals();
#endif
+#ifdef XQUARTZ
/* Quartz support on Mac OS X requires that the Cocoa event loop be in
* the main thread. This allows the X server main to be called again
* from another thread. */
-#if defined(__DARWIN__) && defined(DARWIN_WITH_QUARTZ)
DarwinHandleGUI(argc, argv, envp);
#endif
diff --git a/dix/window.c b/dix/window.c
index 3dfeda36e..ab1f3f153 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -305,6 +305,9 @@ SetWindowToDefaults(register WindowPtr pWin)
#ifdef COMPOSITE
pWin->redirectDraw = 0;
#endif
+#ifdef ROOTLESS
+ pWin->rootlessUnhittable = FALSE;
+#endif
}
static void
diff --git a/fb/Makefile.am b/fb/Makefile.am
index 11b2d2fea..75861a38d 100644
--- a/fb/Makefile.am
+++ b/fb/Makefile.am
@@ -1,4 +1,4 @@
-noinst_LTLIBRARIES = libfb.la libfbmmx.la
+noinst_LTLIBRARIES = libfb.la libwfb.la
INCLUDES = \
-I$(top_srcdir)/hw/xfree86/os-support \
@@ -7,25 +7,12 @@ INCLUDES = \
AM_CFLAGS = $(DIX_CFLAGS)
if XORG
-sdk_HEADERS = fb.h fbrop.h fbpseudocolor.h fboverlay.h
+sdk_HEADERS = fb.h fbrop.h fbpseudocolor.h fboverlay.h wfbrename.h
endif
-if MMX_CAPABLE
-AM_CFLAGS += -DUSE_MMX
+libfb_la_CFLAGS = $(AM_CFLAGS)
-libfbmmx_la_CFLAGS = \
- $(DIX_CFLAGS) \
- -DUSE_MMX \
- -mmmx \
- -msse \
- -Winline \
- --param inline-unit-growth=10000 \
- --param large-function-growth=10000
-endif
-
-libfbmmx_la_SOURCES = \
- fbmmx.c \
- fbmmx.h
+libwfb_la_CFLAGS = $(AM_CFLAGS) -DFB_ACCESS_WRAPPER
libfb_la_SOURCES = \
fb.h \
@@ -38,7 +25,6 @@ libfb_la_SOURCES = \
fbblt.c \
fbbltone.c \
fbbstore.c \
- fbcompose.c \
fbcopy.c \
fbfill.c \
fbfillrect.c \
@@ -66,10 +52,8 @@ libfb_la_SOURCES = \
fbutil.c \
fbwindow.c \
fbpseudocolor.c \
- fbpseudocolor.h \
- fbedge.c \
- fbedgeimp.h
+ fbpseudocolor.h
-libfb_la_LIBADD = libfbmmx.la
+libwfb_la_SOURCES = $(libfb_la_SOURCES)
-EXTRA_DIST = fbcmap.c
+EXTRA_DIST = fbcmap.c fbcmap_mi.c
diff --git a/fb/fb.h b/fb/fb.h
index 3742cf01a..df430b8fd 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -26,6 +26,8 @@
#define _FB_H_
#include <X11/X.h>
+#include <pixman.h>
+
#include "scrnintstr.h"
#include "pixmap.h"
#include "pixmapstr.h"
@@ -44,6 +46,39 @@
#include "picture.h"
#endif
+#ifdef FB_ACCESS_WRAPPER
+
+#include "wfbrename.h"
+#define FBPREFIX(x) wfb##x
+#define WRITE(ptr, val) ((*wfbWriteMemory)((ptr), (val), sizeof(*(ptr))))
+#define READ(ptr) ((*wfbReadMemory)((ptr), sizeof(*(ptr))))
+
+#define MEMCPY_WRAPPED(dst, src, size) do { \
+ size_t _i; \
+ CARD8 *_dst = (CARD8*)(dst), *_src = (CARD8*)(src); \
+ for(_i = 0; _i < size; _i++) { \
+ WRITE(_dst +_i, READ(_src + _i)); \
+ } \
+} while(0)
+
+#define MEMSET_WRAPPED(dst, val, size) do { \
+ size_t _i; \
+ CARD8 *_dst = (CARD8*)(dst); \
+ for(_i = 0; _i < size; _i++) { \
+ WRITE(_dst +_i, (val)); \
+ } \
+} while(0)
+
+#else
+
+#define FBPREFIX(x) fb##x
+#define WRITE(ptr, val) (*(ptr) = (val))
+#define READ(ptr) (*(ptr))
+#define MEMCPY_WRAPPED(dst, src, size) memcpy((dst), (src), (size))
+#define MEMSET_WRAPPED(dst, val, size) memset((dst), (val), (size))
+
+#endif
+
/*
* This single define controls the basic size of data manipulated
* by this software; it must be log2(sizeof (FbBits) * 8)
@@ -222,8 +257,8 @@ extern void fbSetBits (FbStip *bits, int stride, FbStip data);
#define FbPtrOffset(p,o,t) ((t *) ((CARD8 *) (p) + (o)))
#define FbSelectPatternPart(xor,o,t) ((xor) >> (FbPatternOffset (o,t) << 3))
-#define FbStorePart(dst,off,t,xor) (*FbPtrOffset(dst,off,t) = \
- FbSelectPart(xor,off,t))
+#define FbStorePart(dst,off,t,xor) (WRITE(FbPtrOffset(dst,off,t), \
+ FbSelectPart(xor,off,t)))
#ifndef FbSelectPart
#define FbSelectPart(x,o,t) FbSelectPatternPart(x,o,t)
#endif
@@ -403,7 +438,7 @@ extern void fbSetBits (FbStip *bits, int stride, FbStip data);
FbStorePart(dst,sizeof (FbBits) - 1,CARD8,xor); \
break; \
default: \
- *dst = FbDoMaskRRop(*dst, and, xor, l); \
+ WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, l)); \
break; \
} \
}
@@ -423,7 +458,7 @@ extern void fbSetBits (FbStip *bits, int stride, FbStip data);
break; \
FbDoRightMaskByteRRop6Cases(dst,xor) \
default: \
- *dst = FbDoMaskRRop (*dst, and, xor, r); \
+ WRITE(dst, FbDoMaskRRop (READ(dst), and, xor, r)); \
} \
}
#endif
@@ -455,20 +490,20 @@ extern void fbSetBits (FbStip *bits, int stride, FbStip data);
* The term "lane" comes from the hardware term "byte-lane" which
*/
-#define FbLaneCase1(n,a,o) ((n) == 0x01 ? \
- (*(CARD8 *) ((a)+FbPatternOffset(o,CARD8)) = \
- fgxor) : 0)
-#define FbLaneCase2(n,a,o) ((n) == 0x03 ? \
- (*(CARD16 *) ((a)+FbPatternOffset(o,CARD16)) = \
+#define FbLaneCase1(n,a,o) ((n) == 0x01 ? (void) \
+ WRITE((CARD8 *) ((a)+FbPatternOffset(o,CARD8)), \
+ fgxor) : (void) 0)
+#define FbLaneCase2(n,a,o) ((n) == 0x03 ? (void) \
+ WRITE((CARD16 *) ((a)+FbPatternOffset(o,CARD16)), \
fgxor) : \
((void)FbLaneCase1((n)&1,a,o), \
FbLaneCase1((n)>>1,a,(o)+1)))
-#define FbLaneCase4(n,a,o) ((n) == 0x0f ? \
- (*(CARD32 *) ((a)+FbPatternOffset(o,CARD32)) = \
+#define FbLaneCase4(n,a,o) ((n) == 0x0f ? (void) \
+ WRITE((CARD32 *) ((a)+FbPatternOffset(o,CARD32)), \
fgxor) : \
((void)FbLaneCase2((n)&3,a,o), \
FbLaneCase2((n)>>2,a,(o)+2)))
-#define FbLaneCase8(n,a,o) ((n) == 0x0ff ? (*(FbBits *) ((a)+(o)) = fgxor) : \
+#define FbLaneCase8(n,a,o) ((n) == 0x0ff ? (void) (*(FbBits *) ((a)+(o)) = fgxor) : \
((void)FbLaneCase4((n)&15,a,o), \
FbLaneCase4((n)>>4,a,(o)+4)))
@@ -574,20 +609,36 @@ extern int fbGetWinPrivateIndex(void);
extern const GCOps fbGCOps;
extern const GCFuncs fbGCFuncs;
-#ifdef TEKX11
-#define FB_OLD_GC
-#define FB_OLD_SCREEN
+#ifdef FB_24_32BIT
+#define FB_SCREEN_PRIVATE
#endif
-#ifdef FB_OLD_SCREEN
-# define FB_OLD_MISCREENINIT /* miScreenInit requires 14 args, not 13 */
-extern WindowPtr *WindowTable;
-#endif
+/* Framebuffer access wrapper */
+typedef FbBits (*ReadMemoryProcPtr)(const void *src, int size);
+typedef void (*WriteMemoryProcPtr)(void *dst, FbBits value, int size);
+typedef void (*SetupWrapProcPtr)(ReadMemoryProcPtr *pRead,
+ WriteMemoryProcPtr *pWrite,
+ DrawablePtr pDraw);
+typedef void (*FinishWrapProcPtr)(DrawablePtr pDraw);
+
+#ifdef FB_ACCESS_WRAPPER
+
+#define fbPrepareAccess(pDraw) \
+ fbGetScreenPrivate((pDraw)->pScreen)->setupWrap( \
+ &wfbReadMemory, \
+ &wfbWriteMemory, \
+ (pDraw))
+#define fbFinishAccess(pDraw) \
+ fbGetScreenPrivate((pDraw)->pScreen)->finishWrap(pDraw)
+
+#else
+
+#define fbPrepareAccess(pPix)
+#define fbFinishAccess(pDraw)
-#ifdef FB_24_32BIT
-#define FB_SCREEN_PRIVATE
#endif
+
#ifdef FB_SCREEN_PRIVATE
extern int fbScreenPrivateIndex;
extern int fbGetScreenPrivateIndex(void);
@@ -596,6 +647,10 @@ extern int fbGetScreenPrivateIndex(void);
typedef struct {
unsigned char win32bpp; /* window bpp for 32-bpp images */
unsigned char pix32bpp; /* pixmap bpp for 32-bpp images */
+#ifdef FB_ACCESS_WRAPPER
+ SetupWrapProcPtr setupWrap; /* driver hook to set pixmap access wrapping */
+ FinishWrapProcPtr finishWrap; /* driver hook to clean up pixmap access wrapping */
+#endif
} FbScreenPrivRec, *FbScreenPrivPtr;
#define fbGetScreenPrivate(pScreen) ((FbScreenPrivPtr) \
@@ -604,15 +659,6 @@ typedef struct {
/* private field of GC */
typedef struct {
-#ifdef FB_OLD_GC
- unsigned char pad1;
- unsigned char pad2;
- unsigned char pad3;
- unsigned fExpose:1;
- unsigned freeCompClip:1;
- PixmapPtr pRotatedPixmap;
- RegionPtr pCompositeClip;
-#endif
FbBits and, xor; /* reduced rop values */
FbBits bgand, bgxor; /* for stipples */
FbBits fg, bg, pm; /* expanded and filled */
@@ -625,17 +671,10 @@ typedef struct {
#define fbGetGCPrivate(pGC) ((FbGCPrivPtr)\
(pGC)->devPrivates[fbGetGCPrivateIndex()].ptr)
-#ifdef FB_OLD_GC
-#define fbGetCompositeClip(pGC) (fbGetGCPrivate(pGC)->pCompositeClip)
-#define fbGetExpose(pGC) (fbGetGCPrivate(pGC)->fExpose)
-#define fbGetFreeCompClip(pGC) (fbGetGCPrivate(pGC)->freeCompClip)
-#define fbGetRotatedPixmap(pGC) (fbGetGCPrivate(pGC)->pRotatedPixmap)
-#else
#define fbGetCompositeClip(pGC) ((pGC)->pCompositeClip)
#define fbGetExpose(pGC) ((pGC)->fExpose)
#define fbGetFreeCompClip(pGC) ((pGC)->freeCompClip)
#define fbGetRotatedPixmap(pGC) ((pGC)->pRotatedPixmap)
-#endif
#define fbGetScreenPixmap(s) ((PixmapPtr) (s)->devPrivate)
#ifdef FB_NO_WINDOW_PIXMAPS
@@ -674,6 +713,7 @@ typedef struct {
(xoff) = __fbPixOffXPix(_pPix); \
(yoff) = __fbPixOffYPix(_pPix); \
} \
+ fbPrepareAccess(pDrawable); \
(pointer) = (FbBits *) _pPix->devPrivate.ptr; \
(stride) = ((int) _pPix->devKind) / sizeof (FbBits); (void)(stride); \
(bpp) = _pPix->drawable.bitsPerPixel; (void)(bpp); \
@@ -690,6 +730,7 @@ typedef struct {
(xoff) = __fbPixOffXPix(_pPix); \
(yoff) = __fbPixOffYPix(_pPix); \
} \
+ fbPrepareAccess(pDrawable); \
(pointer) = (FbStip *) _pPix->devPrivate.ptr; \
(stride) = ((int) _pPix->devKind) / sizeof (FbStip); (void)(stride); \
(bpp) = _pPix->drawable.bitsPerPixel; (void)(bpp); \
@@ -708,12 +749,6 @@ typedef struct {
((pDrawable)->type == DRAWABLE_PIXMAP ? \
TRUE : fbWindowEnabled((WindowPtr) pDrawable))
-#ifdef FB_OLD_SCREEN
-#define BitsPerPixel(d) (\
- ((1 << PixmapWidthPaddingInfo[d].padBytesLog2) * 8 / \
- (PixmapWidthPaddingInfo[d].padRoundUp+1)))
-#endif
-
#define FbPowerOfTwo(w) (((w) & ((w) - 1)) == 0)
/*
* Accelerated tiles are power of 2 width <= FB_UNIT
@@ -1277,6 +1312,9 @@ void
fbClearVisualTypes(void);
Bool
+fbHasVisualTypes (int depth);
+
+Bool
fbSetVisualTypes (int depth, int visuals, int bitsPerRGB);
Bool
@@ -1720,13 +1758,11 @@ fbQueryBestSize (int class,
unsigned short *width, unsigned short *height,
ScreenPtr pScreen);
-#ifndef FB_OLD_SCREEN
PixmapPtr
_fbGetWindowPixmap (WindowPtr pWindow);
void
_fbSetWindowPixmap (WindowPtr pWindow, PixmapPtr pPixmap);
-#endif
Bool
fbSetupScreen(ScreenPtr pScreen,
@@ -1739,6 +1775,30 @@ fbSetupScreen(ScreenPtr pScreen,
int bpp); /* bits per pixel of frame buffer */
Bool
+wfbFinishScreenInit(ScreenPtr pScreen,
+ pointer pbits,
+ int xsize,
+ int ysize,
+ int dpix,
+ int dpiy,
+ int width,
+ int bpp,
+ SetupWrapProcPtr setupWrap,
+ FinishWrapProcPtr finishWrap);
+
+Bool
+wfbScreenInit(ScreenPtr pScreen,
+ pointer pbits,
+ int xsize,
+ int ysize,
+ int dpix,
+ int dpiy,
+ int width,
+ int bpp,
+ SetupWrapProcPtr setupWrap,
+ FinishWrapProcPtr finishWrap);
+
+Bool
fbFinishScreenInit(ScreenPtr pScreen,
pointer pbits,
int xsize,
@@ -1938,6 +1998,7 @@ fbEvenTile (FbBits *dst,
int height,
FbBits *tile,
+ FbStride tileStride,
int tileHeight,
int alu,
@@ -1994,6 +2055,11 @@ fbReplicatePixel (Pixel p, int bpp);
void
fbReduceRasterOp (int rop, FbBits fg, FbBits pm, FbBits *andp, FbBits *xorp);
+#ifdef FB_ACCESS_WRAPPER
+extern ReadMemoryProcPtr wfbReadMemory;
+extern WriteMemoryProcPtr wfbWriteMemory;
+#endif
+
/*
* fbwindow.c
*/
@@ -2049,4 +2115,9 @@ void
fbPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what);
+pixman_image_t *image_from_pict (PicturePtr pict,
+ Bool has_clip);
+void free_pixman_pict (PicturePtr, pixman_image_t *);
+
#endif /* _FB_H_ */
+
diff --git a/fb/fb24_32.c b/fb/fb24_32.c
index 572da4865..00b739b25 100644
--- a/fb/fb24_32.c
+++ b/fb/fb24_32.c
@@ -38,18 +38,18 @@
* by reading/writing aligned CARD32s where it's easy
*/
-#define Get8(a) ((CARD32) *(a))
+#define Get8(a) ((CARD32) READ(a))
#if BITMAP_BIT_ORDER == MSBFirst
#define Get24(a) ((Get8(a) << 16) | (Get8((a)+1) << 8) | Get8((a)+2))
-#define Put24(a,p) (((a)[0] = (CARD8) ((p) >> 16)), \
- ((a)[1] = (CARD8) ((p) >> 8)), \
- ((a)[2] = (CARD8) (p)))
+#define Put24(a,p) ((WRITE((a+0), (CARD8) ((p) >> 16))), \
+ (WRITE((a+1), (CARD8) ((p) >> 8))), \
+ (WRITE((a+2), (CARD8) (p))))
#else
#define Get24(a) (Get8(a) | (Get8((a)+1) << 8) | (Get8((a)+2)<<16))
-#define Put24(a,p) (((a)[0] = (CARD8) (p)), \
- ((a)[1] = (CARD8) ((p) >> 8)), \
- ((a)[2] = (CARD8) ((p) >> 16)))
+#define Put24(a,p) ((WRITE((a+0), (CARD8) (p))), \
+ (WRITE((a+1), (CARD8) ((p) >> 8))), \
+ (WRITE((a+2), (CARD8) ((p) >> 16))))
#endif
typedef void (*fb24_32BltFunc) (CARD8 *srcLine,
@@ -106,7 +106,7 @@ fb24_32BltDown (CARD8 *srcLine,
while (((long) dst & 3) && w)
{
w--;
- pixel = *src++;
+ pixel = READ(src++);
pixel = FbDoDestInvarientMergeRop(pixel);
Put24 (dst, pixel);
dst += 3;
@@ -115,35 +115,35 @@ fb24_32BltDown (CARD8 *srcLine,
while (w >= 4)
{
CARD32 s0, s1;
- s0 = *src++;
+ s0 = READ(src++);
s0 = FbDoDestInvarientMergeRop(s0);
- s1 = *src++;
+ s1 = READ(src++);
s1 = FbDoDestInvarientMergeRop(s1);
#if BITMAP_BIT_ORDER == LSBFirst
- *(CARD32 *)(dst) = (s0 & 0xffffff) | (s1 << 24);
+ WRITE((CARD32 *)dst, (s0 & 0xffffff) | (s1 << 24));
#else
- *(CARD32 *)(dst) = (s0 << 8) | ((s1 & 0xffffff) >> 16);
+ WRITE((CARD32 *)dst, (s0 << 8) | ((s1 & 0xffffff) >> 16));
#endif
- s0 = *src++;
+ s0 = READ(src++);
s0 = FbDoDestInvarientMergeRop(s0);
#if BITMAP_BIT_ORDER == LSBFirst
- *(CARD32 *)(dst+4) = ((s1 & 0xffffff) >> 8) | (s0 << 16);
+ WRITE((CARD32 *)(dst+4), ((s1 & 0xffffff) >> 8) | (s0 << 16));
#else
- *(CARD32 *)(dst+4) = (s1 << 16) | ((s0 & 0xffffff) >> 8);
+ WRITE((CARD32 *)(dst+4), (s1 << 16) | ((s0 & 0xffffff) >> 8));
#endif
- s1 = *src++;
+ s1 = READ(src++);
s1 = FbDoDestInvarientMergeRop(s1);
#if BITMAP_BIT_ORDER == LSBFirst
- *(CARD32 *)(dst+8) = ((s0 & 0xffffff) >> 16) | (s1 << 8);
+ WRITE((CARD32 *)(dst+8), ((s0 & 0xffffff) >> 16) | (s1 << 8));
#else
- *(CARD32 *)(dst+8) = (s0 << 24) | (s1 & 0xffffff);
+ WRITE((CARD32 *)(dst+8), (s0 << 24) | (s1 & 0xffffff));
#endif
dst += 12;
w -= 4;
}
while (w--)
{
- pixel = *src++;
+ pixel = READ(src++);
pixel = FbDoDestInvarientMergeRop(pixel);
Put24 (dst, pixel);
dst += 3;
@@ -153,7 +153,7 @@ fb24_32BltDown (CARD8 *srcLine,
{
while (w--)
{
- pixel = *src++;
+ pixel = READ(src++);
dpixel = Get24 (dst);
pixel = FbDoMergeRop(pixel, dpixel);
Put24 (dst, pixel);
@@ -205,40 +205,40 @@ fb24_32BltUp (CARD8 *srcLine,
w--;
pixel = Get24(src);
src += 3;
- *dst++ = FbDoDestInvarientMergeRop(pixel);
+ WRITE(dst++, FbDoDestInvarientMergeRop(pixel));
}
/* Do four aligned pixels at a time */
while (w >= 4)
{
CARD32 s0, s1;
- s0 = *(CARD32 *)(src);
+ s0 = READ((CARD32 *)src);
#if BITMAP_BIT_ORDER == LSBFirst
pixel = s0 & 0xffffff;
#else
pixel = s0 >> 8;
#endif
- *dst++ = FbDoDestInvarientMergeRop(pixel);
- s1 = *(CARD32 *)(src+4);
+ WRITE(dst++, FbDoDestInvarientMergeRop(pixel));
+ s1 = READ((CARD32 *)(src+4));
#if BITMAP_BIT_ORDER == LSBFirst
pixel = (s0 >> 24) | ((s1 << 8) & 0xffffff);
#else
pixel = ((s0 << 16) & 0xffffff) | (s1 >> 16);
#endif
- *dst++ = FbDoDestInvarientMergeRop(pixel);
- s0 = *(CARD32 *)(src+8);
+ WRITE(dst++, FbDoDestInvarientMergeRop(pixel));
+ s0 = READ((CARD32 *)(src+8));
#if BITMAP_BIT_ORDER == LSBFirst
pixel = (s1 >> 16) | ((s0 << 16) & 0xffffff);
#else
pixel = ((s1 << 8) & 0xffffff) | (s0 >> 24);
#endif
- *dst++ = FbDoDestInvarientMergeRop(pixel);
+ WRITE(dst++, FbDoDestInvarientMergeRop(pixel));
#if BITMAP_BIT_ORDER == LSBFirst
pixel = s0 >> 8;
#else
pixel = s0 & 0xffffff;
#endif
- *dst++ = FbDoDestInvarientMergeRop(pixel);
+ WRITE(dst++, FbDoDestInvarientMergeRop(pixel));
src += 12;
w -= 4;
}
@@ -247,7 +247,7 @@ fb24_32BltUp (CARD8 *srcLine,
w--;
pixel = Get24(src);
src += 3;
- *dst++ = FbDoDestInvarientMergeRop(pixel);
+ WRITE(dst++, FbDoDestInvarientMergeRop(pixel));
}
}
else
@@ -256,7 +256,7 @@ fb24_32BltUp (CARD8 *srcLine,
{
pixel = Get24(src);
src += 3;
- *dst = FbDoMergeRop(pixel, *dst);
+ WRITE(dst, FbDoMergeRop(pixel, READ(dst)));
dst++;
}
}
@@ -305,6 +305,8 @@ fb24_32GetSpans(DrawablePtr pDrawable,
ppt++;
pwidth++;
}
+
+ fbFinishAccess (pDrawable);
}
void
@@ -366,6 +368,8 @@ fb24_32SetSpans (DrawablePtr pDrawable,
ppt++;
pwidth++;
}
+
+ fbFinishAccess (pDrawable);
}
/*
@@ -429,6 +433,8 @@ fb24_32PutZImage (DrawablePtr pDrawable,
alu,
pm);
}
+
+ fbFinishAccess (pDrawable);
}
void
@@ -463,6 +469,8 @@ fb24_32GetImage (DrawablePtr pDrawable,
fb24_32BltUp (src + (y + srcYoff) * srcStride, srcStride, x + srcXoff,
(CARD8 *) d, dstStride, 0,
w, h, GXcopy, pm);
+
+ fbFinishAccess (pDrawable);
}
void
@@ -519,6 +527,9 @@ fb24_32CopyMtoN (DrawablePtr pSrcDrawable,
pPriv->pm);
pbox++;
}
+
+ fbFinishAccess (pSrcDrawable);
+ fbFinishAccess (pDstDrawable);
}
PixmapPtr
@@ -563,6 +574,9 @@ fb24_32ReformatTile(PixmapPtr pOldTile, int bitsPerPixel)
GXcopy,
FB_ALLONES);
+ fbFinishAccess (&pOldTile->drawable);
+ fbFinishAccess (&pNewTile->drawable);
+
return pNewTile;
}
diff --git a/fb/fb24_32.h b/fb/fb24_32.h
index 3c83f3423..7c9819eba 100644
--- a/fb/fb24_32.h
+++ b/fb/fb24_32.h
@@ -1,6 +1,4 @@
/*
- * $XFree86$
- *
* Copyright © 2000 SuSE, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and its
diff --git a/fb/fballpriv.c b/fb/fballpriv.c
index 3c05ff36e..8efb8fa99 100644
--- a/fb/fballpriv.c
+++ b/fb/fballpriv.c
@@ -1,6 +1,4 @@
/*
- * Id: fballpriv.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -49,10 +47,6 @@ int fbGetWinPrivateIndex(void)
#endif
int fbGeneration;
-#ifdef FB_OLD_SCREEN
-#define miAllocateGCPrivateIndex() AllocateGCPrivateIndex()
-#endif
-
Bool
fbAllocatePrivates(ScreenPtr pScreen, int *pGCIndex)
{
@@ -90,3 +84,8 @@ fbAllocatePrivates(ScreenPtr pScreen, int *pGCIndex)
#endif
return TRUE;
}
+
+#ifdef FB_ACCESS_WRAPPER
+ReadMemoryProcPtr wfbReadMemory;
+WriteMemoryProcPtr wfbWriteMemory;
+#endif
diff --git a/fb/fbarc.c b/fb/fbarc.c
index 8f4d2960e..3f46bd4b2 100644
--- a/fb/fbarc.c
+++ b/fb/fbarc.c
@@ -1,6 +1,4 @@
/*
- * Id: fbarc.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -109,6 +107,7 @@ fbPolyArc (DrawablePtr pDrawable,
miPolyArc(pDrawable, pGC, 1, parcs);
parcs++;
}
+ fbFinishAccess (pDrawable);
}
else
#endif
diff --git a/fb/fbbits.c b/fb/fbbits.c
index 56b58df4e..808374309 100644
--- a/fb/fbbits.c
+++ b/fb/fbbits.c
@@ -1,6 +1,4 @@
/*
- * Id: fbbits.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -103,14 +101,14 @@
#define BITSUNIT BYTE
#define BITSMUL 3
-#define FbDoTypeStore(b,t,x,s) (*((t *) (b)) = (x) >> (s))
-#define FbDoTypeRRop(b,t,a,x,s) (*((t *) (b)) = FbDoRRop(*((t *) (b)),\
- (a) >> (s), \
- (x) >> (s)))
-#define FbDoTypeMaskRRop(b,t,a,x,m,s) (*((t *) (b)) = FbDoMaskRRop(*((t *) (b)),\
- (a) >> (s), \
- (x) >> (s), \
- (m) >> (s))
+#define FbDoTypeStore(b,t,x,s) WRITE(((t *) (b)), (x) >> (s))
+#define FbDoTypeRRop(b,t,a,x,s) WRITE((t *) (b), FbDoRRop(READ((t *) (b)),\
+ (a) >> (s), \
+ (x) >> (s)))
+#define FbDoTypeMaskRRop(b,t,a,x,m,s) WRITE((t *) (b), FbDoMaskRRop(READ((t *) (b)),\
+ (a) >> (s), \
+ (x) >> (s), \
+ (m) >> (s)))
#if BITMAP_BIT_ORDER == LSBFirst
#define BITSSTORE(b,x) ((unsigned long) (b) & 1 ? \
(FbDoTypeStore (b, CARD8, x, 0), \
diff --git a/fb/fbbits.h b/fb/fbbits.h
index e5c006dbb..44991f106 100644
--- a/fb/fbbits.h
+++ b/fb/fbbits.h
@@ -1,6 +1,4 @@
/*
- * $XFree86$
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -42,13 +40,13 @@
#ifdef BITSSTORE
#define STORE(b,x) BITSSTORE(b,x)
#else
-#define STORE(b,x) (*(b) = (x))
+#define STORE(b,x) WRITE((b), (x))
#endif
#ifdef BITSRROP
#define RROP(b,a,x) BITSRROP(b,a,x)
#else
-#define RROP(b,a,x) (*(b) = FbDoRRop (*(b), (a), (x)))
+#define RROP(b,a,x) WRITE((b), FbDoRRop (READ(b), (a), (x)))
#endif
#ifdef BITSUNIT
@@ -119,6 +117,8 @@ BRESSOLID (DrawablePtr pDrawable,
e += e3;
}
}
+
+ fbFinishAccess (pDrawable);
}
#endif
@@ -263,6 +263,8 @@ onOffOdd:
dashlen = len;
}
}
+
+ fbFinishAccess (pDrawable);
}
#endif
@@ -541,18 +543,18 @@ ARC (FbBits *dst,
# define WRITE_ADDR4(n) ((n))
#endif
-#define WRITE1(d,n,fg) ((d)[WRITE_ADDR1(n)] = (BITS) (fg))
+#define WRITE1(d,n,fg) WRITE(d + WRITE_ADDR1(n), (BITS) (fg))
#ifdef BITS2
-# define WRITE2(d,n,fg) (*((BITS2 *) &((d)[WRITE_ADDR2(n)])) = (BITS2) (fg))
+# define WRITE2(d,n,fg) WRITE((BITS2 *) &((d)[WRITE_ADDR2(n)]), (BITS2) (fg))
#else
-# define WRITE2(d,n,fg) WRITE1(d,(n)+1,WRITE1(d,n,fg))
+# define WRITE2(d,n,fg) (WRITE1(d,n,fg), WRITE1(d,(n)+1,fg))
#endif
#ifdef BITS4
-# define WRITE4(d,n,fg) (*((BITS4 *) &((d)[WRITE_ADDR4(n)])) = (BITS4) (fg))
+# define WRITE4(d,n,fg) WRITE((BITS4 *) &((d)[WRITE_ADDR4(n)]), (BITS4) (fg))
#else
-# define WRITE4(d,n,fg) WRITE2(d,(n)+2,WRITE2(d,n,fg))
+# define WRITE4(d,n,fg) (WRITE2(d,n,fg), WRITE2(d,(n)+2,fg))
#endif
void
@@ -710,8 +712,10 @@ POLYLINE (DrawablePtr pDrawable,
intToX(pt2) + xoff, intToY(pt2) + yoff,
npt == 0 && pGC->capStyle != CapNotLast,
&dashoffset);
- if (!npt)
+ if (!npt) {
+ fbFinishAccess (pDrawable);
return;
+ }
pt1 = pt2;
pt2 = *pts++;
npt--;
@@ -776,6 +780,7 @@ POLYLINE (DrawablePtr pDrawable,
{
RROP(bits,and,xor);
}
+ fbFinishAccess (pDrawable);
return;
}
pt1 = pt2;
@@ -786,6 +791,8 @@ POLYLINE (DrawablePtr pDrawable,
}
}
}
+
+ fbFinishAccess (pDrawable);
}
#endif
@@ -883,20 +890,20 @@ POLYSEGMENT (DrawablePtr pDrawable,
FbMaskBits (dstX, width, startmask, nmiddle, endmask);
if (startmask)
{
- *dstLine = FbDoMaskRRop (*dstLine, andBits, xorBits, startmask);
+ WRITE(dstLine, FbDoMaskRRop (READ(dstLine), andBits, xorBits, startmask));
dstLine++;
}
if (!andBits)
while (nmiddle--)
- *dstLine++ = xorBits;
+ WRITE(dstLine++, xorBits);
else
while (nmiddle--)
{
- *dstLine = FbDoRRop (*dstLine, andBits, xorBits);
+ WRITE(dstLine, FbDoRRop (READ(dstLine), andBits, xorBits));
dstLine++;
}
if (endmask)
- *dstLine = FbDoMaskRRop (*dstLine, andBits, xorBits, endmask);
+ WRITE(dstLine, FbDoMaskRRop (READ(dstLine), andBits, xorBits, endmask));
}
else
{
@@ -950,6 +957,8 @@ POLYSEGMENT (DrawablePtr pDrawable,
}
}
}
+
+ fbFinishAccess (pDrawable);
}
#endif
diff --git a/fb/fbblt.c b/fb/fbblt.c
index d176a7c27..837c3a239 100644
--- a/fb/fbblt.c
+++ b/fb/fbblt.c
@@ -1,6 +1,4 @@
/*
- * Id: fbblt.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -92,10 +90,10 @@ fbBlt (FbBits *srcLine,
if (!upsidedown)
for (i = 0; i < height; i++)
- memcpy(dst + i * dstStride, src + i * srcStride, width);
+ MEMCPY_WRAPPED(dst + i * dstStride, src + i * srcStride, width);
else
for (i = height - 1; i >= 0; i--)
- memcpy(dst + i * dstStride, src + i * srcStride, width);
+ MEMCPY_WRAPPED(dst + i * dstStride, src + i * srcStride, width);
return;
}
@@ -137,7 +135,7 @@ fbBlt (FbBits *srcLine,
{
if (endmask)
{
- bits = *--src;
+ bits = READ(--src);
--dst;
FbDoRightMaskByteMergeRop(dst, bits, endbyte, endmask);
}
@@ -145,20 +143,20 @@ fbBlt (FbBits *srcLine,
if (destInvarient)
{
while (n--)
- *--dst = FbDoDestInvarientMergeRop(*--src);
+ WRITE(--dst, FbDoDestInvarientMergeRop(READ(--src)));
}
else
{
while (n--)
{
- bits = *--src;
+ bits = READ(--src);
--dst;
- *dst = FbDoMergeRop (bits, *dst);
+ WRITE(dst, FbDoMergeRop (bits, READ(dst)));
}
}
if (startmask)
{
- bits = *--src;
+ bits = READ(--src);
--dst;
FbDoLeftMaskByteMergeRop(dst, bits, startbyte, startmask);
}
@@ -167,7 +165,7 @@ fbBlt (FbBits *srcLine,
{
if (startmask)
{
- bits = *src++;
+ bits = READ(src++);
FbDoLeftMaskByteMergeRop(dst, bits, startbyte, startmask);
dst++;
}
@@ -198,20 +196,20 @@ fbBlt (FbBits *srcLine,
}
#endif
while (n--)
- *dst++ = FbDoDestInvarientMergeRop(*src++);
+ WRITE(dst++, FbDoDestInvarientMergeRop(READ(src++)));
}
else
{
while (n--)
{
- bits = *src++;
- *dst = FbDoMergeRop (bits, *dst);
+ bits = READ(src++);
+ WRITE(dst, FbDoMergeRop (bits, READ(dst)));
dst++;
}
}
if (endmask)
{
- bits = *src;
+ bits = READ(src);
FbDoRightMaskByteMergeRop(dst, bits, endbyte, endmask);
}
}
@@ -240,13 +238,13 @@ fbBlt (FbBits *srcLine,
if (reverse)
{
if (srcX < dstX)
- bits1 = *--src;
+ bits1 = READ(--src);
if (endmask)
{
bits = FbScrRight(bits1, rightShift);
if (FbScrRight(endmask, leftShift))
{
- bits1 = *--src;
+ bits1 = READ(--src);
bits |= FbScrLeft(bits1, leftShift);
}
--dst;
@@ -258,10 +256,10 @@ fbBlt (FbBits *srcLine,
while (n--)
{
bits = FbScrRight(bits1, rightShift);
- bits1 = *--src;
+ bits1 = READ(--src);
bits |= FbScrLeft(bits1, leftShift);
--dst;
- *dst = FbDoDestInvarientMergeRop(bits);
+ WRITE(dst, FbDoDestInvarientMergeRop(bits));
}
}
else
@@ -269,10 +267,10 @@ fbBlt (FbBits *srcLine,
while (n--)
{
bits = FbScrRight(bits1, rightShift);
- bits1 = *--src;
+ bits1 = READ(--src);
bits |= FbScrLeft(bits1, leftShift);
--dst;
- *dst = FbDoMergeRop(bits, *dst);
+ WRITE(dst, FbDoMergeRop(bits, READ(dst)));
}
}
if (startmask)
@@ -280,7 +278,7 @@ fbBlt (FbBits *srcLine,
bits = FbScrRight(bits1, rightShift);
if (FbScrRight(startmask, leftShift))
{
- bits1 = *--src;
+ bits1 = READ(--src);
bits |= FbScrLeft(bits1, leftShift);
}
--dst;
@@ -290,13 +288,13 @@ fbBlt (FbBits *srcLine,
else
{
if (srcX > dstX)
- bits1 = *src++;
+ bits1 = READ(src++);
if (startmask)
{
bits = FbScrLeft(bits1, leftShift);
if (FbScrLeft(startmask, rightShift))
{
- bits1 = *src++;
+ bits1 = READ(src++);
bits |= FbScrRight(bits1, rightShift);
}
FbDoLeftMaskByteMergeRop (dst, bits, startbyte, startmask);
@@ -308,9 +306,9 @@ fbBlt (FbBits *srcLine,
while (n--)
{
bits = FbScrLeft(bits1, leftShift);
- bits1 = *src++;
+ bits1 = READ(src++);
bits |= FbScrRight(bits1, rightShift);
- *dst = FbDoDestInvarientMergeRop(bits);
+ WRITE(dst, FbDoDestInvarientMergeRop(bits));
dst++;
}
}
@@ -319,9 +317,9 @@ fbBlt (FbBits *srcLine,
while (n--)
{
bits = FbScrLeft(bits1, leftShift);
- bits1 = *src++;
+ bits1 = READ(src++);
bits |= FbScrRight(bits1, rightShift);
- *dst = FbDoMergeRop(bits, *dst);
+ WRITE(dst, FbDoMergeRop(bits, READ(dst)));
dst++;
}
}
@@ -330,7 +328,7 @@ fbBlt (FbBits *srcLine,
bits = FbScrLeft(bits1, leftShift);
if (FbScrLeft(endmask, rightShift))
{
- bits1 = *src;
+ bits1 = READ(src);
bits |= FbScrRight(bits1, rightShift);
}
FbDoRightMaskByteMergeRop (dst, bits, endbyte, endmask);
@@ -425,45 +423,45 @@ fbBlt24Line (FbBits *src,
{
if (endmask)
{
- bits = *--src;
+ bits = READ(--src);
--dst;
- *dst = FbDoMaskMergeRop (bits, *dst, mask & endmask);
+ WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask & endmask));
mask = FbPrev24Pix (mask);
}
while (n--)
{
- bits = *--src;
+ bits = READ(--src);
--dst;
- *dst = FbDoMaskMergeRop (bits, *dst, mask);
+ WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask));
mask = FbPrev24Pix (mask);
}
if (startmask)
{
- bits = *--src;
+ bits = READ(--src);
--dst;
- *dst = FbDoMaskMergeRop(bits, *dst, mask & startmask);
+ WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & startmask));
}
}
else
{
if (startmask)
{
- bits = *src++;
- *dst = FbDoMaskMergeRop (bits, *dst, mask & startmask);
+ bits = READ(src++);
+ WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask & startmask));
dst++;
mask = FbNext24Pix(mask);
}
while (n--)
{
- bits = *src++;
- *dst = FbDoMaskMergeRop (bits, *dst, mask);
+ bits = READ(src++);
+ WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask));
dst++;
mask = FbNext24Pix(mask);
}
if (endmask)
{
- bits = *src;
- *dst = FbDoMaskMergeRop(bits, *dst, mask & endmask);
+ bits = READ(src);
+ WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & endmask));
}
}
}
@@ -484,26 +482,26 @@ fbBlt24Line (FbBits *src,
if (reverse)
{
if (srcX < dstX)
- bits1 = *--src;
+ bits1 = READ(--src);
if (endmask)
{
bits = FbScrRight(bits1, rightShift);
if (FbScrRight(endmask, leftShift))
{
- bits1 = *--src;
+ bits1 = READ(--src);
bits |= FbScrLeft(bits1, leftShift);
}
--dst;
- *dst = FbDoMaskMergeRop (bits, *dst, mask & endmask);
+ WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask & endmask));
mask = FbPrev24Pix(mask);
}
while (n--)
{
bits = FbScrRight(bits1, rightShift);
- bits1 = *--src;
+ bits1 = READ(--src);
bits |= FbScrLeft(bits1, leftShift);
--dst;
- *dst = FbDoMaskMergeRop(bits, *dst, mask);
+ WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask));
mask = FbPrev24Pix(mask);
}
if (startmask)
@@ -511,32 +509,32 @@ fbBlt24Line (FbBits *src,
bits = FbScrRight(bits1, rightShift);
if (FbScrRight(startmask, leftShift))
{
- bits1 = *--src;
+ bits1 = READ(--src);
bits |= FbScrLeft(bits1, leftShift);
}
--dst;
- *dst = FbDoMaskMergeRop (bits, *dst, mask & startmask);
+ WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask & startmask));
}
}
else
{
if (srcX > dstX)
- bits1 = *src++;
+ bits1 = READ(src++);
if (startmask)
{
bits = FbScrLeft(bits1, leftShift);
- bits1 = *src++;
+ bits1 = READ(src++);
bits |= FbScrRight(bits1, rightShift);
- *dst = FbDoMaskMergeRop (bits, *dst, mask & startmask);
+ WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask & startmask));
dst++;
mask = FbNext24Pix(mask);
}
while (n--)
{
bits = FbScrLeft(bits1, leftShift);
- bits1 = *src++;
+ bits1 = READ(src++);
bits |= FbScrRight(bits1, rightShift);
- *dst = FbDoMaskMergeRop(bits, *dst, mask);
+ WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask));
dst++;
mask = FbNext24Pix(mask);
}
@@ -545,10 +543,10 @@ fbBlt24Line (FbBits *src,
bits = FbScrLeft(bits1, leftShift);
if (FbScrLeft(endmask, rightShift))
{
- bits1 = *src;
+ bits1 = READ(src);
bits |= FbScrRight(bits1, rightShift);
}
- *dst = FbDoMaskMergeRop (bits, *dst, mask & endmask);
+ WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask & endmask));
}
}
}
@@ -707,8 +705,8 @@ fbBltOdd (FbBits *srcLine,
{
if (startmask)
{
- bits = *src++;
- *dst = FbDoMaskMergeRop (bits, *dst, startmask);
+ bits = READ(src++);
+ WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), startmask));
dst++;
}
n = nmiddle;
@@ -716,8 +714,8 @@ fbBltOdd (FbBits *srcLine,
{
while (n--)
{
- bits = *src++;
- *dst = FbDoDestInvarientMergeRop(bits);
+ bits = READ(src++);
+ WRITE(dst, FbDoDestInvarientMergeRop(bits));
dst++;
}
}
@@ -725,28 +723,28 @@ fbBltOdd (FbBits *srcLine,
{
while (n--)
{
- bits = *src++;
- *dst = FbDoMergeRop (bits, *dst);
+ bits = READ(src++);
+ WRITE(dst, FbDoMergeRop (bits, READ(dst)));
dst++;
}
}
if (endmask)
{
- bits = *src;
- *dst = FbDoMaskMergeRop(bits, *dst, endmask);
+ bits = READ(src);
+ WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), endmask));
}
}
else
{
bits = 0;
if (srcX > dstX)
- bits = *src++;
+ bits = READ(src++);
if (startmask)
{
bits1 = FbScrLeft(bits, leftShift);
- bits = *src++;
+ bits = READ(src++);
bits1 |= FbScrRight(bits, rightShift);
- *dst = FbDoMaskMergeRop (bits1, *dst, startmask);
+ WRITE(dst, FbDoMaskMergeRop (bits1, READ(dst), startmask));
dst++;
}
n = nmiddle;
@@ -755,9 +753,9 @@ fbBltOdd (FbBits *srcLine,
while (n--)
{
bits1 = FbScrLeft(bits, leftShift);
- bits = *src++;
+ bits = READ(src++);
bits1 |= FbScrRight(bits, rightShift);
- *dst = FbDoDestInvarientMergeRop(bits1);
+ WRITE(dst, FbDoDestInvarientMergeRop(bits1));
dst++;
}
}
@@ -766,9 +764,9 @@ fbBltOdd (FbBits *srcLine,
while (n--)
{
bits1 = FbScrLeft(bits, leftShift);
- bits = *src++;
+ bits = READ(src++);
bits1 |= FbScrRight(bits, rightShift);
- *dst = FbDoMergeRop(bits1, *dst);
+ WRITE(dst, FbDoMergeRop(bits1, READ(dst)));
dst++;
}
}
@@ -777,10 +775,10 @@ fbBltOdd (FbBits *srcLine,
bits1 = FbScrLeft(bits, leftShift);
if (FbScrLeft(endmask, rightShift))
{
- bits = *src;
+ bits = READ(src);
bits1 |= FbScrRight(bits, rightShift);
}
- *dst = FbDoMaskMergeRop (bits1, *dst, endmask);
+ WRITE(dst, FbDoMaskMergeRop (bits1, READ(dst), endmask));
}
}
}
diff --git a/fb/fbbltone.c b/fb/fbbltone.c
index f06357a37..ffe69775a 100644
--- a/fb/fbbltone.c
+++ b/fb/fbbltone.c
@@ -1,6 +1,4 @@
/*
- * Id: fbbltone.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -51,12 +49,12 @@
#define LoadBits {\
if (leftShift) { \
- bitsRight = (src < srcEnd ? *src++ : 0); \
+ bitsRight = (src < srcEnd ? READ(src++) : 0); \
bits = (FbStipLeft (bitsLeft, leftShift) | \
FbStipRight(bitsRight, rightShift)); \
bitsLeft = bitsRight; \
} else \
- bits = (src < srcEnd ? *src++ : 0); \
+ bits = (src < srcEnd ? READ(src++) : 0); \
}
#ifndef FBNOPIXADDR
@@ -285,7 +283,7 @@ fbBltOne (FbStip *src,
bitsLeft = 0;
if (srcX > dstS)
- bitsLeft = *src++;
+ bitsLeft = READ(src++);
if (n)
{
/*
@@ -338,7 +336,7 @@ fbBltOne (FbStip *src,
else
#endif
mask = fbBits[FbLeftStipBits(bits,pixelsPerDst)];
- *dst = FbOpaqueStipple (mask, fgxor, bgxor);
+ WRITE(dst, FbOpaqueStipple (mask, fgxor, bgxor));
dst++;
bits = FbStipLeft(bits, pixelsPerDst);
}
@@ -368,8 +366,8 @@ fbBltOne (FbStip *src,
if (left || !transparent)
{
mask = fbBits[left];
- *dst = FbStippleRRop (*dst, mask,
- fgand, fgxor, bgand, bgxor);
+ WRITE(dst, FbStippleRRop (READ(dst), mask,
+ fgand, fgxor, bgand, bgxor));
}
dst++;
bits = FbStipLeft(bits, pixelsPerDst);
@@ -537,7 +535,7 @@ const FbBits fbStipple24Bits[3][1 << FbStip24Len] = {
stip = FbLeftStipBits(bits, len); \
} else { \
stip = FbLeftStipBits(bits, remain); \
- bits = (src < srcEnd ? *src++ : 0); \
+ bits = (src < srcEnd ? READ(src++) : 0); \
__len = (len) - remain; \
stip = FbMergePartStip24Bits(stip, FbLeftStipBits(bits, __len), \
remain, __len); \
@@ -548,7 +546,7 @@ const FbBits fbStipple24Bits[3][1 << FbStip24Len] = {
}
#define fbInitStipBits(offset,len,stip) {\
- bits = FbStipLeft (*src++,offset); \
+ bits = FbStipLeft (READ(src++),offset); \
remain = FB_STIP_UNIT - offset; \
fbFirstStipBits(len,stip); \
stip = FbMergeStip24Bits (0, stip, len); \
@@ -631,10 +629,11 @@ fbBltOne24 (FbStip *srcLine,
if (leftMask)
{
mask = fbStipple24Bits[rot >> 3][stip];
- *dst = (*dst & ~leftMask) | (FbOpaqueStipple (mask,
- FbRot24(fgxor, rot),
- FbRot24(bgxor, rot))
- & leftMask);
+ WRITE(dst, (READ(dst) & ~leftMask) |
+ (FbOpaqueStipple (mask,
+ FbRot24(fgxor, rot),
+ FbRot24(bgxor, rot))
+ & leftMask));
dst++;
fbNextStipBits(rot,stip);
}
@@ -642,19 +641,20 @@ fbBltOne24 (FbStip *srcLine,
while (nl--)
{
mask = fbStipple24Bits[rot>>3][stip];
- *dst = FbOpaqueStipple (mask,
- FbRot24(fgxor, rot),
- FbRot24(bgxor, rot));
+ WRITE(dst, FbOpaqueStipple (mask,
+ FbRot24(fgxor, rot),
+ FbRot24(bgxor, rot)));
dst++;
fbNextStipBits(rot,stip);
}
if (rightMask)
{
mask = fbStipple24Bits[rot >> 3][stip];
- *dst = (*dst & ~rightMask) | (FbOpaqueStipple (mask,
- FbRot24(fgxor, rot),
- FbRot24(bgxor, rot))
- & rightMask);
+ WRITE(dst, (READ(dst) & ~rightMask) |
+ (FbOpaqueStipple (mask,
+ FbRot24(fgxor, rot),
+ FbRot24(bgxor, rot))
+ & rightMask));
}
dst += dstStride;
src += srcStride;
@@ -674,7 +674,7 @@ fbBltOne24 (FbStip *srcLine,
if (stip)
{
mask = fbStipple24Bits[rot >> 3][stip] & leftMask;
- *dst = (*dst & ~mask) | (FbRot24(fgxor, rot) & mask);
+ WRITE(dst, (READ(dst) & ~mask) | (FbRot24(fgxor, rot) & mask));
}
dst++;
fbNextStipBits (rot, stip);
@@ -685,7 +685,7 @@ fbBltOne24 (FbStip *srcLine,
if (stip)
{
mask = fbStipple24Bits[rot>>3][stip];
- *dst = (*dst & ~mask) | (FbRot24(fgxor,rot) & mask);
+ WRITE(dst, (READ(dst) & ~mask) | (FbRot24(fgxor,rot) & mask));
}
dst++;
fbNextStipBits (rot, stip);
@@ -695,7 +695,7 @@ fbBltOne24 (FbStip *srcLine,
if (stip)
{
mask = fbStipple24Bits[rot >> 3][stip] & rightMask;
- *dst = (*dst & ~mask) | (FbRot24(fgxor, rot) & mask);
+ WRITE(dst, (READ(dst) & ~mask) | (FbRot24(fgxor, rot) & mask));
}
}
dst += dstStride;
@@ -712,12 +712,12 @@ fbBltOne24 (FbStip *srcLine,
if (leftMask)
{
mask = fbStipple24Bits[rot >> 3][stip];
- *dst = FbStippleRRopMask (*dst, mask,
- FbRot24(fgand, rot),
- FbRot24(fgxor, rot),
- FbRot24(bgand, rot),
- FbRot24(bgxor, rot),
- leftMask);
+ WRITE(dst, FbStippleRRopMask (READ(dst), mask,
+ FbRot24(fgand, rot),
+ FbRot24(fgxor, rot),
+ FbRot24(bgand, rot),
+ FbRot24(bgxor, rot),
+ leftMask));
dst++;
fbNextStipBits(rot,stip);
}
@@ -725,23 +725,23 @@ fbBltOne24 (FbStip *srcLine,
while (nl--)
{
mask = fbStipple24Bits[rot >> 3][stip];
- *dst = FbStippleRRop (*dst, mask,
- FbRot24(fgand, rot),
- FbRot24(fgxor, rot),
- FbRot24(bgand, rot),
- FbRot24(bgxor, rot));
+ WRITE(dst, FbStippleRRop (READ(dst), mask,
+ FbRot24(fgand, rot),
+ FbRot24(fgxor, rot),
+ FbRot24(bgand, rot),
+ FbRot24(bgxor, rot)));
dst++;
fbNextStipBits(rot,stip);
}
if (rightMask)
{
mask = fbStipple24Bits[rot >> 3][stip];
- *dst = FbStippleRRopMask (*dst, mask,
- FbRot24(fgand, rot),
- FbRot24(fgxor, rot),
- FbRot24(bgand, rot),
- FbRot24(bgxor, rot),
- rightMask);
+ WRITE(dst, FbStippleRRopMask (READ(dst), mask,
+ FbRot24(fgand, rot),
+ FbRot24(fgxor, rot),
+ FbRot24(bgand, rot),
+ FbRot24(bgxor, rot),
+ rightMask));
}
dst += dstStride;
}
@@ -832,7 +832,7 @@ fbBltPlane (FbBits *src,
if (srcBpp == 24)
srcMask0 = FbRot24(pm,rot0) & FbBitsMask(0, srcBpp);
#endif
- srcBits = *s++;
+ srcBits = READ(s++);
dstMask = dstMaskFirst;
dstUnion = 0;
@@ -844,7 +844,7 @@ fbBltPlane (FbBits *src,
{
if (!srcMask)
{
- srcBits = *s++;
+ srcBits = READ(s++);
#ifdef FB_24BIT
if (srcBpp == 24)
srcMask0 = FbNext24Pix(srcMask0) & FbBitsMask(0,24);
@@ -853,9 +853,9 @@ fbBltPlane (FbBits *src,
}
if (!dstMask)
{
- *d = FbStippleRRopMask(*d, dstBits,
- fgand, fgxor, bgand, bgxor,
- dstUnion);
+ WRITE(d, FbStippleRRopMask(READ(d), dstBits,
+ fgand, fgxor, bgand, bgxor,
+ dstUnion));
d++;
dstMask = FbStipMask(0,1);
dstUnion = 0;
@@ -871,9 +871,9 @@ fbBltPlane (FbBits *src,
dstMask = FbStipRight(dstMask,1);
}
if (dstUnion)
- *d = FbStippleRRopMask(*d,dstBits,
- fgand, fgxor, bgand, bgxor,
- dstUnion);
+ WRITE(d, FbStippleRRopMask(READ(d),dstBits,
+ fgand, fgxor, bgand, bgxor,
+ dstUnion));
}
}
diff --git a/fb/fbbstore.c b/fb/fbbstore.c
index 78174b6fc..3ee5f5e35 100644
--- a/fb/fbbstore.c
+++ b/fb/fbbstore.c
@@ -1,6 +1,4 @@
/*
- * Id: fbbstore.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
diff --git a/fb/fbcmap.c b/fb/fbcmap.c
index 9cf5bcbf5..c29a5131c 100644
--- a/fb/fbcmap.c
+++ b/fb/fbcmap.c
@@ -39,7 +39,12 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "resource.h"
#include "fb.h"
-#ifndef XFree86Server
+#ifdef XFree86Server
+#error "You should be compiling fbcmap_mi.c instead of fbcmap.c!"
+#endif
+
+
+
ColormapPtr FbInstalledMaps[MAXSCREENS];
int
@@ -584,87 +589,3 @@ fbInitVisuals (VisualPtr *visualp,
*defaultVisp = depth[i].vids[j];
return TRUE;
}
-#else
-
-#include "micmap.h"
-
-int
-fbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps)
-{
- return miListInstalledColormaps(pScreen, pmaps);
-}
-
-void
-fbInstallColormap(ColormapPtr pmap)
-{
- miInstallColormap(pmap);
-}
-
-void
-fbUninstallColormap(ColormapPtr pmap)
-{
- miUninstallColormap(pmap);
-}
-
-void
-fbResolveColor(unsigned short *pred,
- unsigned short *pgreen,
- unsigned short *pblue,
- VisualPtr pVisual)
-{
- miResolveColor(pred, pgreen, pblue, pVisual);
-}
-
-Bool
-fbInitializeColormap(ColormapPtr pmap)
-{
- return miInitializeColormap(pmap);
-}
-
-int
-fbExpandDirectColors (ColormapPtr pmap,
- int ndef,
- xColorItem *indefs,
- xColorItem *outdefs)
-{
- return miExpandDirectColors(pmap, ndef, indefs, outdefs);
-}
-
-Bool
-fbCreateDefColormap(ScreenPtr pScreen)
-{
- return miCreateDefColormap(pScreen);
-}
-
-void
-fbClearVisualTypes(void)
-{
- miClearVisualTypes();
-}
-
-Bool
-fbSetVisualTypes (int depth, int visuals, int bitsPerRGB)
-{
- return miSetVisualTypes(depth, visuals, bitsPerRGB, -1);
-}
-
-/*
- * Given a list of formats for a screen, create a list
- * of visuals and depths for the screen which coorespond to
- * the set which can be used with this version of fb.
- */
-
-Bool
-fbInitVisuals (VisualPtr *visualp,
- DepthPtr *depthp,
- int *nvisualp,
- int *ndepthp,
- int *rootDepthp,
- VisualID *defaultVisp,
- unsigned long sizes,
- int bitsPerRGB)
-{
- return miInitVisuals(visualp, depthp, nvisualp, ndepthp, rootDepthp,
- defaultVisp, sizes, bitsPerRGB, -1);
-}
-#endif
diff --git a/fb/fbcmap_mi.c b/fb/fbcmap_mi.c
new file mode 100644
index 000000000..58bcae3aa
--- /dev/null
+++ b/fb/fbcmap_mi.c
@@ -0,0 +1,123 @@
+/************************************************************
+Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this
+software and its documentation for any purpose and without
+fee is hereby granted, provided that the above copyright no-
+tice appear in all copies and that both that copyright no-
+tice and this permission notice appear in supporting docu-
+mentation, and that the names of Sun or X Consortium
+not be used in advertising or publicity pertaining to
+distribution of the software without specific prior
+written permission. Sun and X Consortium make no
+representations about the suitability of this software for
+any purpose. It is provided "as is" without any express or
+implied warranty.
+
+SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
+NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
+ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
+THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+********************************************************/
+
+
+/**
+ * This version of fbcmap.c is implemented in terms of mi functions.
+ * These functions used to be in fbcmap.c and depended upon the symbol
+ * XFree86Server being defined.
+ */
+
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <X11/X.h>
+#include "fb.h"
+#include "micmap.h"
+
+int
+fbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps)
+{
+ return miListInstalledColormaps(pScreen, pmaps);
+}
+
+void
+fbInstallColormap(ColormapPtr pmap)
+{
+ miInstallColormap(pmap);
+}
+
+void
+fbUninstallColormap(ColormapPtr pmap)
+{
+ miUninstallColormap(pmap);
+}
+
+void
+fbResolveColor(unsigned short *pred,
+ unsigned short *pgreen,
+ unsigned short *pblue,
+ VisualPtr pVisual)
+{
+ miResolveColor(pred, pgreen, pblue, pVisual);
+}
+
+Bool
+fbInitializeColormap(ColormapPtr pmap)
+{
+ return miInitializeColormap(pmap);
+}
+
+int
+fbExpandDirectColors (ColormapPtr pmap,
+ int ndef,
+ xColorItem *indefs,
+ xColorItem *outdefs)
+{
+ return miExpandDirectColors(pmap, ndef, indefs, outdefs);
+}
+
+Bool
+fbCreateDefColormap(ScreenPtr pScreen)
+{
+ return miCreateDefColormap(pScreen);
+}
+
+void
+fbClearVisualTypes(void)
+{
+ miClearVisualTypes();
+}
+
+Bool
+fbSetVisualTypes (int depth, int visuals, int bitsPerRGB)
+{
+ return miSetVisualTypes(depth, visuals, bitsPerRGB, -1);
+}
+
+/*
+ * Given a list of formats for a screen, create a list
+ * of visuals and depths for the screen which coorespond to
+ * the set which can be used with this version of fb.
+ */
+Bool
+fbInitVisuals (VisualPtr *visualp,
+ DepthPtr *depthp,
+ int *nvisualp,
+ int *ndepthp,
+ int *rootDepthp,
+ VisualID *defaultVisp,
+ unsigned long sizes,
+ int bitsPerRGB)
+{
+ return miInitVisuals(visualp, depthp, nvisualp, ndepthp, rootDepthp,
+ defaultVisp, sizes, bitsPerRGB, -1);
+}
diff --git a/fb/fbcompose.c b/fb/fbcompose.c
deleted file mode 100644
index b1903e90b..000000000
--- a/fb/fbcompose.c
+++ /dev/null
@@ -1,3676 +0,0 @@
-/*
- *
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
- * 2005 Lars Knoll & Zack Rusin, Trolltech
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "fb.h"
-
-#ifdef RENDER
-
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <assert.h>
-
-#include "picturestr.h"
-#include "mipict.h"
-#include "fbpict.h"
-
-#define mod(a,b) ((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (b) - (-a) % (b))
-
-#define SCANLINE_BUFFER_LENGTH 2048
-
-typedef FASTCALL void (*fetchProc)(const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed);
-
-/*
- * All of the fetch functions
- */
-
-static FASTCALL void
-fbFetch_a8r8g8b8 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- memcpy(buffer, (const CARD32 *)bits + x, width*sizeof(CARD32));
-}
-
-static FASTCALL void
-fbFetch_x8r8g8b8 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- const CARD32 *pixel = (const CARD32 *)bits + x;
- const CARD32 *end = pixel + width;
- while (pixel < end) {
- *buffer++ = *pixel++ | 0xff000000;
- }
-}
-
-static FASTCALL void
-fbFetch_a8b8g8r8 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- const CARD32 *pixel = (CARD32 *)bits + x;
- const CARD32 *end = pixel + width;
- while (pixel < end) {
- *buffer++ = ((*pixel & 0xff00ff00) |
- ((*pixel >> 16) & 0xff) |
- ((*pixel & 0xff) << 16));
- ++pixel;
- }
-}
-
-static FASTCALL void
-fbFetch_x8b8g8r8 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- const CARD32 *pixel = (CARD32 *)bits + x;
- const CARD32 *end = pixel + width;
- while (pixel < end) {
- *buffer++ = 0xff000000 |
- ((*pixel & 0x0000ff00) |
- ((*pixel >> 16) & 0xff) |
- ((*pixel & 0xff) << 16));
- ++pixel;
- }
-}
-
-static FASTCALL void
-fbFetch_r8g8b8 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- const CARD8 *pixel = (const CARD8 *)bits + 3*x;
- const CARD8 *end = pixel + 3*width;
- while (pixel < end) {
- CARD32 b = Fetch24(pixel) | 0xff000000;
- pixel += 3;
- *buffer++ = b;
- }
-}
-
-static FASTCALL void
-fbFetch_b8g8r8 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- const CARD8 *pixel = (const CARD8 *)bits + 3*x;
- const CARD8 *end = pixel + 3*width;
- while (pixel < end) {
- CARD32 b = 0xff000000;
-#if IMAGE_BYTE_ORDER == MSBFirst
- b |= (*pixel++);
- b |= (*pixel++ << 8);
- b |= (*pixel++ << 16);
-#else
- b |= (*pixel++ << 16);
- b |= (*pixel++ << 8);
- b |= (*pixel++);
-#endif
- }
-}
-
-static FASTCALL void
-fbFetch_r5g6b5 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- const CARD16 *pixel = (const CARD16 *)bits + x;
- const CARD16 *end = pixel + width;
- while (pixel < end) {
- CARD32 p = *pixel++;
- CARD32 r = (((p) << 3) & 0xf8) |
- (((p) << 5) & 0xfc00) |
- (((p) << 8) & 0xf80000);
- r |= (r >> 5) & 0x70007;
- r |= (r >> 6) & 0x300;
- *buffer++ = 0xff000000 | r;
- }
-}
-
-static FASTCALL void
-fbFetch_b5g6r5 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- const CARD16 *pixel = (const CARD16 *)bits + x;
- const CARD16 *end = pixel + width;
- while (pixel < end) {
- CARD32 p = *pixel++;
- CARD32 r,g,b;
-
- b = ((p & 0xf800) | ((p & 0xe000) >> 5)) >> 8;
- g = ((p & 0x07e0) | ((p & 0x0600) >> 6)) << 5;
- r = ((p & 0x001c) | ((p & 0x001f) << 5)) << 14;
- *buffer++ = (0xff000000 | r | g | b);
- }
-}
-
-static FASTCALL void
-fbFetch_a1r5g5b5 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- const CARD16 *pixel = (const CARD16 *)bits + x;
- const CARD16 *end = pixel + width;
- while (pixel < end) {
- CARD32 p = *pixel++;
- CARD32 r,g,b, a;
-
- a = (CARD32) ((CARD8) (0 - ((p & 0x8000) >> 15))) << 24;
- r = ((p & 0x7c00) | ((p & 0x7000) >> 5)) << 9;
- g = ((p & 0x03e0) | ((p & 0x0380) >> 5)) << 6;
- b = ((p & 0x001c) | ((p & 0x001f) << 5)) >> 2;
- *buffer++ = (a | r | g | b);
- }
-}
-
-static FASTCALL void
-fbFetch_x1r5g5b5 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- const CARD16 *pixel = (const CARD16 *)bits + x;
- const CARD16 *end = pixel + width;
- while (pixel < end) {
- CARD32 p = *pixel++;
- CARD32 r,g,b;
-
- r = ((p & 0x7c00) | ((p & 0x7000) >> 5)) << 9;
- g = ((p & 0x03e0) | ((p & 0x0380) >> 5)) << 6;
- b = ((p & 0x001c) | ((p & 0x001f) << 5)) >> 2;
- *buffer++ = (0xff000000 | r | g | b);
- }
-}
-
-static FASTCALL void
-fbFetch_a1b5g5r5 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- const CARD16 *pixel = (const CARD16 *)bits + x;
- const CARD16 *end = pixel + width;
- while (pixel < end) {
- CARD32 p = *pixel++;
- CARD32 r,g,b, a;
-
- a = (CARD32) ((CARD8) (0 - ((p & 0x8000) >> 15))) << 24;
- b = ((p & 0x7c00) | ((p & 0x7000) >> 5)) >> 7;
- g = ((p & 0x03e0) | ((p & 0x0380) >> 5)) << 6;
- r = ((p & 0x001c) | ((p & 0x001f) << 5)) << 14;
- *buffer++ = (a | r | g | b);
- }
-}
-
-static FASTCALL void
-fbFetch_x1b5g5r5 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- const CARD16 *pixel = (const CARD16 *)bits + x;
- const CARD16 *end = pixel + width;
- while (pixel < end) {
- CARD32 p = *pixel++;
- CARD32 r,g,b;
-
- b = ((p & 0x7c00) | ((p & 0x7000) >> 5)) >> 7;
- g = ((p & 0x03e0) | ((p & 0x0380) >> 5)) << 6;
- r = ((p & 0x001c) | ((p & 0x001f) << 5)) << 14;
- *buffer++ = (0xff000000 | r | g | b);
- }
-}
-
-static FASTCALL void
-fbFetch_a4r4g4b4 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- const CARD16 *pixel = (const CARD16 *)bits + x;
- const CARD16 *end = pixel + width;
- while (pixel < end) {
- CARD32 p = *pixel++;
- CARD32 r,g,b, a;
-
- a = ((p & 0xf000) | ((p & 0xf000) >> 4)) << 16;
- r = ((p & 0x0f00) | ((p & 0x0f00) >> 4)) << 12;
- g = ((p & 0x00f0) | ((p & 0x00f0) >> 4)) << 8;
- b = ((p & 0x000f) | ((p & 0x000f) << 4));
- *buffer++ = (a | r | g | b);
- }
-}
-
-static FASTCALL void
-fbFetch_x4r4g4b4 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- const CARD16 *pixel = (const CARD16 *)bits + x;
- const CARD16 *end = pixel + width;
- while (pixel < end) {
- CARD32 p = *pixel++;
- CARD32 r,g,b;
-
- r = ((p & 0x0f00) | ((p & 0x0f00) >> 4)) << 12;
- g = ((p & 0x00f0) | ((p & 0x00f0) >> 4)) << 8;
- b = ((p & 0x000f) | ((p & 0x000f) << 4));
- *buffer++ = (0xff000000 | r | g | b);
- }
-}
-
-static FASTCALL void
-fbFetch_a4b4g4r4 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- const CARD16 *pixel = (const CARD16 *)bits + x;
- const CARD16 *end = pixel + width;
- while (pixel < end) {
- CARD32 p = *pixel++;
- CARD32 r,g,b, a;
-
- a = ((p & 0xf000) | ((p & 0xf000) >> 4)) << 16;
- b = ((p & 0x0f00) | ((p & 0x0f00) >> 4)) >> 4;
- g = ((p & 0x00f0) | ((p & 0x00f0) >> 4)) << 8;
- r = ((p & 0x000f) | ((p & 0x000f) << 4)) << 16;
- *buffer++ = (a | r | g | b);
- }
-}
-
-static FASTCALL void
-fbFetch_x4b4g4r4 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- const CARD16 *pixel = (const CARD16 *)bits + x;
- const CARD16 *end = pixel + width;
- while (pixel < end) {
- CARD32 p = *pixel++;
- CARD32 r,g,b;
-
- b = ((p & 0x0f00) | ((p & 0x0f00) >> 4)) >> 4;
- g = ((p & 0x00f0) | ((p & 0x00f0) >> 4)) << 8;
- r = ((p & 0x000f) | ((p & 0x000f) << 4)) << 16;
- *buffer++ = (0xff000000 | r | g | b);
- }
-}
-
-static FASTCALL void
-fbFetch_a8 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- const CARD8 *pixel = (const CARD8 *)bits + x;
- const CARD8 *end = pixel + width;
- while (pixel < end) {
- *buffer++ = (*pixel++) << 24;
- }
-}
-
-static FASTCALL void
-fbFetch_r3g3b2 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- const CARD8 *pixel = (const CARD8 *)bits + x;
- const CARD8 *end = pixel + width;
- while (pixel < end) {
- CARD32 p = *pixel++;
- CARD32 r,g,b;
-
- r = ((p & 0xe0) | ((p & 0xe0) >> 3) | ((p & 0xc0) >> 6)) << 16;
- g = ((p & 0x1c) | ((p & 0x18) >> 3) | ((p & 0x1c) << 3)) << 8;
- b = (((p & 0x03) ) |
- ((p & 0x03) << 2) |
- ((p & 0x03) << 4) |
- ((p & 0x03) << 6));
- *buffer++ = (0xff000000 | r | g | b);
- }
-}
-
-static FASTCALL void
-fbFetch_b2g3r3 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- const CARD8 *pixel = (const CARD8 *)bits + x;
- const CARD8 *end = pixel + width;
- while (pixel < end) {
- CARD32 p = *pixel++;
- CARD32 r,g,b;
-
- b = (((p & 0xc0) ) |
- ((p & 0xc0) >> 2) |
- ((p & 0xc0) >> 4) |
- ((p & 0xc0) >> 6));
- g = ((p & 0x38) | ((p & 0x38) >> 3) | ((p & 0x30) << 2)) << 8;
- r = (((p & 0x07) ) |
- ((p & 0x07) << 3) |
- ((p & 0x06) << 6)) << 16;
- *buffer++ = (0xff000000 | r | g | b);
- }
-}
-
-static FASTCALL void
-fbFetch_a2r2g2b2 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- const CARD8 *pixel = (const CARD8 *)bits + x;
- const CARD8 *end = pixel + width;
- while (pixel < end) {
- CARD32 p = *pixel++;
- CARD32 a,r,g,b;
-
- a = ((p & 0xc0) * 0x55) << 18;
- r = ((p & 0x30) * 0x55) << 12;
- g = ((p & 0x0c) * 0x55) << 6;
- b = ((p & 0x03) * 0x55);
- *buffer++ = a|r|g|b;
- }
-}
-
-static FASTCALL void
-fbFetch_a2b2g2r2 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- const CARD8 *pixel = (const CARD8 *)bits + x;
- const CARD8 *end = pixel + width;
- while (pixel < end) {
- CARD32 p = *pixel++;
- CARD32 a,r,g,b;
-
- a = ((p & 0xc0) * 0x55) << 18;
- b = ((p & 0x30) * 0x55) >> 6;
- g = ((p & 0x0c) * 0x55) << 6;
- r = ((p & 0x03) * 0x55) << 16;
- *buffer++ = a|r|g|b;
- }
-}
-
-static FASTCALL void
-fbFetch_c8 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- const CARD8 *pixel = (const CARD8 *)bits + x;
- const CARD8 *end = pixel + width;
- while (pixel < end) {
- CARD32 p = *pixel++;
- *buffer++ = indexed->rgba[p];
- }
-}
-
-static FASTCALL void
-fbFetch_x4a4 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- const CARD8 *pixel = (const CARD8 *)bits + x;
- const CARD8 *end = pixel + width;
- while (pixel < end) {
- CARD8 p = (*pixel++) & 0xf;
- *buffer++ = (p | (p << 4)) << 24;
- }
-}
-
-#define Fetch8(l,o) (((CARD8 *) (l))[(o) >> 2])
-#if IMAGE_BYTE_ORDER == MSBFirst
-#define Fetch4(l,o) ((o) & 2 ? Fetch8(l,o) & 0xf : Fetch8(l,o) >> 4)
-#else
-#define Fetch4(l,o) ((o) & 2 ? Fetch8(l,o) >> 4 : Fetch8(l,o) & 0xf)
-#endif
-
-static FASTCALL void
-fbFetch_a4 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 p = Fetch4(bits, i + x);
-
- p |= p << 4;
- *buffer++ = p << 24;
- }
-}
-
-static FASTCALL void
-fbFetch_r1g2b1 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 p = Fetch4(bits, i + x);
- CARD32 r,g,b;
-
- r = ((p & 0x8) * 0xff) << 13;
- g = ((p & 0x6) * 0x55) << 7;
- b = ((p & 0x1) * 0xff);
- *buffer++ = 0xff000000|r|g|b;
- }
-}
-
-static FASTCALL void
-fbFetch_b1g2r1 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 p = Fetch4(bits, i + x);
- CARD32 r,g,b;
-
- b = ((p & 0x8) * 0xff) >> 3;
- g = ((p & 0x6) * 0x55) << 7;
- r = ((p & 0x1) * 0xff) << 16;
- *buffer++ = 0xff000000|r|g|b;
- }
-}
-
-static FASTCALL void
-fbFetch_a1r1g1b1 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 p = Fetch4(bits, i + x);
- CARD32 a,r,g,b;
-
- a = ((p & 0x8) * 0xff) << 21;
- r = ((p & 0x4) * 0xff) << 14;
- g = ((p & 0x2) * 0xff) << 7;
- b = ((p & 0x1) * 0xff);
- *buffer++ = a|r|g|b;
- }
-}
-
-static FASTCALL void
-fbFetch_a1b1g1r1 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 p = Fetch4(bits, i + x);
- CARD32 a,r,g,b;
-
- a = ((p & 0x8) * 0xff) << 21;
- r = ((p & 0x4) * 0xff) >> 3;
- g = ((p & 0x2) * 0xff) << 7;
- b = ((p & 0x1) * 0xff) << 16;
- *buffer++ = a|r|g|b;
- }
-}
-
-static FASTCALL void
-fbFetch_c4 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 p = Fetch4(bits, i + x);
-
- *buffer++ = indexed->rgba[p];
- }
-}
-
-
-static FASTCALL void
-fbFetch_a1 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 p = ((CARD32 *)bits)[(i + x) >> 5];
- CARD32 a;
-#if BITMAP_BIT_ORDER == MSBFirst
- a = p >> (0x1f - ((i+x) & 0x1f));
-#else
- a = p >> ((i+x) & 0x1f);
-#endif
- a = a & 1;
- a |= a << 1;
- a |= a << 2;
- a |= a << 4;
- *buffer++ = a << 24;
- }
-}
-
-static FASTCALL void
-fbFetch_g1 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 p = ((CARD32 *)bits)[(i+x) >> 5];
- CARD32 a;
-#if BITMAP_BIT_ORDER == MSBFirst
- a = p >> (0x1f - ((i+x) & 0x1f));
-#else
- a = p >> ((i+x) & 0x1f);
-#endif
- a = a & 1;
- *buffer++ = indexed->rgba[a];
- }
-}
-
-static fetchProc fetchProcForPicture (PicturePtr pict)
-{
- switch(pict->format) {
- case PICT_a8r8g8b8: return fbFetch_a8r8g8b8;
- case PICT_x8r8g8b8: return fbFetch_x8r8g8b8;
- case PICT_a8b8g8r8: return fbFetch_a8b8g8r8;
- case PICT_x8b8g8r8: return fbFetch_x8b8g8r8;
-
- /* 24bpp formats */
- case PICT_r8g8b8: return fbFetch_r8g8b8;
- case PICT_b8g8r8: return fbFetch_b8g8r8;
-
- /* 16bpp formats */
- case PICT_r5g6b5: return fbFetch_r5g6b5;
- case PICT_b5g6r5: return fbFetch_b5g6r5;
-
- case PICT_a1r5g5b5: return fbFetch_a1r5g5b5;
- case PICT_x1r5g5b5: return fbFetch_x1r5g5b5;
- case PICT_a1b5g5r5: return fbFetch_a1b5g5r5;
- case PICT_x1b5g5r5: return fbFetch_x1b5g5r5;
- case PICT_a4r4g4b4: return fbFetch_a4r4g4b4;
- case PICT_x4r4g4b4: return fbFetch_x4r4g4b4;
- case PICT_a4b4g4r4: return fbFetch_a4b4g4r4;
- case PICT_x4b4g4r4: return fbFetch_x4b4g4r4;
-
- /* 8bpp formats */
- case PICT_a8: return fbFetch_a8;
- case PICT_r3g3b2: return fbFetch_r3g3b2;
- case PICT_b2g3r3: return fbFetch_b2g3r3;
- case PICT_a2r2g2b2: return fbFetch_a2r2g2b2;
- case PICT_a2b2g2r2: return fbFetch_a2b2g2r2;
- case PICT_c8: return fbFetch_c8;
- case PICT_g8: return fbFetch_c8;
- case PICT_x4a4: return fbFetch_x4a4;
-
- /* 4bpp formats */
- case PICT_a4: return fbFetch_a4;
- case PICT_r1g2b1: return fbFetch_r1g2b1;
- case PICT_b1g2r1: return fbFetch_b1g2r1;
- case PICT_a1r1g1b1: return fbFetch_a1r1g1b1;
- case PICT_a1b1g1r1: return fbFetch_a1b1g1r1;
- case PICT_c4: return fbFetch_c4;
- case PICT_g4: return fbFetch_c4;
-
- /* 1bpp formats */
- case PICT_a1: return fbFetch_a1;
- case PICT_g1: return fbFetch_g1;
- }
-
- return NULL;
-}
-
-/*
- * Pixel wise fetching
- */
-
-typedef FASTCALL CARD32 (*fetchPixelProc)(const FbBits *bits, int offset, miIndexedPtr indexed);
-
-static FASTCALL CARD32
-fbFetchPixel_a8r8g8b8 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- return ((CARD32 *)bits)[offset];
-}
-
-static FASTCALL CARD32
-fbFetchPixel_x8r8g8b8 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- return ((CARD32 *)bits)[offset] | 0xff000000;
-}
-
-static FASTCALL CARD32
-fbFetchPixel_a8b8g8r8 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD32 pixel = ((CARD32 *)bits)[offset];
-
- return ((pixel & 0xff000000) |
- ((pixel >> 16) & 0xff) |
- (pixel & 0x0000ff00) |
- ((pixel & 0xff) << 16));
-}
-
-static FASTCALL CARD32
-fbFetchPixel_x8b8g8r8 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD32 pixel = ((CARD32 *)bits)[offset];
-
- return ((0xff000000) |
- ((pixel >> 16) & 0xff) |
- (pixel & 0x0000ff00) |
- ((pixel & 0xff) << 16));
-}
-
-static FASTCALL CARD32
-fbFetchPixel_r8g8b8 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD8 *pixel = ((CARD8 *) bits) + (offset*3);
-#if IMAGE_BYTE_ORDER == MSBFirst
- return (0xff000000 |
- (pixel[0] << 16) |
- (pixel[1] << 8) |
- (pixel[2]));
-#else
- return (0xff000000 |
- (pixel[2] << 16) |
- (pixel[1] << 8) |
- (pixel[0]));
-#endif
-}
-
-static FASTCALL CARD32
-fbFetchPixel_b8g8r8 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD8 *pixel = ((CARD8 *) bits) + (offset*3);
-#if IMAGE_BYTE_ORDER == MSBFirst
- return (0xff000000 |
- (pixel[2] << 16) |
- (pixel[1] << 8) |
- (pixel[0]));
-#else
- return (0xff000000 |
- (pixel[0] << 16) |
- (pixel[1] << 8) |
- (pixel[2]));
-#endif
-}
-
-static FASTCALL CARD32
-fbFetchPixel_r5g6b5 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD32 pixel = ((CARD16 *) bits)[offset];
- CARD32 r,g,b;
-
- r = ((pixel & 0xf800) | ((pixel & 0xe000) >> 5)) << 8;
- g = ((pixel & 0x07e0) | ((pixel & 0x0600) >> 6)) << 5;
- b = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) >> 2;
- return (0xff000000 | r | g | b);
-}
-
-static FASTCALL CARD32
-fbFetchPixel_b5g6r5 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD32 pixel = ((CARD16 *) bits)[offset];
- CARD32 r,g,b;
-
- b = ((pixel & 0xf800) | ((pixel & 0xe000) >> 5)) >> 8;
- g = ((pixel & 0x07e0) | ((pixel & 0x0600) >> 6)) << 5;
- r = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) << 14;
- return (0xff000000 | r | g | b);
-}
-
-static FASTCALL CARD32
-fbFetchPixel_a1r5g5b5 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD32 pixel = ((CARD16 *) bits)[offset];
- CARD32 a,r,g,b;
-
- a = (CARD32) ((CARD8) (0 - ((pixel & 0x8000) >> 15))) << 24;
- r = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) << 9;
- g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6;
- b = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) >> 2;
- return (a | r | g | b);
-}
-
-static FASTCALL CARD32
-fbFetchPixel_x1r5g5b5 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD32 pixel = ((CARD16 *) bits)[offset];
- CARD32 r,g,b;
-
- r = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) << 9;
- g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6;
- b = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) >> 2;
- return (0xff000000 | r | g | b);
-}
-
-static FASTCALL CARD32
-fbFetchPixel_a1b5g5r5 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD32 pixel = ((CARD16 *) bits)[offset];
- CARD32 a,r,g,b;
-
- a = (CARD32) ((CARD8) (0 - ((pixel & 0x8000) >> 15))) << 24;
- b = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) >> 7;
- g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6;
- r = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) << 14;
- return (a | r | g | b);
-}
-
-static FASTCALL CARD32
-fbFetchPixel_x1b5g5r5 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD32 pixel = ((CARD16 *) bits)[offset];
- CARD32 r,g,b;
-
- b = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) >> 7;
- g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6;
- r = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) << 14;
- return (0xff000000 | r | g | b);
-}
-
-static FASTCALL CARD32
-fbFetchPixel_a4r4g4b4 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD32 pixel = ((CARD16 *) bits)[offset];
- CARD32 a,r,g,b;
-
- a = ((pixel & 0xf000) | ((pixel & 0xf000) >> 4)) << 16;
- r = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) << 12;
- g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8;
- b = ((pixel & 0x000f) | ((pixel & 0x000f) << 4));
- return (a | r | g | b);
-}
-
-static FASTCALL CARD32
-fbFetchPixel_x4r4g4b4 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD32 pixel = ((CARD16 *) bits)[offset];
- CARD32 r,g,b;
-
- r = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) << 12;
- g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8;
- b = ((pixel & 0x000f) | ((pixel & 0x000f) << 4));
- return (0xff000000 | r | g | b);
-}
-
-static FASTCALL CARD32
-fbFetchPixel_a4b4g4r4 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD32 pixel = ((CARD16 *) bits)[offset];
- CARD32 a,r,g,b;
-
- a = ((pixel & 0xf000) | ((pixel & 0xf000) >> 4)) << 16;
- b = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) >> 4;
- g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8;
- r = ((pixel & 0x000f) | ((pixel & 0x000f) << 4)) << 16;
- return (a | r | g | b);
-}
-
-static FASTCALL CARD32
-fbFetchPixel_x4b4g4r4 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD32 pixel = ((CARD16 *) bits)[offset];
- CARD32 r,g,b;
-
- b = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) >> 4;
- g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8;
- r = ((pixel & 0x000f) | ((pixel & 0x000f) << 4)) << 16;
- return (0xff000000 | r | g | b);
-}
-
-static FASTCALL CARD32
-fbFetchPixel_a8 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD32 pixel = ((CARD8 *) bits)[offset];
-
- return pixel << 24;
-}
-
-static FASTCALL CARD32
-fbFetchPixel_r3g3b2 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD32 pixel = ((CARD8 *) bits)[offset];
- CARD32 r,g,b;
-
- r = ((pixel & 0xe0) | ((pixel & 0xe0) >> 3) | ((pixel & 0xc0) >> 6)) << 16;
- g = ((pixel & 0x1c) | ((pixel & 0x18) >> 3) | ((pixel & 0x1c) << 3)) << 8;
- b = (((pixel & 0x03) ) |
- ((pixel & 0x03) << 2) |
- ((pixel & 0x03) << 4) |
- ((pixel & 0x03) << 6));
- return (0xff000000 | r | g | b);
-}
-
-static FASTCALL CARD32
-fbFetchPixel_b2g3r3 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD32 pixel = ((CARD8 *) bits)[offset];
- CARD32 r,g,b;
-
- b = (((pixel & 0xc0) ) |
- ((pixel & 0xc0) >> 2) |
- ((pixel & 0xc0) >> 4) |
- ((pixel & 0xc0) >> 6));
- g = ((pixel & 0x38) | ((pixel & 0x38) >> 3) | ((pixel & 0x30) << 2)) << 8;
- r = (((pixel & 0x07) ) |
- ((pixel & 0x07) << 3) |
- ((pixel & 0x06) << 6)) << 16;
- return (0xff000000 | r | g | b);
-}
-
-static FASTCALL CARD32
-fbFetchPixel_a2r2g2b2 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD32 pixel = ((CARD8 *) bits)[offset];
- CARD32 a,r,g,b;
-
- a = ((pixel & 0xc0) * 0x55) << 18;
- r = ((pixel & 0x30) * 0x55) << 12;
- g = ((pixel & 0x0c) * 0x55) << 6;
- b = ((pixel & 0x03) * 0x55);
- return a|r|g|b;
-}
-
-static FASTCALL CARD32
-fbFetchPixel_a2b2g2r2 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD32 pixel = ((CARD8 *) bits)[offset];
- CARD32 a,r,g,b;
-
- a = ((pixel & 0xc0) * 0x55) << 18;
- b = ((pixel & 0x30) * 0x55) >> 6;
- g = ((pixel & 0x0c) * 0x55) << 6;
- r = ((pixel & 0x03) * 0x55) << 16;
- return a|r|g|b;
-}
-
-static FASTCALL CARD32
-fbFetchPixel_c8 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD32 pixel = ((CARD8 *) bits)[offset];
- return indexed->rgba[pixel];
-}
-
-static FASTCALL CARD32
-fbFetchPixel_x4a4 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD32 pixel = ((CARD8 *) bits)[offset];
-
- return ((pixel & 0xf) | ((pixel & 0xf) << 4)) << 24;
-}
-
-#define Fetch8(l,o) (((CARD8 *) (l))[(o) >> 2])
-#if IMAGE_BYTE_ORDER == MSBFirst
-#define Fetch4(l,o) ((o) & 2 ? Fetch8(l,o) & 0xf : Fetch8(l,o) >> 4)
-#else
-#define Fetch4(l,o) ((o) & 2 ? Fetch8(l,o) >> 4 : Fetch8(l,o) & 0xf)
-#endif
-
-static FASTCALL CARD32
-fbFetchPixel_a4 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD32 pixel = Fetch4(bits, offset);
-
- pixel |= pixel << 4;
- return pixel << 24;
-}
-
-static FASTCALL CARD32
-fbFetchPixel_r1g2b1 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD32 pixel = Fetch4(bits, offset);
- CARD32 r,g,b;
-
- r = ((pixel & 0x8) * 0xff) << 13;
- g = ((pixel & 0x6) * 0x55) << 7;
- b = ((pixel & 0x1) * 0xff);
- return 0xff000000|r|g|b;
-}
-
-static FASTCALL CARD32
-fbFetchPixel_b1g2r1 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD32 pixel = Fetch4(bits, offset);
- CARD32 r,g,b;
-
- b = ((pixel & 0x8) * 0xff) >> 3;
- g = ((pixel & 0x6) * 0x55) << 7;
- r = ((pixel & 0x1) * 0xff) << 16;
- return 0xff000000|r|g|b;
-}
-
-static FASTCALL CARD32
-fbFetchPixel_a1r1g1b1 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD32 pixel = Fetch4(bits, offset);
- CARD32 a,r,g,b;
-
- a = ((pixel & 0x8) * 0xff) << 21;
- r = ((pixel & 0x4) * 0xff) << 14;
- g = ((pixel & 0x2) * 0xff) << 7;
- b = ((pixel & 0x1) * 0xff);
- return a|r|g|b;
-}
-
-static FASTCALL CARD32
-fbFetchPixel_a1b1g1r1 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD32 pixel = Fetch4(bits, offset);
- CARD32 a,r,g,b;
-
- a = ((pixel & 0x8) * 0xff) << 21;
- r = ((pixel & 0x4) * 0xff) >> 3;
- g = ((pixel & 0x2) * 0xff) << 7;
- b = ((pixel & 0x1) * 0xff) << 16;
- return a|r|g|b;
-}
-
-static FASTCALL CARD32
-fbFetchPixel_c4 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD32 pixel = Fetch4(bits, offset);
-
- return indexed->rgba[pixel];
-}
-
-
-static FASTCALL CARD32
-fbFetchPixel_a1 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD32 pixel = ((CARD32 *)bits)[offset >> 5];
- CARD32 a;
-#if BITMAP_BIT_ORDER == MSBFirst
- a = pixel >> (0x1f - (offset & 0x1f));
-#else
- a = pixel >> (offset & 0x1f);
-#endif
- a = a & 1;
- a |= a << 1;
- a |= a << 2;
- a |= a << 4;
- return a << 24;
-}
-
-static FASTCALL CARD32
-fbFetchPixel_g1 (const FbBits *bits, int offset, miIndexedPtr indexed)
-{
- CARD32 pixel = ((CARD32 *)bits)[offset >> 5];
- CARD32 a;
-#if BITMAP_BIT_ORDER == MSBFirst
- a = pixel >> (0x1f - (offset & 0x1f));
-#else
- a = pixel >> (offset & 0x1f);
-#endif
- a = a & 1;
- return indexed->rgba[a];
-}
-
-static fetchPixelProc fetchPixelProcForPicture (PicturePtr pict)
-{
- switch(pict->format) {
- case PICT_a8r8g8b8: return fbFetchPixel_a8r8g8b8;
- case PICT_x8r8g8b8: return fbFetchPixel_x8r8g8b8;
- case PICT_a8b8g8r8: return fbFetchPixel_a8b8g8r8;
- case PICT_x8b8g8r8: return fbFetchPixel_x8b8g8r8;
-
- /* 24bpp formats */
- case PICT_r8g8b8: return fbFetchPixel_r8g8b8;
- case PICT_b8g8r8: return fbFetchPixel_b8g8r8;
-
- /* 16bpp formats */
- case PICT_r5g6b5: return fbFetchPixel_r5g6b5;
- case PICT_b5g6r5: return fbFetchPixel_b5g6r5;
-
- case PICT_a1r5g5b5: return fbFetchPixel_a1r5g5b5;
- case PICT_x1r5g5b5: return fbFetchPixel_x1r5g5b5;
- case PICT_a1b5g5r5: return fbFetchPixel_a1b5g5r5;
- case PICT_x1b5g5r5: return fbFetchPixel_x1b5g5r5;
- case PICT_a4r4g4b4: return fbFetchPixel_a4r4g4b4;
- case PICT_x4r4g4b4: return fbFetchPixel_x4r4g4b4;
- case PICT_a4b4g4r4: return fbFetchPixel_a4b4g4r4;
- case PICT_x4b4g4r4: return fbFetchPixel_x4b4g4r4;
-
- /* 8bpp formats */
- case PICT_a8: return fbFetchPixel_a8;
- case PICT_r3g3b2: return fbFetchPixel_r3g3b2;
- case PICT_b2g3r3: return fbFetchPixel_b2g3r3;
- case PICT_a2r2g2b2: return fbFetchPixel_a2r2g2b2;
- case PICT_a2b2g2r2: return fbFetchPixel_a2b2g2r2;
- case PICT_c8: return fbFetchPixel_c8;
- case PICT_g8: return fbFetchPixel_c8;
- case PICT_x4a4: return fbFetchPixel_x4a4;
-
- /* 4bpp formats */
- case PICT_a4: return fbFetchPixel_a4;
- case PICT_r1g2b1: return fbFetchPixel_r1g2b1;
- case PICT_b1g2r1: return fbFetchPixel_b1g2r1;
- case PICT_a1r1g1b1: return fbFetchPixel_a1r1g1b1;
- case PICT_a1b1g1r1: return fbFetchPixel_a1b1g1r1;
- case PICT_c4: return fbFetchPixel_c4;
- case PICT_g4: return fbFetchPixel_c4;
-
- /* 1bpp formats */
- case PICT_a1: return fbFetchPixel_a1;
- case PICT_g1: return fbFetchPixel_g1;
- }
-
- return NULL;
-}
-
-
-
-/*
- * All the store functions
- */
-
-typedef FASTCALL void (*storeProc) (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed);
-
-#define Splita(v) CARD32 a = ((v) >> 24), r = ((v) >> 16) & 0xff, g = ((v) >> 8) & 0xff, b = (v) & 0xff
-#define Split(v) CARD32 r = ((v) >> 16) & 0xff, g = ((v) >> 8) & 0xff, b = (v) & 0xff
-
-static FASTCALL void
-fbStore_a8r8g8b8 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- memcpy(((CARD32 *)bits) + x, values, width*sizeof(CARD32));
-}
-
-static FASTCALL void
-fbStore_x8r8g8b8 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- CARD32 *pixel = (CARD32 *)bits + x;
- for (i = 0; i < width; ++i)
- *pixel++ = values[i] & 0xffffff;
-}
-
-static FASTCALL void
-fbStore_a8b8g8r8 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- CARD32 *pixel = (CARD32 *)bits + x;
- for (i = 0; i < width; ++i)
- *pixel++ = (values[i] & 0xff00ff00) | ((values[i] >> 16) & 0xff) | ((values[i] & 0xff) << 16);
-}
-
-static FASTCALL void
-fbStore_x8b8g8r8 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- CARD32 *pixel = (CARD32 *)bits + x;
- for (i = 0; i < width; ++i)
- *pixel++ = (values[i] & 0x0000ff00) | ((values[i] >> 16) & 0xff) | ((values[i] & 0xff) << 16);
-}
-
-static FASTCALL void
-fbStore_r8g8b8 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- CARD8 *pixel = ((CARD8 *) bits) + 3*x;
- for (i = 0; i < width; ++i) {
- Store24(pixel, values[i]);
- pixel += 3;
- }
-}
-
-static FASTCALL void
-fbStore_b8g8r8 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- CARD8 *pixel = ((CARD8 *) bits) + 3*x;
- for (i = 0; i < width; ++i) {
-#if IMAGE_BYTE_ORDER == MSBFirst
- *pixel++ = Blue(values[i]);
- *pixel++ = Green(values[i]);
- *pixel++ = Red(values[i]);
-#else
- *pixel++ = Red(values[i]);
- *pixel++ = Green(values[i]);
- *pixel++ = Blue(values[i]);
-#endif
- }
-}
-
-static FASTCALL void
-fbStore_r5g6b5 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- CARD16 *pixel = ((CARD16 *) bits) + x;
- for (i = 0; i < width; ++i) {
- CARD32 s = values[i];
- *pixel++ = ((s >> 3) & 0x001f) |
- ((s >> 5) & 0x07e0) |
- ((s >> 8) & 0xf800);
- }
-}
-
-static FASTCALL void
-fbStore_b5g6r5 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- CARD16 *pixel = ((CARD16 *) bits) + x;
- for (i = 0; i < width; ++i) {
- Split(values[i]);
- *pixel++ = (((b << 8) & 0xf800) |
- ((g << 3) & 0x07e0) |
- ((r >> 3) ));
- }
-}
-
-static FASTCALL void
-fbStore_a1r5g5b5 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- CARD16 *pixel = ((CARD16 *) bits) + x;
- for (i = 0; i < width; ++i) {
- Splita(values[i]);
- *pixel++ = (((a << 8) & 0x8000) |
- ((r << 7) & 0x7c00) |
- ((g << 2) & 0x03e0) |
- ((b >> 3) ));
- }
-}
-
-static FASTCALL void
-fbStore_x1r5g5b5 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- CARD16 *pixel = ((CARD16 *) bits) + x;
- for (i = 0; i < width; ++i) {
- Split(values[i]);
- *pixel++ = (((r << 7) & 0x7c00) |
- ((g << 2) & 0x03e0) |
- ((b >> 3) ));
- }
-}
-
-static FASTCALL void
-fbStore_a1b5g5r5 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- CARD16 *pixel = ((CARD16 *) bits) + x;
- for (i = 0; i < width; ++i) {
- Splita(values[i]);
- *pixel++ = (((a << 8) & 0x8000) |
- ((b << 7) & 0x7c00) |
- ((g << 2) & 0x03e0) |
- ((r >> 3) ));
- }
-}
-
-static FASTCALL void
-fbStore_x1b5g5r5 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- CARD16 *pixel = ((CARD16 *) bits) + x;
- for (i = 0; i < width; ++i) {
- Split(values[i]);
- *pixel++ = (((b << 7) & 0x7c00) |
- ((g << 2) & 0x03e0) |
- ((r >> 3) ));
- }
-}
-
-static FASTCALL void
-fbStore_a4r4g4b4 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- CARD16 *pixel = ((CARD16 *) bits) + x;
- for (i = 0; i < width; ++i) {
- Splita(values[i]);
- *pixel++ = (((a << 8) & 0xf000) |
- ((r << 4) & 0x0f00) |
- ((g ) & 0x00f0) |
- ((b >> 4) ));
- }
-}
-
-static FASTCALL void
-fbStore_x4r4g4b4 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- CARD16 *pixel = ((CARD16 *) bits) + x;
- for (i = 0; i < width; ++i) {
- Split(values[i]);
- *pixel++ = (((r << 4) & 0x0f00) |
- ((g ) & 0x00f0) |
- ((b >> 4) ));
- }
-}
-
-static FASTCALL void
-fbStore_a4b4g4r4 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- CARD16 *pixel = ((CARD16 *) bits) + x;
- for (i = 0; i < width; ++i) {
- Splita(values[i]);
- *pixel++ = (((a << 8) & 0xf000) |
- ((b << 4) & 0x0f00) |
- ((g ) & 0x00f0) |
- ((r >> 4) ));
- }
-}
-
-static FASTCALL void
-fbStore_x4b4g4r4 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- CARD16 *pixel = ((CARD16 *) bits) + x;
- for (i = 0; i < width; ++i) {
- Split(values[i]);
- *pixel++ = (((b << 4) & 0x0f00) |
- ((g ) & 0x00f0) |
- ((r >> 4) ));
- }
-}
-
-static FASTCALL void
-fbStore_a8 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- CARD8 *pixel = ((CARD8 *) bits) + x;
- for (i = 0; i < width; ++i) {
- *pixel++ = values[i] >> 24;
- }
-}
-
-static FASTCALL void
-fbStore_r3g3b2 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- CARD8 *pixel = ((CARD8 *) bits) + x;
- for (i = 0; i < width; ++i) {
- Split(values[i]);
- *pixel++ = (((r ) & 0xe0) |
- ((g >> 3) & 0x1c) |
- ((b >> 6) ));
- }
-}
-
-static FASTCALL void
-fbStore_b2g3r3 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- CARD8 *pixel = ((CARD8 *) bits) + x;
- for (i = 0; i < width; ++i) {
- Split(values[i]);
- *pixel++ = (((b ) & 0xe0) |
- ((g >> 3) & 0x1c) |
- ((r >> 6) ));
- }
-}
-
-static FASTCALL void
-fbStore_a2r2g2b2 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- CARD8 *pixel = ((CARD8 *) bits) + x;
- for (i = 0; i < width; ++i) {
- Splita(values[i]);
- *pixel++ = (((a ) & 0xc0) |
- ((r >> 2) & 0x30) |
- ((g >> 4) & 0x0c) |
- ((b >> 6) ));
- }
-}
-
-static FASTCALL void
-fbStore_c8 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- CARD8 *pixel = ((CARD8 *) bits) + x;
- for (i = 0; i < width; ++i) {
- *pixel++ = miIndexToEnt24(indexed,values[i]);
- }
-}
-
-static FASTCALL void
-fbStore_x4a4 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- CARD8 *pixel = ((CARD8 *) bits) + x;
- for (i = 0; i < width; ++i) {
- *pixel++ = values[i] >> 28;
- }
-}
-
-#define Store8(l,o,v) (((CARD8 *) l)[(o) >> 3] = (v))
-#if IMAGE_BYTE_ORDER == MSBFirst
-#define Store4(l,o,v) Store8(l,o,((o) & 4 ? \
- (Fetch8(l,o) & 0xf0) | (v) : \
- (Fetch8(l,o) & 0x0f) | ((v) << 4)))
-#else
-#define Store4(l,o,v) Store8(l,o,((o) & 4 ? \
- (Fetch8(l,o) & 0x0f) | ((v) << 4) : \
- (Fetch8(l,o) & 0xf0) | (v)))
-#endif
-
-static FASTCALL void
-fbStore_a4 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- for (i = 0; i < width; ++i) {
- Store4(bits, i + x, values[i]>>28);
- }
-}
-
-static FASTCALL void
-fbStore_r1g2b1 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 pixel;
-
- Split(values[i]);
- pixel = (((r >> 4) & 0x8) |
- ((g >> 5) & 0x6) |
- ((b >> 7) ));
- Store4(bits, i + x, pixel);
- }
-}
-
-static FASTCALL void
-fbStore_b1g2r1 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 pixel;
-
- Split(values[i]);
- pixel = (((b >> 4) & 0x8) |
- ((g >> 5) & 0x6) |
- ((r >> 7) ));
- Store4(bits, i + x, pixel);
- }
-}
-
-static FASTCALL void
-fbStore_a1r1g1b1 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 pixel;
- Splita(values[i]);
- pixel = (((a >> 4) & 0x8) |
- ((r >> 5) & 0x4) |
- ((g >> 6) & 0x2) |
- ((b >> 7) ));
- Store4(bits, i + x, pixel);
- }
-}
-
-static FASTCALL void
-fbStore_a1b1g1r1 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 pixel;
- Splita(values[i]);
- pixel = (((a >> 4) & 0x8) |
- ((b >> 5) & 0x4) |
- ((g >> 6) & 0x2) |
- ((r >> 7) ));
- Store4(bits, i + x, pixel);
- }
-}
-
-static FASTCALL void
-fbStore_c4 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 pixel;
-
- pixel = miIndexToEnt24(indexed, values[i]);
- Store4(bits, i + x, pixel);
- }
-}
-
-static FASTCALL void
-fbStore_a1 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 *pixel = ((CARD32 *) bits) + ((i+x) >> 5);
- CARD32 mask = FbStipMask((i+x) & 0x1f, 1);
-
- CARD32 v = values[i] & 0x80000000 ? mask : 0;
- *pixel = (*pixel & ~mask) | v;
- }
-}
-
-static FASTCALL void
-fbStore_g1 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 *pixel = ((CARD32 *) bits) + ((i+x) >> 5);
- CARD32 mask = FbStipMask((i+x) & 0x1f, 1);
-
- CARD32 v = miIndexToEntY24(indexed,values[i]) ? mask : 0;
- *pixel = (*pixel & ~mask) | v;
- }
-}
-
-
-static storeProc storeProcForPicture (PicturePtr pict)
-{
- switch(pict->format) {
- case PICT_a8r8g8b8: return fbStore_a8r8g8b8;
- case PICT_x8r8g8b8: return fbStore_x8r8g8b8;
- case PICT_a8b8g8r8: return fbStore_a8b8g8r8;
- case PICT_x8b8g8r8: return fbStore_x8b8g8r8;
-
- /* 24bpp formats */
- case PICT_r8g8b8: return fbStore_r8g8b8;
- case PICT_b8g8r8: return fbStore_b8g8r8;
-
- /* 16bpp formats */
- case PICT_r5g6b5: return fbStore_r5g6b5;
- case PICT_b5g6r5: return fbStore_b5g6r5;
-
- case PICT_a1r5g5b5: return fbStore_a1r5g5b5;
- case PICT_x1r5g5b5: return fbStore_x1r5g5b5;
- case PICT_a1b5g5r5: return fbStore_a1b5g5r5;
- case PICT_x1b5g5r5: return fbStore_x1b5g5r5;
- case PICT_a4r4g4b4: return fbStore_a4r4g4b4;
- case PICT_x4r4g4b4: return fbStore_x4r4g4b4;
- case PICT_a4b4g4r4: return fbStore_a4b4g4r4;
- case PICT_x4b4g4r4: return fbStore_x4b4g4r4;
-
- /* 8bpp formats */
- case PICT_a8: return fbStore_a8;
- case PICT_r3g3b2: return fbStore_r3g3b2;
- case PICT_b2g3r3: return fbStore_b2g3r3;
- case PICT_a2r2g2b2: return fbStore_a2r2g2b2;
- case PICT_c8: return fbStore_c8;
- case PICT_g8: return fbStore_c8;
- case PICT_x4a4: return fbStore_x4a4;
-
- /* 4bpp formats */
- case PICT_a4: return fbStore_a4;
- case PICT_r1g2b1: return fbStore_r1g2b1;
- case PICT_b1g2r1: return fbStore_b1g2r1;
- case PICT_a1r1g1b1: return fbStore_a1r1g1b1;
- case PICT_a1b1g1r1: return fbStore_a1b1g1r1;
- case PICT_c4: return fbStore_c4;
- case PICT_g4: return fbStore_c4;
-
- /* 1bpp formats */
- case PICT_a1: return fbStore_a1;
- case PICT_g1: return fbStore_g1;
- default:
- return NULL;
- }
-}
-
-
-/*
- * Combine src and mask
- */
-static FASTCALL void
-fbCombineMaskU (CARD32 *src, const CARD32 *mask, int width)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 a = mask[i] >> 24;
- CARD32 s = src[i];
- FbByteMul(s, a);
- src[i] = s;
- }
-}
-
-/*
- * All of the composing functions
- */
-
-static FASTCALL void
-fbCombineClear (CARD32 *dest, const CARD32 *src, int width)
-{
- memset(dest, 0, width*sizeof(CARD32));
-}
-
-static FASTCALL void
-fbCombineSrcU (CARD32 *dest, const CARD32 *src, int width)
-{
- memcpy(dest, src, width*sizeof(CARD32));
-}
-
-
-static FASTCALL void
-fbCombineOverU (CARD32 *dest, const CARD32 *src, int width)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 s = src[i];
- CARD32 d = dest[i];
- CARD32 ia = Alpha(~s);
-
- FbByteMulAdd(d, ia, s);
- dest[i] = d;
- }
-}
-
-static FASTCALL void
-fbCombineOverReverseU (CARD32 *dest, const CARD32 *src, int width)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 s = src[i];
- CARD32 d = dest[i];
- CARD32 ia = Alpha(~dest[i]);
- FbByteMulAdd(s, ia, d);
- dest[i] = s;
- }
-}
-
-static FASTCALL void
-fbCombineInU (CARD32 *dest, const CARD32 *src, int width)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 s = src[i];
- CARD32 a = Alpha(dest[i]);
- FbByteMul(s, a);
- dest[i] = s;
- }
-}
-
-static FASTCALL void
-fbCombineInReverseU (CARD32 *dest, const CARD32 *src, int width)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 d = dest[i];
- CARD32 a = Alpha(src[i]);
- FbByteMul(d, a);
- dest[i] = d;
- }
-}
-
-static FASTCALL void
-fbCombineOutU (CARD32 *dest, const CARD32 *src, int width)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 s = src[i];
- CARD32 a = Alpha(~dest[i]);
- FbByteMul(s, a);
- dest[i] = s;
- }
-}
-
-static FASTCALL void
-fbCombineOutReverseU (CARD32 *dest, const CARD32 *src, int width)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 d = dest[i];
- CARD32 a = Alpha(~src[i]);
- FbByteMul(d, a);
- dest[i] = d;
- }
-}
-
-static FASTCALL void
-fbCombineAtopU (CARD32 *dest, const CARD32 *src, int width)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 s = src[i];
- CARD32 d = dest[i];
- CARD32 dest_a = Alpha(d);
- CARD32 src_ia = Alpha(~s);
-
- FbByteAddMul(s, dest_a, d, src_ia);
- dest[i] = s;
- }
-}
-
-static FASTCALL void
-fbCombineAtopReverseU (CARD32 *dest, const CARD32 *src, int width)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 s = src[i];
- CARD32 d = dest[i];
- CARD32 src_a = Alpha(s);
- CARD32 dest_ia = Alpha(~d);
-
- FbByteAddMul(s, dest_ia, d, src_a);
- dest[i] = s;
- }
-}
-
-static FASTCALL void
-fbCombineXorU (CARD32 *dest, const CARD32 *src, int width)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 s = src[i];
- CARD32 d = dest[i];
- CARD32 src_ia = Alpha(~s);
- CARD32 dest_ia = Alpha(~d);
-
- FbByteAddMul(s, dest_ia, d, src_ia);
- dest[i] = s;
- }
-}
-
-static FASTCALL void
-fbCombineAddU (CARD32 *dest, const CARD32 *src, int width)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 s = src[i];
- CARD32 d = dest[i];
- FbByteAdd(d, s);
- dest[i] = d;
- }
-}
-
-static FASTCALL void
-fbCombineSaturateU (CARD32 *dest, const CARD32 *src, int width)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 s = src[i];
- CARD32 d = dest[i];
- CARD16 sa, da;
-
- sa = s >> 24;
- da = ~d >> 24;
- if (sa > da)
- {
- sa = FbIntDiv(da, sa);
- FbByteMul(s, sa);
- }
- FbByteAdd(d, s);
- dest[i] = d;
- }
-}
-
-/*
- * All of the disjoint composing functions
-
- The four entries in the first column indicate what source contributions
- come from each of the four areas of the picture -- areas covered by neither
- A nor B, areas covered only by A, areas covered only by B and finally
- areas covered by both A and B.
-
- Disjoint Conjoint
- Fa Fb Fa Fb
-(0,0,0,0) 0 0 0 0
-(0,A,0,A) 1 0 1 0
-(0,0,B,B) 0 1 0 1
-(0,A,B,A) 1 min((1-a)/b,1) 1 max(1-a/b,0)
-(0,A,B,B) min((1-b)/a,1) 1 max(1-b/a,0) 1
-(0,0,0,A) max(1-(1-b)/a,0) 0 min(1,b/a) 0
-(0,0,0,B) 0 max(1-(1-a)/b,0) 0 min(a/b,1)
-(0,A,0,0) min(1,(1-b)/a) 0 max(1-b/a,0) 0
-(0,0,B,0) 0 min(1,(1-a)/b) 0 max(1-a/b,0)
-(0,0,B,A) max(1-(1-b)/a,0) min(1,(1-a)/b) min(1,b/a) max(1-a/b,0)
-(0,A,0,B) min(1,(1-b)/a) max(1-(1-a)/b,0) max(1-b/a,0) min(1,a/b)
-(0,A,B,0) min(1,(1-b)/a) min(1,(1-a)/b) max(1-b/a,0) max(1-a/b,0)
-
- */
-
-#define CombineAOut 1
-#define CombineAIn 2
-#define CombineBOut 4
-#define CombineBIn 8
-
-#define CombineClear 0
-#define CombineA (CombineAOut|CombineAIn)
-#define CombineB (CombineBOut|CombineBIn)
-#define CombineAOver (CombineAOut|CombineBOut|CombineAIn)
-#define CombineBOver (CombineAOut|CombineBOut|CombineBIn)
-#define CombineAAtop (CombineBOut|CombineAIn)
-#define CombineBAtop (CombineAOut|CombineBIn)
-#define CombineXor (CombineAOut|CombineBOut)
-
-/* portion covered by a but not b */
-static INLINE CARD8
-fbCombineDisjointOutPart (CARD8 a, CARD8 b)
-{
- /* min (1, (1-b) / a) */
-
- b = ~b; /* 1 - b */
- if (b >= a) /* 1 - b >= a -> (1-b)/a >= 1 */
- return 0xff; /* 1 */
- return FbIntDiv(b,a); /* (1-b) / a */
-}
-
-/* portion covered by both a and b */
-static INLINE CARD8
-fbCombineDisjointInPart (CARD8 a, CARD8 b)
-{
- /* max (1-(1-b)/a,0) */
- /* = - min ((1-b)/a - 1, 0) */
- /* = 1 - min (1, (1-b)/a) */
-
- b = ~b; /* 1 - b */
- if (b >= a) /* 1 - b >= a -> (1-b)/a >= 1 */
- return 0; /* 1 - 1 */
- return ~FbIntDiv(b,a); /* 1 - (1-b) / a */
-}
-
-static FASTCALL void
-fbCombineDisjointGeneralU (CARD32 *dest, const CARD32 *src, int width, CARD8 combine)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 s = src[i];
- CARD32 d = dest[i];
- CARD32 m,n,o,p;
- CARD16 Fa, Fb, t, u, v;
- CARD8 sa = s >> 24;
- CARD8 da = d >> 24;
-
- switch (combine & CombineA) {
- default:
- Fa = 0;
- break;
- case CombineAOut:
- Fa = fbCombineDisjointOutPart (sa, da);
- break;
- case CombineAIn:
- Fa = fbCombineDisjointInPart (sa, da);
- break;
- case CombineA:
- Fa = 0xff;
- break;
- }
-
- switch (combine & CombineB) {
- default:
- Fb = 0;
- break;
- case CombineBOut:
- Fb = fbCombineDisjointOutPart (da, sa);
- break;
- case CombineBIn:
- Fb = fbCombineDisjointInPart (da, sa);
- break;
- case CombineB:
- Fb = 0xff;
- break;
- }
- m = FbGen (s,d,0,Fa,Fb,t, u, v);
- n = FbGen (s,d,8,Fa,Fb,t, u, v);
- o = FbGen (s,d,16,Fa,Fb,t, u, v);
- p = FbGen (s,d,24,Fa,Fb,t, u, v);
- s = m|n|o|p;
- dest[i] = s;
- }
-}
-
-static FASTCALL void
-fbCombineDisjointOverU (CARD32 *dest, const CARD32 *src, int width)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 s = src[i];
- CARD16 a = s >> 24;
-
- if (a != 0x00)
- {
- if (a != 0xff)
- {
- CARD32 d = dest[i];
- a = fbCombineDisjointOutPart (d >> 24, a);
- FbByteMulAdd(d, a, s);
- s = d;
- }
- dest[i] = s;
- }
- }
-}
-
-static FASTCALL void
-fbCombineDisjointInU (CARD32 *dest, const CARD32 *src, int width)
-{
- fbCombineDisjointGeneralU (dest, src, width, CombineAIn);
-}
-
-static FASTCALL void
-fbCombineDisjointInReverseU (CARD32 *dest, const CARD32 *src, int width)
-{
- fbCombineDisjointGeneralU (dest, src, width, CombineBIn);
-}
-
-static FASTCALL void
-fbCombineDisjointOutU (CARD32 *dest, const CARD32 *src, int width)
-{
- fbCombineDisjointGeneralU (dest, src, width, CombineAOut);
-}
-
-static FASTCALL void
-fbCombineDisjointOutReverseU (CARD32 *dest, const CARD32 *src, int width)
-{
- fbCombineDisjointGeneralU (dest, src, width, CombineBOut);
-}
-
-static FASTCALL void
-fbCombineDisjointAtopU (CARD32 *dest, const CARD32 *src, int width)
-{
- fbCombineDisjointGeneralU (dest, src, width, CombineAAtop);
-}
-
-static FASTCALL void
-fbCombineDisjointAtopReverseU (CARD32 *dest, const CARD32 *src, int width)
-{
- fbCombineDisjointGeneralU (dest, src, width, CombineBAtop);
-}
-
-static FASTCALL void
-fbCombineDisjointXorU (CARD32 *dest, const CARD32 *src, int width)
-{
- fbCombineDisjointGeneralU (dest, src, width, CombineXor);
-}
-
-/* portion covered by a but not b */
-static INLINE CARD8
-fbCombineConjointOutPart (CARD8 a, CARD8 b)
-{
- /* max (1-b/a,0) */
- /* = 1-min(b/a,1) */
-
- /* min (1, (1-b) / a) */
-
- if (b >= a) /* b >= a -> b/a >= 1 */
- return 0x00; /* 0 */
- return ~FbIntDiv(b,a); /* 1 - b/a */
-}
-
-/* portion covered by both a and b */
-static INLINE CARD8
-fbCombineConjointInPart (CARD8 a, CARD8 b)
-{
- /* min (1,b/a) */
-
- if (b >= a) /* b >= a -> b/a >= 1 */
- return 0xff; /* 1 */
- return FbIntDiv(b,a); /* b/a */
-}
-
-static FASTCALL void
-fbCombineConjointGeneralU (CARD32 *dest, const CARD32 *src, int width, CARD8 combine)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 s = src[i];
- CARD32 d = dest[i];
- CARD32 m,n,o,p;
- CARD16 Fa, Fb, t, u, v;
- CARD8 sa = s >> 24;
- CARD8 da = d >> 24;
-
- switch (combine & CombineA) {
- default:
- Fa = 0;
- break;
- case CombineAOut:
- Fa = fbCombineConjointOutPart (sa, da);
- break;
- case CombineAIn:
- Fa = fbCombineConjointInPart (sa, da);
- break;
- case CombineA:
- Fa = 0xff;
- break;
- }
-
- switch (combine & CombineB) {
- default:
- Fb = 0;
- break;
- case CombineBOut:
- Fb = fbCombineConjointOutPart (da, sa);
- break;
- case CombineBIn:
- Fb = fbCombineConjointInPart (da, sa);
- break;
- case CombineB:
- Fb = 0xff;
- break;
- }
- m = FbGen (s,d,0,Fa,Fb,t, u, v);
- n = FbGen (s,d,8,Fa,Fb,t, u, v);
- o = FbGen (s,d,16,Fa,Fb,t, u, v);
- p = FbGen (s,d,24,Fa,Fb,t, u, v);
- s = m|n|o|p;
- dest[i] = s;
- }
-}
-
-static FASTCALL void
-fbCombineConjointOverU (CARD32 *dest, const CARD32 *src, int width)
-{
- fbCombineConjointGeneralU (dest, src, width, CombineAOver);
-}
-
-
-static FASTCALL void
-fbCombineConjointOverReverseU (CARD32 *dest, const CARD32 *src, int width)
-{
- fbCombineConjointGeneralU (dest, src, width, CombineBOver);
-}
-
-
-static FASTCALL void
-fbCombineConjointInU (CARD32 *dest, const CARD32 *src, int width)
-{
- fbCombineConjointGeneralU (dest, src, width, CombineAIn);
-}
-
-
-static FASTCALL void
-fbCombineConjointInReverseU (CARD32 *dest, const CARD32 *src, int width)
-{
- fbCombineConjointGeneralU (dest, src, width, CombineBIn);
-}
-
-static FASTCALL void
-fbCombineConjointOutU (CARD32 *dest, const CARD32 *src, int width)
-{
- fbCombineConjointGeneralU (dest, src, width, CombineAOut);
-}
-
-static FASTCALL void
-fbCombineConjointOutReverseU (CARD32 *dest, const CARD32 *src, int width)
-{
- fbCombineConjointGeneralU (dest, src, width, CombineBOut);
-}
-
-static FASTCALL void
-fbCombineConjointAtopU (CARD32 *dest, const CARD32 *src, int width)
-{
- fbCombineConjointGeneralU (dest, src, width, CombineAAtop);
-}
-
-static FASTCALL void
-fbCombineConjointAtopReverseU (CARD32 *dest, const CARD32 *src, int width)
-{
- fbCombineConjointGeneralU (dest, src, width, CombineBAtop);
-}
-
-static FASTCALL void
-fbCombineConjointXorU (CARD32 *dest, const CARD32 *src, int width)
-{
- fbCombineConjointGeneralU (dest, src, width, CombineXor);
-}
-
-static CombineFuncU fbCombineFuncU[] = {
- fbCombineClear,
- fbCombineSrcU,
- NULL, /* CombineDst */
- fbCombineOverU,
- fbCombineOverReverseU,
- fbCombineInU,
- fbCombineInReverseU,
- fbCombineOutU,
- fbCombineOutReverseU,
- fbCombineAtopU,
- fbCombineAtopReverseU,
- fbCombineXorU,
- fbCombineAddU,
- fbCombineSaturateU,
- NULL,
- NULL,
- fbCombineClear,
- fbCombineSrcU,
- NULL, /* CombineDst */
- fbCombineDisjointOverU,
- fbCombineSaturateU, /* DisjointOverReverse */
- fbCombineDisjointInU,
- fbCombineDisjointInReverseU,
- fbCombineDisjointOutU,
- fbCombineDisjointOutReverseU,
- fbCombineDisjointAtopU,
- fbCombineDisjointAtopReverseU,
- fbCombineDisjointXorU,
- NULL,
- NULL,
- NULL,
- NULL,
- fbCombineClear,
- fbCombineSrcU,
- NULL, /* CombineDst */
- fbCombineConjointOverU,
- fbCombineConjointOverReverseU,
- fbCombineConjointInU,
- fbCombineConjointInReverseU,
- fbCombineConjointOutU,
- fbCombineConjointOutReverseU,
- fbCombineConjointAtopU,
- fbCombineConjointAtopReverseU,
- fbCombineConjointXorU,
-};
-
-static FASTCALL void
-fbCombineMaskC (CARD32 *src, CARD32 *mask, int width)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 a = mask[i];
-
- CARD32 x;
- CARD16 xa;
-
- if (!a)
- {
- src[i] = 0;
- continue;
- }
-
- x = src[i];
- if (a == 0xffffffff)
- {
- x = x >> 24;
- x |= x << 8;
- x |= x << 16;
- mask[i] = x;
- continue;
- }
-
- xa = x >> 24;
- FbByteMulC(x, a);
- src[i] = x;
- FbByteMul(a, xa);
- mask[i] = a;
- }
-}
-
-static FASTCALL void
-fbCombineMaskValueC (CARD32 *src, const CARD32 *mask, int width)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 a = mask[i];
- CARD32 x;
-
- if (!a)
- {
- src[i] = 0;
- continue;
- }
-
- if (a == 0xffffffff)
- continue;
-
- x = src[i];
- FbByteMulC(x, a);
- src[i] = x;
- }
-}
-
-
-static FASTCALL void
-fbCombineMaskAlphaC (const CARD32 *src, CARD32 *mask, int width)
-{
- int i;
- for (i = 0; i < width; ++i) {
- CARD32 a = mask[i];
- CARD32 x;
-
- if (!a)
- continue;
-
- x = src[i] >> 24;
- if (x == 0xff)
- continue;
- if (a == 0xffffffff)
- {
- x = x >> 24;
- x |= x << 8;
- x |= x << 16;
- mask[i] = x;
- continue;
- }
-
- FbByteMul(a, x);
- mask[i] = a;
- }
-}
-
-static FASTCALL void
-fbCombineClearC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- memset(dest, 0, width*sizeof(CARD32));
-}
-
-static FASTCALL void
-fbCombineSrcC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- fbCombineMaskValueC(src, mask, width);
- memcpy(dest, src, width*sizeof(CARD32));
-}
-
-static FASTCALL void
-fbCombineOverC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- int i;
- fbCombineMaskC(src, mask, width);
- for (i = 0; i < width; ++i) {
- CARD32 s = src[i];
- CARD32 a = ~mask[i];
-
- if (a != 0xffffffff)
- {
- if (a)
- {
- CARD32 d = dest[i];
- FbByteMulAddC(d, a, s);
- s = d;
- }
- dest[i] = s;
- }
- }
-}
-
-static FASTCALL void
-fbCombineOverReverseC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- int i;
- fbCombineMaskValueC(src, mask, width);
- for (i = 0; i < width; ++i) {
- CARD32 d = dest[i];
- CARD32 a = ~d >> 24;
-
- if (a)
- {
- CARD32 s = src[i];
- if (a != 0xff)
- {
- FbByteMulAdd(s, a, d);
- }
- dest[i] = s;
- }
- }
-}
-
-static FASTCALL void
-fbCombineInC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- int i;
- fbCombineMaskValueC(src, mask, width);
- for (i = 0; i < width; ++i) {
- CARD32 d = dest[i];
- CARD16 a = d >> 24;
- CARD32 s = 0;
- if (a)
- {
- s = src[i];
- if (a != 0xff)
- {
- FbByteMul(s, a);
- }
- }
- dest[i] = s;
- }
-}
-
-static FASTCALL void
-fbCombineInReverseC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- int i;
- fbCombineMaskAlphaC(src, mask, width);
- for (i = 0; i < width; ++i) {
- CARD32 a = mask[i];
-
- if (a != 0xffffffff)
- {
- CARD32 d = 0;
- if (a)
- {
- d = dest[i];
- FbByteMulC(d, a);
- }
- dest[i] = d;
- }
- }
-}
-
-static FASTCALL void
-fbCombineOutC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- int i;
- fbCombineMaskValueC(src, mask, width);
- for (i = 0; i < width; ++i) {
- CARD32 d = dest[i];
- CARD16 a = ~d >> 24;
- CARD32 s = 0;
- if (a)
- {
- s = src[i];
- if (a != 0xff)
- {
- FbByteMul(s, a);
- }
- }
- dest[i] = s;
- }
-}
-
-static FASTCALL void
-fbCombineOutReverseC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- int i;
- fbCombineMaskAlphaC(src, mask, width);
- for (i = 0; i < width; ++i) {
- CARD32 a = ~mask[i];
-
- if (a != 0xffffffff)
- {
- CARD32 d = 0;
- if (a)
- {
- d = dest[i];
- FbByteMulC(d, a);
- }
- dest[i] = d;
- }
- }
-}
-
-static FASTCALL void
-fbCombineAtopC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- int i;
- fbCombineMaskC(src, mask, width);
- for (i = 0; i < width; ++i) {
- CARD32 d = dest[i];
- CARD32 s = src[i];
- CARD32 ad = ~mask[i];
- CARD16 as = d >> 24;
- FbByteAddMulC(d, ad, s, as);
- dest[i] = d;
- }
-}
-
-static FASTCALL void
-fbCombineAtopReverseC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- int i;
- fbCombineMaskC(src, mask, width);
- for (i = 0; i < width; ++i) {
-
- CARD32 d = dest[i];
- CARD32 s = src[i];
- CARD32 ad = mask[i];
- CARD16 as = ~d >> 24;
- FbByteAddMulC(d, ad, s, as);
- dest[i] = d;
- }
-}
-
-static FASTCALL void
-fbCombineXorC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- int i;
- fbCombineMaskC(src, mask, width);
- for (i = 0; i < width; ++i) {
- CARD32 d = dest[i];
- CARD32 s = src[i];
- CARD32 ad = ~mask[i];
- CARD16 as = ~d >> 24;
- FbByteAddMulC(d, ad, s, as);
- dest[i] = d;
- }
-}
-
-static FASTCALL void
-fbCombineAddC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- int i;
- fbCombineMaskValueC(src, mask, width);
- for (i = 0; i < width; ++i) {
- CARD32 s = src[i];
- CARD32 d = dest[i];
- FbByteAdd(d, s);
- dest[i] = d;
- }
-}
-
-static FASTCALL void
-fbCombineSaturateC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- int i;
- fbCombineMaskC(src, mask, width);
- for (i = 0; i < width; ++i) {
- CARD32 s, d;
- CARD16 sa, sr, sg, sb, da;
- CARD16 t, u, v;
- CARD32 m,n,o,p;
-
- d = dest[i];
- s = src[i];
- sa = (mask[i] >> 24);
- sr = (mask[i] >> 16) & 0xff;
- sg = (mask[i] >> 8) & 0xff;
- sb = (mask[i] ) & 0xff;
- da = ~d >> 24;
-
- if (sb <= da)
- m = FbAdd(s,d,0,t);
- else
- m = FbGen (s, d, 0, (da << 8) / sb, 0xff, t, u, v);
-
- if (sg <= da)
- n = FbAdd(s,d,8,t);
- else
- n = FbGen (s, d, 8, (da << 8) / sg, 0xff, t, u, v);
-
- if (sr <= da)
- o = FbAdd(s,d,16,t);
- else
- o = FbGen (s, d, 16, (da << 8) / sr, 0xff, t, u, v);
-
- if (sa <= da)
- p = FbAdd(s,d,24,t);
- else
- p = FbGen (s, d, 24, (da << 8) / sa, 0xff, t, u, v);
-
- dest[i] = m|n|o|p;
- }
-}
-
-static FASTCALL void
-fbCombineDisjointGeneralC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width, CARD8 combine)
-{
- int i;
- fbCombineMaskC(src, mask, width);
- for (i = 0; i < width; ++i) {
- CARD32 s, d;
- CARD32 m,n,o,p;
- CARD32 Fa, Fb;
- CARD16 t, u, v;
- CARD32 sa;
- CARD8 da;
-
- s = src[i];
- sa = mask[i];
- d = dest[i];
- da = d >> 24;
-
- switch (combine & CombineA) {
- default:
- Fa = 0;
- break;
- case CombineAOut:
- m = fbCombineDisjointOutPart ((CARD8) (sa >> 0), da);
- n = fbCombineDisjointOutPart ((CARD8) (sa >> 8), da) << 8;
- o = fbCombineDisjointOutPart ((CARD8) (sa >> 16), da) << 16;
- p = fbCombineDisjointOutPart ((CARD8) (sa >> 24), da) << 24;
- Fa = m|n|o|p;
- break;
- case CombineAIn:
- m = fbCombineDisjointInPart ((CARD8) (sa >> 0), da);
- n = fbCombineDisjointInPart ((CARD8) (sa >> 8), da) << 8;
- o = fbCombineDisjointInPart ((CARD8) (sa >> 16), da) << 16;
- p = fbCombineDisjointInPart ((CARD8) (sa >> 24), da) << 24;
- Fa = m|n|o|p;
- break;
- case CombineA:
- Fa = 0xffffffff;
- break;
- }
-
- switch (combine & CombineB) {
- default:
- Fb = 0;
- break;
- case CombineBOut:
- m = fbCombineDisjointOutPart (da, (CARD8) (sa >> 0));
- n = fbCombineDisjointOutPart (da, (CARD8) (sa >> 8)) << 8;
- o = fbCombineDisjointOutPart (da, (CARD8) (sa >> 16)) << 16;
- p = fbCombineDisjointOutPart (da, (CARD8) (sa >> 24)) << 24;
- Fb = m|n|o|p;
- break;
- case CombineBIn:
- m = fbCombineDisjointInPart (da, (CARD8) (sa >> 0));
- n = fbCombineDisjointInPart (da, (CARD8) (sa >> 8)) << 8;
- o = fbCombineDisjointInPart (da, (CARD8) (sa >> 16)) << 16;
- p = fbCombineDisjointInPart (da, (CARD8) (sa >> 24)) << 24;
- Fb = m|n|o|p;
- break;
- case CombineB:
- Fb = 0xffffffff;
- break;
- }
- m = FbGen (s,d,0,FbGet8(Fa,0),FbGet8(Fb,0),t, u, v);
- n = FbGen (s,d,8,FbGet8(Fa,8),FbGet8(Fb,8),t, u, v);
- o = FbGen (s,d,16,FbGet8(Fa,16),FbGet8(Fb,16),t, u, v);
- p = FbGen (s,d,24,FbGet8(Fa,24),FbGet8(Fb,24),t, u, v);
- s = m|n|o|p;
- dest[i] = s;
- }
-}
-
-static FASTCALL void
-fbCombineDisjointOverC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- fbCombineDisjointGeneralC (dest, src, mask, width, CombineAOver);
-}
-
-static FASTCALL void
-fbCombineDisjointInC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- fbCombineDisjointGeneralC (dest, src, mask, width, CombineAIn);
-}
-
-static FASTCALL void
-fbCombineDisjointInReverseC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- fbCombineDisjointGeneralC (dest, src, mask, width, CombineBIn);
-}
-
-static FASTCALL void
-fbCombineDisjointOutC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- fbCombineDisjointGeneralC (dest, src, mask, width, CombineAOut);
-}
-
-static FASTCALL void
-fbCombineDisjointOutReverseC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- fbCombineDisjointGeneralC (dest, src, mask, width, CombineBOut);
-}
-
-static FASTCALL void
-fbCombineDisjointAtopC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- fbCombineDisjointGeneralC (dest, src, mask, width, CombineAAtop);
-}
-
-static FASTCALL void
-fbCombineDisjointAtopReverseC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- fbCombineDisjointGeneralC (dest, src, mask, width, CombineBAtop);
-}
-
-static FASTCALL void
-fbCombineDisjointXorC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- fbCombineDisjointGeneralC (dest, src, mask, width, CombineXor);
-}
-
-static FASTCALL void
-fbCombineConjointGeneralC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width, CARD8 combine)
-{
- int i;
- fbCombineMaskC(src, mask, width);
- for (i = 0; i < width; ++i) {
- CARD32 s, d;
- CARD32 m,n,o,p;
- CARD32 Fa, Fb;
- CARD16 t, u, v;
- CARD32 sa;
- CARD8 da;
-
- s = src[i];
- sa = mask[i];
- d = dest[i];
- da = d >> 24;
-
- switch (combine & CombineA) {
- default:
- Fa = 0;
- break;
- case CombineAOut:
- m = fbCombineConjointOutPart ((CARD8) (sa >> 0), da);
- n = fbCombineConjointOutPart ((CARD8) (sa >> 8), da) << 8;
- o = fbCombineConjointOutPart ((CARD8) (sa >> 16), da) << 16;
- p = fbCombineConjointOutPart ((CARD8) (sa >> 24), da) << 24;
- Fa = m|n|o|p;
- break;
- case CombineAIn:
- m = fbCombineConjointInPart ((CARD8) (sa >> 0), da);
- n = fbCombineConjointInPart ((CARD8) (sa >> 8), da) << 8;
- o = fbCombineConjointInPart ((CARD8) (sa >> 16), da) << 16;
- p = fbCombineConjointInPart ((CARD8) (sa >> 24), da) << 24;
- Fa = m|n|o|p;
- break;
- case CombineA:
- Fa = 0xffffffff;
- break;
- }
-
- switch (combine & CombineB) {
- default:
- Fb = 0;
- break;
- case CombineBOut:
- m = fbCombineConjointOutPart (da, (CARD8) (sa >> 0));
- n = fbCombineConjointOutPart (da, (CARD8) (sa >> 8)) << 8;
- o = fbCombineConjointOutPart (da, (CARD8) (sa >> 16)) << 16;
- p = fbCombineConjointOutPart (da, (CARD8) (sa >> 24)) << 24;
- Fb = m|n|o|p;
- break;
- case CombineBIn:
- m = fbCombineConjointInPart (da, (CARD8) (sa >> 0));
- n = fbCombineConjointInPart (da, (CARD8) (sa >> 8)) << 8;
- o = fbCombineConjointInPart (da, (CARD8) (sa >> 16)) << 16;
- p = fbCombineConjointInPart (da, (CARD8) (sa >> 24)) << 24;
- Fb = m|n|o|p;
- break;
- case CombineB:
- Fb = 0xffffffff;
- break;
- }
- m = FbGen (s,d,0,FbGet8(Fa,0),FbGet8(Fb,0),t, u, v);
- n = FbGen (s,d,8,FbGet8(Fa,8),FbGet8(Fb,8),t, u, v);
- o = FbGen (s,d,16,FbGet8(Fa,16),FbGet8(Fb,16),t, u, v);
- p = FbGen (s,d,24,FbGet8(Fa,24),FbGet8(Fb,24),t, u, v);
- s = m|n|o|p;
- dest[i] = s;
- }
-}
-
-static FASTCALL void
-fbCombineConjointOverC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- fbCombineConjointGeneralC (dest, src, mask, width, CombineAOver);
-}
-
-static FASTCALL void
-fbCombineConjointOverReverseC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- fbCombineConjointGeneralC (dest, src, mask, width, CombineBOver);
-}
-
-static FASTCALL void
-fbCombineConjointInC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- fbCombineConjointGeneralC (dest, src, mask, width, CombineAIn);
-}
-
-static FASTCALL void
-fbCombineConjointInReverseC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- fbCombineConjointGeneralC (dest, src, mask, width, CombineBIn);
-}
-
-static FASTCALL void
-fbCombineConjointOutC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- fbCombineConjointGeneralC (dest, src, mask, width, CombineAOut);
-}
-
-static FASTCALL void
-fbCombineConjointOutReverseC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- fbCombineConjointGeneralC (dest, src, mask, width, CombineBOut);
-}
-
-static FASTCALL void
-fbCombineConjointAtopC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- fbCombineConjointGeneralC (dest, src, mask, width, CombineAAtop);
-}
-
-static FASTCALL void
-fbCombineConjointAtopReverseC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- fbCombineConjointGeneralC (dest, src, mask, width, CombineBAtop);
-}
-
-static FASTCALL void
-fbCombineConjointXorC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- fbCombineConjointGeneralC (dest, src, mask, width, CombineXor);
-}
-
-static CombineFuncC fbCombineFuncC[] = {
- fbCombineClearC,
- fbCombineSrcC,
- NULL, /* Dest */
- fbCombineOverC,
- fbCombineOverReverseC,
- fbCombineInC,
- fbCombineInReverseC,
- fbCombineOutC,
- fbCombineOutReverseC,
- fbCombineAtopC,
- fbCombineAtopReverseC,
- fbCombineXorC,
- fbCombineAddC,
- fbCombineSaturateC,
- NULL,
- NULL,
- fbCombineClearC, /* 0x10 */
- fbCombineSrcC,
- NULL, /* Dest */
- fbCombineDisjointOverC,
- fbCombineSaturateC, /* DisjointOverReverse */
- fbCombineDisjointInC,
- fbCombineDisjointInReverseC,
- fbCombineDisjointOutC,
- fbCombineDisjointOutReverseC,
- fbCombineDisjointAtopC,
- fbCombineDisjointAtopReverseC,
- fbCombineDisjointXorC, /* 0x1b */
- NULL,
- NULL,
- NULL,
- NULL,
- fbCombineClearC,
- fbCombineSrcC,
- NULL, /* Dest */
- fbCombineConjointOverC,
- fbCombineConjointOverReverseC,
- fbCombineConjointInC,
- fbCombineConjointInReverseC,
- fbCombineConjointOutC,
- fbCombineConjointOutReverseC,
- fbCombineConjointAtopC,
- fbCombineConjointAtopReverseC,
- fbCombineConjointXorC,
-};
-
-
-FbComposeFunctions composeFunctions = {
- fbCombineFuncU,
- fbCombineFuncC,
- fbCombineMaskU
-};
-
-
-static void fbFetchSolid(PicturePtr pict, int x, int y, int width, CARD32 *buffer)
-{
- FbBits *bits;
- FbStride stride;
- int bpp;
- int xoff, yoff;
- CARD32 color;
- CARD32 *end;
- fetchPixelProc fetch = fetchPixelProcForPicture(pict);
- miIndexedPtr indexed = (miIndexedPtr) pict->pFormat->index.devPrivate;
-
- fbGetDrawable (pict->pDrawable, bits, stride, bpp, xoff, yoff);
- bits += yoff*stride + (xoff*bpp >> FB_SHIFT);
-
- color = fetch(bits, 0, indexed);
-
- end = buffer + width;
- while (buffer < end)
- *buffer++ = color;
-}
-
-static void fbFetch(PicturePtr pict, int x, int y, int width, CARD32 *buffer)
-{
- FbBits *bits;
- FbStride stride;
- int bpp;
- int xoff, yoff;
- fetchProc fetch = fetchProcForPicture(pict);
- miIndexedPtr indexed = (miIndexedPtr) pict->pFormat->index.devPrivate;
-
- fbGetDrawable (pict->pDrawable, bits, stride, bpp, xoff, yoff);
- x += xoff;
- y += yoff;
-
- bits += y*stride;
-
- fetch(bits, x, width, buffer, indexed);
-}
-
-#define MOD(a,b) ((a) < 0 ? ((b) - ((-(a) - 1) % (b))) - 1 : (a) % (b))
-#define DIV(a,b) ((((a) < 0) == ((b) < 0)) ? (a) / (b) :\
- ((a) - (b) + 1 - (((b) < 0) << 1)) / (b))
-
-
-static CARD32 gradientPixel(const SourcePictPtr pGradient, xFixed_48_16 pos, unsigned int spread)
-{
- int ipos = (pos * PICT_GRADIENT_STOPTABLE_SIZE - 1) >> 16;
-
- /* calculate the actual offset. */
- if (ipos < 0 || ipos >= PICT_GRADIENT_STOPTABLE_SIZE) {
- if (pGradient->type == SourcePictTypeConical || spread == RepeatNormal) {
- ipos = ipos % PICT_GRADIENT_STOPTABLE_SIZE;
- ipos = ipos < 0 ? PICT_GRADIENT_STOPTABLE_SIZE + ipos : ipos;
-
- } else if (spread == RepeatReflect) {
- const int limit = PICT_GRADIENT_STOPTABLE_SIZE * 2 - 1;
- ipos = ipos % limit;
- ipos = ipos < 0 ? limit + ipos : ipos;
- ipos = ipos >= PICT_GRADIENT_STOPTABLE_SIZE ? limit - ipos : ipos;
-
- } else if (spread == RepeatPad) {
- if (ipos < 0)
- ipos = 0;
- else if (ipos >= PICT_GRADIENT_STOPTABLE_SIZE)
- ipos = PICT_GRADIENT_STOPTABLE_SIZE-1;
- } else { /* RepeatNone */
- return 0;
- }
- }
-
- assert(ipos >= 0);
- assert(ipos < PICT_GRADIENT_STOPTABLE_SIZE);
-
- return pGradient->linear.colorTable[ipos];
-}
-
-static void fbFetchSourcePict(PicturePtr pict, int x, int y, int width, CARD32 *buffer)
-{
- SourcePictPtr pGradient = pict->pSourcePict;
- CARD32 *end = buffer + width;
-
- if (pGradient->type == SourcePictTypeSolidFill) {
- register CARD32 color = pGradient->solidFill.color;
- while (buffer < end) {
- *buffer++ = color;
- }
- } else if (pGradient->type == SourcePictTypeLinear) {
- PictVector v, unit;
- xFixed_32_32 l;
- xFixed_48_16 dx, dy, a, b, off;
-
- /* reference point is the center of the pixel */
- v.vector[0] = IntToxFixed(x) + xFixed1/2;
- v.vector[1] = IntToxFixed(y) + xFixed1/2;
- v.vector[2] = xFixed1;
- if (pict->transform) {
- if (!PictureTransformPoint3d (pict->transform, &v))
- return;
- unit.vector[0] = pict->transform->matrix[0][0];
- unit.vector[1] = pict->transform->matrix[1][0];
- unit.vector[2] = pict->transform->matrix[2][0];
- } else {
- unit.vector[0] = xFixed1;
- unit.vector[1] = 0;
- unit.vector[2] = 0;
- }
-
- dx = pGradient->linear.p2.x - pGradient->linear.p1.x;
- dy = pGradient->linear.p2.y - pGradient->linear.p1.y;
- l = dx*dx + dy*dy;
- if (l != 0) {
- a = (dx << 32) / l;
- b = (dy << 32) / l;
- off = (-a*pGradient->linear.p1.x - b*pGradient->linear.p1.y)>>16;
- }
- if (l == 0 || (unit.vector[2] == 0 && v.vector[2] == xFixed1)) {
- xFixed_48_16 inc, t;
- /* affine transformation only */
- if (l == 0) {
- t = 0;
- inc = 0;
- } else {
- t = ((a*v.vector[0] + b*v.vector[1]) >> 16) + off;
- inc = (a * unit.vector[0] + b * unit.vector[1]) >> 16;
- }
- while (buffer < end) {
- *buffer++ = gradientPixel(pGradient, t, pict->repeatType);
- t += inc;
- }
- } else {
- /* projective transformation */
- while (buffer < end) {
- xFixed_48_16 t;
- if (v.vector[2] == 0) {
- t = 0;
- } else {
- xFixed_48_16 x, y;
- x = ((xFixed_48_16)v.vector[0] << 16) / v.vector[2];
- y = ((xFixed_48_16)v.vector[1] << 16) / v.vector[2];
- t = ((a*x + b*y) >> 16) + off;
- }
- *buffer++ = gradientPixel(pGradient, t, pict->repeatType);
- v.vector[0] += unit.vector[0];
- v.vector[1] += unit.vector[1];
- v.vector[2] += unit.vector[2];
- }
- }
- } else {
- /* radial or conical */
- Bool affine = TRUE;
- double cx = 1.;
- double cy = 0.;
- double cz = 0.;
- double rx = x;
- double ry = y;
- double rz = 1.;
-
- if (pict->transform) {
- PictVector v;
- /* reference point is the center of the pixel */
- v.vector[0] = IntToxFixed(x) + xFixed1/2;
- v.vector[1] = IntToxFixed(y) + xFixed1/2;
- v.vector[2] = xFixed1;
- if (!PictureTransformPoint3d (pict->transform, &v))
- return;
-
- cx = pict->transform->matrix[0][0]/65536.;
- cy = pict->transform->matrix[1][0]/65536.;
- cz = pict->transform->matrix[2][0]/65536.;
- rx = v.vector[0]/65536.;
- ry = v.vector[1]/65536.;
- rz = v.vector[2]/65536.;
- affine = pict->transform->matrix[2][0] == 0 && v.vector[2] == xFixed1;
- }
-
- if (pGradient->type == SourcePictTypeRadial) {
- if (affine) {
- rx -= pGradient->radial.fx;
- ry -= pGradient->radial.fy;
-
- while (buffer < end) {
- double b = 2*(rx*pGradient->radial.dx + ry*pGradient->radial.dy);
- double c = -(rx*rx + ry*ry);
- double det = (b * b) - (4 * pGradient->radial.a * c);
- double s = (-b + sqrt(det))/(2. * pGradient->radial.a);
- *buffer = gradientPixel(pGradient,
- (xFixed_48_16)((s*pGradient->radial.m + pGradient->radial.b)*65536),
- pict->repeatType);
- ++buffer;
- rx += cx;
- ry += cy;
- }
- } else {
- while (buffer < end) {
- double x, y;
- double b, c, det, s;
- if (rz != 0) {
- x = rx/rz;
- y = ry/rz;
- } else {
- x = y = 0.;
- }
- x -= pGradient->radial.fx;
- y -= pGradient->radial.fy;
- b = 2*(x*pGradient->radial.dx + y*pGradient->radial.dy);
- c = -(x*x + y*y);
- det = (b * b) - (4 * pGradient->radial.a * c);
- s = (-b + sqrt(det))/(2. * pGradient->radial.a);
- *buffer = gradientPixel(pGradient,
- (xFixed_48_16)((s*pGradient->radial.m + pGradient->radial.b)*65536),
- pict->repeatType);
- ++buffer;
- rx += cx;
- ry += cy;
- rz += cz;
- }
- }
- } else /* SourcePictTypeConical */ {
- double a = pGradient->conical.angle/(180.*65536);
- if (affine) {
- rx -= pGradient->conical.center.x/65536.;
- ry -= pGradient->conical.center.y/65536.;
-
- while (buffer < end) {
- double angle = atan2(ry, rx) + a;
- *buffer = gradientPixel(pGradient, (xFixed_48_16) (angle * (65536. / (2*M_PI))),
- pict->repeatType);
- ++buffer;
- rx += cx;
- ry += cy;
- }
- } else {
-
- while (buffer < end) {
- double x, y, angle;
- if (rz != 0) {
- x = rx/rz;
- y = ry/rz;
- } else {
- x = y = 0.;
- }
- x -= pGradient->conical.center.x/65536.;
- y -= pGradient->conical.center.y/65536.;
- angle = atan2(y, x) + a;
- *buffer = gradientPixel(pGradient, (xFixed_48_16) (angle * (65536. / (2*M_PI))),
- pict->repeatType);
- ++buffer;
- rx += cx;
- ry += cy;
- rz += cz;
- }
- }
- }
- }
-}
-
-
-
-static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32 *buffer)
-{
- FbBits *bits;
- FbStride stride;
- int bpp;
- int xoff, yoff, dx, dy;
- fetchPixelProc fetch;
- PictVector v;
- PictVector unit;
- int i;
- BoxRec box;
- miIndexedPtr indexed = (miIndexedPtr) pict->pFormat->index.devPrivate;
- Bool affine = TRUE;
-
- fetch = fetchPixelProcForPicture(pict);
-
- fbGetDrawable(pict->pDrawable, bits, stride, bpp, xoff, yoff);
- x += xoff;
- y += yoff;
-
- dx = pict->pDrawable->x;
- dy = pict->pDrawable->y;
-
- /* reference point is the center of the pixel */
- v.vector[0] = IntToxFixed(x - dx) + xFixed1 / 2;
- v.vector[1] = IntToxFixed(y - dy) + xFixed1 / 2;
- v.vector[2] = xFixed1;
-
- /* when using convolution filters one might get here without a transform */
- if (pict->transform) {
- if (!PictureTransformPoint3d (pict->transform, &v))
- return;
- unit.vector[0] = pict->transform->matrix[0][0];
- unit.vector[1] = pict->transform->matrix[1][0];
- unit.vector[2] = pict->transform->matrix[2][0];
- affine = v.vector[2] == xFixed1 && unit.vector[2] == 0;
- } else {
- unit.vector[0] = xFixed1;
- unit.vector[1] = 0;
- unit.vector[2] = 0;
- }
-
- if (pict->filter == PictFilterNearest)
- {
- if (pict->repeatType == RepeatNormal) {
- if (REGION_NUM_RECTS(pict->pCompositeClip) == 1) {
- for (i = 0; i < width; ++i) {
- if (!v.vector[2]) {
- buffer[i] = 0;
- } else {
- if (!affine) {
- y = MOD(DIV(v.vector[1],v.vector[2]), pict->pDrawable->height);
- x = MOD(DIV(v.vector[0],v.vector[2]), pict->pDrawable->width);
- } else {
- y = MOD(v.vector[1]>>16, pict->pDrawable->height);
- x = MOD(v.vector[0]>>16, pict->pDrawable->width);
- }
- buffer[i] = fetch(bits + (y + dy)*stride, x + dx, indexed);
- }
- v.vector[0] += unit.vector[0];
- v.vector[1] += unit.vector[1];
- v.vector[2] += unit.vector[2];
- }
- } else {
- for (i = 0; i < width; ++i) {
- if (!v.vector[2]) {
- buffer[i] = 0;
- } else {
- if (!affine) {
- y = MOD(DIV(v.vector[1],v.vector[2]), pict->pDrawable->height);
- x = MOD(DIV(v.vector[0],v.vector[2]), pict->pDrawable->width);
- } else {
- y = MOD(v.vector[1]>>16, pict->pDrawable->height);
- x = MOD(v.vector[0]>>16, pict->pDrawable->width);
- }
- if (POINT_IN_REGION (0, pict->pCompositeClip, x + dx, y + dy, &box))
- buffer[i] = fetch(bits + (y + dy)*stride, x + dx, indexed);
- else
- buffer[i] = 0;
- }
- v.vector[0] += unit.vector[0];
- v.vector[1] += unit.vector[1];
- v.vector[2] += unit.vector[2];
- }
- }
- } else {
- if (REGION_NUM_RECTS(pict->pCompositeClip) == 1) {
- box = pict->pCompositeClip->extents;
- for (i = 0; i < width; ++i) {
- if (!v.vector[2]) {
- buffer[i] = 0;
- } else {
- if (!affine) {
- y = DIV(v.vector[1],v.vector[2]);
- x = DIV(v.vector[0],v.vector[2]);
- } else {
- y = v.vector[1]>>16;
- x = v.vector[0]>>16;
- }
- buffer[i] = ((x < box.x1-dx) | (x >= box.x2-dx) | (y < box.y1-dy) | (y >= box.y2-dy)) ?
- 0 : fetch(bits + (y + dy)*stride, x + dx, indexed);
- }
- v.vector[0] += unit.vector[0];
- v.vector[1] += unit.vector[1];
- v.vector[2] += unit.vector[2];
- }
- } else {
- for (i = 0; i < width; ++i) {
- if (!v.vector[2]) {
- buffer[i] = 0;
- } else {
- if (!affine) {
- y = DIV(v.vector[1],v.vector[2]);
- x = DIV(v.vector[0],v.vector[2]);
- } else {
- y = v.vector[1]>>16;
- x = v.vector[0]>>16;
- }
- if (POINT_IN_REGION (0, pict->pCompositeClip, x + dx, y + dy, &box))
- buffer[i] = fetch(bits + (y + dy)*stride, x + dx, indexed);
- else
- buffer[i] = 0;
- }
- v.vector[0] += unit.vector[0];
- v.vector[1] += unit.vector[1];
- v.vector[2] += unit.vector[2];
- }
- }
- }
- } else if (pict->filter == PictFilterBilinear) {
- /* adjust vector for maximum contribution at 0.5, 0.5 of each texel. */
- v.vector[0] -= v.vector[2] / 2;
- v.vector[1] -= v.vector[2] / 2;
- unit.vector[0] -= unit.vector[2] / 2;
- unit.vector[1] -= unit.vector[2] / 2;
-
- if (pict->repeatType == RepeatNormal) {
- if (REGION_NUM_RECTS(pict->pCompositeClip) == 1) {
- for (i = 0; i < width; ++i) {
- if (!v.vector[2]) {
- buffer[i] = 0;
- } else {
- int x1, x2, y1, y2, distx, idistx, disty, idisty;
- FbBits *b;
- CARD32 tl, tr, bl, br, r;
- CARD32 ft, fb;
-
- if (!affine) {
- xFixed_48_16 div;
- div = ((xFixed_48_16)v.vector[0] << 16)/v.vector[2];
- x1 = div >> 16;
- distx = ((xFixed)div >> 8) & 0xff;
- div = ((xFixed_48_16)v.vector[1] << 16)/v.vector[2];
- y1 = div >> 16;
- disty = ((xFixed)div >> 8) & 0xff;
- } else {
- x1 = v.vector[0] >> 16;
- distx = (v.vector[0] >> 8) & 0xff;
- y1 = v.vector[1] >> 16;
- disty = (v.vector[1] >> 8) & 0xff;
- }
- x2 = x1 + 1;
- y2 = y1 + 1;
-
- idistx = 256 - distx;
- idisty = 256 - disty;
-
- x1 = MOD (x1, pict->pDrawable->width);
- x2 = MOD (x2, pict->pDrawable->width);
- y1 = MOD (y1, pict->pDrawable->height);
- y2 = MOD (y2, pict->pDrawable->height);
-
- b = bits + (y1 + dy)*stride;
-
- tl = fetch(b, x1 + dx, indexed);
- tr = fetch(b, x2 + dx, indexed);
- b = bits + (y2 + dy)*stride;
- bl = fetch(b, x1 + dx, indexed);
- br = fetch(b, x2 + dx, indexed);
-
- ft = FbGet8(tl,0) * idistx + FbGet8(tr,0) * distx;
- fb = FbGet8(bl,0) * idistx + FbGet8(br,0) * distx;
- r = (((ft * idisty + fb * disty) >> 16) & 0xff);
- ft = FbGet8(tl,8) * idistx + FbGet8(tr,8) * distx;
- fb = FbGet8(bl,8) * idistx + FbGet8(br,8) * distx;
- r |= (((ft * idisty + fb * disty) >> 8) & 0xff00);
- ft = FbGet8(tl,16) * idistx + FbGet8(tr,16) * distx;
- fb = FbGet8(bl,16) * idistx + FbGet8(br,16) * distx;
- r |= (((ft * idisty + fb * disty)) & 0xff0000);
- ft = FbGet8(tl,24) * idistx + FbGet8(tr,24) * distx;
- fb = FbGet8(bl,24) * idistx + FbGet8(br,24) * distx;
- r |= (((ft * idisty + fb * disty) << 8) & 0xff000000);
- buffer[i] = r;
- }
- v.vector[0] += unit.vector[0];
- v.vector[1] += unit.vector[1];
- v.vector[2] += unit.vector[2];
- }
- } else {
- for (i = 0; i < width; ++i) {
- if (!v.vector[2]) {
- buffer[i] = 0;
- } else {
- int x1, x2, y1, y2, distx, idistx, disty, idisty;
- FbBits *b;
- CARD32 tl, tr, bl, br, r;
- CARD32 ft, fb;
-
- if (!affine) {
- xFixed_48_16 div;
- div = ((xFixed_48_16)v.vector[0] << 16)/v.vector[2];
- x1 = div >> 16;
- distx = ((xFixed)div >> 8) & 0xff;
- div = ((xFixed_48_16)v.vector[1] << 16)/v.vector[2];
- y1 = div >> 16;
- disty = ((xFixed)div >> 8) & 0xff;
- } else {
- x1 = v.vector[0] >> 16;
- distx = (v.vector[0] >> 8) & 0xff;
- y1 = v.vector[1] >> 16;
- disty = (v.vector[1] >> 8) & 0xff;
- }
- x2 = x1 + 1;
- y2 = y1 + 1;
-
- idistx = 256 - distx;
- idisty = 256 - disty;
-
- x1 = MOD (x1, pict->pDrawable->width);
- x2 = MOD (x2, pict->pDrawable->width);
- y1 = MOD (y1, pict->pDrawable->height);
- y2 = MOD (y2, pict->pDrawable->height);
-
- b = bits + (y1 + dy)*stride;
-
- tl = POINT_IN_REGION(0, pict->pCompositeClip, x1 + dx, y1 + dy, &box)
- ? fetch(b, x1 + dx, indexed) : 0;
- tr = POINT_IN_REGION(0, pict->pCompositeClip, x2 + dx, y1 + dy, &box)
- ? fetch(b, x2 + dx, indexed) : 0;
- b = bits + (y2 + dy)*stride;
- bl = POINT_IN_REGION(0, pict->pCompositeClip, x1 + dx, y2 + dy, &box)
- ? fetch(b, x1 + dx, indexed) : 0;
- br = POINT_IN_REGION(0, pict->pCompositeClip, x2 + dx, y2 + dy, &box)
- ? fetch(b, x2 + dx, indexed) : 0;
-
- ft = FbGet8(tl,0) * idistx + FbGet8(tr,0) * distx;
- fb = FbGet8(bl,0) * idistx + FbGet8(br,0) * distx;
- r = (((ft * idisty + fb * disty) >> 16) & 0xff);
- ft = FbGet8(tl,8) * idistx + FbGet8(tr,8) * distx;
- fb = FbGet8(bl,8) * idistx + FbGet8(br,8) * distx;
- r |= (((ft * idisty + fb * disty) >> 8) & 0xff00);
- ft = FbGet8(tl,16) * idistx + FbGet8(tr,16) * distx;
- fb = FbGet8(bl,16) * idistx + FbGet8(br,16) * distx;
- r |= (((ft * idisty + fb * disty)) & 0xff0000);
- ft = FbGet8(tl,24) * idistx + FbGet8(tr,24) * distx;
- fb = FbGet8(bl,24) * idistx + FbGet8(br,24) * distx;
- r |= (((ft * idisty + fb * disty) << 8) & 0xff000000);
- buffer[i] = r;
- }
- v.vector[0] += unit.vector[0];
- v.vector[1] += unit.vector[1];
- v.vector[2] += unit.vector[2];
- }
- }
- } else {
- if (REGION_NUM_RECTS(pict->pCompositeClip) == 1) {
- box = pict->pCompositeClip->extents;
- for (i = 0; i < width; ++i) {
- if (!v.vector[2]) {
- buffer[i] = 0;
- } else {
- int x1, x2, y1, y2, distx, idistx, disty, idisty, x_off;
- FbBits *b;
- CARD32 tl, tr, bl, br, r;
- Bool x1_out, x2_out, y1_out, y2_out;
- CARD32 ft, fb;
-
- if (!affine) {
- xFixed_48_16 div;
- div = ((xFixed_48_16)v.vector[0] << 16)/v.vector[2];
- x1 = div >> 16;
- distx = ((xFixed)div >> 8) & 0xff;
- div = ((xFixed_48_16)v.vector[1] << 16)/v.vector[2];
- y1 = div >> 16;
- disty = ((xFixed)div >> 8) & 0xff;
- } else {
- x1 = v.vector[0] >> 16;
- distx = (v.vector[0] >> 8) & 0xff;
- y1 = v.vector[1] >> 16;
- disty = (v.vector[1] >> 8) & 0xff;
- }
- x2 = x1 + 1;
- y2 = y1 + 1;
-
- idistx = 256 - distx;
- idisty = 256 - disty;
-
- b = bits + (y1 + dy)*stride;
- x_off = x1 + dx;
-
- x1_out = (x1 < box.x1-dx) | (x1 >= box.x2-dx);
- x2_out = (x2 < box.x1-dx) | (x2 >= box.x2-dx);
- y1_out = (y1 < box.y1-dy) | (y1 >= box.y2-dy);
- y2_out = (y2 < box.y1-dy) | (y2 >= box.y2-dy);
-
- tl = x1_out|y1_out ? 0 : fetch(b, x_off, indexed);
- tr = x2_out|y1_out ? 0 : fetch(b, x_off + 1, indexed);
- b += stride;
- bl = x1_out|y2_out ? 0 : fetch(b, x_off, indexed);
- br = x2_out|y2_out ? 0 : fetch(b, x_off + 1, indexed);
-
- ft = FbGet8(tl,0) * idistx + FbGet8(tr,0) * distx;
- fb = FbGet8(bl,0) * idistx + FbGet8(br,0) * distx;
- r = (((ft * idisty + fb * disty) >> 16) & 0xff);
- ft = FbGet8(tl,8) * idistx + FbGet8(tr,8) * distx;
- fb = FbGet8(bl,8) * idistx + FbGet8(br,8) * distx;
- r |= (((ft * idisty + fb * disty) >> 8) & 0xff00);
- ft = FbGet8(tl,16) * idistx + FbGet8(tr,16) * distx;
- fb = FbGet8(bl,16) * idistx + FbGet8(br,16) * distx;
- r |= (((ft * idisty + fb * disty)) & 0xff0000);
- ft = FbGet8(tl,24) * idistx + FbGet8(tr,24) * distx;
- fb = FbGet8(bl,24) * idistx + FbGet8(br,24) * distx;
- r |= (((ft * idisty + fb * disty) << 8) & 0xff000000);
- buffer[i] = r;
- }
- v.vector[0] += unit.vector[0];
- v.vector[1] += unit.vector[1];
- v.vector[2] += unit.vector[2];
- }
- } else {
- for (i = 0; i < width; ++i) {
- if (!v.vector[2]) {
- buffer[i] = 0;
- } else {
- int x1, x2, y1, y2, distx, idistx, disty, idisty, x_off;
- FbBits *b;
- CARD32 tl, tr, bl, br, r;
- CARD32 ft, fb;
-
- if (!affine) {
- xFixed_48_16 div;
- div = ((xFixed_48_16)v.vector[0] << 16)/v.vector[2];
- x1 = div >> 16;
- distx = ((xFixed)div >> 8) & 0xff;
- div = ((xFixed_48_16)v.vector[1] << 16)/v.vector[2];
- y1 = div >> 16;
- disty = ((xFixed)div >> 8) & 0xff;
- } else {
- x1 = v.vector[0] >> 16;
- distx = (v.vector[0] >> 8) & 0xff;
- y1 = v.vector[1] >> 16;
- disty = (v.vector[1] >> 8) & 0xff;
- }
- x2 = x1 + 1;
- y2 = y1 + 1;
-
- idistx = 256 - distx;
- idisty = 256 - disty;
-
- b = bits + (y1 + dy)*stride;
- x_off = x1 + dx;
-
- tl = POINT_IN_REGION(0, pict->pCompositeClip, x1 + dx, y1 + dy, &box)
- ? fetch(b, x_off, indexed) : 0;
- tr = POINT_IN_REGION(0, pict->pCompositeClip, x2 + dx, y1 + dy, &box)
- ? fetch(b, x_off + 1, indexed) : 0;
- b += stride;
- bl = POINT_IN_REGION(0, pict->pCompositeClip, x1 + dx, y2 + dy, &box)
- ? fetch(b, x_off, indexed) : 0;
- br = POINT_IN_REGION(0, pict->pCompositeClip, x2 + dx, y2 + dy, &box)
- ? fetch(b, x_off + 1, indexed) : 0;
-
- ft = FbGet8(tl,0) * idistx + FbGet8(tr,0) * distx;
- fb = FbGet8(bl,0) * idistx + FbGet8(br,0) * distx;
- r = (((ft * idisty + fb * disty) >> 16) & 0xff);
- ft = FbGet8(tl,8) * idistx + FbGet8(tr,8) * distx;
- fb = FbGet8(bl,8) * idistx + FbGet8(br,8) * distx;
- r |= (((ft * idisty + fb * disty) >> 8) & 0xff00);
- ft = FbGet8(tl,16) * idistx + FbGet8(tr,16) * distx;
- fb = FbGet8(bl,16) * idistx + FbGet8(br,16) * distx;
- r |= (((ft * idisty + fb * disty)) & 0xff0000);
- ft = FbGet8(tl,24) * idistx + FbGet8(tr,24) * distx;
- fb = FbGet8(bl,24) * idistx + FbGet8(br,24) * distx;
- r |= (((ft * idisty + fb * disty) << 8) & 0xff000000);
- buffer[i] = r;
- }
- v.vector[0] += unit.vector[0];
- v.vector[1] += unit.vector[1];
- v.vector[2] += unit.vector[2];
- }
- }
- }
- } else if (pict->filter == PictFilterConvolution) {
- xFixed *params = pict->filter_params;
- INT32 cwidth = xFixedToInt(params[0]);
- INT32 cheight = xFixedToInt(params[1]);
- int xoff = (params[0] - xFixed1) >> 1;
- int yoff = (params[1] - xFixed1) >> 1;
- params += 2;
- for (i = 0; i < width; ++i) {
- if (!v.vector[2]) {
- buffer[i] = 0;
- } else {
- int x1, x2, y1, y2, x, y;
- INT32 srtot, sgtot, sbtot, satot;
- xFixed *p = params;
-
- if (!affine) {
- xFixed_48_16 tmp;
- tmp = ((xFixed_48_16)v.vector[0] << 16)/v.vector[2] - xoff;
- x1 = xFixedToInt(tmp);
- tmp = ((xFixed_48_16)v.vector[1] << 16)/v.vector[2] - yoff;
- y1 = xFixedToInt(tmp);
- } else {
- x1 = xFixedToInt(v.vector[0] - xoff);
- y1 = xFixedToInt(v.vector[1] - yoff);
- }
- x2 = x1 + cwidth;
- y2 = y1 + cheight;
-
- srtot = sgtot = sbtot = satot = 0;
-
- for (y = y1; y < y2; y++) {
- int ty = (pict->repeatType == RepeatNormal) ? MOD (y, pict->pDrawable->height) : y;
- for (x = x1; x < x2; x++) {
- if (*p) {
- int tx = (pict->repeatType == RepeatNormal) ? MOD (x, pict->pDrawable->width) : x;
- if (POINT_IN_REGION (0, pict->pCompositeClip, tx + dx, ty + dy, &box)) {
- FbBits *b = bits + (ty + dy)*stride;
- CARD32 c = fetch(b, tx + dx, indexed);
-
- srtot += Red(c) * *p;
- sgtot += Green(c) * *p;
- sbtot += Blue(c) * *p;
- satot += Alpha(c) * *p;
- }
- }
- p++;
- }
- }
-
- satot >>= 16;
- srtot >>= 16;
- sgtot >>= 16;
- sbtot >>= 16;
-
- if (satot < 0) satot = 0; else if (satot > 0xff) satot = 0xff;
- if (srtot < 0) srtot = 0; else if (srtot > 0xff) srtot = 0xff;
- if (sgtot < 0) sgtot = 0; else if (sgtot > 0xff) sgtot = 0xff;
- if (sbtot < 0) sbtot = 0; else if (sbtot > 0xff) sbtot = 0xff;
-
- buffer[i] = ((satot << 24) |
- (srtot << 16) |
- (sgtot << 8) |
- (sbtot ));
- }
- v.vector[0] += unit.vector[0];
- v.vector[1] += unit.vector[1];
- v.vector[2] += unit.vector[2];
- }
- }
-}
-
-
-static void fbFetchExternalAlpha(PicturePtr pict, int x, int y, int width, CARD32 *buffer)
-{
- int i;
- CARD32 _alpha_buffer[SCANLINE_BUFFER_LENGTH];
- CARD32 *alpha_buffer = _alpha_buffer;
-
- if (!pict->alphaMap) {
- fbFetchTransformed(pict, x, y, width, buffer);
- return;
- }
- if (width > SCANLINE_BUFFER_LENGTH)
- alpha_buffer = (CARD32 *) malloc(width*sizeof(CARD32));
-
- fbFetchTransformed(pict, x, y, width, buffer);
- fbFetchTransformed(pict->alphaMap, x - pict->alphaOrigin.x, y - pict->alphaOrigin.y, width, alpha_buffer);
- for (i = 0; i < width; ++i) {
- int a = alpha_buffer[i]>>24;
- buffer[i] = (a << 24)
- | (div_255(Red(buffer[i]) * a) << 16)
- | (div_255(Green(buffer[i]) * a) << 8)
- | (div_255(Blue(buffer[i]) * a));
- }
-
- if (alpha_buffer != _alpha_buffer)
- free(alpha_buffer);
-}
-
-static void fbStore(PicturePtr pict, int x, int y, int width, CARD32 *buffer)
-{
- FbBits *bits;
- FbStride stride;
- int bpp;
- int xoff, yoff;
- storeProc store = storeProcForPicture(pict);
- miIndexedPtr indexed = (miIndexedPtr) pict->pFormat->index.devPrivate;
-
- fbGetDrawable (pict->pDrawable, bits, stride, bpp, xoff, yoff);
- x += xoff;
- y += yoff;
-
- bits += y*stride;
- store(bits, buffer, x, width, indexed);
-}
-
-static void fbStoreExternalAlpha(PicturePtr pict, int x, int y, int width, CARD32 *buffer)
-{
- FbBits *bits, *alpha_bits;
- FbStride stride, astride;
- int bpp, abpp;
- int xoff, yoff;
- int ax, ay;
- storeProc store;
- storeProc astore;
- miIndexedPtr indexed = (miIndexedPtr) pict->pFormat->index.devPrivate;
- miIndexedPtr aindexed;
-
- if (!pict->alphaMap) {
- fbStore(pict, x, y, width, buffer);
- return;
- }
-
- store = storeProcForPicture(pict);
- astore = storeProcForPicture(pict->alphaMap);
- aindexed = (miIndexedPtr) pict->alphaMap->pFormat->index.devPrivate;
-
- ax = x;
- ay = y;
-
- fbGetDrawable (pict->pDrawable, bits, stride, bpp, xoff, yoff);
- x += xoff;
- y += yoff;
- fbGetDrawable (pict->alphaMap->pDrawable, alpha_bits, astride, abpp, xoff, yoff);
- ax += xoff;
- ay += yoff;
-
- bits += y*stride;
- alpha_bits += (ay - pict->alphaOrigin.y)*astride;
-
-
- store(bits, buffer, x, width, indexed);
- astore(alpha_bits, buffer, ax - pict->alphaOrigin.x, width, aindexed);
-}
-
-typedef void (*scanStoreProc)(PicturePtr , int , int , int , CARD32 *);
-typedef void (*scanFetchProc)(PicturePtr , int , int , int , CARD32 *);
-
-static void
-fbCompositeRect (const FbComposeData *data, CARD32 *scanline_buffer)
-{
- CARD32 *src_buffer = scanline_buffer;
- CARD32 *dest_buffer = src_buffer + data->width;
- int i;
- scanStoreProc store;
- scanFetchProc fetchSrc = NULL, fetchMask = NULL, fetchDest = NULL;
-
- if (data->op == PictOpClear)
- fetchSrc = NULL;
- else if (!data->src->pDrawable) {
- if (data->src->pSourcePict)
- fetchSrc = fbFetchSourcePict;
- } else if (data->src->alphaMap)
- fetchSrc = fbFetchExternalAlpha;
- else if (data->src->repeatType == RepeatNormal &&
- data->src->pDrawable->width == 1 && data->src->pDrawable->height == 1)
- fetchSrc = fbFetchSolid;
- else if (!data->src->transform && data->src->filter != PictFilterConvolution)
- fetchSrc = fbFetch;
- else
- fetchSrc = fbFetchTransformed;
-
- if (data->mask && data->op != PictOpClear) {
- if (!data->mask->pDrawable) {
- if (data->mask->pSourcePict)
- fetchMask = fbFetchSourcePict;
- } else if (data->mask->alphaMap)
- fetchMask = fbFetchExternalAlpha;
- else if (data->mask->repeatType == RepeatNormal
- && data->mask->pDrawable->width == 1 && data->mask->pDrawable->height == 1)
- fetchMask = fbFetchSolid;
- else if (!data->mask->transform && data->mask->filter != PictFilterConvolution)
- fetchMask = fbFetch;
- else
- fetchMask = fbFetchTransformed;
- } else {
- fetchMask = NULL;
- }
-
- if (data->dest->alphaMap) {
- fetchDest = fbFetchExternalAlpha;
- store = fbStoreExternalAlpha;
- } else {
- fetchDest = fbFetch;
- store = fbStore;
- }
- if (data->op == PictOpClear || data->op == PictOpSrc)
- fetchDest = NULL;
-
- if (fetchSrc && fetchMask && data->mask && data->mask->componentAlpha && PICT_FORMAT_RGB(data->mask->format)) {
- CARD32 *mask_buffer = dest_buffer + data->width;
- CombineFuncC compose = composeFunctions.combineC[data->op];
- if (!compose)
- return;
-
- for (i = 0; i < data->height; ++i)
- {
- /* fill first half of scanline with source */
- fetchSrc(data->src, data->xSrc, data->ySrc + i, data->width, src_buffer);
- fetchMask(data->mask, data->xMask, data->yMask + i, data->width, mask_buffer);
-
- /* fill dest into second half of scanline */
- if (fetchDest)
- fetchDest(data->dest, data->xDest, data->yDest + i, data->width, dest_buffer);
-
- /* blend */
- compose(dest_buffer, src_buffer, mask_buffer, data->width);
-
- /* write back */
- store(data->dest, data->xDest, data->yDest + i, data->width, dest_buffer);
- }
- } else {
-
- CombineFuncU compose = composeFunctions.combineU[data->op];
- if (!compose)
- return;
-
- if (fetchSrc == fbFetchSolid && (!fetchMask || fetchMask == fbFetchSolid)) {
- fetchSrc(data->src, data->xSrc, data->ySrc, data->width, src_buffer);
- if (fetchMask) {
- fetchMask(data->mask, data->xMask, data->yMask, data->width, dest_buffer);
- composeFunctions.combineMaskU(src_buffer, dest_buffer, data->width);
- }
- fetchSrc = NULL;
- fetchMask = NULL;
- }
-
- for (i = 0; i < data->height; ++i)
- {
- /* fill first half of scanline with source */
- if (fetchSrc) {
- fetchSrc(data->src, data->xSrc, data->ySrc + i, data->width, src_buffer);
-
- /* add in mask */
- if (fetchMask) {
- fetchMask(data->mask, data->xMask, data->yMask + i, data->width, dest_buffer);
- composeFunctions.combineMaskU(src_buffer, dest_buffer, data->width);
- }
- }
-
- /* fill dest into second half of scanline */
- if (fetchDest)
- fetchDest(data->dest, data->xDest, data->yDest + i, data->width, dest_buffer);
-
- /* blend */
- compose(dest_buffer, src_buffer, data->width);
-
- /* write back */
- store(data->dest, data->xDest, data->yDest + i, data->width, dest_buffer);
- }
- }
-}
-
-void
-fbCompositeGeneral (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- RegionRec region;
- int n;
- BoxPtr pbox;
- Bool srcRepeat = FALSE;
- Bool maskRepeat = FALSE;
- int w, h;
- CARD32 _scanline_buffer[SCANLINE_BUFFER_LENGTH*3];
- CARD32 *scanline_buffer = _scanline_buffer;
- FbComposeData compose_data;
-
- if (pSrc->pDrawable)
- srcRepeat = pSrc->repeatType == RepeatNormal && !pSrc->transform
- && (pSrc->pDrawable->width != 1 || pSrc->pDrawable->height != 1);
-
- if (pMask && pMask->pDrawable)
- maskRepeat = pMask->repeatType == RepeatNormal && !pMask->transform
- && (pMask->pDrawable->width != 1 || pMask->pDrawable->height != 1);
-
- if (op == PictOpOver && !pMask && !pSrc->transform && !PICT_FORMAT_A(pSrc->format) && !pSrc->alphaMap)
- op = PictOpSrc;
-
- if (!miComputeCompositeRegion (&region,
- pSrc,
- pMask,
- pDst,
- xSrc,
- ySrc,
- xMask,
- yMask,
- xDst,
- yDst,
- width,
- height))
- return;
-
- compose_data.op = op;
- compose_data.src = pSrc;
- compose_data.mask = pMask;
- compose_data.dest = pDst;
- if (width > SCANLINE_BUFFER_LENGTH)
- scanline_buffer = (CARD32 *) malloc(width * 3 * sizeof(CARD32));
-
- n = REGION_NUM_RECTS (&region);
- pbox = REGION_RECTS (&region);
- while (n--)
- {
- h = pbox->y2 - pbox->y1;
- compose_data.ySrc = pbox->y1 - yDst + ySrc;
- compose_data.yMask = pbox->y1 - yDst + yMask;
- compose_data.yDest = pbox->y1;
- while (h)
- {
- compose_data.height = h;
- w = pbox->x2 - pbox->x1;
- compose_data.xSrc = pbox->x1 - xDst + xSrc;
- compose_data.xMask = pbox->x1 - xDst + xMask;
- compose_data.xDest = pbox->x1;
- if (maskRepeat)
- {
- compose_data.yMask = mod (compose_data.yMask, pMask->pDrawable->height);
- if (compose_data.height > pMask->pDrawable->height - compose_data.yMask)
- compose_data.height = pMask->pDrawable->height - compose_data.yMask;
- }
- if (srcRepeat)
- {
- compose_data.ySrc = mod (compose_data.ySrc, pSrc->pDrawable->height);
- if (compose_data.height > pSrc->pDrawable->height - compose_data.ySrc)
- compose_data.height = pSrc->pDrawable->height - compose_data.ySrc;
- }
- while (w)
- {
- compose_data.width = w;
- if (maskRepeat)
- {
- compose_data.xMask = mod (compose_data.xMask, pMask->pDrawable->width);
- if (compose_data.width > pMask->pDrawable->width - compose_data.xMask)
- compose_data.width = pMask->pDrawable->width - compose_data.xMask;
- }
- if (srcRepeat)
- {
- compose_data.xSrc = mod (compose_data.xSrc, pSrc->pDrawable->width);
- if (compose_data.width > pSrc->pDrawable->width - compose_data.xSrc)
- compose_data.width = pSrc->pDrawable->width - compose_data.xSrc;
- }
- fbCompositeRect(&compose_data, scanline_buffer);
- w -= compose_data.width;
- compose_data.xSrc += compose_data.width;
- compose_data.xMask += compose_data.width;
- compose_data.xDest += compose_data.width;
- }
- h -= compose_data.height;
- compose_data.ySrc += compose_data.height;
- compose_data.yMask += compose_data.height;
- compose_data.yDest += compose_data.height;
- }
- pbox++;
- }
- REGION_UNINIT (pDst->pDrawable->pScreen, &region);
-
- if (scanline_buffer != _scanline_buffer)
- free(scanline_buffer);
-}
-
-#endif
diff --git a/fb/fbcopy.c b/fb/fbcopy.c
index 0d1cb7faf..68f403f3f 100644
--- a/fb/fbcopy.c
+++ b/fb/fbcopy.c
@@ -1,6 +1,4 @@
/*
- * Id: fbcopy.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -29,7 +27,6 @@
#include <stdlib.h>
#include "fb.h"
-#include "fbmmx.h"
void
fbCopyNtoN (DrawablePtr pSrcDrawable,
@@ -60,21 +57,17 @@ fbCopyNtoN (DrawablePtr pSrcDrawable,
while (nbox--)
{
-#ifdef USE_MMX
+#ifndef FB_ACCESS_WRAPPER /* pixman_blt() doesn't support accessors yet */
if (pm == FB_ALLONES && alu == GXcopy && !reverse &&
- !upsidedown && fbHaveMMX())
+ !upsidedown)
{
- if (!fbCopyAreammx (pSrcDrawable,
- pDstDrawable,
-
- (pbox->x1 + dx),
- (pbox->y1 + dy),
-
- (pbox->x1),
- (pbox->y1),
-
- (pbox->x2 - pbox->x1),
- (pbox->y2 - pbox->y1)))
+ if (!pixman_blt ((uint32_t *)src, (uint32_t *)dst, srcStride, dstStride, srcBpp, dstBpp,
+ (pbox->x1 + dx + srcXoff),
+ (pbox->y1 + dy + srcYoff),
+ (pbox->x1 + dstXoff),
+ (pbox->y1 + dstYoff),
+ (pbox->x2 - pbox->x1),
+ (pbox->y2 - pbox->y1)))
goto fallback;
else
goto next;
@@ -98,11 +91,13 @@ fbCopyNtoN (DrawablePtr pSrcDrawable,
reverse,
upsidedown);
-#ifdef USE_MMX
+#ifndef FB_ACCESS_WRAPPER
next:
#endif
pbox++;
}
+ fbFinishAccess (pDstDrawable);
+ fbFinishAccess (pSrcDrawable);
}
void
@@ -173,6 +168,9 @@ fbCopy1toN (DrawablePtr pSrcDrawable,
}
pbox++;
}
+
+ fbFinishAccess (pDstDrawable);
+ fbFinishAccess (pSrcDrawable);
}
void
@@ -221,6 +219,8 @@ fbCopyNto1 (DrawablePtr pSrcDrawable,
(FbStip) pPriv->and, (FbStip) pPriv->xor,
(FbStip) pPriv->bgand, (FbStip) pPriv->bgxor,
bitplane);
+ fbFinishAccess (pDstDrawable);
+ fbFinishAccess (pSrcDrawable);
}
else
{
@@ -281,6 +281,9 @@ fbCopyNto1 (DrawablePtr pSrcDrawable,
pPriv->and, pPriv->xor,
pPriv->bgand, pPriv->bgxor);
xfree (tmp);
+
+ fbFinishAccess (pDstDrawable);
+ fbFinishAccess (pSrcDrawable);
}
pbox++;
}
diff --git a/fb/fbedge.c b/fb/fbedge.c
deleted file mode 100644
index b6ca829a4..000000000
--- a/fb/fbedge.c
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
- * $Id$
- *
- * Copyright © 2004 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include <string.h>
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "fb.h"
-
-#ifdef RENDER
-
-#include "picturestr.h"
-#include "mipict.h"
-#include "renderedge.h"
-#include "fbpict.h"
-
-/*
- * 4 bit alpha
- */
-
-#define N_BITS 4
-#define rasterizeEdges fbRasterizeEdges4
-
-#if BITMAP_BIT_ORDER == LSBFirst
-#define Shift4(o) ((o) << 2)
-#else
-#define Shift4(o) ((1-(o)) << 2)
-#endif
-
-#define Get4(x,o) (((x) >> Shift4(o)) & 0xf)
-#define Put4(x,o,v) (((x) & ~(0xf << Shift4(o))) | (((v) & 0xf) << Shift4(o)))
-
-#define DefineAlpha(line,x) \
- CARD8 *__ap = (CARD8 *) line + ((x) >> 1); \
- int __ao = (x) & 1
-
-#define StepAlpha ((__ap += __ao), (__ao ^= 1))
-
-#define AddAlpha(a) { \
- CARD8 __o = *__ap; \
- CARD8 __a = (a) + Get4(__o, __ao); \
- *__ap = Put4 (__o, __ao, __a | (0 - ((__a) >> 4))); \
-}
-
-#include "fbedgeimp.h"
-
-#undef AddAlpha
-#undef StepAlpha
-#undef DefineAlpha
-#undef rasterizeEdges
-#undef N_BITS
-
-
-/*
- * 1 bit alpha
- */
-
-#define N_BITS 1
-#define rasterizeEdges fbRasterizeEdges1
-
-#include "fbedgeimp.h"
-
-#undef rasterizeEdges
-#undef N_BITS
-
-/*
- * 8 bit alpha
- */
-
-static INLINE CARD8
-clip255 (int x)
-{
- if (x > 255) return 255;
- return x;
-}
-
-static INLINE void
-add_saturate_8 (CARD8 *buf, int value, int length)
-{
- while (length--)
- {
- *buf = clip255 (*buf + value);
- buf++;
- }
-}
-
-/*
- * We want to detect the case where we add the same value to a long
- * span of pixels. The triangles on the end are filled in while we
- * count how many sub-pixel scanlines contribute to the middle section.
- *
- * +--------------------------+
- * fill_height =| \ /
- * +------------------+
- * |================|
- * fill_start fill_end
- */
-static void
-fbRasterizeEdges8 (FbBits *buf,
- int width,
- int stride,
- RenderEdge *l,
- RenderEdge *r,
- xFixed t,
- xFixed b)
-{
- xFixed y = t;
- FbBits *line;
- int fill_start = -1, fill_end = -1;
- int fill_size = 0;
-
- line = buf + xFixedToInt (y) * stride;
-
- for (;;)
- {
- CARD8 *ap = (CARD8 *) line;
- xFixed lx, rx;
- int lxi, rxi;
-
- /* clip X */
- lx = l->x;
- if (lx < 0)
- lx = 0;
- rx = r->x;
- if (xFixedToInt (rx) >= width)
- rx = IntToxFixed (width);
-
- /* Skip empty (or backwards) sections */
- if (rx > lx)
- {
- int lxs, rxs;
-
- /* Find pixel bounds for span. */
- lxi = xFixedToInt (lx);
- rxi = xFixedToInt (rx);
-
- /* Sample coverage for edge pixels */
- lxs = RenderSamplesX (lx, 8);
- rxs = RenderSamplesX (rx, 8);
-
- /* Add coverage across row */
- if (lxi == rxi)
- {
- ap[lxi] = clip255 (ap[lxi] + rxs - lxs);
- }
- else
- {
- ap[lxi] = clip255 (ap[lxi] + N_X_FRAC(8) - lxs);
-
- /* Move forward so that lxi/rxi is the pixel span */
- lxi++;
-
- /* Don't bother trying to optimize the fill unless
- * the span is longer than 4 pixels. */
- if (rxi - lxi > 4)
- {
- if (fill_start < 0)
- {
- fill_start = lxi;
- fill_end = rxi;
- fill_size++;
- }
- else
- {
- if (lxi >= fill_end || rxi < fill_start)
- {
- /* We're beyond what we saved, just fill it */
- add_saturate_8 (ap + fill_start,
- fill_size * N_X_FRAC(8),
- fill_end - fill_start);
- fill_start = lxi;
- fill_end = rxi;
- fill_size = 1;
- }
- else
- {
- /* Update fill_start */
- if (lxi > fill_start)
- {
- add_saturate_8 (ap + fill_start,
- fill_size * N_X_FRAC(8),
- lxi - fill_start);
- fill_start = lxi;
- }
- else if (lxi < fill_start)
- {
- add_saturate_8 (ap + lxi, N_X_FRAC(8),
- fill_start - lxi);
- }
-
- /* Update fill_end */
- if (rxi < fill_end)
- {
- add_saturate_8 (ap + rxi,
- fill_size * N_X_FRAC(8),
- fill_end - rxi);
- fill_end = rxi;
- }
- else if (fill_end < rxi)
- {
- add_saturate_8 (ap + fill_end,
- N_X_FRAC(8),
- rxi - fill_end);
- }
- fill_size++;
- }
- }
- }
- else
- {
- add_saturate_8 (ap + lxi, N_X_FRAC(8), rxi - lxi);
- }
-
- /* Do not add in a 0 alpha here. This check is
- * necessary to avoid a buffer overrun, (when rx
- * is exactly on a pixel boundary). */
- if (rxs)
- ap[rxi] = clip255 (ap[rxi] + rxs);
- }
- }
-
- if (y == b) {
- /* We're done, make sure we clean up any remaining fill. */
- if (fill_start != fill_end) {
- if (fill_size == N_Y_FRAC(8))
- {
- memset (ap + fill_start, 0xff, fill_end - fill_start);
- }
- else
- {
- add_saturate_8 (ap + fill_start, fill_size * N_X_FRAC(8),
- fill_end - fill_start);
- }
- }
- break;
- }
-
- if (xFixedFrac (y) != Y_FRAC_LAST(8))
- {
- RenderEdgeStepSmall (l);
- RenderEdgeStepSmall (r);
- y += STEP_Y_SMALL(8);
- }
- else
- {
- RenderEdgeStepBig (l);
- RenderEdgeStepBig (r);
- y += STEP_Y_BIG(8);
- if (fill_start != fill_end)
- {
- if (fill_size == N_Y_FRAC(8))
- {
- memset (ap + fill_start, 0xff, fill_end - fill_start);
- }
- else
- {
- add_saturate_8 (ap + fill_start, fill_size * N_X_FRAC(8),
- fill_end - fill_start);
- }
- fill_start = fill_end = -1;
- fill_size = 0;
- }
- line += stride;
- }
- }
-}
-
-void
-fbRasterizeEdges (FbBits *buf,
- int bpp,
- int width,
- int stride,
- RenderEdge *l,
- RenderEdge *r,
- xFixed t,
- xFixed b)
-{
- switch (bpp) {
- case 1:
- fbRasterizeEdges1 (buf, width, stride, l, r, t, b);
- break;
- case 4:
- fbRasterizeEdges4 (buf, width, stride, l, r, t, b);
- break;
- case 8:
- fbRasterizeEdges8 (buf, width, stride, l, r, t, b);
- break;
- }
-}
-
-#endif /* RENDER */
diff --git a/fb/fbedgeimp.h b/fb/fbedgeimp.h
deleted file mode 100644
index 877393516..000000000
--- a/fb/fbedgeimp.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * $Id$
- *
- * Copyright © 2004 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#ifndef rasterizeSpan
-#endif
-
-static void
-rasterizeEdges (FbBits *buf,
- int width,
- int stride,
- RenderEdge *l,
- RenderEdge *r,
- xFixed t,
- xFixed b)
-{
- xFixed y = t;
- FbBits *line;
-
- line = buf + xFixedToInt (y) * stride;
-
- for (;;)
- {
- xFixed lx, rx;
- int lxi, rxi;
-
- /* clip X */
- lx = l->x;
- if (lx < 0)
- lx = 0;
- rx = r->x;
- if (xFixedToInt (rx) >= width)
- rx = IntToxFixed (width);
-
- /* Skip empty (or backwards) sections */
- if (rx > lx)
- {
-
- /* Find pixel bounds for span */
- lxi = xFixedToInt (lx);
- rxi = xFixedToInt (rx);
-
-#if N_BITS == 1
- {
- FbBits *a = line;
- FbBits startmask, endmask;
- int nmiddle;
- int width = rxi - lxi;
- int x = lxi;
-
- a += x >> FB_SHIFT;
- x &= FB_MASK;
-
- FbMaskBits (x, width, startmask, nmiddle, endmask);
- if (startmask)
- *a++ |= startmask;
- while (nmiddle--)
- *a++ = FB_ALLONES;
- if (endmask)
- *a |= endmask;
- }
-#else
- {
- DefineAlpha(line,lxi);
- int lxs, rxs;
-
- /* Sample coverage for edge pixels */
- lxs = RenderSamplesX (lx, N_BITS);
- rxs = RenderSamplesX (rx, N_BITS);
-
- /* Add coverage across row */
- if (lxi == rxi)
- {
- AddAlpha (rxs - lxs);
- }
- else
- {
- int xi;
-
- AddAlpha (N_X_FRAC(N_BITS) - lxs);
- StepAlpha;
- for (xi = lxi + 1; xi < rxi; xi++)
- {
- AddAlpha (N_X_FRAC(N_BITS));
- StepAlpha;
- }
- /* Do not add in a 0 alpha here. This check is necessary
- * to avoid a buffer overrun when rx is exactly on a pixel
- * boundary.
- */
- if (rxs != 0)
- AddAlpha (rxs);
- }
- }
-#endif
- }
-
- if (y == b)
- break;
-
-#if N_BITS > 1
- if (xFixedFrac (y) != Y_FRAC_LAST(N_BITS))
- {
- RenderEdgeStepSmall (l);
- RenderEdgeStepSmall (r);
- y += STEP_Y_SMALL(N_BITS);
- }
- else
-#endif
- {
- RenderEdgeStepBig (l);
- RenderEdgeStepBig (r);
- y += STEP_Y_BIG(N_BITS);
- line += stride;
- }
- }
-}
-
-#undef rasterizeSpan
diff --git a/fb/fbfill.c b/fb/fbfill.c
index ad5025c84..831b1ce76 100644
--- a/fb/fbfill.c
+++ b/fb/fbfill.c
@@ -1,6 +1,4 @@
/*
- * Id: fbfill.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -27,7 +25,6 @@
#endif
#include "fb.h"
-#include "fbmmx.h"
void
fbFill (DrawablePtr pDrawable,
@@ -47,17 +44,18 @@ fbFill (DrawablePtr pDrawable,
switch (pGC->fillStyle) {
case FillSolid:
-#ifdef USE_MMX
- if (!pPriv->and && fbHaveMMX())
- if (fbSolidFillmmx (pDrawable, x, y, width, height, pPriv->xor))
- return;
+#ifndef FB_ACCESS_WRAPPER
+ if (pPriv->and || !pixman_fill ((uint32_t *)dst, dstStride, dstBpp,
+ x + dstXoff, y + dstYoff,
+ width, height,
+ pPriv->xor))
#endif
- fbSolid (dst + (y + dstYoff) * dstStride,
- dstStride,
- (x + dstXoff) * dstBpp,
- dstBpp,
- width * dstBpp, height,
- pPriv->and, pPriv->xor);
+ fbSolid (dst + (y + dstYoff) * dstStride,
+ dstStride,
+ (x + dstXoff) * dstBpp,
+ dstBpp,
+ width * dstBpp, height,
+ pPriv->and, pPriv->xor);
break;
case FillStippled:
case FillOpaqueStippled: {
@@ -92,6 +90,7 @@ fbFill (DrawablePtr pDrawable,
(pGC->patOrg.x + pDrawable->x + dstXoff),
pGC->patOrg.y + pDrawable->y - y);
+ fbFinishAccess (&pStip->drawable);
}
else
{
@@ -129,6 +128,7 @@ fbFill (DrawablePtr pDrawable,
bgand, bgxor,
pGC->patOrg.x + pDrawable->x + dstXoff,
pGC->patOrg.y + pDrawable->y - y);
+ fbFinishAccess (&pStip->drawable);
}
break;
}
@@ -157,10 +157,12 @@ fbFill (DrawablePtr pDrawable,
dstBpp,
(pGC->patOrg.x + pDrawable->x + dstXoff) * dstBpp,
pGC->patOrg.y + pDrawable->y - y);
+ fbFinishAccess (&pTile->drawable);
break;
}
}
fbValidateDrawable (pDrawable);
+ fbFinishAccess (pDrawable);
}
void
@@ -209,23 +211,20 @@ fbSolidBoxClipped (DrawablePtr pDrawable,
if (partY2 <= partY1)
continue;
-#ifdef USE_MMX
- if (!and && fbHaveMMX())
- {
- if (fbSolidFillmmx (pDrawable,
- partX1, partY1,
- (partX2 - partX1), (partY2 - partY1),
- xor))
- return;
- }
+#ifndef FB_ACCESS_WRAPPER
+ if (and || !pixman_fill ((uint32_t *)dst, dstStride, dstBpp,
+ partX1 + dstXoff, partY1 + dstYoff,
+ (partX2 - partX1), (partY2 - partY1),
+ xor))
#endif
- fbSolid (dst + (partY1 + dstYoff) * dstStride,
- dstStride,
- (partX1 + dstXoff) * dstBpp,
- dstBpp,
-
- (partX2 - partX1) * dstBpp,
- (partY2 - partY1),
- and, xor);
+ fbSolid (dst + (partY1 + dstYoff) * dstStride,
+ dstStride,
+ (partX1 + dstXoff) * dstBpp,
+ dstBpp,
+
+ (partX2 - partX1) * dstBpp,
+ (partY2 - partY1),
+ and, xor);
}
+ fbFinishAccess (pDrawable);
}
diff --git a/fb/fbfillrect.c b/fb/fbfillrect.c
index f404044c5..4e4edb3fd 100644
--- a/fb/fbfillrect.c
+++ b/fb/fbfillrect.c
@@ -1,6 +1,4 @@
/*
- * Id: fbfillrect.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
diff --git a/fb/fbfillsp.c b/fb/fbfillsp.c
index 77e4772a6..5d2147213 100644
--- a/fb/fbfillsp.c
+++ b/fb/fbfillsp.c
@@ -1,6 +1,4 @@
/*
- * Id: fbfillsp.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
diff --git a/fb/fbgc.c b/fb/fbgc.c
index 5b5581093..fda391b14 100644
--- a/fb/fbgc.c
+++ b/fb/fbgc.c
@@ -1,6 +1,4 @@
/*
- * Id: fbgc.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -106,16 +104,18 @@ fbPadPixmap (PixmapPtr pPixmap)
mask = FbBitsMask (0, width);
while (height--)
{
- b = *bits & mask;
+ b = READ(bits) & mask;
w = width;
while (w < FB_UNIT)
{
b = b | FbScrRight(b, w);
w <<= 1;
}
- *bits = b;
+ WRITE(bits, b);
bits += stride;
}
+
+ fbFinishAccess (&pPixmap->drawable);
}
/*
@@ -153,7 +153,7 @@ fbLineRepeat (FbBits *bits, int len, int width)
width = (width + FB_UNIT-1) >> FB_SHIFT;
bits++;
while (--width)
- if (*bits != first)
+ if (READ(bits) != first)
return FALSE;
return TRUE;
}
@@ -183,10 +183,13 @@ fbCanEvenStipple (PixmapPtr pStipple, int bpp)
/* check to see that the stipple repeats horizontally */
while (h--)
{
- if (!fbLineRepeat (bits, len, pStipple->drawable.width))
+ if (!fbLineRepeat (bits, len, pStipple->drawable.width)) {
+ fbFinishAccess (&pStipple->drawable);
return FALSE;
+ }
bits += stride;
}
+ fbFinishAccess (&pStipple->drawable);
return TRUE;
}
diff --git a/fb/fbgetsp.c b/fb/fbgetsp.c
index f77ea8c52..6402c6c38 100644
--- a/fb/fbgetsp.c
+++ b/fb/fbgetsp.c
@@ -1,6 +1,4 @@
/*
- * Id: fbgetsp.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -84,4 +82,6 @@ fbGetSpans(DrawablePtr pDrawable,
ppt++;
pwidth++;
}
+
+ fbFinishAccess (pDrawable);
}
diff --git a/fb/fbglyph.c b/fb/fbglyph.c
index 8e819401b..2c19b742f 100644
--- a/fb/fbglyph.c
+++ b/fb/fbglyph.c
@@ -62,11 +62,11 @@ fbGlyphIn (RegionPtr pRegion,
#ifdef FB_24BIT
#ifndef FBNOPIXADDR
-#define WRITE1(d,n,fg) ((d)[n] = (CARD8) fg)
-#define WRITE2(d,n,fg) (*(CARD16 *) &(d[n]) = (CARD16) fg)
-#define WRITE4(d,n,fg) (*(CARD32 *) &(d[n]) = (CARD32) fg)
+#define WRITE1(d,n,fg) WRITE((d) + (n), (CARD8) fg)
+#define WRITE2(d,n,fg) WRITE((CARD16 *) &(d[n]), (CARD16) fg)
+#define WRITE4(d,n,fg) WRITE((CARD32 *) &(d[n]), (CARD32) fg)
#if FB_UNIT == 6 && IMAGE_BYTE_ORDER == LSBFirst
-#define WRITE8(d) (*(FbBits *) &(d[0]) = fg)
+#define WRITE8(d) WRITE((FbBits *) &(d[0]), fg)
#else
#define WRITE8(d) WRITE4(d,0,_ABCA), WRITE4(d,4,_BCAB)
#endif
@@ -157,7 +157,7 @@ fbGlyph24 (FbBits *dstBits,
lshift = 4 - shift;
while (height--)
{
- bits = *stipple++;
+ bits = READ(stipple++);
n = lshift;
dst = dstLine;
while (bits)
@@ -284,7 +284,7 @@ fbPolyGlyphBlt (DrawablePtr pDrawable,
glyph = 0;
if (pGC->fillStyle == FillSolid && pPriv->and == 0)
{
- fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
+ dstBpp = pDrawable->bitsPerPixel;
switch (dstBpp) {
case 8: glyph = fbGlyph8; break;
case 16: glyph = fbGlyph16; break;
@@ -312,6 +312,7 @@ fbPolyGlyphBlt (DrawablePtr pDrawable,
if (glyph && gWidth <= sizeof (FbStip) * 8 &&
fbGlyphIn (fbGetCompositeClip(pGC), gx, gy, gWidth, gHeight))
{
+ fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
(*glyph) (dst + (gy + dstYoff) * dstStride,
dstStride,
dstBpp,
@@ -319,6 +320,7 @@ fbPolyGlyphBlt (DrawablePtr pDrawable,
pPriv->xor,
gx + dstXoff,
gHeight);
+ fbFinishAccess (pDrawable);
}
else
#endif
@@ -375,7 +377,7 @@ fbImageGlyphBlt (DrawablePtr pDrawable,
glyph = 0;
if (pPriv->and == 0)
{
- fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
+ dstBpp = pDrawable->bitsPerPixel;
switch (dstBpp) {
case 8: glyph = fbGlyph8; break;
case 16: glyph = fbGlyph16; break;
@@ -443,6 +445,7 @@ fbImageGlyphBlt (DrawablePtr pDrawable,
if (glyph && gWidth <= sizeof (FbStip) * 8 &&
fbGlyphIn (fbGetCompositeClip(pGC), gx, gy, gWidth, gHeight))
{
+ fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
(*glyph) (dst + (gy + dstYoff) * dstStride,
dstStride,
dstBpp,
@@ -450,6 +453,7 @@ fbImageGlyphBlt (DrawablePtr pDrawable,
pPriv->fg,
gx + dstXoff,
gHeight);
+ fbFinishAccess (pDrawable);
}
else
#endif
diff --git a/fb/fbimage.c b/fb/fbimage.c
index 3b4a07c3d..2b9ac27c0 100644
--- a/fb/fbimage.c
+++ b/fb/fbimage.c
@@ -1,6 +1,4 @@
/*
- * Id: fbimage.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -170,6 +168,8 @@ fbPutZImage (DrawablePtr pDrawable,
pm,
dstBpp);
}
+
+ fbFinishAccess (pDrawable);
}
void
@@ -277,6 +277,8 @@ fbPutXYImage (DrawablePtr pDrawable,
fgand, fgxor, bgand, bgxor);
}
}
+
+ fbFinishAccess (pDrawable);
}
void
@@ -361,4 +363,6 @@ fbGetImage (DrawablePtr pDrawable,
fbXorStip(GXcopy,0,FB_STIP_ALLONES),
planeMask);
}
+
+ fbFinishAccess (pDrawable);
}
diff --git a/fb/fbline.c b/fb/fbline.c
index 8e99dd99f..2cee123ae 100644
--- a/fb/fbline.c
+++ b/fb/fbline.c
@@ -1,6 +1,4 @@
/*
- * $XFree86$
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
diff --git a/fb/fbmmx.c b/fb/fbmmx.c
deleted file mode 100644
index f74930a39..000000000
--- a/fb/fbmmx.c
+++ /dev/null
@@ -1,2314 +0,0 @@
-/*
- * Copyright © 2004, 2005 Red Hat, Inc.
- * Copyright © 2004 Nicholas Miell
- * Copyright © 2005 Trolltech AS
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Red Hat not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. Red Hat makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
- * Author: Søren Sandmann (sandmann@redhat.com)
- * Minor Improvements: Nicholas Miell (nmiell@gmail.com)
- * MMX code paths for fbcompose.c by Lars Knoll (lars@trolltech.com)
- *
- * Based on work by Owen Taylor
- */
-
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#ifdef USE_MMX
-
-#if defined(__amd64__) || defined(__x86_64__)
-#define USE_SSE
-#endif
-
-#include <mmintrin.h>
-#ifdef USE_SSE
-#include <xmmintrin.h> /* for _mm_shuffle_pi16 and _MM_SHUFFLE */
-#endif
-
-#ifdef RENDER
-
-#include "fb.h"
-#include "fbmmx.h"
-
-#include "picturestr.h"
-#include "mipict.h"
-#include "fbpict.h"
-
-#define noVERBOSE
-
-#ifdef VERBOSE
-#define CHECKPOINT() ErrorF ("at %s %d\n", __FUNCTION__, __LINE__)
-#else
-#define CHECKPOINT()
-#endif
-
-/* Notes about writing mmx code
- *
- * give memory operands as the second operand. If you give it as the
- * first, gcc will first load it into a register, then use that
- * register
- *
- * ie. use
- *
- * _mm_mullo_pi16 (x, mmx_constant);
- *
- * not
- *
- * _mm_mullo_pi16 (mmx_constant, x);
- *
- * Also try to minimize dependencies. i.e. when you need a value, try
- * to calculate it from a value that was calculated as early as
- * possible.
- */
-
-/* --------------- MMX primitivess ------------------------------------ */
-
-typedef unsigned long long ullong;
-
-typedef struct
-{
- ullong mmx_4x00ff;
- ullong mmx_4x0080;
- ullong mmx_565_rgb;
- ullong mmx_565_unpack_multiplier;
- ullong mmx_565_r;
- ullong mmx_565_g;
- ullong mmx_565_b;
- ullong mmx_mask_0;
- ullong mmx_mask_1;
- ullong mmx_mask_2;
- ullong mmx_mask_3;
- ullong mmx_full_alpha;
- ullong mmx_ffff0000ffff0000;
- ullong mmx_0000ffff00000000;
- ullong mmx_000000000000ffff;
-} MMXData;
-
-static const MMXData c =
-{
- .mmx_4x00ff = 0x00ff00ff00ff00ffULL,
- .mmx_4x0080 = 0x0080008000800080ULL,
- .mmx_565_rgb = 0x000001f0003f001fULL,
- .mmx_565_r = 0x000000f800000000ULL,
- .mmx_565_g = 0x0000000000fc0000ULL,
- .mmx_565_b = 0x00000000000000f8ULL,
- .mmx_mask_0 = 0xffffffffffff0000ULL,
- .mmx_mask_1 = 0xffffffff0000ffffULL,
- .mmx_mask_2 = 0xffff0000ffffffffULL,
- .mmx_mask_3 = 0x0000ffffffffffffULL,
- .mmx_full_alpha = 0x00ff000000000000ULL,
- .mmx_565_unpack_multiplier = 0x0000008404100840ULL,
- .mmx_ffff0000ffff0000 = 0xffff0000ffff0000ULL,
- .mmx_0000ffff00000000 = 0x0000ffff00000000ULL,
- .mmx_000000000000ffff = 0x000000000000ffffULL,
-};
-
-#define MC(x) ((__m64) c.mmx_##x)
-
-static __inline__ __m64
-shift (__m64 v, int s)
-{
- if (s > 0)
- return _mm_slli_si64 (v, s);
- else if (s < 0)
- return _mm_srli_si64 (v, -s);
- else
- return v;
-}
-
-static __inline__ __m64
-negate (__m64 mask)
-{
- return _mm_xor_si64 (mask, MC(4x00ff));
-}
-
-static __inline__ __m64
-pix_multiply (__m64 a, __m64 b)
-{
- __m64 res;
-
- res = _mm_mullo_pi16 (a, b);
- res = _mm_adds_pu16 (res, MC(4x0080));
- res = _mm_adds_pu16 (res, _mm_srli_pi16 (res, 8));
- res = _mm_srli_pi16 (res, 8);
-
- return res;
-}
-
-static __inline__ __m64
-pix_add (__m64 a, __m64 b)
-{
- return _mm_adds_pu8 (a, b);
-}
-
-#ifdef USE_SSE
-
-static __inline__ __m64
-expand_alpha (__m64 pixel)
-{
- return _mm_shuffle_pi16 (pixel, _MM_SHUFFLE(3, 3, 3, 3));
-}
-
-static __inline__ __m64
-expand_alpha_rev (__m64 pixel)
-{
- return _mm_shuffle_pi16 (pixel, _MM_SHUFFLE(0, 0, 0, 0));
-}
-
-static __inline__ __m64
-invert_colors (__m64 pixel)
-{
- return _mm_shuffle_pi16 (pixel, _MM_SHUFFLE(3, 0, 1, 2));
-}
-
-#else
-
-static __inline__ __m64
-expand_alpha (__m64 pixel)
-{
- __m64 t1, t2;
-
- t1 = shift (pixel, -48);
- t2 = shift (t1, 16);
- t1 = _mm_or_si64 (t1, t2);
- t2 = shift (t1, 32);
- t1 = _mm_or_si64 (t1, t2);
-
- return t1;
-}
-
-static __inline__ __m64
-expand_alpha_rev (__m64 pixel)
-{
- __m64 t1, t2;
-
- /* move alpha to low 16 bits and zero the rest */
- t1 = shift (pixel, 48);
- t1 = shift (t1, -48);
-
- t2 = shift (t1, 16);
- t1 = _mm_or_si64 (t1, t2);
- t2 = shift (t1, 32);
- t1 = _mm_or_si64 (t1, t2);
-
- return t1;
-}
-
-static __inline__ __m64
-invert_colors (__m64 pixel)
-{
- __m64 x, y, z;
-
- x = y = z = pixel;
-
- x = _mm_and_si64 (x, MC(ffff0000ffff0000));
- y = _mm_and_si64 (y, MC(000000000000ffff));
- z = _mm_and_si64 (z, MC(0000ffff00000000));
-
- y = shift (y, 32);
- z = shift (z, -32);
-
- x = _mm_or_si64 (x, y);
- x = _mm_or_si64 (x, z);
-
- return x;
-}
-
-#endif
-
-static __inline__ __m64
-over (__m64 src, __m64 srca, __m64 dest)
-{
- return _mm_adds_pu8 (src, pix_multiply(dest, negate(srca)));
-}
-
-static __inline__ __m64
-over_rev_non_pre (__m64 src, __m64 dest)
-{
- __m64 srca = expand_alpha (src);
- __m64 srcfaaa = _mm_or_si64 (srca, MC(full_alpha));
-
- return over(pix_multiply(invert_colors(src), srcfaaa), srca, dest);
-}
-
-static __inline__ __m64
-in (__m64 src,
- __m64 mask)
-{
- return pix_multiply (src, mask);
-}
-
-static __inline__ __m64
-in_over (__m64 src,
- __m64 srca,
- __m64 mask,
- __m64 dest)
-{
- return over(in(src, mask), pix_multiply(srca, mask), dest);
-}
-
-static __inline__ __m64
-load8888 (CARD32 v)
-{
- return _mm_unpacklo_pi8 (_mm_cvtsi32_si64 (v), _mm_setzero_si64());
-}
-
-static __inline__ __m64
-pack8888 (__m64 lo, __m64 hi)
-{
- return _mm_packs_pu16 (lo, hi);
-}
-
-static __inline__ CARD32
-store8888 (__m64 v)
-{
- return _mm_cvtsi64_si32(pack8888(v, _mm_setzero_si64()));
-}
-
-/* Expand 16 bits positioned at @pos (0-3) of a mmx register into
- *
- * 00RR00GG00BB
- *
- * --- Expanding 565 in the low word ---
- *
- * m = (m << (32 - 3)) | (m << (16 - 5)) | m;
- * m = m & (01f0003f001f);
- * m = m * (008404100840);
- * m = m >> 8;
- *
- * Note the trick here - the top word is shifted by another nibble to
- * avoid it bumping into the middle word
- */
-static __inline__ __m64
-expand565 (__m64 pixel, int pos)
-{
- __m64 p = pixel;
- __m64 t1, t2;
-
- /* move pixel to low 16 bit and zero the rest */
- p = shift (shift (p, (3 - pos) * 16), -48);
-
- t1 = shift (p, 36 - 11);
- t2 = shift (p, 16 - 5);
-
- p = _mm_or_si64 (t1, p);
- p = _mm_or_si64 (t2, p);
- p = _mm_and_si64 (p, MC(565_rgb));
-
- pixel = _mm_mullo_pi16 (p, MC(565_unpack_multiplier));
- return _mm_srli_pi16 (pixel, 8);
-}
-
-static __inline__ __m64
-expand8888 (__m64 in, int pos)
-{
- if (pos == 0)
- return _mm_unpacklo_pi8 (in, _mm_setzero_si64());
- else
- return _mm_unpackhi_pi8 (in, _mm_setzero_si64());
-}
-
-static __inline__ __m64
-pack565 (__m64 pixel, __m64 target, int pos)
-{
- __m64 p = pixel;
- __m64 t = target;
- __m64 r, g, b;
-
- r = _mm_and_si64 (p, MC(565_r));
- g = _mm_and_si64 (p, MC(565_g));
- b = _mm_and_si64 (p, MC(565_b));
-
- r = shift (r, - (32 - 8) + pos * 16);
- g = shift (g, - (16 - 3) + pos * 16);
- b = shift (b, - (0 + 3) + pos * 16);
-
- if (pos == 0)
- t = _mm_and_si64 (t, MC(mask_0));
- else if (pos == 1)
- t = _mm_and_si64 (t, MC(mask_1));
- else if (pos == 2)
- t = _mm_and_si64 (t, MC(mask_2));
- else if (pos == 3)
- t = _mm_and_si64 (t, MC(mask_3));
-
- p = _mm_or_si64 (r, t);
- p = _mm_or_si64 (g, p);
-
- return _mm_or_si64 (b, p);
-}
-
-static __inline__ __m64
-pix_add_mul (__m64 x, __m64 a, __m64 y, __m64 b)
-{
- x = _mm_mullo_pi16 (x, a);
- y = _mm_mullo_pi16 (y, b);
- x = _mm_srli_pi16(x, 1);
- y = _mm_srli_pi16(y, 1);
- x = _mm_adds_pu16 (x, y);
- x = _mm_adds_pu16 (x, _mm_srli_pi16 (x, 8));
- x = _mm_adds_pu16 (x, MC(4x0080));
- x = _mm_srli_pi16 (x, 7);
-
- return x;
-}
-
-/* --------------- MMX code patch for fbcompose.c --------------------- */
-
-static FASTCALL void
-mmxCombineMaskU (CARD32 *src, const CARD32 *mask, int width)
-{
- const CARD32 *end = mask + width;
- while (mask < end) {
- __m64 a = load8888(*mask);
- __m64 s = load8888(*src);
- a = expand_alpha(a);
- s = pix_multiply(s, a);
- *src = store8888(s);
- ++src;
- ++mask;
- }
- _mm_empty();
-}
-
-
-static FASTCALL void
-mmxCombineOverU (CARD32 *dest, const CARD32 *src, int width)
-{
- const CARD32 *end = dest + width;
-
- while (dest < end) {
- __m64 s, sa;
- s = load8888(*src);
- sa = expand_alpha(s);
- *dest = store8888(over(s, sa, load8888(*dest)));
- ++dest;
- ++src;
- }
- _mm_empty();
-}
-
-static FASTCALL void
-mmxCombineOverReverseU (CARD32 *dest, const CARD32 *src, int width)
-{
- const CARD32 *end = dest + width;
-
- while (dest < end) {
- __m64 d, da;
- d = load8888(*dest);
- da = expand_alpha(d);
- *dest = store8888(over (d, da, load8888(*src)));
- ++dest;
- ++src;
- }
- _mm_empty();
-}
-
-static FASTCALL void
-mmxCombineInU (CARD32 *dest, const CARD32 *src, int width)
-{
- const CARD32 *end = dest + width;
-
- while (dest < end) {
- __m64 x, a;
- x = load8888(*src);
- a = load8888(*dest);
- a = expand_alpha(a);
- x = pix_multiply(x, a);
- *dest = store8888(x);
- ++dest;
- ++src;
- }
- _mm_empty();
-}
-
-static FASTCALL void
-mmxCombineInReverseU (CARD32 *dest, const CARD32 *src, int width)
-{
- const CARD32 *end = dest + width;
-
- while (dest < end) {
- __m64 x, a;
- x = load8888(*dest);
- a = load8888(*src);
- a = expand_alpha(a);
- x = pix_multiply(x, a);
- *dest = store8888(x);
- ++dest;
- ++src;
- }
- _mm_empty();
-}
-
-static FASTCALL void
-mmxCombineOutU (CARD32 *dest, const CARD32 *src, int width)
-{
- const CARD32 *end = dest + width;
-
- while (dest < end) {
- __m64 x, a;
- x = load8888(*src);
- a = load8888(*dest);
- a = expand_alpha(a);
- a = negate(a);
- x = pix_multiply(x, a);
- *dest = store8888(x);
- ++dest;
- ++src;
- }
- _mm_empty();
-}
-
-static FASTCALL void
-mmxCombineOutReverseU (CARD32 *dest, const CARD32 *src, int width)
-{
- const CARD32 *end = dest + width;
-
- while (dest < end) {
- __m64 x, a;
- x = load8888(*dest);
- a = load8888(*src);
- a = expand_alpha(a);
- a = negate(a);
- x = pix_multiply(x, a);
- *dest = store8888(x);
- ++dest;
- ++src;
- }
- _mm_empty();
-}
-
-static FASTCALL void
-mmxCombineAtopU (CARD32 *dest, const CARD32 *src, int width)
-{
- const CARD32 *end = dest + width;
-
- while (dest < end) {
- __m64 s, da, d, sia;
- s = load8888(*src);
- d = load8888(*dest);
- sia = expand_alpha(s);
- sia = negate(sia);
- da = expand_alpha(d);
- s = pix_add_mul (s, da, d, sia);
- *dest = store8888(s);
- ++dest;
- ++src;
- }
- _mm_empty();
-}
-
-static FASTCALL void
-mmxCombineAtopReverseU (CARD32 *dest, const CARD32 *src, int width)
-{
- const CARD32 *end;
-
- end = dest + width;
-
- while (dest < end) {
- __m64 s, dia, d, sa;
- s = load8888(*src);
- d = load8888(*dest);
- sa = expand_alpha(s);
- dia = expand_alpha(d);
- dia = negate(dia);
- s = pix_add_mul (s, dia, d, sa);
- *dest = store8888(s);
- ++dest;
- ++src;
- }
- _mm_empty();
-}
-
-static FASTCALL void
-mmxCombineXorU (CARD32 *dest, const CARD32 *src, int width)
-{
- const CARD32 *end = dest + width;
-
- while (dest < end) {
- __m64 s, dia, d, sia;
- s = load8888(*src);
- d = load8888(*dest);
- sia = expand_alpha(s);
- dia = expand_alpha(d);
- sia = negate(sia);
- dia = negate(dia);
- s = pix_add_mul (s, dia, d, sia);
- *dest = store8888(s);
- ++dest;
- ++src;
- }
- _mm_empty();
-}
-
-static FASTCALL void
-mmxCombineAddU (CARD32 *dest, const CARD32 *src, int width)
-{
- const CARD32 *end = dest + width;
- while (dest < end) {
- __m64 s, d;
- s = load8888(*src);
- d = load8888(*dest);
- s = pix_add(s, d);
- *dest = store8888(s);
- ++dest;
- ++src;
- }
- _mm_empty();
-}
-
-static FASTCALL void
-mmxCombineSaturateU (CARD32 *dest, const CARD32 *src, int width)
-{
- const CARD32 *end = dest + width;
- while (dest < end) {
- CARD32 s = *src;
- CARD32 d = *dest;
- __m64 ms = load8888(s);
- __m64 md = load8888(d);
- CARD32 sa = s >> 24;
- CARD32 da = ~d >> 24;
-
- if (sa > da) {
- __m64 msa = load8888(FbIntDiv(da, sa));
- msa = expand_alpha_rev(msa);
- ms = pix_multiply(ms, msa);
- }
- md = pix_add(md, ms);
- *dest = store8888(md);
- ++src;
- ++dest;
- }
- _mm_empty();
-}
-
-
-static FASTCALL void
-mmxCombineSrcC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- const CARD32 *end = src + width;
- while (src < end) {
- __m64 a = load8888(*mask);
- __m64 s = load8888(*src);
- s = pix_multiply(s, a);
- *dest = store8888(s);
- ++src;
- ++mask;
- ++dest;
- }
- _mm_empty();
-}
-
-static FASTCALL void
-mmxCombineOverC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- const CARD32 *end = src + width;
- while (src < end) {
- __m64 a = load8888(*mask);
- __m64 s = load8888(*src);
- __m64 d = load8888(*dest);
- __m64 sa = expand_alpha(s);
-
- *dest = store8888(in_over (s, sa, a, d));
-
- ++src;
- ++dest;
- ++mask;
- }
- _mm_empty();
-}
-
-static FASTCALL void
-mmxCombineOverReverseC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- const CARD32 *end = src + width;
- while (src < end) {
- __m64 a = load8888(*mask);
- __m64 s = load8888(*src);
- __m64 d = load8888(*dest);
- __m64 da = expand_alpha(d);
-
- *dest = store8888(over (d, da, in (s, a)));
-
- ++src;
- ++dest;
- ++mask;
- }
- _mm_empty();
-}
-
-
-static FASTCALL void
-mmxCombineInC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- const CARD32 *end = src + width;
- while (src < end) {
- __m64 a = load8888(*mask);
- __m64 s = load8888(*src);
- __m64 d = load8888(*dest);
- __m64 da = expand_alpha(d);
- s = pix_multiply(s, a);
- s = pix_multiply(s, da);
- *dest = store8888(s);
- ++src;
- ++dest;
- ++mask;
- }
- _mm_empty();
-}
-
-static FASTCALL void
-mmxCombineInReverseC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- const CARD32 *end = src + width;
- while (src < end) {
- __m64 a = load8888(*mask);
- __m64 s = load8888(*src);
- __m64 d = load8888(*dest);
- __m64 sa = expand_alpha(s);
- a = pix_multiply(a, sa);
- d = pix_multiply(d, a);
- *dest = store8888(d);
- ++src;
- ++dest;
- ++mask;
- }
- _mm_empty();
-}
-
-static FASTCALL void
-mmxCombineOutC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- const CARD32 *end = src + width;
- while (src < end) {
- __m64 a = load8888(*mask);
- __m64 s = load8888(*src);
- __m64 d = load8888(*dest);
- __m64 da = expand_alpha(d);
- da = negate(da);
- s = pix_multiply(s, a);
- s = pix_multiply(s, da);
- *dest = store8888(s);
- ++src;
- ++dest;
- ++mask;
- }
- _mm_empty();
-}
-
-static FASTCALL void
-mmxCombineOutReverseC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- const CARD32 *end = src + width;
- while (src < end) {
- __m64 a = load8888(*mask);
- __m64 s = load8888(*src);
- __m64 d = load8888(*dest);
- __m64 sa = expand_alpha(s);
- a = pix_multiply(a, sa);
- a = negate(a);
- d = pix_multiply(d, a);
- *dest = store8888(d);
- ++src;
- ++dest;
- ++mask;
- }
- _mm_empty();
-}
-
-static FASTCALL void
-mmxCombineAtopC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- const CARD32 *end = src + width;
- while (src < end) {
- __m64 a = load8888(*mask);
- __m64 s = load8888(*src);
- __m64 d = load8888(*dest);
- __m64 da = expand_alpha(d);
- __m64 sa = expand_alpha(s);
- s = pix_multiply(s, a);
- a = pix_multiply(a, sa);
- a = negate(a);
- d = pix_add_mul (d, a, s, da);
- *dest = store8888(d);
- ++src;
- ++dest;
- ++mask;
- }
- _mm_empty();
-}
-
-static FASTCALL void
-mmxCombineAtopReverseC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- const CARD32 *end = src + width;
- while (src < end) {
- __m64 a = load8888(*mask);
- __m64 s = load8888(*src);
- __m64 d = load8888(*dest);
- __m64 da = expand_alpha(d);
- __m64 sa = expand_alpha(s);
- s = pix_multiply(s, a);
- a = pix_multiply(a, sa);
- da = negate(da);
- d = pix_add_mul (d, a, s, da);
- *dest = store8888(d);
- ++src;
- ++dest;
- ++mask;
- }
- _mm_empty();
-}
-
-static FASTCALL void
-mmxCombineXorC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- const CARD32 *end = src + width;
- while (src < end) {
- __m64 a = load8888(*mask);
- __m64 s = load8888(*src);
- __m64 d = load8888(*dest);
- __m64 da = expand_alpha(d);
- __m64 sa = expand_alpha(s);
- s = pix_multiply(s, a);
- a = pix_multiply(a, sa);
- da = negate(da);
- a = negate(a);
- d = pix_add_mul (d, a, s, da);
- *dest = store8888(d);
- ++src;
- ++dest;
- ++mask;
- }
- _mm_empty();
-}
-
-static FASTCALL void
-mmxCombineAddC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
-{
- const CARD32 *end = src + width;
- while (src < end) {
- __m64 a = load8888(*mask);
- __m64 s = load8888(*src);
- __m64 d = load8888(*dest);
- s = pix_multiply(s, a);
- d = pix_add(s, d);
- *dest = store8888(d);
- ++src;
- ++dest;
- ++mask;
- }
- _mm_empty();
-}
-
-extern FbComposeFunctions composeFunctions;
-
-void fbComposeSetupMMX(void)
-{
- /* check if we have MMX support and initialize accordingly */
- if (fbHaveMMX()) {
- composeFunctions.combineU[PictOpOver] = mmxCombineOverU;
- composeFunctions.combineU[PictOpOverReverse] = mmxCombineOverReverseU;
- composeFunctions.combineU[PictOpIn] = mmxCombineInU;
- composeFunctions.combineU[PictOpInReverse] = mmxCombineInReverseU;
- composeFunctions.combineU[PictOpOut] = mmxCombineOutU;
- composeFunctions.combineU[PictOpOutReverse] = mmxCombineOutReverseU;
- composeFunctions.combineU[PictOpAtop] = mmxCombineAtopU;
- composeFunctions.combineU[PictOpAtopReverse] = mmxCombineAtopReverseU;
- composeFunctions.combineU[PictOpXor] = mmxCombineXorU;
- composeFunctions.combineU[PictOpAdd] = mmxCombineAddU;
- composeFunctions.combineU[PictOpSaturate] = mmxCombineSaturateU;
-
- composeFunctions.combineC[PictOpSrc] = mmxCombineSrcC;
- composeFunctions.combineC[PictOpOver] = mmxCombineOverC;
- composeFunctions.combineC[PictOpOverReverse] = mmxCombineOverReverseC;
- composeFunctions.combineC[PictOpIn] = mmxCombineInC;
- composeFunctions.combineC[PictOpInReverse] = mmxCombineInReverseC;
- composeFunctions.combineC[PictOpOut] = mmxCombineOutC;
- composeFunctions.combineC[PictOpOutReverse] = mmxCombineOutReverseC;
- composeFunctions.combineC[PictOpAtop] = mmxCombineAtopC;
- composeFunctions.combineC[PictOpAtopReverse] = mmxCombineAtopReverseC;
- composeFunctions.combineC[PictOpXor] = mmxCombineXorC;
- composeFunctions.combineC[PictOpAdd] = mmxCombineAddC;
-
- composeFunctions.combineMaskU = mmxCombineMaskU;
- }
-}
-
-
-/* ------------------ MMX code paths called from fbpict.c ----------------------- */
-
-void
-fbCompositeSolid_nx8888mmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD32 src;
- CARD32 *dstLine, *dst;
- CARD16 w;
- FbStride dstStride;
- __m64 vsrc, vsrca;
-
- CHECKPOINT();
-
- fbComposeGetSolid(pSrc, src, pDst->format);
-
- if (src >> 24 == 0)
- return;
-
- fbComposeGetStart (pDst, xDst, yDst, CARD32, dstStride, dstLine, 1);
-
- vsrc = load8888 (src);
- vsrca = expand_alpha (vsrc);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- w = width;
-
- CHECKPOINT();
-
- while (w && (unsigned long)dst & 7)
- {
- *dst = store8888(over(vsrc, vsrca, load8888(*dst)));
-
- w--;
- dst++;
- }
-
- while (w >= 2)
- {
- __m64 vdest;
- __m64 dest0, dest1;
-
- vdest = *(__m64 *)dst;
-
- dest0 = over(vsrc, vsrca, expand8888(vdest, 0));
- dest1 = over(vsrc, vsrca, expand8888(vdest, 1));
-
- *(__m64 *)dst = pack8888(dest0, dest1);
-
- dst += 2;
- w -= 2;
- }
-
- CHECKPOINT();
-
- while (w)
- {
- *dst = store8888(over(vsrc, vsrca, load8888(*dst)));
-
- w--;
- dst++;
- }
- }
-
- _mm_empty();
-}
-
-void
-fbCompositeSolid_nx0565mmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD32 src;
- CARD16 *dstLine, *dst;
- CARD16 w;
- FbStride dstStride;
- __m64 vsrc, vsrca;
-
- CHECKPOINT();
-
- fbComposeGetSolid(pSrc, src, pDst->format);
-
- if (src >> 24 == 0)
- return;
-
- fbComposeGetStart (pDst, xDst, yDst, CARD16, dstStride, dstLine, 1);
-
- vsrc = load8888 (src);
- vsrca = expand_alpha (vsrc);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- w = width;
-
- CHECKPOINT();
-
- while (w && (unsigned long)dst & 7)
- {
- ullong d = *dst;
- __m64 vdest = expand565 ((__m64)d, 0);
- vdest = pack565(over(vsrc, vsrca, vdest), vdest, 0);
- *dst = (ullong)vdest;
-
- w--;
- dst++;
- }
-
- while (w >= 4)
- {
- __m64 vdest;
-
- vdest = *(__m64 *)dst;
-
- vdest = pack565 (over(vsrc, vsrca, expand565(vdest, 0)), vdest, 0);
- vdest = pack565 (over(vsrc, vsrca, expand565(vdest, 1)), vdest, 1);
- vdest = pack565 (over(vsrc, vsrca, expand565(vdest, 2)), vdest, 2);
- vdest = pack565 (over(vsrc, vsrca, expand565(vdest, 3)), vdest, 3);
-
- *(__m64 *)dst = vdest;
-
- dst += 4;
- w -= 4;
- }
-
- CHECKPOINT();
-
- while (w)
- {
- ullong d = *dst;
- __m64 vdest = expand565 ((__m64)d, 0);
- vdest = pack565(over(vsrc, vsrca, vdest), vdest, 0);
- *dst = (ullong)vdest;
-
- w--;
- dst++;
- }
- }
-
- _mm_empty();
-}
-
-void
-fbCompositeSolidMask_nx8888x8888Cmmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD32 src, srca;
- CARD32 *dstLine;
- CARD32 *maskLine;
- FbStride dstStride, maskStride;
- __m64 vsrc, vsrca;
-
- CHECKPOINT();
-
- fbComposeGetSolid(pSrc, src, pDst->format);
-
- srca = src >> 24;
- if (srca == 0)
- return;
-
- fbComposeGetStart (pDst, xDst, yDst, CARD32, dstStride, dstLine, 1);
- fbComposeGetStart (pMask, xMask, yMask, CARD32, maskStride, maskLine, 1);
-
- vsrc = load8888(src);
- vsrca = expand_alpha(vsrc);
-
- while (height--)
- {
- int twidth = width;
- CARD32 *p = (CARD32 *)maskLine;
- CARD32 *q = (CARD32 *)dstLine;
-
- while (twidth && (unsigned long)q & 7)
- {
- CARD32 m = *(CARD32 *)p;
-
- if (m)
- {
- __m64 vdest = load8888(*q);
- vdest = in_over(vsrc, vsrca, load8888(m), vdest);
- *q = store8888(vdest);
- }
-
- twidth--;
- p++;
- q++;
- }
-
- while (twidth >= 2)
- {
- CARD32 m0, m1;
- m0 = *p;
- m1 = *(p + 1);
-
- if (m0 | m1)
- {
- __m64 dest0, dest1;
- __m64 vdest = *(__m64 *)q;
-
- dest0 = in_over(vsrc, vsrca, load8888(m0),
- expand8888 (vdest, 0));
- dest1 = in_over(vsrc, vsrca, load8888(m1),
- expand8888 (vdest, 1));
-
- *(__m64 *)q = pack8888(dest0, dest1);
- }
-
- p += 2;
- q += 2;
- twidth -= 2;
- }
-
- while (twidth)
- {
- CARD32 m = *(CARD32 *)p;
-
- if (m)
- {
- __m64 vdest = load8888(*q);
- vdest = in_over(vsrc, vsrca, load8888(m), vdest);
- *q = store8888(vdest);
- }
-
- twidth--;
- p++;
- q++;
- }
-
- dstLine += dstStride;
- maskLine += maskStride;
- }
-
- _mm_empty();
-}
-
-void
-fbCompositeSrc_8888x8x8888mmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD32 *dstLine, *dst;
- CARD32 *srcLine, *src;
- CARD8 *maskLine;
- CARD32 mask;
- __m64 vmask;
- FbStride dstStride, srcStride, maskStride;
- CARD16 w;
- __m64 srca;
-
- CHECKPOINT();
-
- fbComposeGetStart (pDst, xDst, yDst, CARD32, dstStride, dstLine, 1);
- fbComposeGetStart (pSrc, xSrc, ySrc, CARD32, srcStride, srcLine, 1);
- fbComposeGetStart (pMask, xMask, yMask, CARD8, maskStride, maskLine, 1);
-
- mask = *maskLine << 24 | *maskLine << 16 | *maskLine << 8 | *maskLine;
- vmask = load8888 (mask);
- srca = MC(4x00ff);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- src = srcLine;
- srcLine += srcStride;
- w = width;
-
- while (w && (unsigned long)dst & 7)
- {
- __m64 s = load8888 (*src);
- __m64 d = load8888 (*dst);
-
- *dst = store8888 (in_over (s, srca, vmask, d));
-
- w--;
- dst++;
- src++;
- }
-
- while (w >= 16)
- {
- __m64 vd0 = *(__m64 *)(dst + 0);
- __m64 vd1 = *(__m64 *)(dst + 2);
- __m64 vd2 = *(__m64 *)(dst + 4);
- __m64 vd3 = *(__m64 *)(dst + 6);
- __m64 vd4 = *(__m64 *)(dst + 8);
- __m64 vd5 = *(__m64 *)(dst + 10);
- __m64 vd6 = *(__m64 *)(dst + 12);
- __m64 vd7 = *(__m64 *)(dst + 14);
-
- __m64 vs0 = *(__m64 *)(src + 0);
- __m64 vs1 = *(__m64 *)(src + 2);
- __m64 vs2 = *(__m64 *)(src + 4);
- __m64 vs3 = *(__m64 *)(src + 6);
- __m64 vs4 = *(__m64 *)(src + 8);
- __m64 vs5 = *(__m64 *)(src + 10);
- __m64 vs6 = *(__m64 *)(src + 12);
- __m64 vs7 = *(__m64 *)(src + 14);
-
- vd0 = (__m64)pack8888 (
- in_over (expand8888 (vs0, 0), srca, vmask, expand8888 (vd0, 0)),
- in_over (expand8888 (vs0, 1), srca, vmask, expand8888 (vd0, 1)));
-
- vd1 = (__m64)pack8888 (
- in_over (expand8888 (vs1, 0), srca, vmask, expand8888 (vd1, 0)),
- in_over (expand8888 (vs1, 1), srca, vmask, expand8888 (vd1, 1)));
-
- vd2 = (__m64)pack8888 (
- in_over (expand8888 (vs2, 0), srca, vmask, expand8888 (vd2, 0)),
- in_over (expand8888 (vs2, 1), srca, vmask, expand8888 (vd2, 1)));
-
- vd3 = (__m64)pack8888 (
- in_over (expand8888 (vs3, 0), srca, vmask, expand8888 (vd3, 0)),
- in_over (expand8888 (vs3, 1), srca, vmask, expand8888 (vd3, 1)));
-
- vd4 = (__m64)pack8888 (
- in_over (expand8888 (vs4, 0), srca, vmask, expand8888 (vd4, 0)),
- in_over (expand8888 (vs4, 1), srca, vmask, expand8888 (vd4, 1)));
-
- vd5 = (__m64)pack8888 (
- in_over (expand8888 (vs5, 0), srca, vmask, expand8888 (vd5, 0)),
- in_over (expand8888 (vs5, 1), srca, vmask, expand8888 (vd5, 1)));
-
- vd6 = (__m64)pack8888 (
- in_over (expand8888 (vs6, 0), srca, vmask, expand8888 (vd6, 0)),
- in_over (expand8888 (vs6, 1), srca, vmask, expand8888 (vd6, 1)));
-
- vd7 = (__m64)pack8888 (
- in_over (expand8888 (vs7, 0), srca, vmask, expand8888 (vd7, 0)),
- in_over (expand8888 (vs7, 1), srca, vmask, expand8888 (vd7, 1)));
-
- *(__m64 *)(dst + 0) = vd0;
- *(__m64 *)(dst + 2) = vd1;
- *(__m64 *)(dst + 4) = vd2;
- *(__m64 *)(dst + 6) = vd3;
- *(__m64 *)(dst + 8) = vd4;
- *(__m64 *)(dst + 10) = vd5;
- *(__m64 *)(dst + 12) = vd6;
- *(__m64 *)(dst + 14) = vd7;
-
- w -= 16;
- dst += 16;
- src += 16;
- }
-
- while (w)
- {
- __m64 s = load8888 (*src);
- __m64 d = load8888 (*dst);
-
- *dst = store8888 (in_over (s, srca, vmask, d));
-
- w--;
- dst++;
- src++;
- }
- }
-
- _mm_empty();
-}
-
-void
-fbCompositeSrc_8888x8888mmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD32 *dstLine, *dst;
- CARD32 *srcLine, *src;
- FbStride dstStride, srcStride;
- CARD16 w;
- __m64 srca;
-
- CHECKPOINT();
-
- fbComposeGetStart (pDst, xDst, yDst, CARD32, dstStride, dstLine, 1);
- fbComposeGetStart (pSrc, xSrc, ySrc, CARD32, srcStride, srcLine, 1);
-
- srca = MC (4x00ff);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- src = srcLine;
- srcLine += srcStride;
- w = width;
-
- while (w && (unsigned long)dst & 7)
- {
- __m64 s = load8888 (*src);
- __m64 d = load8888 (*dst);
-
- *dst = store8888 (over (s, expand_alpha (s), d));
-
- w--;
- dst++;
- src++;
- }
-
- while (w >= 2)
- {
- __m64 vd = *(__m64 *)(dst + 0);
- __m64 vs = *(__m64 *)(src + 0);
- __m64 vs0 = expand8888 (vs, 0);
- __m64 vs1 = expand8888 (vs, 1);
-
- *(__m64 *)dst = (__m64)pack8888 (
- over (vs0, expand_alpha (vs0), expand8888 (vd, 0)),
- over (vs1, expand_alpha (vs1), expand8888 (vd, 1)));
-
- w -= 2;
- dst += 2;
- src += 2;
- }
-
- while (w)
- {
- __m64 s = load8888 (*src);
- __m64 d = load8888 (*dst);
-
- *dst = store8888 (over (s, expand_alpha (s), d));
-
- w--;
- dst++;
- src++;
- }
- }
-
- _mm_empty();
-}
-
-void
-fbCompositeSolidMask_nx8x8888mmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD32 src, srca;
- CARD32 *dstLine, *dst;
- CARD8 *maskLine, *mask;
- FbStride dstStride, maskStride;
- CARD16 w;
- __m64 vsrc, vsrca;
- ullong srcsrc;
-
- CHECKPOINT();
-
- fbComposeGetSolid(pSrc, src, pDst->format);
-
- srca = src >> 24;
- if (srca == 0)
- return;
-
- srcsrc = (unsigned long long)src << 32 | src;
-
- fbComposeGetStart (pDst, xDst, yDst, CARD32, dstStride, dstLine, 1);
- fbComposeGetStart (pMask, xMask, yMask, CARD8, maskStride, maskLine, 1);
-
- vsrc = load8888 (src);
- vsrca = expand_alpha (vsrc);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- mask = maskLine;
- maskLine += maskStride;
- w = width;
-
- CHECKPOINT();
-
- while (w && (unsigned long)dst & 7)
- {
- ullong m = *mask;
-
- if (m)
- {
- __m64 vdest = in_over(vsrc, vsrca, expand_alpha_rev ((__m64)m), load8888(*dst));
- *dst = store8888(vdest);
- }
-
- w--;
- mask++;
- dst++;
- }
-
- CHECKPOINT();
-
- while (w >= 2)
- {
- ullong m0, m1;
- m0 = *mask;
- m1 = *(mask + 1);
-
- if (srca == 0xff && (m0 & m1) == 0xff)
- {
- *(unsigned long long *)dst = srcsrc;
- }
- else if (m0 | m1)
- {
- __m64 vdest;
- __m64 dest0, dest1;
-
- vdest = *(__m64 *)dst;
-
- dest0 = in_over(vsrc, vsrca, expand_alpha_rev ((__m64)m0), expand8888(vdest, 0));
- dest1 = in_over(vsrc, vsrca, expand_alpha_rev ((__m64)m1), expand8888(vdest, 1));
-
- *(__m64 *)dst = pack8888(dest0, dest1);
- }
-
- mask += 2;
- dst += 2;
- w -= 2;
- }
-
- CHECKPOINT();
-
- while (w)
- {
- ullong m = *mask;
-
- if (m)
- {
- __m64 vdest = load8888(*dst);
- vdest = in_over(vsrc, vsrca, expand_alpha_rev ((__m64)m), vdest);
- *dst = store8888(vdest);
- }
-
- w--;
- mask++;
- dst++;
- }
- }
-
- _mm_empty();
-}
-
-
-void
-fbCompositeSolidMask_nx8x0565mmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD32 src, srca;
- CARD16 *dstLine, *dst;
- CARD8 *maskLine, *mask;
- FbStride dstStride, maskStride;
- CARD16 w;
- __m64 vsrc, vsrca;
- unsigned long long srcsrcsrcsrc, src16;
-
- CHECKPOINT();
-
- fbComposeGetSolid(pSrc, src, pDst->format);
-
- srca = src >> 24;
- if (srca == 0)
- return;
-
- fbComposeGetStart (pDst, xDst, yDst, CARD16, dstStride, dstLine, 1);
- fbComposeGetStart (pMask, xMask, yMask, CARD8, maskStride, maskLine, 1);
-
- vsrc = load8888 (src);
- vsrca = expand_alpha (vsrc);
-
- src16 = (ullong)pack565(vsrc, _mm_setzero_si64(), 0);
-
- srcsrcsrcsrc = (ullong)src16 << 48 | (ullong)src16 << 32 |
- (ullong)src16 << 16 | (ullong)src16;
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- mask = maskLine;
- maskLine += maskStride;
- w = width;
-
- CHECKPOINT();
-
- while (w && (unsigned long)dst & 7)
- {
- ullong m = *mask;
-
- if (m)
- {
- ullong d = *dst;
- __m64 vd = (__m64)d;
- __m64 vdest = in_over(vsrc, vsrca, expand_alpha_rev ((__m64)m), expand565(vd, 0));
- *dst = (ullong)pack565(vdest, _mm_setzero_si64(), 0);
- }
-
- w--;
- mask++;
- dst++;
- }
-
- CHECKPOINT();
-
- while (w >= 4)
- {
- ullong m0, m1, m2, m3;
- m0 = *mask;
- m1 = *(mask + 1);
- m2 = *(mask + 2);
- m3 = *(mask + 3);
-
- if (srca == 0xff && (m0 & m1 & m2 & m3) == 0xff)
- {
- *(unsigned long long *)dst = srcsrcsrcsrc;
- }
- else if (m0 | m1 | m2 | m3)
- {
- __m64 vdest;
- __m64 vm0, vm1, vm2, vm3;
-
- vdest = *(__m64 *)dst;
-
- vm0 = (__m64)m0;
- vdest = pack565(in_over(vsrc, vsrca, expand_alpha_rev(vm0), expand565(vdest, 0)), vdest, 0);
- vm1 = (__m64)m1;
- vdest = pack565(in_over(vsrc, vsrca, expand_alpha_rev(vm1), expand565(vdest, 1)), vdest, 1);
- vm2 = (__m64)m2;
- vdest = pack565(in_over(vsrc, vsrca, expand_alpha_rev(vm2), expand565(vdest, 2)), vdest, 2);
- vm3 = (__m64)m3;
- vdest = pack565(in_over(vsrc, vsrca, expand_alpha_rev(vm3), expand565(vdest, 3)), vdest, 3);
-
- *(__m64 *)dst = vdest;
- }
-
- w -= 4;
- mask += 4;
- dst += 4;
- }
-
- CHECKPOINT();
-
- while (w)
- {
- ullong m = *mask;
-
- if (m)
- {
- ullong d = *dst;
- __m64 vd = (__m64)d;
- __m64 vdest = in_over(vsrc, vsrca, expand_alpha_rev ((__m64)m), expand565(vd, 0));
- *dst = (ullong)pack565(vdest, _mm_setzero_si64(), 0);
- }
-
- w--;
- mask++;
- dst++;
- }
- }
-
- _mm_empty();
-}
-
-void
-fbCompositeSrc_8888RevNPx0565mmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD16 *dstLine, *dst;
- CARD32 *srcLine, *src;
- FbStride dstStride, srcStride;
- CARD16 w;
-
- CHECKPOINT();
-
- fbComposeGetStart (pDst, xDst, yDst, CARD16, dstStride, dstLine, 1);
- fbComposeGetStart (pSrc, xSrc, ySrc, CARD32, srcStride, srcLine, 1);
-
- assert (pSrc->pDrawable == pMask->pDrawable);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- src = srcLine;
- srcLine += srcStride;
- w = width;
-
- CHECKPOINT();
-
- while (w && (unsigned long)dst & 7)
- {
- __m64 vsrc = load8888 (*src);
- ullong d = *dst;
- __m64 vdest = expand565 ((__m64)d, 0);
-
- vdest = pack565(over_rev_non_pre(vsrc, vdest), vdest, 0);
-
- *dst = (ullong)vdest;
-
- w--;
- dst++;
- src++;
- }
-
- CHECKPOINT();
-
- while (w >= 4)
- {
- CARD32 s0, s1, s2, s3;
- unsigned char a0, a1, a2, a3;
-
- s0 = *src;
- s1 = *(src + 1);
- s2 = *(src + 2);
- s3 = *(src + 3);
-
- a0 = (s0 >> 24);
- a1 = (s1 >> 24);
- a2 = (s2 >> 24);
- a3 = (s3 >> 24);
-
- if ((a0 & a1 & a2 & a3) == 0xFF)
- {
- __m64 vdest;
- vdest = pack565(invert_colors(load8888(s0)), _mm_setzero_si64(), 0);
- vdest = pack565(invert_colors(load8888(s1)), vdest, 1);
- vdest = pack565(invert_colors(load8888(s2)), vdest, 2);
- vdest = pack565(invert_colors(load8888(s3)), vdest, 3);
-
- *(__m64 *)dst = vdest;
- }
- else if (a0 | a1 | a2 | a3)
- {
- __m64 vdest = *(__m64 *)dst;
-
- vdest = pack565(over_rev_non_pre(load8888(s0), expand565(vdest, 0)), vdest, 0);
- vdest = pack565(over_rev_non_pre(load8888(s1), expand565(vdest, 1)), vdest, 1);
- vdest = pack565(over_rev_non_pre(load8888(s2), expand565(vdest, 2)), vdest, 2);
- vdest = pack565(over_rev_non_pre(load8888(s3), expand565(vdest, 3)), vdest, 3);
-
- *(__m64 *)dst = vdest;
- }
-
- w -= 4;
- dst += 4;
- src += 4;
- }
-
- CHECKPOINT();
-
- while (w)
- {
- __m64 vsrc = load8888 (*src);
- ullong d = *dst;
- __m64 vdest = expand565 ((__m64)d, 0);
-
- vdest = pack565(over_rev_non_pre(vsrc, vdest), vdest, 0);
-
- *dst = (ullong)vdest;
-
- w--;
- dst++;
- src++;
- }
- }
-
- _mm_empty();
-}
-
-/* "8888RevNP" is GdkPixbuf's format: ABGR, non premultiplied */
-
-void
-fbCompositeSrc_8888RevNPx8888mmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD32 *dstLine, *dst;
- CARD32 *srcLine, *src;
- FbStride dstStride, srcStride;
- CARD16 w;
-
- CHECKPOINT();
-
- fbComposeGetStart (pDst, xDst, yDst, CARD32, dstStride, dstLine, 1);
- fbComposeGetStart (pSrc, xSrc, ySrc, CARD32, srcStride, srcLine, 1);
-
- assert (pSrc->pDrawable == pMask->pDrawable);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- src = srcLine;
- srcLine += srcStride;
- w = width;
-
- while (w && (unsigned long)dst & 7)
- {
- __m64 s = load8888 (*src);
- __m64 d = load8888 (*dst);
-
- *dst = store8888 (over_rev_non_pre (s, d));
-
- w--;
- dst++;
- src++;
- }
-
- while (w >= 2)
- {
- ullong s0, s1;
- unsigned char a0, a1;
- __m64 d0, d1;
-
- s0 = *src;
- s1 = *(src + 1);
-
- a0 = (s0 >> 24);
- a1 = (s1 >> 24);
-
- if ((a0 & a1) == 0xFF)
- {
- d0 = invert_colors(load8888(s0));
- d1 = invert_colors(load8888(s1));
-
- *(__m64 *)dst = pack8888 (d0, d1);
- }
- else if (a0 | a1)
- {
- __m64 vdest = *(__m64 *)dst;
-
- d0 = over_rev_non_pre (load8888(s0), expand8888 (vdest, 0));
- d1 = over_rev_non_pre (load8888(s1), expand8888 (vdest, 1));
-
- *(__m64 *)dst = pack8888 (d0, d1);
- }
-
- w -= 2;
- dst += 2;
- src += 2;
- }
-
- while (w)
- {
- __m64 s = load8888 (*src);
- __m64 d = load8888 (*dst);
-
- *dst = store8888 (over_rev_non_pre (s, d));
-
- w--;
- dst++;
- src++;
- }
- }
-
- _mm_empty();
-}
-
-void
-fbCompositeSolidMask_nx8888x0565Cmmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD32 src, srca;
- CARD16 *dstLine;
- CARD32 *maskLine;
- FbStride dstStride, maskStride;
- __m64 vsrc, vsrca;
-
- CHECKPOINT();
-
- fbComposeGetSolid(pSrc, src, pDst->format);
-
- srca = src >> 24;
- if (srca == 0)
- return;
-
- fbComposeGetStart (pDst, xDst, yDst, CARD16, dstStride, dstLine, 1);
- fbComposeGetStart (pMask, xMask, yMask, CARD32, maskStride, maskLine, 1);
-
- vsrc = load8888 (src);
- vsrca = expand_alpha (vsrc);
-
- while (height--)
- {
- int twidth = width;
- CARD32 *p = (CARD32 *)maskLine;
- CARD16 *q = (CARD16 *)dstLine;
-
- while (twidth && ((unsigned long)q & 7))
- {
- CARD32 m = *(CARD32 *)p;
-
- if (m)
- {
- ullong d = *q;
- __m64 vdest = expand565 ((__m64)d, 0);
- vdest = pack565 (in_over (vsrc, vsrca, load8888 (m), vdest), vdest, 0);
- *q = (ullong)vdest;
- }
-
- twidth--;
- p++;
- q++;
- }
-
- while (twidth >= 4)
- {
- CARD32 m0, m1, m2, m3;
-
- m0 = *p;
- m1 = *(p + 1);
- m2 = *(p + 2);
- m3 = *(p + 3);
-
- if ((m0 | m1 | m2 | m3))
- {
- __m64 vdest = *(__m64 *)q;
-
- vdest = pack565(in_over(vsrc, vsrca, load8888(m0), expand565(vdest, 0)), vdest, 0);
- vdest = pack565(in_over(vsrc, vsrca, load8888(m1), expand565(vdest, 1)), vdest, 1);
- vdest = pack565(in_over(vsrc, vsrca, load8888(m2), expand565(vdest, 2)), vdest, 2);
- vdest = pack565(in_over(vsrc, vsrca, load8888(m3), expand565(vdest, 3)), vdest, 3);
-
- *(__m64 *)q = vdest;
- }
- twidth -= 4;
- p += 4;
- q += 4;
- }
-
- while (twidth)
- {
- CARD32 m;
-
- m = *(CARD32 *)p;
- if (m)
- {
- ullong d = *q;
- __m64 vdest = expand565((__m64)d, 0);
- vdest = pack565 (in_over(vsrc, vsrca, load8888(m), vdest), vdest, 0);
- *q = (ullong)vdest;
- }
-
- twidth--;
- p++;
- q++;
- }
-
- maskLine += maskStride;
- dstLine += dstStride;
- }
-
- _mm_empty ();
-}
-
-void
-fbCompositeSrcAdd_8000x8000mmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD8 *dstLine, *dst;
- CARD8 *srcLine, *src;
- FbStride dstStride, srcStride;
- CARD16 w;
- CARD8 s, d;
- CARD16 t;
-
- CHECKPOINT();
-
- fbComposeGetStart (pSrc, xSrc, ySrc, CARD8, srcStride, srcLine, 1);
- fbComposeGetStart (pDst, xDst, yDst, CARD8, dstStride, dstLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- src = srcLine;
- srcLine += srcStride;
- w = width;
-
- while (w && (unsigned long)dst & 7)
- {
- s = *src;
- d = *dst;
- t = d + s;
- s = t | (0 - (t >> 8));
- *dst = s;
-
- dst++;
- src++;
- w--;
- }
-
- while (w >= 8)
- {
- *(__m64*)dst = _mm_adds_pu8(*(__m64*)src, *(__m64*)dst);
- dst += 8;
- src += 8;
- w -= 8;
- }
-
- while (w)
- {
- s = *src;
- d = *dst;
- t = d + s;
- s = t | (0 - (t >> 8));
- *dst = s;
-
- dst++;
- src++;
- w--;
- }
- }
-
- _mm_empty();
-}
-
-void
-fbCompositeSrcAdd_8888x8888mmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD32 *dstLine, *dst;
- CARD32 *srcLine, *src;
- FbStride dstStride, srcStride;
- CARD16 w;
-
- CHECKPOINT();
-
- fbComposeGetStart (pSrc, xSrc, ySrc, CARD32, srcStride, srcLine, 1);
- fbComposeGetStart (pDst, xDst, yDst, CARD32, dstStride, dstLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- src = srcLine;
- srcLine += srcStride;
- w = width;
-
- while (w && (unsigned long)dst & 7)
- {
- *dst = _mm_cvtsi64_si32(_mm_adds_pu8(_mm_cvtsi32_si64(*src),
- _mm_cvtsi32_si64(*dst)));
- dst++;
- src++;
- w--;
- }
-
- while (w >= 2)
- {
- *(ullong*)dst = (ullong) _mm_adds_pu8(*(__m64*)src, *(__m64*)dst);
- dst += 2;
- src += 2;
- w -= 2;
- }
-
- if (w)
- {
- *dst = _mm_cvtsi64_si32(_mm_adds_pu8(_mm_cvtsi32_si64(*src),
- _mm_cvtsi32_si64(*dst)));
-
- }
- }
-
- _mm_empty();
-}
-
-Bool
-fbSolidFillmmx (DrawablePtr pDraw,
- int x,
- int y,
- int width,
- int height,
- FbBits xor)
-{
- FbStride stride;
- int bpp;
- ullong fill;
- __m64 vfill;
- CARD32 byte_width;
- CARD8 *byte_line;
- FbBits *bits;
- int xoff, yoff;
- __m64 v1, v2, v3, v4, v5, v6, v7;
-
- CHECKPOINT();
-
- fbGetDrawable(pDraw, bits, stride, bpp, xoff, yoff);
-
- if (bpp == 16 && (xor >> 16 != (xor & 0xffff)))
- return FALSE;
-
- if (bpp != 16 && bpp != 32)
- return FALSE;
-
- if (bpp == 16)
- {
- stride = stride * sizeof (FbBits) / 2;
- byte_line = (CARD8 *)(((CARD16 *)bits) + stride * (y + yoff) + (x + xoff));
- byte_width = 2 * width;
- stride *= 2;
- }
- else
- {
- stride = stride * sizeof (FbBits) / 4;
- byte_line = (CARD8 *)(((CARD32 *)bits) + stride * (y + yoff) + (x + xoff));
- byte_width = 4 * width;
- stride *= 4;
- }
-
- fill = ((ullong)xor << 32) | xor;
- vfill = (__m64)fill;
-
- __asm__ (
- "movq %7, %0\n"
- "movq %7, %1\n"
- "movq %7, %2\n"
- "movq %7, %3\n"
- "movq %7, %4\n"
- "movq %7, %5\n"
- "movq %7, %6\n"
- : "=y" (v1), "=y" (v2), "=y" (v3),
- "=y" (v4), "=y" (v5), "=y" (v6), "=y" (v7)
- : "y" (vfill));
-
- while (height--)
- {
- int w;
- CARD8 *d = byte_line;
- byte_line += stride;
- w = byte_width;
-
- while (w >= 2 && ((unsigned long)d & 3))
- {
- *(CARD16 *)d = xor;
- w -= 2;
- d += 2;
- }
-
- while (w >= 4 && ((unsigned long)d & 7))
- {
- *(CARD32 *)d = xor;
-
- w -= 4;
- d += 4;
- }
-
- while (w >= 64)
- {
- __asm__ (
- "movq %1, (%0)\n"
- "movq %2, 8(%0)\n"
- "movq %3, 16(%0)\n"
- "movq %4, 24(%0)\n"
- "movq %5, 32(%0)\n"
- "movq %6, 40(%0)\n"
- "movq %7, 48(%0)\n"
- "movq %8, 56(%0)\n"
- :
- : "r" (d),
- "y" (vfill), "y" (v1), "y" (v2), "y" (v3),
- "y" (v4), "y" (v5), "y" (v6), "y" (v7)
- : "memory");
-
- w -= 64;
- d += 64;
- }
-
- while (w >= 4)
- {
- *(CARD32 *)d = xor;
-
- w -= 4;
- d += 4;
- }
- if (w >= 2)
- {
- *(CARD16 *)d = xor;
- w -= 2;
- d += 2;
- }
- }
-
- _mm_empty();
- return TRUE;
-}
-
-Bool
-fbCopyAreammx (DrawablePtr pSrc,
- DrawablePtr pDst,
- int src_x,
- int src_y,
- int dst_x,
- int dst_y,
- int width,
- int height)
-{
- FbBits * src_bits;
- FbStride src_stride;
- int src_bpp;
- int src_xoff;
- int src_yoff;
-
- FbBits * dst_bits;
- FbStride dst_stride;
- int dst_bpp;
- int dst_xoff;
- int dst_yoff;
-
- CARD8 * src_bytes;
- CARD8 * dst_bytes;
- int byte_width;
-
- fbGetDrawable(pSrc, src_bits, src_stride, src_bpp, src_xoff, src_yoff);
- fbGetDrawable(pDst, dst_bits, dst_stride, dst_bpp, dst_xoff, dst_yoff);
-
- if (src_bpp != dst_bpp)
- return FALSE;
-
- if (src_bpp == 16)
- {
- src_stride = src_stride * sizeof (FbBits) / 2;
- dst_stride = dst_stride * sizeof (FbBits) / 2;
- src_bytes = (CARD8 *)(((CARD16 *)src_bits) + src_stride * (src_y + src_yoff) + (src_x + src_xoff));
- dst_bytes = (CARD8 *)(((CARD16 *)dst_bits) + dst_stride * (dst_y + dst_yoff) + (dst_x + dst_xoff));
- byte_width = 2 * width;
- src_stride *= 2;
- dst_stride *= 2;
- } else if (src_bpp == 32) {
- src_stride = src_stride * sizeof (FbBits) / 4;
- dst_stride = dst_stride * sizeof (FbBits) / 4;
- src_bytes = (CARD8 *)(((CARD32 *)src_bits) + src_stride * (src_y + src_yoff) + (src_x + src_xoff));
- dst_bytes = (CARD8 *)(((CARD32 *)dst_bits) + dst_stride * (dst_y + dst_yoff) + (dst_x + dst_xoff));
- byte_width = 4 * width;
- src_stride *= 4;
- dst_stride *= 4;
- } else {
- return FALSE;
- }
-
- while (height--)
- {
- int w;
- CARD8 *s = src_bytes;
- CARD8 *d = dst_bytes;
- src_bytes += src_stride;
- dst_bytes += dst_stride;
- w = byte_width;
-
- while (w >= 2 && ((unsigned long)d & 3))
- {
- *(CARD16 *)d = *(CARD16 *)s;
- w -= 2;
- s += 2;
- d += 2;
- }
-
- while (w >= 4 && ((unsigned long)d & 7))
- {
- *(CARD32 *)d = *(CARD32 *)s;
-
- w -= 4;
- s += 4;
- d += 4;
- }
-
- while (w >= 64)
- {
- __asm__ (
- "movq (%1), %%mm0\n"
- "movq 8(%1), %%mm1\n"
- "movq 16(%1), %%mm2\n"
- "movq 24(%1), %%mm3\n"
- "movq 32(%1), %%mm4\n"
- "movq 40(%1), %%mm5\n"
- "movq 48(%1), %%mm6\n"
- "movq 56(%1), %%mm7\n"
-
- "movq %%mm0, (%0)\n"
- "movq %%mm1, 8(%0)\n"
- "movq %%mm2, 16(%0)\n"
- "movq %%mm3, 24(%0)\n"
- "movq %%mm4, 32(%0)\n"
- "movq %%mm5, 40(%0)\n"
- "movq %%mm6, 48(%0)\n"
- "movq %%mm7, 56(%0)\n"
- :
- : "r" (d), "r" (s)
- : "memory",
- "%mm0", "%mm1", "%mm2", "%mm3",
- "%mm4", "%mm5", "%mm6", "%mm7");
-
- w -= 64;
- s += 64;
- d += 64;
- }
- while (w >= 4)
- {
- *(CARD32 *)d = *(CARD32 *)s;
-
- w -= 4;
- s += 4;
- d += 4;
- }
- if (w >= 2)
- {
- *(CARD16 *)d = *(CARD16 *)s;
- w -= 2;
- s += 2;
- d += 2;
- }
- }
-
- _mm_empty();
- return TRUE;
-}
-
-void
-fbCompositeCopyAreammx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- fbCopyAreammx (pSrc->pDrawable,
- pDst->pDrawable,
- xSrc, ySrc,
- xDst, yDst,
- width, height);
-}
-
-
-
-
-#endif /* RENDER */
-#endif /* USE_MMX */
diff --git a/fb/fbmmx.h b/fb/fbmmx.h
deleted file mode 100644
index 34718e3c0..000000000
--- a/fb/fbmmx.h
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Copyright © 2004 Red Hat, Inc.
- * Copyright © 2005 Trolltech AS
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Red Hat not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. Red Hat makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
- * Author: Søren Sandmann (sandmann@redhat.com)
- * Lars Knoll (lars@trolltech.com)
- *
- * Based on work by Owen Taylor
- */
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#ifdef USE_MMX
-
-#if !defined(__amd64__) && !defined(__x86_64__)
-Bool fbHaveMMX(void);
-#else
-#define fbHaveMMX() TRUE
-#endif
-
-#else
-#define fbHaveMMX() FALSE
-#endif
-
-#ifdef USE_MMX
-
-void fbComposeSetupMMX(void);
-
-void fbCompositeSolidMask_nx8888x0565Cmmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-void fbCompositeSrcAdd_8888x8888mmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-void fbCompositeSrc_8888x8888mmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-void fbCompositeSolidMask_nx8888x8888Cmmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-void fbCompositeSolidMask_nx8x8888mmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-void fbCompositeSrcAdd_8000x8000mmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-void fbCompositeSrc_8888RevNPx8888mmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-void fbCompositeSrc_8888RevNPx0565mmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-void fbCompositeSolid_nx8888mmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-void fbCompositeSolid_nx0565mmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-void fbCompositeSolidMask_nx8x0565mmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-void fbCompositeSrc_8888x8x8888mmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-Bool fbCopyAreammx (DrawablePtr pSrc,
- DrawablePtr pDst,
- int src_x,
- int src_y,
- int dst_x,
- int dst_y,
- int width,
- int height);
-void fbCompositeCopyAreammx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-Bool fbSolidFillmmx (DrawablePtr pDraw,
- int x,
- int y,
- int width,
- int height,
- FbBits xor);
-
-#endif /* USE_MMX */
diff --git a/fb/fboverlay.c b/fb/fboverlay.c
index 1e3d756ed..5d7481eed 100644
--- a/fb/fboverlay.c
+++ b/fb/fboverlay.c
@@ -413,11 +413,7 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen,
return FALSE;
if (! miScreenInit(pScreen, 0, xsize, ysize, dpix, dpiy, 0,
depth1, ndepths, depths,
- defaultVisual, nvisuals, visuals
-#ifdef FB_OLD_MISCREENINIT
- , (miBSFuncPtr) 0
-#endif
- ))
+ defaultVisual, nvisuals, visuals))
return FALSE;
/* MI thinks there's no frame buffer */
#ifdef MITSHM
diff --git a/fb/fbpict.c b/fb/fbpict.c
index 38afbea5c..85b5171c5 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -1,6 +1,7 @@
/*
*
* Copyright © 2000 SuSE, Inc.
+ * Copyright © 2007 Red Hat, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -35,833 +36,36 @@
#include "picturestr.h"
#include "mipict.h"
#include "fbpict.h"
-#include "fbmmx.h"
-typedef void (*CompositeFunc) (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-CARD32
-fbOver (CARD32 x, CARD32 y)
-{
- CARD16 a = ~x >> 24;
- CARD16 t;
- CARD32 m,n,o,p;
-
- m = FbOverU(x,y,0,a,t);
- n = FbOverU(x,y,8,a,t);
- o = FbOverU(x,y,16,a,t);
- p = FbOverU(x,y,24,a,t);
- return m|n|o|p;
-}
-
-CARD32
-fbOver24 (CARD32 x, CARD32 y)
-{
- CARD16 a = ~x >> 24;
- CARD16 t;
- CARD32 m,n,o;
-
- m = FbOverU(x,y,0,a,t);
- n = FbOverU(x,y,8,a,t);
- o = FbOverU(x,y,16,a,t);
- return m|n|o;
-}
-
-CARD32
-fbIn (CARD32 x, CARD8 y)
-{
- CARD16 a = y;
- CARD16 t;
- CARD32 m,n,o,p;
-
- m = FbInU(x,0,a,t);
- n = FbInU(x,8,a,t);
- o = FbInU(x,16,a,t);
- p = FbInU(x,24,a,t);
- return m|n|o|p;
-}
-
-/*
- * Naming convention:
- *
- * opSRCxMASKxDST
- */
-
-void
-fbCompositeSolidMask_nx8x8888 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD32 src, srca;
- CARD32 *dstLine, *dst, d, dstMask;
- CARD8 *maskLine, *mask, m;
- FbStride dstStride, maskStride;
- CARD16 w;
-
- fbComposeGetSolid(pSrc, src, pDst->format);
-
- dstMask = FbFullMask (pDst->pDrawable->depth);
- srca = src >> 24;
- if (src == 0)
- return;
-
- fbComposeGetStart (pDst, xDst, yDst, CARD32, dstStride, dstLine, 1);
- fbComposeGetStart (pMask, xMask, yMask, CARD8, maskStride, maskLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- mask = maskLine;
- maskLine += maskStride;
- w = width;
-
- while (w--)
- {
- m = *mask++;
- if (m == 0xff)
- {
- if (srca == 0xff)
- *dst = src & dstMask;
- else
- *dst = fbOver (src, *dst) & dstMask;
- }
- else if (m)
- {
- d = fbIn (src, m);
- *dst = fbOver (d, *dst) & dstMask;
- }
- dst++;
- }
- }
-}
-
-void
-fbCompositeSolidMask_nx8888x8888C (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD32 src, srca;
- CARD32 *dstLine, *dst, d, dstMask;
- CARD32 *maskLine, *mask, ma;
- FbStride dstStride, maskStride;
- CARD16 w;
- CARD32 m, n, o, p;
-
- fbComposeGetSolid(pSrc, src, pDst->format);
-
- dstMask = FbFullMask (pDst->pDrawable->depth);
- srca = src >> 24;
- if (src == 0)
- return;
-
- fbComposeGetStart (pDst, xDst, yDst, CARD32, dstStride, dstLine, 1);
- fbComposeGetStart (pMask, xMask, yMask, CARD32, maskStride, maskLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- mask = maskLine;
- maskLine += maskStride;
- w = width;
-
- while (w--)
- {
- ma = *mask++;
- if (ma == 0xffffffff)
- {
- if (srca == 0xff)
- *dst = src & dstMask;
- else
- *dst = fbOver (src, *dst) & dstMask;
- }
- else if (ma)
- {
- d = *dst;
-#define FbInOverC(src,srca,msk,dst,i,result) { \
- CARD16 __a = FbGet8(msk,i); \
- CARD32 __t, __ta; \
- CARD32 __i; \
- __t = FbIntMult (FbGet8(src,i), __a,__i); \
- __ta = (CARD8) ~FbIntMult (srca, __a,__i); \
- __t = __t + FbIntMult(FbGet8(dst,i),__ta,__i); \
- __t = (CARD32) (CARD8) (__t | (-(__t >> 8))); \
- result = __t << (i); \
-}
- FbInOverC (src, srca, ma, d, 0, m);
- FbInOverC (src, srca, ma, d, 8, n);
- FbInOverC (src, srca, ma, d, 16, o);
- FbInOverC (src, srca, ma, d, 24, p);
- *dst = m|n|o|p;
- }
- dst++;
- }
- }
-}
-
-void
-fbCompositeSolidMask_nx8x0888 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD32 src, srca;
- CARD8 *dstLine, *dst;
- CARD32 d;
- CARD8 *maskLine, *mask, m;
- FbStride dstStride, maskStride;
- CARD16 w;
-
- fbComposeGetSolid(pSrc, src, pDst->format);
-
- srca = src >> 24;
- if (src == 0)
- return;
-
- fbComposeGetStart (pDst, xDst, yDst, CARD8, dstStride, dstLine, 3);
- fbComposeGetStart (pMask, xMask, yMask, CARD8, maskStride, maskLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- mask = maskLine;
- maskLine += maskStride;
- w = width;
-
- while (w--)
- {
- m = *mask++;
- if (m == 0xff)
- {
- if (srca == 0xff)
- d = src;
- else
- {
- d = Fetch24(dst);
- d = fbOver24 (src, d);
- }
- Store24(dst,d);
- }
- else if (m)
- {
- d = fbOver24 (fbIn(src,m), Fetch24(dst));
- Store24(dst,d);
- }
- dst += 3;
- }
- }
-}
-
-void
-fbCompositeSolidMask_nx8x0565 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD32 src, srca;
- CARD16 *dstLine, *dst;
- CARD32 d;
- CARD8 *maskLine, *mask, m;
- FbStride dstStride, maskStride;
- CARD16 w;
-
- fbComposeGetSolid(pSrc, src, pDst->format);
-
- srca = src >> 24;
- if (src == 0)
- return;
-
- fbComposeGetStart (pDst, xDst, yDst, CARD16, dstStride, dstLine, 1);
- fbComposeGetStart (pMask, xMask, yMask, CARD8, maskStride, maskLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- mask = maskLine;
- maskLine += maskStride;
- w = width;
-
- while (w--)
- {
- m = *mask++;
- if (m == 0xff)
- {
- if (srca == 0xff)
- d = src;
- else
- {
- d = *dst;
- d = fbOver24 (src, cvt0565to8888(d));
- }
- *dst = cvt8888to0565(d);
- }
- else if (m)
- {
- d = *dst;
- d = fbOver24 (fbIn(src,m), cvt0565to8888(d));
- *dst = cvt8888to0565(d);
- }
- dst++;
- }
- }
-}
-
-void
-fbCompositeSolidMask_nx8888x0565C (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD32 src, srca;
- CARD16 src16;
- CARD16 *dstLine, *dst;
- CARD32 d;
- CARD32 *maskLine, *mask, ma;
- FbStride dstStride, maskStride;
- CARD16 w;
- CARD32 m, n, o;
-
- fbComposeGetSolid(pSrc, src, pDst->format);
-
- srca = src >> 24;
- if (src == 0)
- return;
-
- src16 = cvt8888to0565(src);
-
- fbComposeGetStart (pDst, xDst, yDst, CARD16, dstStride, dstLine, 1);
- fbComposeGetStart (pMask, xMask, yMask, CARD32, maskStride, maskLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- mask = maskLine;
- maskLine += maskStride;
- w = width;
-
- while (w--)
- {
- ma = *mask++;
- if (ma == 0xffffffff)
- {
- if (srca == 0xff)
- {
- *dst = src16;
- }
- else
- {
- d = *dst;
- d = fbOver24 (src, cvt0565to8888(d));
- *dst = cvt8888to0565(d);
- }
- }
- else if (ma)
- {
- d = *dst;
- d = cvt0565to8888(d);
- FbInOverC (src, srca, ma, d, 0, m);
- FbInOverC (src, srca, ma, d, 8, n);
- FbInOverC (src, srca, ma, d, 16, o);
- d = m|n|o;
- *dst = cvt8888to0565(d);
- }
- dst++;
- }
- }
-}
-
-void
-fbCompositeSrc_8888x8888 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD32 *dstLine, *dst, dstMask;
- CARD32 *srcLine, *src, s;
- FbStride dstStride, srcStride;
- CARD8 a;
- CARD16 w;
-
- fbComposeGetStart (pDst, xDst, yDst, CARD32, dstStride, dstLine, 1);
- fbComposeGetStart (pSrc, xSrc, ySrc, CARD32, srcStride, srcLine, 1);
-
- dstMask = FbFullMask (pDst->pDrawable->depth);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- src = srcLine;
- srcLine += srcStride;
- w = width;
-
- while (w--)
- {
- s = *src++;
- a = s >> 24;
- if (a == 0xff)
- *dst = s & dstMask;
- else if (a)
- *dst = fbOver (s, *dst) & dstMask;
- dst++;
- }
- }
-}
-
-void
-fbCompositeSrc_8888x0888 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD8 *dstLine, *dst;
- CARD32 d;
- CARD32 *srcLine, *src, s;
- CARD8 a;
- FbStride dstStride, srcStride;
- CARD16 w;
-
- fbComposeGetStart (pDst, xDst, yDst, CARD8, dstStride, dstLine, 3);
- fbComposeGetStart (pSrc, xSrc, ySrc, CARD32, srcStride, srcLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- src = srcLine;
- srcLine += srcStride;
- w = width;
-
- while (w--)
- {
- s = *src++;
- a = s >> 24;
- if (a)
- {
- if (a == 0xff)
- d = s;
- else
- d = fbOver24 (s, Fetch24(dst));
- Store24(dst,d);
- }
- dst += 3;
- }
- }
-}
-
-void
-fbCompositeSrc_8888x0565 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD16 *dstLine, *dst;
- CARD32 d;
- CARD32 *srcLine, *src, s;
- CARD8 a;
- FbStride dstStride, srcStride;
- CARD16 w;
-
- fbComposeGetStart (pSrc, xSrc, ySrc, CARD32, srcStride, srcLine, 1);
- fbComposeGetStart (pDst, xDst, yDst, CARD16, dstStride, dstLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- src = srcLine;
- srcLine += srcStride;
- w = width;
-
- while (w--)
- {
- s = *src++;
- a = s >> 24;
- if (a)
- {
- if (a == 0xff)
- d = s;
- else
- {
- d = *dst;
- d = fbOver24 (s, cvt0565to8888(d));
- }
- *dst = cvt8888to0565(d);
- }
- dst++;
- }
- }
-}
-
-void
-fbCompositeSrc_0565x0565 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD16 *dstLine, *dst;
- CARD16 *srcLine, *src;
- FbStride dstStride, srcStride;
- CARD16 w;
-
- fbComposeGetStart (pSrc, xSrc, ySrc, CARD16, srcStride, srcLine, 1);
-
- fbComposeGetStart (pDst, xDst, yDst, CARD16, dstStride, dstLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- src = srcLine;
- srcLine += srcStride;
- w = width;
-
- while (w--)
- *dst++ = *src++;
- }
-}
-
-void
-fbCompositeSrcAdd_8000x8000 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD8 *dstLine, *dst;
- CARD8 *srcLine, *src;
- FbStride dstStride, srcStride;
- CARD16 w;
- CARD8 s, d;
- CARD16 t;
-
- fbComposeGetStart (pSrc, xSrc, ySrc, CARD8, srcStride, srcLine, 1);
- fbComposeGetStart (pDst, xDst, yDst, CARD8, dstStride, dstLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- src = srcLine;
- srcLine += srcStride;
- w = width;
-
- while (w--)
- {
- s = *src++;
- if (s)
- {
- if (s != 0xff)
- {
- d = *dst;
- t = d + s;
- s = t | (0 - (t >> 8));
- }
- *dst = s;
- }
- dst++;
- }
- }
-}
-
-void
-fbCompositeSrcAdd_8888x8888 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD32 *dstLine, *dst;
- CARD32 *srcLine, *src;
- FbStride dstStride, srcStride;
- CARD16 w;
- CARD32 s, d;
- CARD16 t;
- CARD32 m,n,o,p;
-
- fbComposeGetStart (pSrc, xSrc, ySrc, CARD32, srcStride, srcLine, 1);
- fbComposeGetStart (pDst, xDst, yDst, CARD32, dstStride, dstLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- src = srcLine;
- srcLine += srcStride;
- w = width;
-
- while (w--)
- {
- s = *src++;
- if (s)
- {
- if (s != 0xffffffff)
- {
- d = *dst;
- if (d)
- {
- m = FbAdd(s,d,0,t);
- n = FbAdd(s,d,8,t);
- o = FbAdd(s,d,16,t);
- p = FbAdd(s,d,24,t);
- s = m|n|o|p;
- }
- }
- *dst = s;
- }
- dst++;
- }
- }
-}
-
-void
-fbCompositeSrcAdd_1000x1000 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- FbBits *dstBits, *srcBits;
- FbStride dstStride, srcStride;
- int dstBpp, srcBpp;
- int dstXoff, dstYoff;
- int srcXoff, srcYoff;
-
- fbGetDrawable(pSrc->pDrawable, srcBits, srcStride, srcBpp, srcXoff, srcYoff);
-
- fbGetDrawable(pDst->pDrawable, dstBits, dstStride, dstBpp, dstXoff, dstYoff);
-
- fbBlt (srcBits + srcStride * (ySrc + srcYoff),
- srcStride,
- xSrc + srcXoff,
-
- dstBits + dstStride * (yDst + dstYoff),
- dstStride,
- xDst + dstXoff,
-
- width,
- height,
-
- GXor,
- FB_ALLONES,
- srcBpp,
-
- FALSE,
- FALSE);
-}
-
-void
-fbCompositeSolidMask_nx1xn (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- FbBits *dstBits;
- FbStip *maskBits;
- FbStride dstStride, maskStride;
- int dstBpp, maskBpp;
- int dstXoff, dstYoff;
- int maskXoff, maskYoff;
- FbBits src;
-
- fbComposeGetSolid(pSrc, src, pDst->format);
-
- if ((src & 0xff000000) != 0xff000000)
- {
- fbCompositeGeneral (op, pSrc, pMask, pDst,
- xSrc, ySrc, xMask, yMask, xDst, yDst,
- width, height);
- return;
- }
- fbGetStipDrawable (pMask->pDrawable, maskBits, maskStride, maskBpp, maskXoff, maskYoff);
- fbGetDrawable (pDst->pDrawable, dstBits, dstStride, dstBpp, dstXoff, dstYoff);
-
- switch (dstBpp) {
- case 32:
- break;
- case 24:
- break;
- case 16:
- src = cvt8888to0565(src);
- break;
- }
-
- src = fbReplicatePixel (src, dstBpp);
-
- fbBltOne (maskBits + maskStride * (yMask + maskYoff),
- maskStride,
- xMask + maskXoff,
-
- dstBits + dstStride * (yDst + dstYoff),
- dstStride,
- (xDst + dstXoff) * dstBpp,
- dstBpp,
-
- width * dstBpp,
- height,
-
- 0x0,
- src,
- FB_ALLONES,
- 0x0);
-}
-
-# define mod(a,b) ((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (b) - (-a) % (b))
+#define mod(a,b) ((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (b) - (-a) % (b))
void
-fbComposite (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
+fbWalkCompositeRegion (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pMask,
+ PicturePtr pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height,
+ Bool srcRepeat,
+ Bool maskRepeat,
+ CompositeFunc compositeRect)
{
RegionRec region;
int n;
BoxPtr pbox;
- CompositeFunc func = NULL;
- Bool srcRepeat = pSrc->pDrawable && pSrc->repeat;
- Bool maskRepeat = FALSE;
- Bool srcAlphaMap = pSrc->alphaMap != 0;
- Bool maskAlphaMap = FALSE;
- Bool dstAlphaMap = pDst->alphaMap != 0;
- int x_msk, y_msk, x_src, y_src, x_dst, y_dst;
int w, h, w_this, h_this;
-
-#ifdef USE_MMX
- static Bool mmx_setup = FALSE;
- if (!mmx_setup) {
- fbComposeSetupMMX();
- mmx_setup = TRUE;
- }
-#endif
-
+ int x_msk, y_msk, x_src, y_src, x_dst, y_dst;
+
xDst += pDst->pDrawable->x;
yDst += pDst->pDrawable->y;
- if (pSrc->pDrawable) {
+ if (pSrc->pDrawable)
+ {
xSrc += pSrc->pDrawable->x;
ySrc += pSrc->pDrawable->y;
}
@@ -869,431 +73,12 @@ fbComposite (CARD8 op,
{
xMask += pMask->pDrawable->x;
yMask += pMask->pDrawable->y;
- maskRepeat = pMask->repeat == RepeatNormal;
- maskAlphaMap = pMask->alphaMap != 0;
- }
-
- if (pSrc->pDrawable && (!pMask || pMask->pDrawable)
- && !pSrc->transform && !(pMask && pMask->transform)
- && !maskAlphaMap && !srcAlphaMap && !dstAlphaMap
- && (pSrc->filter != PictFilterConvolution)
- && (!pMask || pMask->filter != PictFilterConvolution))
- switch (op) {
- case PictOpSrc:
-#ifdef USE_MMX
- if (!pMask && pSrc->format == pDst->format &&
- pSrc->format != PICT_a8 && pSrc->pDrawable != pDst->pDrawable)
- {
- func = fbCompositeCopyAreammx;
- }
-#endif
- break;
- case PictOpOver:
- if (pMask)
- {
- if (fbCanGetSolid(pSrc) &&
- !maskRepeat)
- {
- srcRepeat = FALSE;
- if (PICT_FORMAT_COLOR(pSrc->format)) {
- switch (pMask->format) {
- case PICT_a8:
- switch (pDst->format) {
- case PICT_r5g6b5:
- case PICT_b5g6r5:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSolidMask_nx8x0565mmx;
- else
-#endif
- func = fbCompositeSolidMask_nx8x0565;
- break;
- case PICT_r8g8b8:
- case PICT_b8g8r8:
- func = fbCompositeSolidMask_nx8x0888;
- break;
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
- case PICT_a8b8g8r8:
- case PICT_x8b8g8r8:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSolidMask_nx8x8888mmx;
- else
-#endif
- func = fbCompositeSolidMask_nx8x8888;
- break;
- default:
- break;
- }
- break;
- case PICT_a8r8g8b8:
- if (pMask->componentAlpha) {
- switch (pDst->format) {
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSolidMask_nx8888x8888Cmmx;
- else
-#endif
- func = fbCompositeSolidMask_nx8888x8888C;
- break;
- case PICT_r5g6b5:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSolidMask_nx8888x0565Cmmx;
- else
-#endif
- func = fbCompositeSolidMask_nx8888x0565C;
- break;
- default:
- break;
- }
- }
- break;
- case PICT_a8b8g8r8:
- if (pMask->componentAlpha) {
- switch (pDst->format) {
- case PICT_a8b8g8r8:
- case PICT_x8b8g8r8:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSolidMask_nx8888x8888Cmmx;
- else
-#endif
- func = fbCompositeSolidMask_nx8888x8888C;
- break;
- case PICT_b5g6r5:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSolidMask_nx8888x0565Cmmx;
- else
-#endif
- func = fbCompositeSolidMask_nx8888x0565C;
- break;
- default:
- break;
- }
- }
- break;
- case PICT_a1:
- switch (pDst->format) {
- case PICT_r5g6b5:
- case PICT_b5g6r5:
- case PICT_r8g8b8:
- case PICT_b8g8r8:
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
- case PICT_a8b8g8r8:
- case PICT_x8b8g8r8:
- func = fbCompositeSolidMask_nx1xn;
- break;
- default:
- break;
- }
- break;
- default:
- break;
- }
- default:
- break;
- }
- }
- else if (! srcRepeat) /* has mask and non-repeating source */
- {
- if (pSrc->pDrawable == pMask->pDrawable &&
- xSrc == xMask && ySrc == yMask &&
- !pMask->componentAlpha && !maskRepeat)
- {
- /* source == mask: non-premultiplied data */
- switch (pSrc->format) {
- case PICT_x8b8g8r8:
- switch (pMask->format) {
- case PICT_a8r8g8b8:
- case PICT_a8b8g8r8:
- switch (pDst->format) {
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSrc_8888RevNPx8888mmx;
-#endif
- break;
- case PICT_r5g6b5:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSrc_8888RevNPx0565mmx;
-#endif
- break;
- default:
- break;
- }
- break;
- default:
- break;
- }
- break;
- case PICT_x8r8g8b8:
- switch (pMask->format) {
- case PICT_a8r8g8b8:
- case PICT_a8b8g8r8:
- switch (pDst->format) {
- case PICT_a8b8g8r8:
- case PICT_x8b8g8r8:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSrc_8888RevNPx8888mmx;
-#endif
- break;
- case PICT_r5g6b5:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSrc_8888RevNPx0565mmx;
-#endif
- break;
- default:
- break;
- }
- break;
- default:
- break;
- }
- break;
- default:
- break;
- }
- break;
- }
- else
- {
- /* non-repeating source, repeating mask => translucent window */
- if (fbCanGetSolid(pMask))
- {
- if (pSrc->format == PICT_x8r8g8b8 &&
- pDst->format == PICT_x8r8g8b8 &&
- pMask->format == PICT_a8)
- {
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSrc_8888x8x8888mmx;
-#endif
- }
- }
- }
- }
- }
- else /* no mask */
- {
- if (fbCanGetSolid(pSrc))
- {
- /* no mask and repeating source */
- switch (pSrc->format) {
- case PICT_a8r8g8b8:
- switch (pDst->format) {
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
-#ifdef USE_MMX
- if (fbHaveMMX())
- {
- srcRepeat = FALSE;
- func = fbCompositeSolid_nx8888mmx;
- }
-#endif
- break;
- case PICT_r5g6b5:
-#ifdef USE_MMX
- if (fbHaveMMX())
- {
- srcRepeat = FALSE;
- func = fbCompositeSolid_nx0565mmx;
- }
-#endif
- break;
- default:
- break;
- }
- break;
- default:
- break;
- }
- }
- else if (! srcRepeat)
- {
- switch (pSrc->format) {
- case PICT_a8r8g8b8:
- switch (pDst->format) {
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSrc_8888x8888mmx;
- else
-#endif
- func = fbCompositeSrc_8888x8888;
- break;
- case PICT_r8g8b8:
- func = fbCompositeSrc_8888x0888;
- break;
- case PICT_r5g6b5:
- func = fbCompositeSrc_8888x0565;
- break;
- default:
- break;
- }
- break;
- case PICT_x8r8g8b8:
- switch (pDst->format) {
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeCopyAreammx;
-#endif
- break;
- default:
- break;
- }
- case PICT_x8b8g8r8:
- switch (pDst->format) {
- case PICT_a8b8g8r8:
- case PICT_x8b8g8r8:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeCopyAreammx;
-#endif
- break;
- default:
- break;
- }
- break;
- case PICT_a8b8g8r8:
- switch (pDst->format) {
- case PICT_a8b8g8r8:
- case PICT_x8b8g8r8:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSrc_8888x8888mmx;
- else
-#endif
- func = fbCompositeSrc_8888x8888;
- break;
- case PICT_b8g8r8:
- func = fbCompositeSrc_8888x0888;
- break;
- case PICT_b5g6r5:
- func = fbCompositeSrc_8888x0565;
- break;
- default:
- break;
- }
- break;
- case PICT_r5g6b5:
- switch (pDst->format) {
- case PICT_r5g6b5:
- func = fbCompositeSrc_0565x0565;
- break;
- default:
- break;
- }
- break;
- case PICT_b5g6r5:
- switch (pDst->format) {
- case PICT_b5g6r5:
- func = fbCompositeSrc_0565x0565;
- break;
- default:
- break;
- }
- break;
- default:
- break;
- }
- }
- }
- break;
- case PictOpAdd:
- if (pMask == 0)
- {
- switch (pSrc->format) {
- case PICT_a8r8g8b8:
- switch (pDst->format) {
- case PICT_a8r8g8b8:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSrcAdd_8888x8888mmx;
- else
-#endif
- func = fbCompositeSrcAdd_8888x8888;
- break;
- default:
- break;
- }
- break;
- case PICT_a8b8g8r8:
- switch (pDst->format) {
- case PICT_a8b8g8r8:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSrcAdd_8888x8888mmx;
- else
-#endif
- func = fbCompositeSrcAdd_8888x8888;
- break;
- default:
- break;
- }
- break;
- case PICT_a8:
- switch (pDst->format) {
- case PICT_a8:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSrcAdd_8000x8000mmx;
- else
-#endif
- func = fbCompositeSrcAdd_8000x8000;
- break;
- default:
- break;
- }
- break;
- case PICT_a1:
- switch (pDst->format) {
- case PICT_a1:
- func = fbCompositeSrcAdd_1000x1000;
- break;
- default:
- break;
- }
- break;
- default:
- break;
- }
- }
- break;
- }
-
- if (!func) {
- /* no fast path, use the general code */
- fbCompositeGeneral(op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height);
- return;
}
- if (!miComputeCompositeRegion (&region,
- pSrc,
- pMask,
- pDst,
- xSrc,
- ySrc,
- xMask,
- yMask,
- xDst,
- yDst,
- width,
- height))
+ if (!miComputeCompositeRegion (&region, pSrc, pMask, pDst, xSrc, ySrc,
+ xMask, yMask, xDst, yDst, width, height))
return;
-
+
n = REGION_NUM_RECTS (&region);
pbox = REGION_RECTS (&region);
while (n--)
@@ -1340,9 +125,9 @@ fbComposite (CARD8 op,
w_this = pSrc->pDrawable->width - x_src;
x_src += pSrc->pDrawable->x;
}
- (*func) (op, pSrc, pMask, pDst,
- x_src, y_src, x_msk, y_msk, x_dst, y_dst,
- w_this, h_this);
+ (*compositeRect) (op, pSrc, pMask, pDst,
+ x_src, y_src, x_msk, y_msk, x_dst, y_dst,
+ w_this, h_this);
w -= w_this;
x_src += w_this;
x_msk += w_this;
@@ -1358,166 +143,329 @@ fbComposite (CARD8 op,
REGION_UNINIT (pDst->pDrawable->pScreen, &region);
}
-#endif /* RENDER */
-
-Bool
-fbPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
+void
+fbComposite (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pMask,
+ PicturePtr pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height)
{
+ pixman_image_t *src, *mask, *dest;
+
+ xDst += pDst->pDrawable->x;
+ yDst += pDst->pDrawable->y;
+ if (pSrc->pDrawable)
+ {
+ xSrc += pSrc->pDrawable->x;
+ ySrc += pSrc->pDrawable->y;
+ }
+ if (pMask && pMask->pDrawable)
+ {
+ xMask += pMask->pDrawable->x;
+ yMask += pMask->pDrawable->y;
+ }
-#ifdef RENDER
+ miCompositeSourceValidate (pSrc, xSrc, ySrc, width, height);
+ if (pMask)
+ miCompositeSourceValidate (pMask, xMask, yMask, width, height);
+
+ src = image_from_pict (pSrc, TRUE);
+ mask = image_from_pict (pMask, TRUE);
+ dest = image_from_pict (pDst, TRUE);
- PictureScreenPtr ps;
+ if (src && dest && !(pMask && !mask))
+ {
+ pixman_image_composite (op, src, mask, dest,
+ xSrc, ySrc, xMask, yMask, xDst, yDst,
+ width, height);
+ }
- if (!miPictureInit (pScreen, formats, nformats))
- return FALSE;
- ps = GetPictureScreen(pScreen);
- ps->Composite = fbComposite;
- ps->Glyphs = miGlyphs;
- ps->CompositeRects = miCompositeRects;
- ps->RasterizeTrapezoid = fbRasterizeTrapezoid;
- ps->AddTraps = fbAddTraps;
- ps->AddTriangles = fbAddTriangles;
+ free_pixman_pict (pSrc, src);
+ free_pixman_pict (pMask, mask);
+ free_pixman_pict (pDst, dest);
+}
+
+void
+fbCompositeGeneral (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pMask,
+ PicturePtr pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height)
+{
+ fbComposite (op, pSrc, pMask, pDst,
+ xSrc, ySrc, xMask, yMask, xDst, yDst,
+ width, height);
+}
#endif /* RENDER */
- return TRUE;
+static pixman_image_t *
+create_solid_fill_image (PicturePtr pict)
+{
+ PictSolidFill *solid = &pict->pSourcePict->solidFill;
+ pixman_color_t color;
+ CARD32 a, r, g, b;
+
+ a = (solid->color & 0xff000000) >> 24;
+ r = (solid->color & 0x00ff0000) >> 16;
+ g = (solid->color & 0x0000ff00) >> 8;
+ b = (solid->color & 0x000000ff) >> 0;
+
+ color.alpha = (a << 8) | a;
+ color.red = (r << 8) | r;
+ color.green = (g << 8) | g;
+ color.blue = (b << 8) | b;
+
+ return pixman_image_create_solid_fill (&color);
}
-#ifdef USE_MMX
-/* The CPU detection code needs to be in a file not compiled with
- * "-mmmx -msse", as gcc would generate CMOV instructions otherwise
- * that would lead to SIGILL instructions on old CPUs that don't have
- * it.
- */
-#if !defined(__amd64__) && !defined(__x86_64__)
+static pixman_image_t *
+create_linear_gradient_image (PictGradient *gradient)
+{
+ PictLinearGradient *linear = (PictLinearGradient *)gradient;
+ pixman_point_fixed_t p1;
+ pixman_point_fixed_t p2;
+
+ p1.x = linear->p1.x;
+ p1.y = linear->p1.y;
+ p2.x = linear->p2.x;
+ p2.y = linear->p2.y;
+
+ return pixman_image_create_linear_gradient (
+ &p1, &p2, (pixman_gradient_stop_t *)gradient->stops, gradient->nstops);
+}
-#ifdef HAVE_GETISAX
-#include <sys/auxv.h>
-#endif
+static pixman_image_t *
+create_radial_gradient_image (PictGradient *gradient)
+{
+ PictRadialGradient *radial = (PictRadialGradient *)gradient;
+ pixman_point_fixed_t c1;
+ pixman_point_fixed_t c2;
+
+ c1.x = radial->c1.x;
+ c1.y = radial->c1.y;
+ c2.x = radial->c2.x;
+ c2.y = radial->c2.y;
+
+ return pixman_image_create_radial_gradient (
+ &c1, &c2, radial->c1.radius,
+ radial->c2.radius,
+ (pixman_gradient_stop_t *)gradient->stops, gradient->nstops);
+}
+
+static pixman_image_t *
+create_conical_gradient_image (PictGradient *gradient)
+{
+ PictConicalGradient *conical = (PictConicalGradient *)gradient;
+ pixman_point_fixed_t center;
+
+ center.x = conical->center.x;
+ center.y = conical->center.y;
+
+ return pixman_image_create_conical_gradient (
+ &center, conical->angle, (pixman_gradient_stop_t *)gradient->stops,
+ gradient->nstops);
+}
-enum CPUFeatures {
- NoFeatures = 0,
- MMX = 0x1,
- MMX_Extensions = 0x2,
- SSE = 0x6,
- SSE2 = 0x8,
- CMOV = 0x10
-};
+static pixman_image_t *
+create_bits_picture (PicturePtr pict,
+ Bool has_clip)
+{
+ FbBits *bits;
+ FbStride stride;
+ int bpp, xoff, yoff;
+ pixman_image_t *image;
+
+ fbGetDrawable (pict->pDrawable, bits, stride, bpp, xoff, yoff);
-static unsigned int detectCPUFeatures(void) {
- unsigned int features = 0;
- unsigned int result;
+ bits = (CARD8*)bits + yoff * stride * sizeof(FbBits) + xoff * (bpp / 8);
-#ifdef HAVE_GETISAX
- if (getisax(&result, 1)) {
- if (result & AV_386_CMOV)
- features |= CMOV;
- if (result & AV_386_MMX)
- features |= MMX;
- if (result & AV_386_AMD_MMX)
- features |= MMX_Extensions;
- if (result & AV_386_SSE)
- features |= SSE;
- if (result & AV_386_SSE2)
- features |= SSE2;
- }
+ image = pixman_image_create_bits (
+ pict->format,
+ pict->pDrawable->width, pict->pDrawable->height,
+ (uint32_t *)bits, stride * sizeof (FbStride));
+
+
+#ifdef FB_ACCESS_WRAPPER
+#if FB_SHIFT==5
+
+ pixman_image_set_accessors (image,
+ (pixman_read_memory_func_t)wfbReadMemory,
+ (pixman_write_memory_func_t)wfbWriteMemory);
+
#else
- char vendor[13];
- vendor[0] = 0;
- vendor[12] = 0;
- /* see p. 118 of amd64 instruction set manual Vol3 */
- /* We need to be careful about the handling of %ebx and
- * %esp here. We can't declare either one as clobbered
- * since they are special registers (%ebx is the "PIC
- * register" holding an offset to global data, %esp the
- * stack pointer), so we need to make sure they have their
- * original values when we access the output operands.
+
+#error The pixman library only works when FbBits is 32 bits wide
+
+#endif
+#endif
+
+ /* pCompositeClip is undefined for source pictures, so
+ * only set the clip region for pictures with drawables
*/
- __asm__ ("pushf\n"
- "pop %%eax\n"
- "mov %%eax, %%ecx\n"
- "xor $0x00200000, %%eax\n"
- "push %%eax\n"
- "popf\n"
- "pushf\n"
- "pop %%eax\n"
- "mov $0x0, %%edx\n"
- "xor %%ecx, %%eax\n"
- "jz 1\n"
+ if (has_clip)
+ {
+ if (pict->clientClipType != CT_NONE)
+ pixman_image_set_has_client_clip (image, TRUE);
+
+ pixman_image_set_clip_region (image, pict->pCompositeClip);
+ }
+
+ /* Indexed table */
+ if (pict->pFormat->index.devPrivate)
+ pixman_image_set_indexed (image, pict->pFormat->index.devPrivate);
- "mov $0x00000000, %%eax\n"
- "push %%ebx\n"
- "cpuid\n"
- "mov %%ebx, %%eax\n"
- "pop %%ebx\n"
- "mov %%eax, %1\n"
- "mov %%edx, %2\n"
- "mov %%ecx, %3\n"
- "mov $0x00000001, %%eax\n"
- "push %%ebx\n"
- "cpuid\n"
- "pop %%ebx\n"
- "1:\n"
- "mov %%edx, %0\n"
- : "=r" (result),
- "=m" (vendor[0]),
- "=m" (vendor[4]),
- "=m" (vendor[8])
- :
- : "%eax", "%ecx", "%edx"
- );
+ return image;
+}
- if (result) {
- /* result now contains the standard feature bits */
- if (result & (1 << 15))
- features |= CMOV;
- if (result & (1 << 23))
- features |= MMX;
- if (result & (1 << 25))
- features |= SSE;
- if (result & (1 << 26))
- features |= SSE2;
- if ((result & MMX) && !(result & SSE) && (strcmp(vendor, "AuthenticAMD") == 0)) {
- /* check for AMD MMX extensions */
+static void
+set_image_properties (pixman_image_t *image, PicturePtr pict)
+{
+ pixman_repeat_t repeat;
+ pixman_filter_t filter;
+
+ if (pict->transform)
+ {
+ pixman_image_set_transform (
+ image, (pixman_transform_t *)pict->transform);
+ }
+
+ switch (pict->repeatType)
+ {
+ default:
+ case RepeatNone:
+ repeat = PIXMAN_REPEAT_NONE;
+ break;
+
+ case RepeatPad:
+ repeat = PIXMAN_REPEAT_PAD;
+ break;
+
+ case RepeatNormal:
+ repeat = PIXMAN_REPEAT_NORMAL;
+ break;
+
+ case RepeatReflect:
+ repeat = PIXMAN_REPEAT_REFLECT;
+ break;
+ }
+
+ pixman_image_set_repeat (image, repeat);
+
+ if (pict->alphaMap)
+ {
+ pixman_image_t *alpha_map = image_from_pict (pict->alphaMap, TRUE);
+
+ pixman_image_set_alpha_map (
+ image, alpha_map, pict->alphaOrigin.x, pict->alphaOrigin.y);
+
+ free_pixman_pict (pict->alphaMap, alpha_map);
+ }
+
+ pixman_image_set_component_alpha (image, pict->componentAlpha);
- unsigned int result;
- __asm__("push %%ebx\n"
- "mov $0x80000000, %%eax\n"
- "cpuid\n"
- "xor %%edx, %%edx\n"
- "cmp $0x1, %%eax\n"
- "jge 2\n"
- "mov $0x80000001, %%eax\n"
- "cpuid\n"
- "2:\n"
- "pop %%ebx\n"
- "mov %%edx, %0\n"
- : "=r" (result)
- :
- : "%eax", "%ecx", "%edx"
- );
- if (result & (1<<22))
- features |= MMX_Extensions;
- }
+ switch (pict->filter)
+ {
+ default:
+ case PictFilterNearest:
+ case PictFilterFast:
+ filter = PIXMAN_FILTER_NEAREST;
+ break;
+
+ case PictFilterBilinear:
+ case PictFilterGood:
+ filter = PIXMAN_FILTER_BILINEAR;
+ break;
+
+ case PictFilterConvolution:
+ filter = PIXMAN_FILTER_CONVOLUTION;
+ break;
}
-#endif /* HAVE_GETISAX */
- return features;
+
+ pixman_image_set_filter (image, filter, (pixman_fixed_t *)pict->filter_params, pict->filter_nparams);
+ pixman_image_set_source_clipping (image, TRUE);
}
-Bool
-fbHaveMMX (void)
+pixman_image_t *
+image_from_pict (PicturePtr pict,
+ Bool has_clip)
{
- static Bool initialized = FALSE;
- static Bool mmx_present;
+ pixman_image_t *image = NULL;
+
+ if (!pict)
+ return NULL;
- if (!initialized)
+ if (pict->pDrawable)
+ {
+ image = create_bits_picture (pict, has_clip);
+ }
+ else if (pict->pSourcePict)
{
- unsigned int features = detectCPUFeatures();
- mmx_present = (features & (MMX|MMX_Extensions)) == (MMX|MMX_Extensions);
- initialized = TRUE;
+ SourcePict *sp = pict->pSourcePict;
+
+ if (sp->type == SourcePictTypeSolidFill)
+ {
+ image = create_solid_fill_image (pict);
+ }
+ else
+ {
+ PictGradient *gradient = &pict->pSourcePict->gradient;
+
+ if (sp->type == SourcePictTypeLinear)
+ image = create_linear_gradient_image (gradient);
+ else if (sp->type == SourcePictTypeRadial)
+ image = create_radial_gradient_image (gradient);
+ else if (sp->type == SourcePictTypeConical)
+ image = create_conical_gradient_image (gradient);
+ }
}
- return mmx_present;
+ if (image)
+ set_image_properties (image, pict);
+
+ return image;
+}
+
+void
+free_pixman_pict (PicturePtr pict, pixman_image_t *image)
+{
+ if (image && pixman_image_unref (image) && pict->pDrawable)
+ fbFinishAccess (pict->pDrawable);
+}
+
+Bool
+fbPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
+{
+
+#ifdef RENDER
+
+ PictureScreenPtr ps;
+
+ if (!miPictureInit (pScreen, formats, nformats))
+ return FALSE;
+ ps = GetPictureScreen(pScreen);
+ ps->Composite = fbComposite;
+ ps->Glyphs = miGlyphs;
+ ps->CompositeRects = miCompositeRects;
+ ps->RasterizeTrapezoid = fbRasterizeTrapezoid;
+ ps->AddTraps = fbAddTraps;
+ ps->AddTriangles = fbAddTriangles;
+
+#endif /* RENDER */
+
+ return TRUE;
}
-#endif /* __amd64__ */
-#endif
diff --git a/fb/fbpict.h b/fb/fbpict.h
index bfcb38e58..b4c1dcf12 100644
--- a/fb/fbpict.h
+++ b/fb/fbpict.h
@@ -114,14 +114,22 @@ fbCanGetSolid(PicturePtr pict)
fbGetDrawable((pict)->pDrawable,__bits__,__stride__,__bpp__,__xoff__,__yoff__); \
switch (__bpp__) { \
case 32: \
- (bits) = *(CARD32 *) __bits__; \
+ (bits) = READ((CARD32 *) __bits__); \
break; \
case 24: \
(bits) = Fetch24 ((CARD8 *) __bits__); \
break; \
case 16: \
- (bits) = *(CARD16 *) __bits__; \
- (bits) = cvt0565to8888(bits); \
+ (bits) = READ((CARD16 *) __bits__); \
+ (bits) = cvt0565to0888(bits); \
+ break; \
+ case 8: \
+ (bits) = READ((CARD8 *) __bits__); \
+ (bits) = (bits) << 24; \
+ break; \
+ case 1: \
+ (bits) = READ((CARD32 *) __bits__); \
+ (bits) = FbLeftStipBits((bits),1) ? 0xff000000 : 0x00000000;\
break; \
default: \
return; \
@@ -137,6 +145,7 @@ fbCanGetSolid(PicturePtr pict)
/* manage missing src alpha */ \
if ((pict)->pFormat->direct.alphaMask == 0) \
(bits) |= 0xff000000; \
+ fbFinishAccess ((pict)->pDrawable); \
}
#define fbComposeGetStart(pict,x,y,type,stride,line,mul) {\
@@ -152,28 +161,28 @@ fbCanGetSolid(PicturePtr pict)
#define cvt8888to0565(s) ((((s) >> 3) & 0x001f) | \
(((s) >> 5) & 0x07e0) | \
(((s) >> 8) & 0xf800))
-#define cvt0565to8888(s) (((((s) << 3) & 0xf8) | (((s) >> 2) & 0x7)) | \
+#define cvt0565to0888(s) (((((s) << 3) & 0xf8) | (((s) >> 2) & 0x7)) | \
((((s) << 5) & 0xfc00) | (((s) >> 1) & 0x300)) | \
((((s) << 8) & 0xf80000) | (((s) << 3) & 0x70000)))
#if IMAGE_BYTE_ORDER == MSBFirst
#define Fetch24(a) ((unsigned long) (a) & 1 ? \
- ((*(a) << 16) | *((CARD16 *) ((a)+1))) : \
- ((*((CARD16 *) (a)) << 8) | *((a)+2)))
+ ((READ(a) << 16) | READ((CARD16 *) ((a)+1))) : \
+ ((READ((CARD16 *) (a)) << 8) | READ((a)+2)))
#define Store24(a,v) ((unsigned long) (a) & 1 ? \
- ((*(a) = (CARD8) ((v) >> 16)), \
- (*((CARD16 *) ((a)+1)) = (CARD16) (v))) : \
- ((*((CARD16 *) (a)) = (CARD16) ((v) >> 8)), \
- (*((a)+2) = (CARD8) (v))))
+ (WRITE(a, (CARD8) ((v) >> 16)), \
+ WRITE((CARD16 *) ((a)+1), (CARD16) (v))) : \
+ (WRITE((CARD16 *) (a), (CARD16) ((v) >> 8)), \
+ WRITE((a)+2, (CARD8) (v))))
#else
#define Fetch24(a) ((unsigned long) (a) & 1 ? \
- ((*(a)) | (*((CARD16 *) ((a)+1)) << 8)) : \
- ((*((CARD16 *) (a))) | (*((a)+2) << 16)))
+ (READ(a) | (READ((CARD16 *) ((a)+1)) << 8)) : \
+ (READ((CARD16 *) (a)) | (READ((a)+2) << 16)))
#define Store24(a,v) ((unsigned long) (a) & 1 ? \
- ((*(a) = (CARD8) (v)), \
- (*((CARD16 *) ((a)+1)) = (CARD16) ((v) >> 8))) : \
- ((*((CARD16 *) (a)) = (CARD16) (v)),\
- (*((a)+2) = (CARD8) ((v) >> 16))))
+ (WRITE(a, (CARD8) (v)), \
+ WRITE((CARD16 *) ((a)+1), (CARD16) ((v) >> 8))) : \
+ (WRITE((CARD16 *) (a), (CARD16) (v)),\
+ WRITE((a)+2, (CARD8) ((v) >> 16))))
#endif
/*
@@ -374,6 +383,9 @@ typedef struct _FbComposeData {
CARD16 height;
} FbComposeData;
+void
+fbCompositeRect (const FbComposeData *data, CARD32 *scanline_buffer);
+
typedef FASTCALL void (*CombineMaskU) (CARD32 *src, const CARD32 *mask, int width);
typedef FASTCALL void (*CombineFuncU) (CARD32 *dest, const CARD32 *src, int width);
typedef FASTCALL void (*CombineFuncC) (CARD32 *dest, CARD32 *src, CARD32 *mask, int width);
@@ -400,210 +412,7 @@ fbCompositeGeneral (CARD8 op,
CARD16 width,
CARD16 height);
-
-/* fbedge.c */
-void
-fbRasterizeEdges (FbBits *buf,
- int bpp,
- int width,
- int stride,
- RenderEdge *l,
- RenderEdge *r,
- xFixed t,
- xFixed b);
-
/* fbpict.c */
-CARD32
-fbOver (CARD32 x, CARD32 y);
-
-CARD32
-fbOver24 (CARD32 x, CARD32 y);
-
-CARD32
-fbIn (CARD32 x, CARD8 y);
-
-void
-fbCompositeSolidMask_nx8x8888 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-void
-fbCompositeSolidMask_nx8x0888 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-void
-fbCompositeSolidMask_nx8888x8888C (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-void
-fbCompositeSolidMask_nx8x0565 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-void
-fbCompositeSolidMask_nx8888x0565C (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-void
-fbCompositeSrc_8888x8888 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-void
-fbCompositeSrc_8888x0888 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-void
-fbCompositeSrc_8888x0565 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-void
-fbCompositeSrc_0565x0565 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-void
-fbCompositeSrcAdd_8000x8000 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-void
-fbCompositeSrcAdd_8888x8888 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-void
-fbCompositeSrcAdd_1000x1000 (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-void
-fbCompositeSolidMask_nx1xn (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
void
fbComposite (CARD8 op,
PicturePtr pSrc,
@@ -618,6 +427,36 @@ fbComposite (CARD8 op,
CARD16 width,
CARD16 height);
+typedef void (*CompositeFunc) (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pMask,
+ PicturePtr pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height);
+
+void
+fbWalkCompositeRegion (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pMask,
+ PicturePtr pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height,
+ Bool srcRepeat,
+ Bool maskRepeat,
+ CompositeFunc compositeRect);
+
/* fbtrap.c */
void
diff --git a/fb/fbpixmap.c b/fb/fbpixmap.c
index f79f7010d..88f693e73 100644
--- a/fb/fbpixmap.c
+++ b/fb/fbpixmap.c
@@ -1,6 +1,4 @@
/*
- * Id: fbpixmap.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -43,11 +41,7 @@ fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp)
if (paddedWidth / 4 > 32767 || height > 32767)
return NullPixmap;
datasize = height * paddedWidth;
-#ifdef PIXPRIV
base = pScreen->totalPixmapSize;
-#else
- base = sizeof (PixmapRec);
-#endif
adjust = 0;
if (base & 7)
adjust = 8 - (base & 7);
@@ -160,6 +154,8 @@ fbPixmapToRegion(PixmapPtr pPix)
FirstRect = REGION_BOXPTR(pReg);
rects = FirstRect;
+ fbPrepareAccess(&pPix->drawable);
+
pwLine = (FbBits *) pPix->devPrivate.ptr;
nWidth = pPix->devKind >> (FB_SHIFT-3);
@@ -174,7 +170,7 @@ fbPixmapToRegion(PixmapPtr pPix)
irectLineStart = rects - FirstRect;
/* If the Screen left most bit of the word is set, we're starting in
* a box */
- if(*pw & mask0)
+ if(READ(pw) & mask0)
{
fInBox = TRUE;
rx1 = 0;
@@ -185,7 +181,7 @@ fbPixmapToRegion(PixmapPtr pPix)
pwLineEnd = pw + (width >> FB_SHIFT);
for (base = 0; pw < pwLineEnd; base += FB_UNIT)
{
- w = *pw++;
+ w = READ(pw++);
if (fInBox)
{
if (!~w)
@@ -226,7 +222,7 @@ fbPixmapToRegion(PixmapPtr pPix)
if(width & FB_MASK)
{
/* Process final partial word on line */
- w = *pw++;
+ w = READ(pw++);
for(ib = 0; ib < (width & FB_MASK); ib++)
{
/* If the Screen left most bit of the word is set, we're
@@ -311,6 +307,8 @@ fbPixmapToRegion(PixmapPtr pPix)
pReg->data = (RegDataPtr)NULL;
}
}
+
+ fbFinishAccess(&pPix->drawable);
#ifdef DEBUG
if (!miValidRegion(pReg))
FatalError("Assertion failed file %s, line %d: expr\n", __FILE__, __LINE__);
@@ -362,6 +360,7 @@ fbValidateDrawable (DrawablePtr pDrawable)
if (!fbValidateBits (first, stride, FB_HEAD_BITS) ||
!fbValidateBits (last, stride, FB_TAIL_BITS))
fbInitializeDrawable(pDrawable);
+ fbFinishAccess (pDrawable);
}
void
@@ -383,5 +382,6 @@ fbInitializeDrawable (DrawablePtr pDrawable)
last = bits + stride * pDrawable->height;
fbSetBits (first, stride, FB_HEAD_BITS);
fbSetBits (last, stride, FB_TAIL_BITS);
+ fbFinishAccess (pDrawable);
}
#endif /* FB_DEBUG */
diff --git a/fb/fbpoint.c b/fb/fbpoint.c
index 7154b53a1..c0ea8ba5b 100644
--- a/fb/fbpoint.c
+++ b/fb/fbpoint.c
@@ -1,6 +1,4 @@
/*
- * Id: fbpoint.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -90,20 +88,20 @@ fbDots (FbBits *dstOrig,
FbMaskStip (x, 24, leftMask, n, rightMask);
if (leftMask)
{
- *d = FbDoMaskRRop (*d, andT, xorT, leftMask);
+ WRITE(d, FbDoMaskRRop (READ(d), andT, xorT, leftMask));
andT = FbNext24Stip(andT);
xorT = FbNext24Stip(xorT);
d++;
}
if (rightMask)
- *d = FbDoMaskRRop(*d, andT, xorT, rightMask);
+ WRITE(d, FbDoMaskRRop(READ(d), andT, xorT, rightMask));
}
else
#endif
{
FbStip mask;
mask = FbStipMask(x, dstBpp);
- *d = FbDoMaskRRop (*d, and, xor, mask);
+ WRITE(d, FbDoMaskRRop (READ(d), and, xor, mask));
}
}
}
@@ -160,4 +158,5 @@ fbPolyPoint (DrawablePtr pDrawable,
nBox--; pBox++)
(*dots) (dst, dstStride, dstBpp, pBox, pptInit, nptInit,
pDrawable->x, pDrawable->y, dstXoff, dstYoff, and, xor);
+ fbFinishAccess (pDrawable);
}
diff --git a/fb/fbpseudocolor.c b/fb/fbpseudocolor.c
index 2233f95dc..271e98145 100644
--- a/fb/fbpseudocolor.c
+++ b/fb/fbpseudocolor.c
@@ -875,6 +875,8 @@ xxCopyPseudocolorRegion(ScreenPtr pScreen, RegionPtr pReg,
register CARD16 *d;
int w;
+ fbPrepareAccess((DrawablePtr)pScreen->devPrivate);
+
dst_base = (CARD16*) ((PixmapPtr)pScreen->devPrivate)->devPrivate.ptr;
dst_stride = (int)((PixmapPtr)pScreen->devPrivate)->devKind
/ sizeof (CARD16);
@@ -899,6 +901,8 @@ xxCopyPseudocolorRegion(ScreenPtr pScreen, RegionPtr pReg,
}
pbox++;
}
+
+ fbFinishAccess(&((PixmapPtr)pScreen->devPrivate)->drawable);
}
static void
@@ -1200,7 +1204,7 @@ GCFuncs xxGCFuncs = {
xxChangeClip, xxDestroyClip, xxCopyClip
};
-GCOps xxGCOps = {
+static GCOps xxGCOps = {
xxFillSpans, xxSetSpans,
xxPutImage, xxCopyArea,
xxCopyPlane, xxPolyPoint,
diff --git a/fb/fbpush.c b/fb/fbpush.c
index 0632766d0..891572f0d 100644
--- a/fb/fbpush.c
+++ b/fb/fbpush.c
@@ -1,6 +1,4 @@
/*
- * Id: fbpush.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -58,7 +56,7 @@ fbPushPattern (DrawablePtr pDrawable,
w = width;
s = src;
src += srcStride;
- bits = *s++;
+ bits = READ(s++);
xspan = x;
while (w)
{
@@ -73,7 +71,7 @@ fbPushPattern (DrawablePtr pDrawable,
bitsMask = FbStipRight (bitsMask, 1);
if (!bitsMask)
{
- bits = *s++;
+ bits = READ(s++);
bitsMask = FbBitsMask(0,1);
}
} while (bits & bitsMask);
@@ -92,7 +90,7 @@ fbPushPattern (DrawablePtr pDrawable,
bitsMask = FbStipRight (bitsMask, 1);
if (!bitsMask)
{
- bits = *s++;
+ bits = READ(s++);
bitsMask = FbBitsMask(0,1);
}
} while (!(bits & bitsMask));
@@ -165,6 +163,7 @@ fbPushFill (DrawablePtr pDrawable,
fbAnd(GXnoop,(FbBits) 0,FB_ALLONES),
fbXor(GXnoop,(FbBits) 0,FB_ALLONES));
}
+ fbFinishAccess (pDrawable);
}
else
{
diff --git a/fb/fbrop.h b/fb/fbrop.h
index f3768a265..1685ee836 100644
--- a/fb/fbrop.h
+++ b/fb/fbrop.h
@@ -1,6 +1,4 @@
/*
- * Id: fbrop.h,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
diff --git a/fb/fbscreen.c b/fb/fbscreen.c
index b88375810..94033f1d1 100644
--- a/fb/fbscreen.c
+++ b/fb/fbscreen.c
@@ -81,7 +81,6 @@ fbQueryBestSize (int class,
}
}
-#ifndef FB_OLD_SCREEN
PixmapPtr
_fbGetWindowPixmap (WindowPtr pWindow)
{
@@ -97,7 +96,6 @@ _fbSetWindowPixmap (WindowPtr pWindow, PixmapPtr pPixmap)
pWindow->devPrivates[fbWinPrivateIndex].ptr = (pointer) pPixmap;
#endif
}
-#endif
Bool
fbSetupScreen(ScreenPtr pScreen,
@@ -141,7 +139,6 @@ fbSetupScreen(ScreenPtr pScreen,
pScreen->ResolveColor = fbResolveColor;
pScreen->BitmapToRegion = fbPixmapToRegion;
-#ifndef FB_OLD_SCREEN
pScreen->GetWindowPixmap = _fbGetWindowPixmap;
pScreen->SetWindowPixmap = _fbSetWindowPixmap;
@@ -150,11 +147,23 @@ fbSetupScreen(ScreenPtr pScreen,
pScreen->BackingStoreFuncs.SetClipmaskRgn = 0;
pScreen->BackingStoreFuncs.GetImagePixmap = 0;
pScreen->BackingStoreFuncs.GetSpansPixmap = 0;
-#endif
return TRUE;
}
+#ifdef FB_ACCESS_WRAPPER
+Bool
+wfbFinishScreenInit(ScreenPtr pScreen,
+ pointer pbits,
+ int xsize,
+ int ysize,
+ int dpix,
+ int dpiy,
+ int width,
+ int bpp,
+ SetupWrapProcPtr setupWrap,
+ FinishWrapProcPtr finishWrap)
+#else
Bool
fbFinishScreenInit(ScreenPtr pScreen,
pointer pbits,
@@ -164,6 +173,7 @@ fbFinishScreenInit(ScreenPtr pScreen,
int dpiy,
int width,
int bpp)
+#endif
{
VisualPtr visuals;
DepthPtr depths;
@@ -222,6 +232,10 @@ fbFinishScreenInit(ScreenPtr pScreen,
fbGetScreenPrivate(pScreen)->win32bpp = 32;
fbGetScreenPrivate(pScreen)->pix32bpp = 32;
}
+#ifdef FB_ACCESS_WRAPPER
+ fbGetScreenPrivate(pScreen)->setupWrap = setupWrap;
+ fbGetScreenPrivate(pScreen)->finishWrap = finishWrap;
+#endif
#endif
rootdepth = 0;
if (!fbInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &rootdepth,
@@ -229,11 +243,7 @@ fbFinishScreenInit(ScreenPtr pScreen,
return FALSE;
if (! miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width,
rootdepth, ndepths, depths,
- defaultVisual, nvisuals, visuals
-#ifdef FB_OLD_MISCREENINIT
- , (miBSFuncPtr) 0
-#endif
- ))
+ defaultVisual, nvisuals, visuals))
return FALSE;
/* overwrite miCloseScreen with our own */
pScreen->CloseScreen = fbCloseScreen;
@@ -256,6 +266,27 @@ fbFinishScreenInit(ScreenPtr pScreen,
}
/* dts * (inch/dot) * (25.4 mm / inch) = mm */
+#ifdef FB_ACCESS_WRAPPER
+Bool
+wfbScreenInit(ScreenPtr pScreen,
+ pointer pbits,
+ int xsize,
+ int ysize,
+ int dpix,
+ int dpiy,
+ int width,
+ int bpp,
+ SetupWrapProcPtr setupWrap,
+ FinishWrapProcPtr finishWrap)
+{
+ if (!fbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width, bpp))
+ return FALSE;
+ if (!wfbFinishScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy,
+ width, bpp, setupWrap, finishWrap))
+ return FALSE;
+ return TRUE;
+}
+#else
Bool
fbScreenInit(ScreenPtr pScreen,
pointer pbits,
@@ -273,26 +304,4 @@ fbScreenInit(ScreenPtr pScreen,
return FALSE;
return TRUE;
}
-
-
-#ifdef FB_OLD_SCREEN
-const miBSFuncRec fbBSFuncRec = {
- fbSaveAreas,
- fbRestoreAreas,
- (void (*)(GCPtr, RegionPtr)) 0,
- (PixmapPtr (*)(void)) 0,
- (PixmapPtr (*)(void)) 0,
-};
-#endif
-
-#if 0
-void
-fbInitializeBackingStore (ScreenPtr pScreen)
-{
-#ifdef FB_OLD_SCREEN
- miInitializeBackingStore (pScreen, (miBSFuncRec *) &fbBSFuncRec);
-#else
- miInitializeBackingStore (pScreen);
-#endif
-}
#endif
diff --git a/fb/fbseg.c b/fb/fbseg.c
index d66e42468..80ce7404e 100644
--- a/fb/fbseg.c
+++ b/fb/fbseg.c
@@ -1,6 +1,4 @@
/*
- * Id: fbseg.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -79,7 +77,7 @@ fbBresSolid (DrawablePtr pDrawable,
mask = fbBresShiftMask(mask,signdx,dstBpp);
if (!mask)
{
- *dst = FbDoMaskRRop (*dst, and, xor, bits);
+ WRITE(dst, FbDoMaskRRop (READ(dst), and, xor, bits));
bits = 0;
dst += signdx;
mask = mask0;
@@ -87,20 +85,20 @@ fbBresSolid (DrawablePtr pDrawable,
e += e1;
if (e >= 0)
{
- *dst = FbDoMaskRRop (*dst, and, xor, bits);
+ WRITE(dst, FbDoMaskRRop (READ(dst), and, xor, bits));
bits = 0;
dst += dstStride;
e += e3;
}
}
if (bits)
- *dst = FbDoMaskRRop (*dst, and, xor, bits);
+ WRITE(dst, FbDoMaskRRop (READ(dst), and, xor, bits));
}
else
{
while (len--)
{
- *dst = FbDoMaskRRop (*dst, and, xor, mask);
+ WRITE(dst, FbDoMaskRRop (READ(dst), and, xor, mask));
dst += dstStride;
e += e1;
if (e >= 0)
@@ -115,6 +113,8 @@ fbBresSolid (DrawablePtr pDrawable,
}
}
}
+
+ fbFinishAccess (pDrawable);
}
void
@@ -164,9 +164,9 @@ fbBresDash (DrawablePtr pDrawable,
while (len--)
{
if (even)
- *dst = FbDoMaskRRop (*dst, and, xor, mask);
+ WRITE(dst, FbDoMaskRRop (READ(dst), and, xor, mask));
else if (doOdd)
- *dst = FbDoMaskRRop (*dst, bgand, bgxor, mask);
+ WRITE(dst, FbDoMaskRRop (READ(dst), bgand, bgxor, mask));
if (axis == X_AXIS)
{
mask = fbBresShiftMask(mask,signdx,dstBpp);
@@ -199,6 +199,8 @@ fbBresDash (DrawablePtr pDrawable,
}
FbDashStep (dashlen, even);
}
+
+ fbFinishAccess (pDrawable);
}
void
@@ -371,13 +373,13 @@ fbBresSolid24RRop (DrawablePtr pDrawable,
FbMaskStip (x, 24, leftMask, nl, rightMask);
if (leftMask)
{
- *d = FbDoMaskRRop (*d, andT, xorT, leftMask);
+ WRITE(d, FbDoMaskRRop (READ(d), andT, xorT, leftMask));
d++;
andT = FbNext24Stip (andT);
xorT = FbNext24Stip (xorT);
}
if (rightMask)
- *d = FbDoMaskRRop (*d, andT, xorT, rightMask);
+ WRITE(d, FbDoMaskRRop (READ(d), andT, xorT, rightMask));
if (axis == X_AXIS)
{
x1 += signdx;
@@ -399,6 +401,8 @@ fbBresSolid24RRop (DrawablePtr pDrawable,
}
}
}
+
+ fbFinishAccess (pDrawable);
}
static void
@@ -468,13 +472,13 @@ fbBresDash24RRop (DrawablePtr pDrawable,
FbMaskStip (x, 24, leftMask, nl, rightMask);
if (leftMask)
{
- *d = FbDoMaskRRop (*d, andT, xorT, leftMask);
+ WRITE(d, FbDoMaskRRop (READ(d), andT, xorT, leftMask));
d++;
andT = FbNext24Stip (andT);
xorT = FbNext24Stip (xorT);
}
if (rightMask)
- *d = FbDoMaskRRop (*d, andT, xorT, rightMask);
+ WRITE(d, FbDoMaskRRop (READ(d), andT, xorT, rightMask));
}
if (axis == X_AXIS)
{
@@ -498,6 +502,8 @@ fbBresDash24RRop (DrawablePtr pDrawable,
}
FbDashStep (dashlen, even);
}
+
+ fbFinishAccess (pDrawable);
}
#endif
diff --git a/fb/fbsetsp.c b/fb/fbsetsp.c
index c59c13ceb..227ba4c62 100644
--- a/fb/fbsetsp.c
+++ b/fb/fbsetsp.c
@@ -1,6 +1,4 @@
/*
- * Id: fbsetsp.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -99,5 +97,6 @@ fbSetSpans (DrawablePtr pDrawable,
pwidth++;
}
fbValidateDrawable (pDrawable);
+ fbFinishAccess (pDrawable);
}
diff --git a/fb/fbsolid.c b/fb/fbsolid.c
index 89effe63b..53fcae071 100644
--- a/fb/fbsolid.c
+++ b/fb/fbsolid.c
@@ -1,6 +1,4 @@
/*
- * $XFree86$
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -70,12 +68,12 @@ fbSolid (FbBits *dst,
n = nmiddle;
if (!and)
while (n--)
- *dst++ = xor;
+ WRITE(dst++, xor);
else
while (n--)
{
- *dst = FbDoRRop (*dst, and, xor);
- dst++;
+ WRITE(dst, FbDoRRop (READ(dst), and, xor));
+ dst++;
}
if (endmask)
FbDoRightMaskByteRRop(dst,endbyte,endmask,and,xor);
@@ -160,26 +158,26 @@ fbSolid24 (FbBits *dst,
{
if (startmask)
{
- *dst = FbDoMaskRRop(*dst, andS, xorS, startmask);
- dst++;
+ WRITE(dst, FbDoMaskRRop(READ(dst), andS, xorS, startmask));
+ dst++;
}
n = nmiddle;
if (!and0)
{
while (n >= 3)
{
- *dst++ = xor0;
- *dst++ = xor1;
- *dst++ = xor2;
+ WRITE(dst++, xor0);
+ WRITE(dst++, xor1);
+ WRITE(dst++, xor2);
n -= 3;
}
if (n)
{
- *dst++ = xor0;
+ WRITE(dst++, xor0);
n--;
if (n)
{
- *dst++ = xor1;
+ WRITE(dst++, xor1);
}
}
}
@@ -187,28 +185,28 @@ fbSolid24 (FbBits *dst,
{
while (n >= 3)
{
- *dst = FbDoRRop (*dst, and0, xor0);
- dst++;
- *dst = FbDoRRop (*dst, and1, xor1);
- dst++;
- *dst = FbDoRRop (*dst, and2, xor2);
- dst++;
+ WRITE(dst, FbDoRRop (READ(dst), and0, xor0));
+ dst++;
+ WRITE(dst, FbDoRRop (READ(dst), and1, xor1));
+ dst++;
+ WRITE(dst, FbDoRRop (READ(dst), and2, xor2));
+ dst++;
n -= 3;
}
if (n)
{
- *dst = FbDoRRop (*dst, and0, xor0);
- dst++;
+ WRITE(dst, FbDoRRop (READ(dst), and0, xor0));
+ dst++;
n--;
if (n)
{
- *dst = FbDoRRop (*dst, and1, xor1);
- dst++;
+ WRITE(dst, FbDoRRop (READ(dst), and1, xor1));
+ dst++;
}
}
}
if (endmask)
- *dst = FbDoMaskRRop (*dst, andE, xorE, endmask);
+ WRITE(dst, FbDoMaskRRop (READ(dst), andE, xorE, endmask));
dst += dstStride;
}
}
diff --git a/fb/fbstipple.c b/fb/fbstipple.c
index ce971481e..7d1326367 100644
--- a/fb/fbstipple.c
+++ b/fb/fbstipple.c
@@ -1,6 +1,4 @@
/*
- * Id: fbstipple.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -155,7 +153,7 @@ fbEvenStipple (FbBits *dst,
/*
* Extract stipple bits for this scanline;
*/
- bits = *s;
+ bits = READ(s);
s += stipStride;
if (s == stipEnd)
s = stip;
@@ -199,12 +197,12 @@ fbEvenStipple (FbBits *dst,
n = nmiddle;
if (!and)
while (n--)
- *dst++ = xor;
+ WRITE(dst++, xor);
else
{
while (n--)
{
- *dst = FbDoRRop (*dst, and, xor);
+ WRITE(dst, FbDoRRop (READ(dst), and, xor));
dst++;
}
}
diff --git a/fb/fbtile.c b/fb/fbtile.c
index 0d0cfe174..05a27a17b 100644
--- a/fb/fbtile.c
+++ b/fb/fbtile.c
@@ -1,6 +1,4 @@
/*
- * Id: fbtile.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -42,6 +40,7 @@ fbEvenTile (FbBits *dst,
int height,
FbBits *tile,
+ FbStride tileStride,
int tileHeight,
int alu,
@@ -68,9 +67,9 @@ fbEvenTile (FbBits *dst,
/*
* Compute tile start scanline and rotation parameters
*/
- tileEnd = tile + tileHeight;
+ tileEnd = tile + tileHeight * tileStride;
modulus (- yRot, tileHeight, tileY);
- t = tile + tileY;
+ t = tile + tileY * tileStride;
modulus (- xRot, FB_UNIT, tileX);
rot = tileX;
@@ -80,8 +79,9 @@ fbEvenTile (FbBits *dst,
/*
* Pick up bits for this scanline
*/
- bits = *t++;
- if (t == tileEnd) t = tile;
+ bits = READ(t);
+ t += tileStride;
+ if (t >= tileEnd) t = tile;
bits = FbRotLeft(bits,rot);
and = fbAnd(alu,bits,pm);
xor = fbXor(alu,bits,pm);
@@ -94,11 +94,11 @@ fbEvenTile (FbBits *dst,
n = nmiddle;
if (!and)
while (n--)
- *dst++ = xor;
+ WRITE(dst++, xor);
else
while (n--)
{
- *dst = FbDoRRop (*dst, and, xor);
+ WRITE(dst, FbDoRRop (READ(dst), and, xor));
dst++;
}
if (endmask)
@@ -194,7 +194,7 @@ fbTile (FbBits *dst,
{
if (FbEvenTile (tileWidth))
fbEvenTile (dst, dstStride, dstX, width, height,
- tile, tileHeight,
+ tile, tileStride, tileHeight,
alu, pm, xRot, yRot);
else
fbOddTile (dst, dstStride, dstX, width, height,
diff --git a/fb/fbtrap.c b/fb/fbtrap.c
index 863969527..830603ae7 100644
--- a/fb/fbtrap.c
+++ b/fb/fbtrap.c
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Copyright © 2004 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -42,59 +40,14 @@ fbAddTraps (PicturePtr pPicture,
int ntrap,
xTrap *traps)
{
- FbBits *buf;
- int bpp;
- int width;
- int stride;
- int height;
- int pxoff, pyoff;
-
- xFixed x_off_fixed;
- xFixed y_off_fixed;
- RenderEdge l, r;
- xFixed t, b;
-
- fbGetDrawable (pPicture->pDrawable, buf, stride, bpp, pxoff, pyoff);
+ pixman_image_t *image = image_from_pict (pPicture, FALSE);
- width = pPicture->pDrawable->width;
- height = pPicture->pDrawable->height;
- x_off += pxoff;
- y_off += pyoff;
+ if (!image)
+ return;
- x_off_fixed = IntToxFixed(y_off);
- y_off_fixed = IntToxFixed(y_off);
+ pixman_add_traps (image, x_off, y_off, ntrap, (pixman_trap_t *)traps);
- while (ntrap--)
- {
- t = traps->top.y + y_off_fixed;
- if (t < 0)
- t = 0;
- t = RenderSampleCeilY (t, bpp);
-
- b = traps->bot.y + y_off_fixed;
- if (xFixedToInt (b) >= height)
- b = IntToxFixed (height) - 1;
- b = RenderSampleFloorY (b, bpp);
-
- if (b >= t)
- {
- /* initialize edge walkers */
- RenderEdgeInit (&l, bpp, t,
- traps->top.l + x_off_fixed,
- traps->top.y + y_off_fixed,
- traps->bot.l + x_off_fixed,
- traps->bot.y + y_off_fixed);
-
- RenderEdgeInit (&r, bpp, t,
- traps->top.r + x_off_fixed,
- traps->top.y + y_off_fixed,
- traps->bot.r + x_off_fixed,
- traps->bot.y + y_off_fixed);
-
- fbRasterizeEdges (buf, bpp, width, stride, &l, &r, t, b);
- }
- traps++;
- }
+ free_pixman_pict (pPicture, image);
}
void
@@ -103,45 +56,14 @@ fbRasterizeTrapezoid (PicturePtr pPicture,
int x_off,
int y_off)
{
- FbBits *buf;
- int bpp;
- int width;
- int stride;
- int height;
- int pxoff, pyoff;
-
- xFixed x_off_fixed;
- xFixed y_off_fixed;
- RenderEdge l, r;
- xFixed t, b;
-
- fbGetDrawable (pPicture->pDrawable, buf, stride, bpp, pxoff, pyoff);
+ pixman_image_t *image = image_from_pict (pPicture, FALSE);
- width = pPicture->pDrawable->width;
- height = pPicture->pDrawable->height;
- x_off += pxoff;
- y_off += pyoff;
-
- x_off_fixed = IntToxFixed(x_off);
- y_off_fixed = IntToxFixed(y_off);
- t = trap->top + y_off_fixed;
- if (t < 0)
- t = 0;
- t = RenderSampleCeilY (t, bpp);
-
- b = trap->bottom + y_off_fixed;
- if (xFixedToInt (b) >= height)
- b = IntToxFixed (height) - 1;
- b = RenderSampleFloorY (b, bpp);
-
- if (b >= t)
- {
- /* initialize edge walkers */
- RenderLineFixedEdgeInit (&l, bpp, t, &trap->left, x_off, y_off);
- RenderLineFixedEdgeInit (&r, bpp, t, &trap->right, x_off, y_off);
-
- fbRasterizeEdges (buf, bpp, width, stride, &l, &r, t, b);
- }
+ if (!image)
+ return;
+
+ pixman_rasterize_trapezoid (image, (pixman_trapezoid_t *)trap, x_off, y_off);
+
+ free_pixman_pict (pPicture, image);
}
static int
diff --git a/fb/fbutil.c b/fb/fbutil.c
index 4be0f233c..5e232971e 100644
--- a/fb/fbutil.c
+++ b/fb/fbutil.c
@@ -1,6 +1,4 @@
/*
- * Id: fbutil.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
diff --git a/fb/fbwindow.c b/fb/fbwindow.c
index 968b5a61d..144f08362 100644
--- a/fb/fbwindow.c
+++ b/fb/fbwindow.c
@@ -1,6 +1,4 @@
/*
- * Id: fbwindow.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -30,10 +28,6 @@
#include "fb.h"
-#ifdef USE_MMX
-#include "fbmmx.h"
-#endif
-
Bool
fbCreateWindow(WindowPtr pWin)
{
@@ -118,6 +112,9 @@ fbCopyWindowProc (DrawablePtr pSrcDrawable,
upsidedown);
pbox++;
}
+
+ fbFinishAccess (pDstDrawable);
+ fbFinishAccess (pSrcDrawable);
}
void
@@ -219,36 +216,39 @@ fbFillRegionSolid (DrawablePtr pDrawable,
int n = REGION_NUM_RECTS(pRegion);
BoxPtr pbox = REGION_RECTS(pRegion);
-#ifdef USE_MMX
- int has_mmx = 0;
- if (!and && fbHaveMMX())
- has_mmx = 1;
+#ifndef FB_ACCESS_WRAPPER
+ int try_mmx = 0;
+ if (!and)
+ try_mmx = 1;
#endif
fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
while (n--)
{
-#ifdef USE_MMX
- if (!has_mmx || !fbSolidFillmmx (pDrawable,
- pbox->x1,
- pbox->y1,
- (pbox->x2 - pbox->x1),
- (pbox->y2 - pbox->y1), xor)) {
+#ifndef FB_ACCESS_WRAPPER
+ if (!try_mmx || !pixman_fill (dst, dstStride, dstBpp,
+ pbox->x1 + dstXoff, pbox->y1 + dstYoff,
+ (pbox->x2 - pbox->x1),
+ (pbox->y2 - pbox->y1),
+ xor))
+ {
#endif
- fbSolid (dst + (pbox->y1 + dstYoff) * dstStride,
- dstStride,
- (pbox->x1 + dstXoff) * dstBpp,
- dstBpp,
- (pbox->x2 - pbox->x1) * dstBpp,
- pbox->y2 - pbox->y1,
- and, xor);
-#ifdef USE_MMX
+ fbSolid (dst + (pbox->y1 + dstYoff) * dstStride,
+ dstStride,
+ (pbox->x1 + dstXoff) * dstBpp,
+ dstBpp,
+ (pbox->x2 - pbox->x1) * dstBpp,
+ pbox->y2 - pbox->y1,
+ and, xor);
+#ifndef FB_ACCESS_WRAPPER
}
#endif
fbValidateDrawable (pDrawable);
pbox++;
}
+
+ fbFinishAccess (pDrawable);
}
#ifdef PANORAMIX
@@ -311,6 +311,9 @@ fbFillRegionTiled (DrawablePtr pDrawable,
yRot - (pbox->y1 + dstYoff));
pbox++;
}
+
+ fbFinishAccess (&pTile->drawable);
+ fbFinishAccess (pDrawable);
}
void
diff --git a/fb/wfbrename.h b/fb/wfbrename.h
new file mode 100644
index 000000000..5ea9092f8
--- /dev/null
+++ b/fb/wfbrename.h
@@ -0,0 +1,201 @@
+#define fb16Lane wfb16Lane
+#define fb24_32CopyMtoN wfb24_32CopyMtoN
+#define fb24_32CreateScreenResources wfb24_32CreateScreenResources
+#define fb24_32GetImage wfb24_32GetImage
+#define fb24_32GetSpans wfb24_32GetSpans
+#define fb24_32ModifyPixmapHeader wfb24_32ModifyPixmapHeader
+#define fb24_32PutZImage wfb24_32PutZImage
+#define fb24_32ReformatTile wfb24_32ReformatTile
+#define fb24_32SetSpans wfb24_32SetSpans
+#define fb32Lane wfb32Lane
+#define fb8Lane wfb8Lane
+#define fbAddTraps wfbAddTraps
+#define fbAddTriangles wfbAddTriangles
+#define fbAllocatePrivates wfbAllocatePrivates
+#define fbArc16 wfbArc16
+#define fbArc24 wfbArc24
+#define fbArc32 wfbArc32
+#define fbArc8 wfbArc8
+#define fbBlt wfbBlt
+#define fbBlt24 wfbBlt24
+#define fbBltOne wfbBltOne
+#define fbBltOne24 wfbBltOne24
+#define fbBltPlane wfbBltPlane
+#define fbBltStip wfbBltStip
+#define fbBres wfbBres
+#define fbBresDash wfbBresDash
+#define fbBresDash16 wfbBresDash16
+#define fbBresDash24 wfbBresDash24
+#define fbBresDash32 wfbBresDash32
+#define fbBresDash8 wfbBresDash8
+#define fbBresFill wfbBresFill
+#define fbBresFillDash wfbBresFillDash
+#define fbBresSolid wfbBresSolid
+#define fbBresSolid16 wfbBresSolid16
+#define fbBresSolid24 wfbBresSolid24
+#define fbBresSolid32 wfbBresSolid32
+#define fbBresSolid8 wfbBresSolid8
+#define fbChangeWindowAttributes wfbChangeWindowAttributes
+#define fbClearVisualTypes wfbClearVisualTypes
+#define fbCloseScreen wfbCloseScreen
+#define fbComposite wfbComposite
+#define fbCompositeGeneral wfbCompositeGeneral
+#define fbCompositeSolidMask_nx1xn wfbCompositeSolidMask_nx1xn
+#define fbCompositeSolidMask_nx8888x0565C wfbCompositeSolidMask_nx8888x0565C
+#define fbCompositeSolidMask_nx8888x8888C wfbCompositeSolidMask_nx8888x8888C
+#define fbCompositeSolidMask_nx8x0565 wfbCompositeSolidMask_nx8x0565
+#define fbCompositeSolidMask_nx8x0888 wfbCompositeSolidMask_nx8x0888
+#define fbCompositeSolidMask_nx8x8888 wfbCompositeSolidMask_nx8x8888
+#define fbCompositeSrc_0565x0565 wfbCompositeSrc_0565x0565
+#define fbCompositeSrc_8888x0565 wfbCompositeSrc_8888x0565
+#define fbCompositeSrc_8888x0888 wfbCompositeSrc_8888x0888
+#define fbCompositeSrc_8888x8888 wfbCompositeSrc_8888x8888
+#define fbCompositeSrcAdd_1000x1000 wfbCompositeSrcAdd_1000x1000
+#define fbCompositeSrcAdd_8000x8000 wfbCompositeSrcAdd_8000x8000
+#define fbCompositeSrcAdd_8888x8888 wfbCompositeSrcAdd_8888x8888
+#define fbCopy1toN wfbCopy1toN
+#define fbCopyArea wfbCopyArea
+#define fbCopyNto1 wfbCopyNto1
+#define fbCopyNtoN wfbCopyNtoN
+#define fbCopyPlane wfbCopyPlane
+#define fbCopyRegion wfbCopyRegion
+#define fbCopyWindow wfbCopyWindow
+#define fbCopyWindowProc wfbCopyWindowProc
+#define fbCreateDefColormap wfbCreateDefColormap
+#define fbCreateGC wfbCreateGC
+#define fbCreatePixmap wfbCreatePixmap
+#define fbCreatePixmapBpp wfbCreatePixmapBpp
+#define fbCreateWindow wfbCreateWindow
+#define fbDestroyPixmap wfbDestroyPixmap
+#define fbDestroyWindow wfbDestroyWindow
+#define fbDoCopy wfbDoCopy
+#define fbDots wfbDots
+#define fbDots16 wfbDots16
+#define fbDots24 wfbDots24
+#define fbDots32 wfbDots32
+#define fbDots8 wfbDots8
+#define fbEvenStipple wfbEvenStipple
+#define fbEvenTile wfbEvenTile
+#define fbExpandDirectColors wfbExpandDirectColors
+#define fbFill wfbFill
+#define fbFillRegionSolid wfbFillRegionSolid
+#define fbFillRegionTiled wfbFillRegionTiled
+#define fbFillSpans wfbFillSpans
+#define fbFixCoordModePrevious wfbFixCoordModePrevious
+#define fbGCFuncs wfbGCFuncs
+#define fbGCOps wfbGCOps
+#define fbGCPrivateIndex wfbGCPrivateIndex
+#define fbGeneration wfbGeneration
+#define fbGetGCPrivateIndex wfbGetGCPrivateIndex
+#define fbGetImage wfbGetImage
+#define fbGetScreenPrivateIndex wfbGetScreenPrivateIndex
+#define fbGetSpans wfbGetSpans
+#define _fbGetWindowPixmap _wfbGetWindowPixmap
+#define fbGetWinPrivateIndex wfbGetWinPrivateIndex
+#define fbGlyph16 wfbGlyph16
+#define fbGlyph24 wfbGlyph24
+#define fbGlyph32 wfbGlyph32
+#define fbGlyph8 wfbGlyph8
+#define fbGlyphIn wfbGlyphIn
+#define fbHasVisualTypes wfbHasVisualTypes
+#define fbImageGlyphBlt wfbImageGlyphBlt
+#define fbIn wfbIn
+#define fbInitializeColormap wfbInitializeColormap
+#define fbInitVisuals wfbInitVisuals
+#define fbInstallColormap wfbInstallColormap
+#define fbLaneTable wfbLaneTable
+#define fbListInstalledColormaps wfbListInstalledColormaps
+#define fbMapWindow wfbMapWindow
+#define FbMergeRopBits wFbMergeRopBits
+#define fbOddStipple wfbOddStipple
+#define fbOddTile wfbOddTile
+#define fbOver wfbOver
+#define fbOver24 wfbOver24
+#define fbOverlayCloseScreen wfbOverlayCloseScreen
+#define fbOverlayCopyWindow wfbOverlayCopyWindow
+#define fbOverlayCreateScreenResources wfbOverlayCreateScreenResources
+#define fbOverlayCreateWindow wfbOverlayCreateWindow
+#define fbOverlayFinishScreenInit wfbOverlayFinishScreenInit
+#define fbOverlayGeneration wfbOverlayGeneration
+#define fbOverlayGetScreenPrivateIndex wfbOverlayGetScreenPrivateIndex
+#define fbOverlayPaintKey wfbOverlayPaintKey
+#define fbOverlayPaintWindow wfbOverlayPaintWindow
+#define fbOverlayScreenPrivateIndex wfbOverlayScreenPrivateIndex
+#define fbOverlaySetupScreen wfbOverlaySetupScreen
+#define fbOverlayUpdateLayerRegion wfbOverlayUpdateLayerRegion
+#define fbOverlayWindowExposures wfbOverlayWindowExposures
+#define fbOverlayWindowLayer wfbOverlayWindowLayer
+#define fbPadPixmap wfbPadPixmap
+#define fbPaintWindow wfbPaintWindow
+#define fbPictureInit wfbPictureInit
+#define fbPixmapToRegion wfbPixmapToRegion
+#define fbPolyArc wfbPolyArc
+#define fbPolyFillRect wfbPolyFillRect
+#define fbPolyGlyphBlt wfbPolyGlyphBlt
+#define fbPolyLine wfbPolyLine
+#define fbPolyline16 wfbPolyline16
+#define fbPolyline24 wfbPolyline24
+#define fbPolyline32 wfbPolyline32
+#define fbPolyline8 wfbPolyline8
+#define fbPolyPoint wfbPolyPoint
+#define fbPolySegment wfbPolySegment
+#define fbPolySegment16 wfbPolySegment16
+#define fbPolySegment24 wfbPolySegment24
+#define fbPolySegment32 wfbPolySegment32
+#define fbPolySegment8 wfbPolySegment8
+#define fbPositionWindow wfbPositionWindow
+#define fbPushFill wfbPushFill
+#define fbPushImage wfbPushImage
+#define fbPushPattern wfbPushPattern
+#define fbPushPixels wfbPushPixels
+#define fbPutImage wfbPutImage
+#define fbPutXYImage wfbPutXYImage
+#define fbPutZImage wfbPutZImage
+#define fbQueryBestSize wfbQueryBestSize
+#define fbRasterizeEdges wfbRasterizeEdges
+#define fbRasterizeTrapezoid wfbRasterizeTrapezoid
+#define fbRealizeFont wfbRealizeFont
+#define fbReduceRasterOp wfbReduceRasterOp
+#define fbReplicatePixel wfbReplicatePixel
+#define fbResolveColor wfbResolveColor
+#define fbRestoreAreas wfbRestoreAreas
+#define fbSaveAreas wfbSaveAreas
+#define fbScreenPrivateIndex wfbScreenPrivateIndex
+#define fbSegment wfbSegment
+#define fbSelectBres wfbSelectBres
+#define fbSetSpans wfbSetSpans
+#define fbSetupScreen wfbSetupScreen
+#define fbSetVisualTypes wfbSetVisualTypes
+#define fbSetVisualTypesAndMasks wfbSetVisualTypesAndMasks
+#define _fbSetWindowPixmap _wfbSetWindowPixmap
+#define fbSolid wfbSolid
+#define fbSolid24 wfbSolid24
+#define fbSolidBoxClipped wfbSolidBoxClipped
+#define fbStipple wfbStipple
+#define fbStipple1Bits wfbStipple1Bits
+#define fbStipple24Bits wfbStipple24Bits
+#define fbStipple2Bits wfbStipple2Bits
+#define fbStipple4Bits wfbStipple4Bits
+#define fbStipple8Bits wfbStipple8Bits
+#define fbStippleTable wfbStippleTable
+#define fbTile wfbTile
+#define fbTransparentSpan wfbTransparentSpan
+#define fbUninstallColormap wfbUninstallColormap
+#define fbUnmapWindow wfbUnmapWindow
+#define fbUnrealizeFont wfbUnrealizeFont
+#define fbValidateGC wfbValidateGC
+#define fbWalkCompositeRegion wfbWalkCompositeRegion
+#define fbWinPrivateIndex wfbWinPrivateIndex
+#define fbZeroLine wfbZeroLine
+#define fbZeroSegment wfbZeroSegment
+#define free_pixman_pict wfb_free_pixman_pict
+#define image_from_pict wfb_image_from_pict
+#define xxScrPrivateIndex wfbxxScrPrivateIndex
+#define xxGCPrivateIndex wfbxxGCPrivateIndex
+#define xxColormapPrivateIndex wfbxxColormapPrivateIndex
+#define xxGeneration wfbxxGeneration
+#define xxPrintVisuals wfbxxPrintVisuals
+#define xxGCFuncs wfbxxGCFuncs
+#define xxGCOps wfbxxGCOps
+#define xxSetup wfbxxSetup
+#define composeFunctions wfbComposeFunctions
diff --git a/hw/Makefile.am b/hw/Makefile.am
index d00d6fb3f..d3a35711c 100644
--- a/hw/Makefile.am
+++ b/hw/Makefile.am
@@ -1,11 +1,3 @@
-if DMX
-DMX_SUBDIRS = dmx
-endif
-
-if XORG
-XORG_SUBDIRS = xfree86
-endif
-
if XVFB
XVFB_SUBDIRS = vfb
endif
@@ -30,7 +22,9 @@ if XPRINT
XPRINT_SUBDIRS = xprint
endif
-# need to add darwin support here
+if XQUARTZ
+XQUARTZ_SUBDIRS = xquartz
+endif
SUBDIRS = \
$(XORG_SUBDIRS) \
@@ -38,11 +32,12 @@ SUBDIRS = \
$(XWIN_SUBDIRS) \
$(XVFB_SUBDIRS) \
$(XNEST_SUBDIRS) \
- $(DMX_SUBDIRS) \
- $(KDRIVE_SUBDIRS) \
+ $(DMX_SUBDIRS) \
+ $(KDRIVE_SUBDIRS) \
+ $(XQUARTZ_SUBDIRS) \
$(XPRINT_SUBDIRS)
-DIST_SUBDIRS = dmx xfree86 vfb xnest xwin darwin kdrive xgl xprint
+DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive xgl xprint
relink:
for i in $(SUBDIRS) ; do $(MAKE) -C $$i relink ; done
diff --git a/hw/darwin/Makefile.am b/hw/darwin/Makefile.am
deleted file mode 100644
index 542bfdb24..000000000
--- a/hw/darwin/Makefile.am
+++ /dev/null
@@ -1,117 +0,0 @@
-EXTRA_DIST = \
- bundle/Dutch.lproj/Credits.rtf \
- bundle/Dutch.lproj/Localizable.strings \
- bundle/Dutch.lproj/MainMenu.nib/classes.nib \
- bundle/Dutch.lproj/MainMenu.nib/objects.nib \
- bundle/Dutch.lproj/XDarwinHelp.html.cpp \
- bundle/English.lproj/Credits.rtf \
- bundle/English.lproj/InfoPlist.strings.cpp \
- bundle/English.lproj/Localizable.strings \
- bundle/English.lproj/MainMenu.nib/classes.nib \
- bundle/English.lproj/MainMenu.nib/objects.nib \
- bundle/English.lproj/XDarwinHelp.html.cpp \
- bundle/French.lproj/Credits.rtf \
- bundle/French.lproj/Localizable.strings \
- bundle/French.lproj/MainMenu.nib/classes.nib \
- bundle/French.lproj/MainMenu.nib/objects.nib \
- bundle/French.lproj/XDarwinHelp.html.cpp \
- bundle/German.lproj/Credits.rtf \
- bundle/German.lproj/Localizable.strings \
- bundle/German.lproj/MainMenu.nib/classes.nib \
- bundle/German.lproj/MainMenu.nib/objects.nib \
- bundle/German.lproj/XDarwinHelp.html.cpp \
- bundle/Japanese.lproj/Credits.rtf \
- bundle/Japanese.lproj/Localizable.strings \
- bundle/Japanese.lproj/MainMenu.nib/classes.nib \
- bundle/Japanese.lproj/MainMenu.nib/objects.nib \
- bundle/Japanese.lproj/XDarwinHelp.html.cpp \
- bundle/ko.lproj/Credits.rtf \
- bundle/ko.lproj/Localizable.strings \
- bundle/ko.lproj/MainMenu.nib/classes.nib \
- bundle/ko.lproj/MainMenu.nib/objects.nib \
- bundle/ko.lproj/XDarwinHelp.html.cpp \
- bundle/Portuguese.lproj/Credits.rtf \
- bundle/Portuguese.lproj/Localizable.strings \
- bundle/Portuguese.lproj/MainMenu.nib/classes.nib \
- bundle/Portuguese.lproj/MainMenu.nib/objects.nib \
- bundle/Portuguese.lproj/XDarwinHelp.html.cpp \
- bundle/Spanish.lproj/Credits.rtf \
- bundle/Spanish.lproj/Localizable.strings \
- bundle/Spanish.lproj/MainMenu.nib/classes.nib \
- bundle/Spanish.lproj/MainMenu.nib/objects.nib \
- bundle/Spanish.lproj/XDarwinHelp.html.cpp \
- bundle/startXClients.cpp \
- bundle/Swedish.lproj/Credits.rtf \
- bundle/Swedish.lproj/Localizable.strings \
- bundle/Swedish.lproj/MainMenu.nib/classes.nib \
- bundle/Swedish.lproj/MainMenu.nib/objects.nib \
- bundle/Swedish.lproj/XDarwinHelp.html.cpp \
- bundle/XDarwin.icns \
- darwin.c \
- darwinClut8.h \
- darwinEvents.c \
- darwin.h \
- darwinKeyboard.c \
- darwinKeyboard.h \
- darwinXinput.c \
- iokit/xfIOKit.c \
- iokit/xfIOKitCursor.c \
- iokit/xfIOKit.h \
- iokit/xfIOKitStartup.c \
- Makefile.am \
- quartz/applewm.c \
- quartz/applewmExt.h \
- quartz/cr/crAppleWM.m \
- quartz/cr/crFrame.m \
- quartz/cr/cr.h \
- quartz/cr/crScreen.m \
- quartz/cr/XView.h \
- quartz/cr/XView.m \
- quartz/fullscreen/fullscreen.c \
- quartz/fullscreen/quartzCursor.c \
- quartz/fullscreen/quartzCursor.h \
- quartz/keysym2ucs.c \
- quartz/keysym2ucs.h \
- quartz/Preferences.h \
- quartz/Preferences.m \
- quartz/pseudoramiX.c \
- quartz/pseudoramiX.h \
- quartz/quartzAudio.c \
- quartz/quartzAudio.h \
- quartz/quartz.c \
- quartz/quartzCocoa.m \
- quartz/quartzCommon.h \
- quartz/quartzCursor.c \
- quartz/quartzCursor.h \
- quartz/quartz.h \
- quartz/quartzKeyboard.c \
- quartz/quartzPasteboard.c \
- quartz/quartzPasteboard.h \
- quartz/quartzStartup.c \
- quartz/XApplication.h \
- quartz/XApplication.m \
- quartz/XDarwin.pbproj/project.pbxproj \
- quartz/XDarwinStartup.c \
- quartz/XDarwinStartup.man \
- quartz/xpr/appledri.c \
- quartz/xpr/dri.c \
- quartz/xpr/dri.h \
- quartz/xpr/dristruct.h \
- quartz/xpr/x-hash.c \
- quartz/xpr/x-hash.h \
- quartz/xpr/x-hook.c \
- quartz/xpr/x-hook.h \
- quartz/xpr/x-list.c \
- quartz/xpr/x-list.h \
- quartz/xpr/Xplugin.h \
- quartz/xpr/xprAppleWM.c \
- quartz/xpr/xprCursor.c \
- quartz/xpr/xprFrame.c \
- quartz/xpr/xpr.h \
- quartz/xpr/xprScreen.c \
- quartz/XServer.h \
- quartz/XServer.m \
- utils/dumpkeymap.c \
- utils/dumpkeymap.man \
- utils/README.txt \
- XDarwin.man
diff --git a/hw/darwin/XDarwin.man b/hw/darwin/XDarwin.man
deleted file mode 100644
index eb1b9dcb8..000000000
--- a/hw/darwin/XDarwin.man
+++ /dev/null
@@ -1,205 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/darwin/XDarwin.man,v 1.3 2001/09/23 23:02:37 torrey Exp $
-.\"
-.TH XDARWIN 1 __vendorversion__
-.SH NAME
-XDarwin \- X window system server for Darwin operating system
-.SH SYNOPSIS
-.B XDarwin
-[ options ] ...
-.SH DESCRIPTION
-#ifdef DARWIN_WITH_QUARTZ
-.I XDarwin
-is the X window server for Mac OS X and the Darwin operating system
-provided by the X.Org Foundation.
-.I XDarwin
-can run in three different modes. On Mac OS X,
-.I XDarwin
-runs in parallel with Aqua in full screen or rootless modes. These modes
-are called Quartz modes, named after the Quartz 2D compositing engine used
-by Aqua. XDarwin can also be run from the Darwin text console in IOKit mode.
-.PP
-When running from the console,
-.I XDarwin
-acts as the window server and uses IOKit services to access the display
-framebuffer, mouse and keyboard and to provide a layer of hardware
-abstraction. In console mode,
-.I XDarwin
-will normally be started by the \fIxdm(1)\fP display manager or by a script
-that runs the program \fIxinit(1)\fP.
-.PP
-When running with the Mac OS X Aqua GUI,
-.I XDarwin
-will normally be started by launching from the Finder, but it may also be
-started from the command line with the \fB\-quartz\fP, \fB\-fullscreen\fP, or
-\fB\-rootless\fP options. Note that the defaults for various command line
-options are set by the
-.I XDarwin
-application preferences in the Quartz modes.
-.PP
-In full screen Quartz mode, when the X Window System is active, it takes over
-the entire screen. CoreGraphics is used to capture and draw to the screen. The
-.I XDarwin
-application allows easy switching between the Mac OS X and X window
-desktops. More information is available in the Help menu of the
-.I XDarwin
-application.
-.PP
-In rootless mode, the X window system and Aqua 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 Aqua
-handles the desktop background.
-#else
-.I XDarwin
-is the X window server for Mac OS X and the Darwin operating system
-provided by the X.Org Foundation. This version of
-.I XDarwin
-can only be started from the Darwin text console. The Mac OS X Aqua GUI, if
-present, must be shut down.
-.I XDarwin
-uses IOKit services to access the display
-framebuffer, mouse and keyboard and to provide a layer of hardware
-abstraction.
-.I XDarwin
-will normally be started by the \fIxdm(1)\fP display manager or by a script
-that runs the program \fIxinit(1)\fP.
-#endif
-.SH OPTIONS
-.PP
-In addition to the normal server options described in the \fIXserver(1)\fP
-manual page, \fIXDarwin\fP accepts the following command line switches:
-.TP 8
-.B \-fakebuttons
-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 \-nofakebuttons
-Do not emulate a 3 button mouse. This is the default.
-.TP 8
-.B "\-fakemouse2 \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: Shift, Option, Control, Command, Fn. For example,
-.B \-fakemouse2 """Option,Shift""
-will set holding Option, Shift and clicking on button one as equivalent to
-clicking the second mouse button.
-.TP 8
-.B "\-fakemouse3 \fImodifiers\fP"
-Change the modifier keys used to emulate the third mouse button. By default,
-Option is used to emulate the third button. Any combination of the following
-modifier names may be used: Shift, Option, Control, Command, Fn. For example,
-.B \-fakemouse3 """Control,Shift""
-will set holding Control, Shift and clicking on button one as equivalent to
-clicking the third mouse button.
-.TP 8
-.B "\-keymap \fIfile\fP"
-On startup \fIXDarwin\fP translates a Darwin keymapping into an X keymap.
-The default is to read this keymapping from USA.keymapping. With this option
-the keymapping will be read from \fIfile\fP instead. If the file's path is
-not specified, it will be searched for in Library/Keyboards/ underneath the
-following directories (in order): ~, /, /Network, /System.
-.TP 8
-.B \-nokeymap
-On startup \fIXDarwin\fP translates a Darwin keymapping into an X keymap.
-With this option XDarwin queries the kernel for the current keymapping
-instead of reading it from a file. This will often fail on newer kernels.
-#ifdef DARWIN_WITH_QUARTZ
-.TP 8
-.B "\-size \fIwidth\fP \fIheight\fP"
-Sets the screen resolution for the X server to use.
-Ignored in rootless mode.
-.TP 8
-.B "\-depth \fIdepth\fP"
-Specifies the color bit depth to use. Currently only 8, 15, and 24 color bits
-per pixel are supported.
-Ignored in rootless mode.
-.TP 8
-.B "\-refresh \fIrate\fP"
-Gives the refresh rate to use in Hz. For LCD displays this should be 0.
-Ignored in rootless mode.
-.TP 8
-.B \-fullscreen
-Run full screen in parallel with Mac OS X Aqua GUI.
-.TP 8
-.B \-rootless
-Run rootless inside Mac OS X Aqua GUI.
-.TP 8
-.B \-quartz
-Run in parallel with the Mac OS X Aqua GUI using the default mode.
-#else
-.TP 8
-.B "\-size \fIwidth\fP \fIheight\fP"
-Sets the screen resolution for the X server to use.
-.TP 8
-.B "\-depth \fIdepth\fP"
-Specifies the color bit depth to use. Currently only 8, 15, and 24 color bits
-per pixel are supported.
-.TP 8
-.B "\-refresh \fIrate\fP"
-Gives the refresh rate to use in Hz. For LCD displays this should be 0.
-#endif
-.TP 8
-.B \-showconfig
-Print out the server version and patchlevel.
-.TP 8
-.B \-version
-Same as \fB\-showconfig\fP.
-.SH "SEE ALSO"
-.PP
-X(__miscmansuffix__), Xorg(1), Xserver(1), xdm(1), xinit(1)
-.SH BUGS
-.I XDarwin
-and this man page still have many limitations. Some of the more obvious
-ones are:
-.br
-- The display mode cannot be changed once the X server has started.
-.br
-- A screen saver is not supported.
-.PP
-.SH AUTHORS
-XFree86 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
diff --git a/hw/darwin/bundle/Dutch.lproj/Credits.rtf b/hw/darwin/bundle/Dutch.lproj/Credits.rtf
deleted file mode 100644
index 5858e5933..000000000
--- a/hw/darwin/bundle/Dutch.lproj/Credits.rtf
+++ /dev/null
@@ -1,168 +0,0 @@
-{\rtf1\mac\ansicpg10000\cocoartf102
-{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fswiss\fcharset77 Helvetica-Oblique;
-}
-{\colortbl;\red255\green255\blue255;}
-\vieww9000\viewh9000\viewkind0
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
-
-\f0\fs24 \cf0 This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors. The following people contributed to Darwin/Mac OS X support.\
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f1\b \cf0 Contributors to Xorg Foundation Release:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Kaleb KEITHLEY\
-
-\f2\i Working left and right Ctrl, Alt (Option), Meta (Command) and Shift keys.
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\f1\b \cf0 Contributors to XFree86 4.4:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 John Harper\
-
-\f2\i Rootless acceleration and Apple-WM extension
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Additional XonX Contributors to XFree86 4.3:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Fabr\'92cio Luis de Castro\
-
-\f2\i Portuguese localization
-\f0\i0 \
-Michael Oland\
-
-\f2\i New XDarwin icon
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 XonX Contributors to XFree86 4.2:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Darwin x86 support
-\f0\i0 \
-Pablo Di Noto\
-
-\f2\i Spanish localization
-\f0\i0 \
-Paul Edens\
-
-\f2\i Dutch localization
-\f0\i0 \
-Kyunghwan Kim\
-
-\f2\i Korean localization
-\f0\i0 \
-Mario Klebsch\
-
-\f2\i Non-US keyboard support
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f0\i0 \
-Andreas Monitzer\
-
-\f2\i German localization
-\f0\i0 \
-Patrik Montgomery\
-
-\f2\i Swedish localization
-\f0\i0 \
-Greg Parker\
-
-\f2\i Rootless support
-\f0\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Japanese localization
-\f0\i0 \
-Olivier Verdier\
-
-\f2\i French localization
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Special Thanks:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Devin Poolman and Zero G Software, Inc.\
-
-\f2\i Installer
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 XonX Team Members\
-Contributing to XFree86 4.1:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Darwin x86 support
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f0\i0 \
-Andreas Monitzer\
-
-\f2\i Cocoa version of XDarwin front end
-\f0\i0 \
-Greg Parker\
-
-\f2\i Original Quartz implementation
-\f0\i0 \
-Christoph Pfisterer\
-
-\f2\i Dynamic shared libraries
-\f0\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Japanese localization
-\f0\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f1\b \cf0 Special Thanks:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Tiago Ribeiro\
-
-\f2\i XDarwin icon
-\f0\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f1\b \cf0 History:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 John Carmack\
-
-\f2\i Original XFree86 port to Mac OS X Server
-\f0\i0 \
-Dave Zarzycki\
-
-\f2\i XFree86 4.0 port to Darwin 1.0
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/Dutch.lproj/Localizable.strings b/hw/darwin/bundle/Dutch.lproj/Localizable.strings
deleted file mode 100644
index 6abd91072..000000000
--- a/hw/darwin/bundle/Dutch.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/classes.nib
deleted file mode 100644
index 77f345a4e..000000000
--- a/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/classes.nib
+++ /dev/null
@@ -1,72 +0,0 @@
-{
- IBClasses = (
- {
- ACTIONS = {showHelp = id; };
- CLASS = FirstResponder;
- LANGUAGE = ObjC;
- SUPERCLASS = NSObject;
- },
- {
- ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
- CLASS = Preferences;
- LANGUAGE = ObjC;
- OUTLETS = {
- addToPathButton = id;
- addToPathField = id;
- button2ModifiersMatrix = id;
- button3ModifiersMatrix = id;
- depthButton = id;
- displayField = id;
- dockSwitchButton = id;
- fakeButton = id;
- keymapFileField = id;
- modeMatrix = id;
- modeWindowButton = id;
- mouseAccelChangeButton = id;
- startupHelpButton = id;
- switchKeyButton = id;
- systemBeepButton = id;
- useDefaultShellMatrix = id;
- useOtherShellField = id;
- useXineramaButton = id;
- window = id;
- };
- SUPERCLASS = NSObject;
- },
- {
- CLASS = XApplication;
- LANGUAGE = ObjC;
- OUTLETS = {preferences = id; xserver = id; };
- SUPERCLASS = NSApplication;
- },
- {
- ACTIONS = {
- bringAllToFront = id;
- closeHelpAndShow = id;
- itemSelected = id;
- nextWindow = id;
- previousWindow = id;
- showAction = id;
- showSwitchPanel = id;
- startFullScreen = id;
- startRootless = id;
- };
- CLASS = XServer;
- LANGUAGE = ObjC;
- OUTLETS = {
- dockMenu = NSMenu;
- helpWindow = NSWindow;
- modeWindow = NSWindow;
- startFullScreenButton = NSButton;
- startRootlessButton = NSButton;
- startupHelpButton = NSButton;
- startupModeButton = NSButton;
- switchWindow = NSPanel;
- windowMenu = NSMenu;
- windowSeparator = NSMenuItem;
- };
- SUPERCLASS = NSObject;
- }
- );
- IBVersion = 1;
-} \ No newline at end of file
diff --git a/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/objects.nib
deleted file mode 100644
index 8e9224cb6..000000000
--- a/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/objects.nib
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp
deleted file mode 100644
index 1113b8ae6..000000000
--- a/hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp,v 1.2 2001/11/04 07:02:28 torrey Exp $ -->
-
-<html>
-<head>
-<title>XDarwin Help</title>
-</head>
-<body>
-<center>
- <h1>XDarwin X Server for Mac OS X</h1>
- X_VENDOR_NAME X_VERSION<br>
- Release Date: X_REL_DATE
-</center>
-<h2>Inhoud</h2>
-<ol>
- <li><A HREF="#notice">Belangrijke Informatie</A></li>
- <li><A HREF="#usage">Gebruik</A></li>
- <li><A HREF="#path">Instellen van het Path</A></li>
- <li><A HREF="#prefs">Voorkeursinstellingen</A></li>
- <li><A HREF="#license">Licentie</A></li>
-</ol>
-<center>
- <h2><a NAME="notice">Belangrijke Informatie</a></h2>
-</center>
-<blockquote>
-#if X_PRE_RELEASE
-Dit is een pre-release van XDarwin, waarvoor geen ondersteuning beschikbaar is. Rapporteren van bugs en aanleveren van patches kan op de <A HREF="http://sourceforge.net/projects/xonx/">XonX project pagina</A> bij SourceForge. Kijk alvorens een bug te rapporteren in een pre-release eerst of een nieuwe versie beschikbaar is bij <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> of de X_VENDOR_LINK.
-#else
-Als de server ouder is dan 6-12 maanden, of als uw hardware nieuwer is dan de bovenstaande datum, kijk dan of een nieuwe versie beschikbaar is voor u een probleem aanmeldt. Rapporteren van bugs en aanleveren van patches kan op de <A HREF="http://sourceforge.net/projects/xonx/">XonX project pagina</A> bij SourceForge.
-#endif
-</blockquote>
-<blockquote>
-Deze software is beschikbaar gesteld onder de voorwaarden van de <A HREF="#license">MIT X11 / X Consortium Licentie</A> en is beschikbaar 'AS IS',zonder enige garantie. Lees s.v.p. de <A HREF="#license">Licentie</A> voor gebruik.</blockquote>
-
-<h2><a NAME="usage">Gebruik</a></h2>
-<p>XDarwin is een open-source X server van het <a HREF="http://www.x.org/">X Window Systeem</a>. This version of XDarwin was produced by the X_VENDOR_LINK. XDarwin werkt op Mac OS X in schermvullende of rootless modus.</p>
-<p>Het X window systeem in schermvullende modus neemt het hele beeldscherm in beslag. U schakelt terug naar de Mac OS X desktop door de toesten Command-Option-A in te drukken. Deze toetsencombinatie kunt u veranderen in de Voorkeuren. Op de Mac OS X desktop klikt u op de XDarwin icoon in de Dock om weer naar het X window systeem te schakelen. (In de Voorkeuren kunt er voor kiezen om een apart XDarwin schakelpaneel te gebruiken op de Mac OS X desktop.)</p>
-<p>In rootless modus verschijnen het X window systeem en Aqua (de Mac OS X desktop) tegelijk op het scherm. Het achtergrondscherm van X11, waarbinnen alle X11 vensters vallen, is net zo groot als het gehele scherm, maar het achtergrondscherm zelf is onzichtbaar.</p>
-
-<h3>Meerknopsmuis emulatie</h3>
-<p>Voor veel X11 programma's hebt u een 3-knops muis nodig. Met een 1-knops muis kunt u een 3-knops muis nabootsen door een toets in te drukken terwijl u klikt met de muis. Het instellen hiervan kan bij Voorkeuren, "Meerknopsmuis emulatie" in "Algemeen". Emulatie is standaard ingeschakeld: ingedrukt houden van de "command" toets terwijl u klikt emuleert knop 2, ingedrukt houden van "option" emuleert knop 3. Deze toetsen kunt u dus wijzigen in de Voorkeuren. Let op: als u xmodmap gebruikt om de indeling van het toetsenbord te wijzigen, moet u toch de oorspronkelijke toetsen op het toetsenbord gebruiken voor deze functie.</p>
-
-<h2><a NAME="path">Instellen van het Path</a></h2>
-<p>Het path is de lijst van directories waarin gezocht wordt naar commando's. De X11 commando's staan in de directory <code>/usr/X11R6/bin</code>, die dus aan uw path moet worden toegevoegd. XDarwin doet dit automatisch voor u en kan extra directories toevoegen waarin u commando's hebt ge&iuml;nstalleerd.</p>
-
-<p>Ervaren gebruikers zullen het path al correct hebben ingesteld in de configuratiebestanden voor hun shell. In dat geval kunt u XDarwin via de Voorkeuren vertellen het path niet te wijzigen. XDarwin start de eerste X11 clients binnen de standaard login shell van de gebruiker (bij de Voorkeuren kunt u een afwijkende shell opgeven). Het instellen van het path is afhankelijk van de shell. Zie hiervoor de man pages voor de shell.</p>
-
-<p>Het kan handig zijn de manualpages voor X11 toe te voegen aan de lijst waarin gezocht wordt als u documentatie opvraagt. De manualpages voor X11 staan in <code>/usr/X11R6/man</code> en de <code>MANPATH</code> environment variable bevat de lijst van directories waarin naar documentatie wordt gezocht.</p>
-
-<h2><a NAME="prefs">Voorkeursinstellingen</a></h2>
-<p>Een aantal instellingen kan worden gewijzigd door "Voorkeuren..." te kiezen in het "XDarwin" menu. Wijzigingen van de instellingen genoemd onder "Start" gaan pas in als u XDarwin opnieuw hebt gestart. Een wijziging van de overige instellingen is direct effectief. Hier onder vindt u de verschillende mogelijkheden beschreven:</p>
-
-<h3>Algemeen</h3>
-<ul>
- <li><b>Gebruik systeempiep voor X11:</b> Als u dit inschakelt wordt het Mac OS X waarschuwingssignaal ook gebruikt door X11, anders gebruikt X11 een simpele pieptoon (dit is de standaardinstelling).</li>
- <li><b>Wijzigen muis-versnelling door X11 mogelijk:</b> In een standaard X window systeem kan de window manager de muis-versnelling aanpassen. Dit kan verwarrend zijn omdat de snelheid onder X11 dan verschillend kan zijn van de snelheid die u in Mac OS X bij Systeemvoorkeuren hebt ingesteld. Om verwarring te voorkomen is de standaardinstelling dat X11 de versnelling niet kan wijzigen.</li>
- <li><b>Meerknopsmuis emulatie:</b> Dit is hierboven beschreven bij <a HREF="#usage">Gebruik</a>. Als emulatie is ingeschakeld moet u de gekozen toetsen ingedrukt houden terwijl u met de muis klikt om de tweede en derde muisknop na te bootsen.</li>
-</ul>
-
-<h3>Start</h3>
-<ul>
- <li><b>Standaard modus:</b> Hier kiest u de standaard scherm-modus: schermvullend of rootless (hierboven beschreven bij <a HREF="#usage">Gebruik</a>). U kunt ook kiezen tijdens het starten van XDarwin, zie de optie hieronder.</li>
- <li><b>Kies scherm-modus tijdens start:</b> Dit is standaard ingeschakeld zodat u tijdens het starten van XDarwin kunt kiezen tussen schermvullend en rootless scherm-modus. Als u dit uitschakelt start XDarwin in de standaard modus zonder u iets te vragen.</li>
- <li><b>X11 scherm nummer:</b> Met X11 kunnen meerdere schermen worden aangestuurd door verschillende X servers op dezelfde computer. Als u meerdere X servers tegelijk wilt gebruiken stelt u hier het scherm nummer in dat door XDarwin wordt gebruikt.</li>
- <li><b>Xinerama multi-monitor ondersteuning mogelijk:</b> XDarwin ondersteunt het gebruik van meerdere monitoren met Xinerama, waarbij elke monitor wordt gezien als deel van &eacute;&eacute;n groot rechthoekig scherm. U kunt Xinerama hier uitschakelen, maar XDarwin werkt op dit moment zonder Xinerama niet goed met meerdere monitoren. Als u maar 1 monitor gebruikt is deze instelling automatisch uitgeschakeld.</li>
- <li><b>Toetsenbordindeling-bestand:</b> Een toetsenbordindeling-bestand wordt bij het starten geladen en omgezet naar een X11 toetsenbordindeling. Voor verschillende talen vindt u toetsenbordindelingen in de directory <code>/System/Library/Keyboards</code>.</li>
- <li><b>Bij starten eerste X11 clients:</b> Als XDarwin start, wordt <code>xinit</code> uitgevoerd om de X window manager en andere X clients te starten (zie "<code>man xinit</code>"). Voordat XDarwin <code>xinit</code> uitvoert voegt het de opgegeven directories toe aan het path. Standaard wordt alleen <code>/usr/X11R6/bin</code> toegevoegd. U kunt meerdere directories opgeven, gescheiden door een dubbelepunt. X clients worden gestart met de standaard login shell van de gebruiker met gebruik van de configuratiebestanden voor die shell. U kunt een afwijkende shell opgeven.</li>
-</ul>
-
-<h3>Schermvullend</h3>
-<ul>
- <li><b>Toetscombinatie knop:</b> Klik op deze knop om de toetscombinatie te wijzigen waarmee u tussen de Mac OS X desktop en X11 schakelt. Als toetscombinatie kunt u elke combinatie gebruiken van de shift, control, command en option toetsen samen met &eacute;&eacute;n normale toets.</li>
- <li><b>Klikken op icoon in Dock schakelt naar X11:</b> Hiermee is een klik op de XDarwin icoon in de Dock voldoende om naar X11 te schakelen. In sommige versies van Mac OS X verdwijnt soms de cursor als u deze mogelijkheid gebruikt en daarna terugkeert naar de Mac OS X desktop.</li>
- <li><b>Toon help bij schermvullend starten:</b> Hiermee wordt een inleidend scherm getoond als XDarwin schermvullend start.</li>
- <li><b>Kleurdiepte:</b> In de schermvullende modus kan X11 een andere kleurdiepte gebruiken dan Aqua (en de Mac OS X desktop). Als u "Huidig" kiest, neemt XDarwin bij het starten de kleurdiepte over van Aqua. U kunt ook kiezen voor 8, 15 of 24 bits.</li>
-</ul>
-
-<h2><a NAME="license">Licentie</a></h2>
-The main license for XDarwin is one based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please refer to the source code.
-<H3><A NAME="3"></A>X Consortium License</H3>
-<p>Copyright (C) 1996 X Consortium</p>
-<p>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:</p>
-<p>The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.</p>
-<p>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 X CONSORTIUM 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.</p>
-<p>Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization from
-the X Consortium.</p>
-<p>X Window System is a trademark of X Consortium, Inc.</p>
-</body>
-</html>
-
diff --git a/hw/darwin/bundle/English.lproj/Credits.rtf b/hw/darwin/bundle/English.lproj/Credits.rtf
deleted file mode 100644
index 34408e78c..000000000
--- a/hw/darwin/bundle/English.lproj/Credits.rtf
+++ /dev/null
@@ -1,168 +0,0 @@
-{\rtf1\mac\ansicpg10000\cocoartf102
-{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fswiss\fcharset77 Helvetica-Oblique;
-}
-{\colortbl;\red255\green255\blue255;}
-\vieww5160\viewh6300\viewkind0
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
-
-\f0\fs24 \cf0 This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors. The following people contributed to Darwin/Mac OS X support.\
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f1\b \cf0 Contributors to Xorg Foundation Release:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Kaleb KEITHLEY\
-
-\f2\i Working left and right Ctrl, Alt (Option), Meta (Command) and Shift keys.
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\f1\b \cf0 Contributors to XFree86 4.4:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 John Harper\
-
-\f2\i Rootless acceleration and Apple-WM extension
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Additional XonX Contributors to XFree86 4.3:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Fabr\'92cio Luis de Castro\
-
-\f2\i Portuguese localization
-\f0\i0 \
-Michael Oland\
-
-\f2\i New XDarwin icon
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 XonX Contributors to XFree86 4.2:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Darwin x86 support
-\f0\i0 \
-Pablo Di Noto\
-
-\f2\i Spanish localization
-\f0\i0 \
-Paul Edens\
-
-\f2\i Dutch localization
-\f0\i0 \
-Kyunghwan Kim\
-
-\f2\i Korean localization
-\f0\i0 \
-Mario Klebsch\
-
-\f2\i Non-US keyboard support
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f0\i0 \
-Andreas Monitzer\
-
-\f2\i German localization
-\f0\i0 \
-Patrik Montgomery\
-
-\f2\i Swedish localization
-\f0\i0 \
-Greg Parker\
-
-\f2\i Rootless support
-\f0\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Japanese localization
-\f0\i0 \
-Olivier Verdier\
-
-\f2\i French localization
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Special Thanks:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Devin Poolman and Zero G Software, Inc.\
-
-\f2\i Installer
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 XonX Team Members\
-Contributing to XFree86 4.1:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Darwin x86 support
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f0\i0 \
-Andreas Monitzer\
-
-\f2\i Cocoa version of XDarwin front end
-\f0\i0 \
-Greg Parker\
-
-\f2\i Original Quartz implementation
-\f0\i0 \
-Christoph Pfisterer\
-
-\f2\i Dynamic shared libraries
-\f0\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Japanese localization
-\f0\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f1\b \cf0 Special Thanks:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Tiago Ribeiro\
-
-\f2\i XDarwin icon
-\f0\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f1\b \cf0 History:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 John Carmack\
-
-\f2\i Original XFree86 port to Mac OS X Server
-\f0\i0 \
-Dave Zarzycki\
-
-\f2\i XFree86 4.0 port to Darwin 1.0
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp b/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp
deleted file mode 100644
index aeb210342..000000000
--- a/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-/* English versions of the Info.plist keys; used by most localizations. */
-/* Most of these are set in the target application settings. */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp,v 1.3 2002/07/17 01:24:55 torrey Exp $ */
-
-NSHumanReadableCopyright = __quote__ X_VENDOR_NAME X_VERSION __quote__;
diff --git a/hw/darwin/bundle/English.lproj/Localizable.strings b/hw/darwin/bundle/English.lproj/Localizable.strings
deleted file mode 100644
index 2c25c1dc3..000000000
--- a/hw/darwin/bundle/English.lproj/Localizable.strings
+++ /dev/null
@@ -1,23 +0,0 @@
-/* English localized versions of strings used by the Mac OS X front end. */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/Localizable.strings,v 1.3 2002/01/30 06:50:46 torrey Exp $ */
-
-/* Title of alert panel */
-"Quit X server?" = "Quit X server?";
-
-/* Text of alert panel */
-"Quitting the X server will terminate any running X Window System programs." = "Quitting the X server will terminate any running X Window System programs.";
-
-/* Quit */
-"Quit" = "Quit";
-
-/* Cancel */
-"Cancel" = "Cancel";
-
-/* Default keymapping file */
-"USA.keymapping" = "USA.keymapping";
-
-/* Default switch string */
-"Cmd-Opt-a" = "Cmd-Opt-a";
-
-/* Button title when changing switch key */
-"Press key" = "Press key";
diff --git a/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib
deleted file mode 100644
index 77f345a4e..000000000
--- a/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib
+++ /dev/null
@@ -1,72 +0,0 @@
-{
- IBClasses = (
- {
- ACTIONS = {showHelp = id; };
- CLASS = FirstResponder;
- LANGUAGE = ObjC;
- SUPERCLASS = NSObject;
- },
- {
- ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
- CLASS = Preferences;
- LANGUAGE = ObjC;
- OUTLETS = {
- addToPathButton = id;
- addToPathField = id;
- button2ModifiersMatrix = id;
- button3ModifiersMatrix = id;
- depthButton = id;
- displayField = id;
- dockSwitchButton = id;
- fakeButton = id;
- keymapFileField = id;
- modeMatrix = id;
- modeWindowButton = id;
- mouseAccelChangeButton = id;
- startupHelpButton = id;
- switchKeyButton = id;
- systemBeepButton = id;
- useDefaultShellMatrix = id;
- useOtherShellField = id;
- useXineramaButton = id;
- window = id;
- };
- SUPERCLASS = NSObject;
- },
- {
- CLASS = XApplication;
- LANGUAGE = ObjC;
- OUTLETS = {preferences = id; xserver = id; };
- SUPERCLASS = NSApplication;
- },
- {
- ACTIONS = {
- bringAllToFront = id;
- closeHelpAndShow = id;
- itemSelected = id;
- nextWindow = id;
- previousWindow = id;
- showAction = id;
- showSwitchPanel = id;
- startFullScreen = id;
- startRootless = id;
- };
- CLASS = XServer;
- LANGUAGE = ObjC;
- OUTLETS = {
- dockMenu = NSMenu;
- helpWindow = NSWindow;
- modeWindow = NSWindow;
- startFullScreenButton = NSButton;
- startRootlessButton = NSButton;
- startupHelpButton = NSButton;
- startupModeButton = NSButton;
- switchWindow = NSPanel;
- windowMenu = NSMenu;
- windowSeparator = NSMenuItem;
- };
- SUPERCLASS = NSObject;
- }
- );
- IBVersion = 1;
-} \ No newline at end of file
diff --git a/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib
deleted file mode 100644
index ebbfd8317..000000000
--- a/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp
deleted file mode 100644
index 5996285ae..000000000
--- a/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp,v 1.1 2001/05/21 01:42:17 torrey Exp $ -->
-
-<html>
-<head>
-<title>XDarwin Help</title>
-</head>
-<body>
-<center>
- <h1>XDarwin X Server for Mac OS X</h1>
- X_VENDOR_NAME X_VERSION<br>
- Release Date: X_REL_DATE
-</center>
-<h2>Contents</h2>
-<ol>
- <li><A HREF="#notice">Important Notice</A></li>
- <li><A HREF="#usage">Usage</A></li>
- <li><A HREF="#path">Setting Your Path</A></li>
- <li><A HREF="#prefs">User Preferences</A></li>
- <li><A HREF="#license">License</A></li>
-</ol>
-<center>
- <h2><a NAME="notice">Important Notice</a></h2>
-</center>
-<blockquote>
-#if X_PRE_RELEASE
-This is a pre-release version of XDarwin, and is not supported in any way. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge. Before reporting bugs in pre-release versions, please check the latest version from <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> or the X_VENDOR_LINK.
-#else
-If the server is older than 6-12 months, or if your hardware is newer than the above date, look for a newer version before reporting problems. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge.
-#endif
-</blockquote>
-<blockquote>
-This software is distributed under the terms of the <A HREF="#license">MIT X11 / X Consortium License</A> and is provided AS IS, with no warranty. Please read the <A HREF="#license">License</A> before using.</blockquote>
-
-<h2><a NAME="usage">Usage</a></h2>
-<p>XDarwin is a freely redistributable open-source X server for the <a HREF="http://www.x.org/">X Window System</a>. This version of XDarwin was produced by the X_VENDOR_LINK. XDarwin runs on Mac OS X in full screen or rootless modes.</p>
-<p>In full screen mode, when the X window system is active, it takes over the entire screen. You can switch back to the Mac OS X desktop by holding down Command-Option-A. This key combination can be changed in the user preferences. From the Mac OS X desktop, click on the XDarwin icon in the Dock to switch back to the X window system. (You can change this behavior in the user preferences so that you must click the XDarwin icon in the floating switch window instead.)</p>
-<p>In rootless mode, the X window system and Aqua 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 Aqua handles the desktop background.</p>
-<h3>Multi-Button Mouse Emulation</h3>
-<p>Many X11 applications rely on the use of a 3-button mouse. You can emulate a 3-button mouse with a single button by holding down various modifier keys while you click the mouse button. This is controlled by settings in the "Multi-Button Mouse Emulation" section of the "General" preferences. By default, emulation is on and holding down the command key and clicking the mouse button will simulate clicking the second mouse button. Holding down the option key and clicking will simulate the third button. You can change to any combination of modifiers to emulate buttons two and three in the preferences. Note, even if the modifiers keys are mapped to some other key with xmodmap, you still must use the actual keys specified in the preferences for multi-button mouse emulation.</p>
-
-<h2><a NAME="path">Setting Your Path</a></h2>
-<p>Your path is the list of directories to be searched for executable commands. The X11 commands are located in <code>/usr/X11R6/bin</code>, which needs to be added to your path. XDarwin does this for you by default and can also add additional directories where you have installed command line applications.</p>
-<p>More experienced users will have already set their path correctly using the initialization files for their shell. In this case, you can inform XDarwin not to modify your path in the preferences. XDarwin launches the initial X11 clients in the user's default login shell. (An alternate shell can also be specified in the preferences.) The way to set the path depends on the shell you are using. This is described in the man page documentation for the shell.</p>
-<p>In addition you may also want to add the X11 man pages to the list of pages to be searched when you are looking for documentation. The X11 man pages are located in <code>/usr/X11R6/man</code> and the <code>MANPATH</code> environment variable contains the list of directories to search.</p>
-
-<h2><a NAME="prefs">User Preferences</a></h2>
-<p>A number of options may be set from the user preferences, accessible from the "Preferences..." menu item in the "XDarwin" menu. The options listed as start up options will not take effect until you have restarted XDarwin. All other options take effect immediately. The various options are described below:</p>
-<h3>General</h3>
-<ul>
- <li><b>Use System beep for X11:</b> When enabled the standard Mac OS X alert sound is used as the X11 bell. When disabled (default) a simple tone is used.</li>
- <li><b>Allow X11 to change mouse acceleration:</b> In a standard X window system implementation, the window manager can change the mouse acceleration. This can lead to confusion as the mouse acceleration may be set to different values by the Mac OS X System Preferences and the X window manager. By default, X11 is not allowed to change the mouse acceleration to avoid this problem.</li>
- <li><b>Multi-Button Mouse Emulation:</b> This is described above under <a HREF="#usage">Usage</a>. When emulation is enabled the selected modifiers must be held down when the mouse button is pushed to emulate the second or third mouse buttons.</li>
-</ul>
-<h3>Start Up</h3>
-<ul>
- <li><b>Default Mode:</b> If the user does not indicate whether to run in full screen or rootless mode, the mode specified here will be used.</li>
- <li><b>Show mode pick panel on startup:</b> By default, a panel is displayed when XDarwin is started to allow the user to choose between full screen or rootless mode. If this option is turned off, the default mode will be started automatically.</li>
- <li><b>X11 Display number:</b> X11 allows there to be multiple displays managed by separate X servers on a single computer. The user may specify an integer display number for XDarwin to use if more than one X server is going to be run simultaneously.</li>
- <li><b>Allow Xinerama multiple monitor support:</b> XDarwin supports multiple monitors with Xinerama, which treats all monitors as being part of one large rectangular screen. You can disable Xinerama with this option, but currently XDarwin does not handle multiple monitors correctly without it. If you only have a single monitor, Xinerama is automatically disabled.</li>
- <li><b>Keymapping File:</b> A keymapping file is read at startup and translated to an X11 keymap. Keymapping files, available for a wide variety of languages, are found in <code>/System/Library/Keyboards</code>.</li>
- <li><b>Starting First X11 Clients:</b> When XDarwin is started from the Finder, it will run <code>xinit</code> to launch the X window manager and other X clients. (See "<code>man xinit</code>" for more information.) Before XDarwin runs <code>xinit</code> it will add the specified directories to the user's path. By default only <code>/usr/X11R6/bin</code> is added. Additional directories may added, separated by a colon. The X clients are started in the user's default login shell so that the user's shell initialization files are read. If desired, an alternate shell may be specified.</li>
-</ul>
-<h3>Full Screen</h3>
-<ul>
- <li><b>Key combination button:</b> Click this button and then press any number of modifiers followed by a standard key to change the key combination to switch between Aqua and X11.</li>
- <li><b>Click on icon in Dock switches to X11:</b> Enable this to activate switching to X11 by clicking on the XDarwin icon in the Dock. On some versions of Mac OS X, switching by clicking in the Dock can cause the cursor to disappear on returning to Aqua.</li>
- <li><b>Show help on startup:</b> This will show an introductory splash screen when XDarwin is started in full screen mode.</li>
- <li><b>Color bit depth:</b> In full screen mode, the X11 display can use a different color bit depth than is used by Aqua. If "Current" is specified, the depth used by Aqua when XDarwin starts will be used. Otherwise 8, 15, or 24 bits may be specified.</li>
-</ul>
-
-<h2><a NAME="license">License</a></h2>
-The main license for XDarwin is based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please refer to the source code.
-<H3><A NAME="3"></A>X Consortium License</H3>
-<p>Copyright (C) 1996 X Consortium</p>
-<p>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:</p>
-<p>The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.</p>
-<p>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 X CONSORTIUM 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.</p>
-<p>Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization from
-the X Consortium.</p>
-<p>X Window System is a trademark of X Consortium, Inc.</p>
-</body>
-</html>
diff --git a/hw/darwin/bundle/French.lproj/Credits.rtf b/hw/darwin/bundle/French.lproj/Credits.rtf
deleted file mode 100644
index 17e0a0d70..000000000
--- a/hw/darwin/bundle/French.lproj/Credits.rtf
+++ /dev/null
@@ -1,166 +0,0 @@
-{\rtf1\mac\ansicpg10000\cocoartf102
-{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fswiss\fcharset77 Helvetica-Oblique;
-}
-{\colortbl;\red255\green255\blue255;}
-\vieww5160\viewh4480\viewkind0
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
-
-\f0\fs24 \cf0 This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors. The following people contributed to Darwin/Mac OS X support.\
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f1\b \cf0 Contributors to Xorg Foundation Release:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Kaleb KEITHLEY\
-
-\f2\i Working left and right Ctrl, Alt (Option), Meta (Command) and Shift keys.
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\f1\b \cf0 Contributors to XFree86 4.4:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 John Harper\
-
-\f2\i Rootless acceleration and Apple-WM extension
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Additional XonX Contributors to XFree86 4.3:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Fabr\'92cio Luis de Castro\
-
-\f2\i Portuguese localization
-\f0\i0 \
-Michael Oland\
-
-\f2\i New XDarwin icon
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f1\b \cf0 \
-Participants \'88 XonX pour XFree86 4.2 :
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Version pour Darwin x86
-\f0\i0 \
-Pablo Di Noto\
-
-\f2\i Traduction en espagnol
-\f0\i0 \
-Paul Edens\
-
-\f2\i Traduction en allemand
-\f0\i0 \
-Kyunghwan Kim\
-
-\f2\i Traduction en cor\'8een
-\f0\i0 \
-Mario Klebsch\
-
-\f2\i Claviers non-US
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Direction du projet
-\f0\i0 \
-Andreas Monitzer\
-
-\f2\i Traduction en allemand
-\f0\i0 \
-Patrik Montgomery\
-
-\f2\i Traduction en su\'8edois
-\f0\i0 \
-Greg Parker\
-
-\f2\i Version \'c7 rootless \'c8
-\f0\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Traduction en japonais
-\f0\i0 \
-Olivier Verdier\
-
-\f2\i Traduction en fran\'8dais
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Remerciements :
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Devin Poolman et Zero G Software, Inc.\
-
-\f2\i Installeur
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Participants \'88 XonX pour XFree86 4.2 :
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Version pour Darwin x86
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Direction du projet
-\f0\i0 \
-Andreas Monitzer\
-
-\f2\i Version Cocoa de l'interface de XDarwin
-\f0\i0 \
-Greg Parker\
-
-\f2\i Impl\'8ementation initiale sur Quartz
-\f0\i0 \
-Christoph Pfisterer\
-
-\f2\i Librairies partag\'8ees dynamiquement
-\f0\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Traduction en japonais
-\f0\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f1\b \cf0 Remerciements :
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Tiago Ribeiro\
- Ic\'99ne
-\f2\i XDarwin
-\f0\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f1\b \cf0 Historique :
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 John Carmack\
-
-\f2\i Premi\'8fre adaptation de XFree86 sur Mac OS X Server
-\f0\i0 \
-Dave Zarzycki\
-
-\f2\i Adaptation de Free86 4.0 pour Darwin 1.0
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Int\'8egration dans le projet XFree86 pour la version 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/French.lproj/Localizable.strings b/hw/darwin/bundle/French.lproj/Localizable.strings
deleted file mode 100644
index 21c4a99c1..000000000
--- a/hw/darwin/bundle/French.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/French.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/French.lproj/MainMenu.nib/classes.nib
deleted file mode 100644
index 77f345a4e..000000000
--- a/hw/darwin/bundle/French.lproj/MainMenu.nib/classes.nib
+++ /dev/null
@@ -1,72 +0,0 @@
-{
- IBClasses = (
- {
- ACTIONS = {showHelp = id; };
- CLASS = FirstResponder;
- LANGUAGE = ObjC;
- SUPERCLASS = NSObject;
- },
- {
- ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
- CLASS = Preferences;
- LANGUAGE = ObjC;
- OUTLETS = {
- addToPathButton = id;
- addToPathField = id;
- button2ModifiersMatrix = id;
- button3ModifiersMatrix = id;
- depthButton = id;
- displayField = id;
- dockSwitchButton = id;
- fakeButton = id;
- keymapFileField = id;
- modeMatrix = id;
- modeWindowButton = id;
- mouseAccelChangeButton = id;
- startupHelpButton = id;
- switchKeyButton = id;
- systemBeepButton = id;
- useDefaultShellMatrix = id;
- useOtherShellField = id;
- useXineramaButton = id;
- window = id;
- };
- SUPERCLASS = NSObject;
- },
- {
- CLASS = XApplication;
- LANGUAGE = ObjC;
- OUTLETS = {preferences = id; xserver = id; };
- SUPERCLASS = NSApplication;
- },
- {
- ACTIONS = {
- bringAllToFront = id;
- closeHelpAndShow = id;
- itemSelected = id;
- nextWindow = id;
- previousWindow = id;
- showAction = id;
- showSwitchPanel = id;
- startFullScreen = id;
- startRootless = id;
- };
- CLASS = XServer;
- LANGUAGE = ObjC;
- OUTLETS = {
- dockMenu = NSMenu;
- helpWindow = NSWindow;
- modeWindow = NSWindow;
- startFullScreenButton = NSButton;
- startRootlessButton = NSButton;
- startupHelpButton = NSButton;
- startupModeButton = NSButton;
- switchWindow = NSPanel;
- windowMenu = NSMenu;
- windowSeparator = NSMenuItem;
- };
- SUPERCLASS = NSObject;
- }
- );
- IBVersion = 1;
-} \ No newline at end of file
diff --git a/hw/darwin/bundle/French.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/French.lproj/MainMenu.nib/objects.nib
deleted file mode 100644
index 109d5cc6f..000000000
--- a/hw/darwin/bundle/French.lproj/MainMenu.nib/objects.nib
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp
deleted file mode 100644
index 2a14793db..000000000
--- a/hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp,v 1.2 2001/11/04 07:02:28 torrey Exp $ -->
-
-<html>
-<head><META HTTP-EQUIV="content-type" CONTENT="text/html; charset=iso-8859-1">
-<title>XDarwin Help</title>
-</head>
-<body>
-<center>
- <h1>XDarwin X Server pour Mac OS X</h1>
- X_VENDOR_NAME X_VERSION<br>
- Date : X_REL_DATE
-</center>
-<h2>Sommaire</h2>
-<ol>
- <li><A HREF="#notice">Avertissement</A></li>
- <li><A HREF="#usage">Utilisation</A></li>
- <li><A HREF="#path">Chemins d'accès</A></li>
- <li><A HREF="#prefs">Préférences</A></li>
- <li><A HREF="#license">Licence</A></li>
-</ol>
-<center>
- <h2><a NAME="notice">Avertissement</a></h2>
-</center>
-<blockquote>
-#if PRE_RELEASE
-Ceci est une pré-version de XDarwin et ne fait par conséquent l'objet d'aucun support client. Les bogues peuvent être signalés et des patches peuvent être soumis sur la
-<A HREF="http://sourceforge.net/projects/xonx/">page du projet XonX</A> chez SourceForge. Veuillez prendre connaissance de la dernière version sur <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> ou le X_VENDOR_LINK avant de signaler un bogue d'une pré-version.
-#else
-Si le serveur date de plus de 6-12 mois ou si votre matériel est plus récent que la date indiquée ci-dessus, veuillez vous procurer une version plus récente avant de signaler toute anomalie. Les bogues peuvent être signalés et des patches peuvent être soumis sur la <A HREF="http://sourceforge.net/projects/xonx/">page du projet XonX</A> chez SourceForge.
-#endif
-</blockquote>
-<blockquote>
-Ce logiciel est distribué sous la
-<A HREF="#license">Licence du Consortium X/X11 du MIT</A> et est fourni TEL QUEL, sans garanties. Veuillez prendre connaissance de la <A HREF="#license">Licence</A> avant toute utilisation.</blockquote>
-
-<h2><a NAME="usage">Utilisation</a></h2>
-<p>XDarwin est une X server libre et distribuable sans contrainte du <a HREF
-="http://www.x.org/">X Window System</a>. This version of XDarwin was produced by the X_VENDOR_LINK. XDarwin fonctionne sous Mac OS X en mode « rootless » ou plein écran.</p>
-<p>Lorsque le système X window est actif en mode plein écran, il prend en charge la totalité de l'écran. Il est possible de revenir sur le bureau de Mac OS X en appuyant sur Commande-Option-A. Cette combinaison de touches peut être modifiée dans les préférences. Pour revenir dans X window, cliquer sur l'icône de XDarwin dans le Dock de Mac OS X. (Un réglage des préférences permet d'effectuer cette opération en cliquant dans une fenêtre flottante au lieu de l'icône du Dock)</p>
-<p>En mode « rootless », X window system et Aqua utilisent le même affichage. La fenêtre-mère de l'affichage X11 est de la taille de l'écran et contient toutes les autre fenêtres. En mode « rootless » cette fenêtre-mère n'est pas affichée car Aqua gère le fond d'écran.</p>
-<h3>Émulation de souris à plusieurs boutons</h3>
-<p>Le fonctionnement de la plupart des applications X11 repose sur l'utilisation d'une souris à 3 boutons. Il est possible d'émuler une souris à 3 boutons avec un seul bouton en appuyant sur des touches de modification. Ceci est réglé dans la section "Émulation de souris à plusieurs boutons" de l'onglet "Général" des préférences. L'émulation est activée par défaut. Dans ce cas, cliquer en appuyant simultanément sur la touche "commande" simulera le bouton du milieu. Cliquer en appuyant simultanément sur la touche "option" simulera le bouton de droite. Les préférences permettent de régler n'importe quelle combinaison de touches de modification pour émuler les boutons du milieu et de droite. Notez que même si les touches de modifications sont mises en correspondance avec d'autres touches par xmodmap, ce sont les touches originelles spécifiées dans les préférences qui assureront l'émulation d'une souris à plusieurs boutons.
-
-<h2><a NAME="path">Réglage du chemin d'accès</a></h2>
-<p>Le chemin d'accès est une liste de répertoires utilisés pour la recherche d'exécutables. Les commandes X11 sont situées dans <code>/usr/X11R6/bin</code>, qui doit être ajouté à votre chemin d'accès. XDarwin fait cela par défaut, et peut également ajouter d'autres répertoires dans lesquels vous auriez installé d'autre commandes unix.</p>
-<p>Les utilisateurs plus expérimentés auront déjà réglé leur chemin d'accès correctement par le biais des fichiers d'initialisation de leur shell. Dans ce cas, il est possible de demander à XDarwin de ne pas modifier le chemin d'accès initial. XDarwin lance les premiers clients X11 dans le shell d'ouverture de session par défaut. (Un shell de remplacement peut être spécifié dans les préférences.) La façon de régler le chemin d'accès dépend du shell utilisé. Ceci est documenté dans les pages "man" du shell.</p>
-<p>De plus, il est possible d'ajouter les pages "man" de X11 à la liste des pages recherchées pour la documentation "man". Les pages "man" X11 se trouvent dans <code>/usr/X11R6/man</code> et la variable d'environnement <code>MANPATH</code> contient la liste des répertoires dans lesquels chercher.</p>
-
-
-<h2><a NAME="prefs">Préférences</a></h2>
-<p>Un certain nombre d'options peuvent être réglées dans les préférences. On accède aux préférences en choisissant "Préférences..." dans le menu "XDarwin". Les options décrites comme options de démarrage ne prendront pas effet avant le redémarrage de XDarwin. Les autres options prennent immédiatement effet. Les différentes options sont détaillées ci-après :</p>
-<h3>Général</h3>
-<ul>
- <li><b>Utiliser le bip d'alerte Système dans X11 :</b> Cocher cette option pour que le son d'alerte standard de Mac OS X soit utilisé à la place du son d'alerte de X11. L'option n'est pas cochée ar défaut. Dans ce cas, un simple signal sonore est utilisé.</li>
- <li><b>Autoriser X11 à changer la vitesse de la souris :</b> Dans une implémentation classique du sytème X window, le gestionnaire de fenêtres peut modifier la vitesse de la souris. Cela peut s'avérer déroutant puisque le réglage de la vitesse de la souris peut être différent dans les préférences de Mac OS X et dans le gestionnaire X window. Par défaut, X11 n'est pas autorisé à changer la vitesse de la souris.</li>
- <li><b>Émulation de souris à plusieurs boutons :</b> Ceci est décrit ci-dessus à la rubrique <a HREF="#usage">Usage</a>. Lorsque l'émulation est activée, il suffit d'appuyer simultanément sur les touches modificatrices sélectionnées et sur le bouton de la souris afin d'émuler les boutons du milieu et de droite.</li>
-</ul>
-<h3>Démarrage</h3>
-<ul>
- <li><b>Mode par défaut :</b> Le mode spécifié à cet endroit sera utilisé si l'utilisateur ne l'indique pas au démarrage.</li>
- <li><b>Choix du mode d'affichage au démarrage</b> Par défaut, une fenêtre de dialogue est affichée au démarrage de XDarwin pour permettre à l'utilisateur de choisir entre le mode plein écran et le mode « rootless ». Si cette option est désactivée, le mode par défaut sera automatiquement utilisé.</li>
- <li><b>Numéro d'affichage (Display)</b> X11 offre la possibilité de plusieurs serveurs X sur un ordinateur. L'utilisateur doit spécifier ici le numéro d'affichage utilisé par XDarwin dans le cas où plusieurs serveurs X seraient en service simultanément.</li>
- <li><b>Autoriser la prise en charge Xinerama de plusieurs moniteurs :</b> XDarwin peut être utilisé avec plusieurs moniteur avec Xinerama, qui considère les différents moniteurs comme des parties d'un écran rectugulaire plus grand. Cette option permet de désactiver Xinerama mais XDarwin ne prend alors pour l'instant pas correctement en charge l'affichage sur plusieurs écrans. Si il n'y a qu'un seul moniteur, Xinerama est automatiquement désactivé.</li>
- <li><b>Fichier clavier :</b> Un fichier de correspondance de clavier est lu au démarrage puis transformé en un fihcier de correspondance clavier pour X11. Les fichiers de correspondance clavier, disponibles pour de nombreuses langues, se trouvent dans <code>/System/Library/Keyboards</code>.</li>
- <li><b>Démarrage des premiers clients X11 :</b> Lorsque XDarwin est démarré à partir du Finder, il lance <code>xinit</code> qui lance à son tour le gestionnaire X window ainsi que d'autres clients X. (Voir "<code>man xinit</code>" pour plus d'informations.) Avant de lancer <code>xinit</code>, XDarwin ajoute les répertoires ainsi spécifiés au chemin d'accès de l'utilisateur. Par défaut, seul <code>/usr/X11R6/bin</code> est ajouté. Il est possible d'ajouter d'autres répertoires en les séparants à l'aide de deux points (<code>:</code>). Les clients X sont démarrés à partir du shell par défaut de l'utilisateur. Ainsi, le fichier d'initialisation de shell de l'utilisateur est lu. Un autre shell peut éventuellement être spécifié.</li>
-</ul>
-<h3>Plein écran</h3>
-<ul>
- <li><b>Combinaison de touches :</b> Appuyer sur ce bouton, puis appuyer sur une ou plusieurs touches modificatrices suivies d'une touche ordinaire. Cette combinaison de touche servira à commuter entre Aqua et X11.</li>
- <li><b>Basculer dans X11 en cliquant sur l'icône du Dock :</b> Cette option permet de passer dans X11 en cliquant dans l'icône de XDarwin dans le Dock. Sur certaines versions de Mac OS X, la commutation en utilisant le Dock peut faire disparaître le curseur lors du retour dans Aqua.</li>
- <li><b>Afficher l'aide du mode plein écran au démarrage :</b> Permet l'affichage d'une fenêtre d'introduction lorsque XDarwin est démarré en mode plein écran.</li>
- <li><b>Profondeur de couleur :</b> En mode plein écran, l'affichage X11 peut utiliser une autre profondeur de couleur que celle employée par Aqua. Si "Actuelle" est choisi, XDarwin utilisera la même profondeur de couleur qu'Aqua. Les autres choix sont 8 (256 couleurs), 15 (milliers de couleurs) et 24 bits (millions de couleurs). </li>
-</ul>
-
-<h2><a NAME="license">Licence</a></h2>
-The main license for XDarwin is one based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please refer to the source code.
-<H3><A NAME="3"></A>X Consortium License</H3>
-<p>Copyright (C) 1996 X Consortium</p>
-<p>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:</p>
-<p>The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.</p>
-<p>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 X CONSORTIUM 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.</p>
-<p>Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization from
-the X Consortium.</p>
-<p>X Window System is a trademark of X Consortium, Inc.</p>
-</body>
-</html>
-
diff --git a/hw/darwin/bundle/German.lproj/Credits.rtf b/hw/darwin/bundle/German.lproj/Credits.rtf
deleted file mode 100644
index 34408e78c..000000000
--- a/hw/darwin/bundle/German.lproj/Credits.rtf
+++ /dev/null
@@ -1,168 +0,0 @@
-{\rtf1\mac\ansicpg10000\cocoartf102
-{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fswiss\fcharset77 Helvetica-Oblique;
-}
-{\colortbl;\red255\green255\blue255;}
-\vieww5160\viewh6300\viewkind0
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
-
-\f0\fs24 \cf0 This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors. The following people contributed to Darwin/Mac OS X support.\
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f1\b \cf0 Contributors to Xorg Foundation Release:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Kaleb KEITHLEY\
-
-\f2\i Working left and right Ctrl, Alt (Option), Meta (Command) and Shift keys.
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\f1\b \cf0 Contributors to XFree86 4.4:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 John Harper\
-
-\f2\i Rootless acceleration and Apple-WM extension
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Additional XonX Contributors to XFree86 4.3:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Fabr\'92cio Luis de Castro\
-
-\f2\i Portuguese localization
-\f0\i0 \
-Michael Oland\
-
-\f2\i New XDarwin icon
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 XonX Contributors to XFree86 4.2:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Darwin x86 support
-\f0\i0 \
-Pablo Di Noto\
-
-\f2\i Spanish localization
-\f0\i0 \
-Paul Edens\
-
-\f2\i Dutch localization
-\f0\i0 \
-Kyunghwan Kim\
-
-\f2\i Korean localization
-\f0\i0 \
-Mario Klebsch\
-
-\f2\i Non-US keyboard support
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f0\i0 \
-Andreas Monitzer\
-
-\f2\i German localization
-\f0\i0 \
-Patrik Montgomery\
-
-\f2\i Swedish localization
-\f0\i0 \
-Greg Parker\
-
-\f2\i Rootless support
-\f0\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Japanese localization
-\f0\i0 \
-Olivier Verdier\
-
-\f2\i French localization
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Special Thanks:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Devin Poolman and Zero G Software, Inc.\
-
-\f2\i Installer
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 XonX Team Members\
-Contributing to XFree86 4.1:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Darwin x86 support
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f0\i0 \
-Andreas Monitzer\
-
-\f2\i Cocoa version of XDarwin front end
-\f0\i0 \
-Greg Parker\
-
-\f2\i Original Quartz implementation
-\f0\i0 \
-Christoph Pfisterer\
-
-\f2\i Dynamic shared libraries
-\f0\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Japanese localization
-\f0\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f1\b \cf0 Special Thanks:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Tiago Ribeiro\
-
-\f2\i XDarwin icon
-\f0\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f1\b \cf0 History:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 John Carmack\
-
-\f2\i Original XFree86 port to Mac OS X Server
-\f0\i0 \
-Dave Zarzycki\
-
-\f2\i XFree86 4.0 port to Darwin 1.0
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/German.lproj/Localizable.strings b/hw/darwin/bundle/German.lproj/Localizable.strings
deleted file mode 100644
index 5db6306ec..000000000
--- a/hw/darwin/bundle/German.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/German.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/German.lproj/MainMenu.nib/classes.nib
deleted file mode 100644
index 77f345a4e..000000000
--- a/hw/darwin/bundle/German.lproj/MainMenu.nib/classes.nib
+++ /dev/null
@@ -1,72 +0,0 @@
-{
- IBClasses = (
- {
- ACTIONS = {showHelp = id; };
- CLASS = FirstResponder;
- LANGUAGE = ObjC;
- SUPERCLASS = NSObject;
- },
- {
- ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
- CLASS = Preferences;
- LANGUAGE = ObjC;
- OUTLETS = {
- addToPathButton = id;
- addToPathField = id;
- button2ModifiersMatrix = id;
- button3ModifiersMatrix = id;
- depthButton = id;
- displayField = id;
- dockSwitchButton = id;
- fakeButton = id;
- keymapFileField = id;
- modeMatrix = id;
- modeWindowButton = id;
- mouseAccelChangeButton = id;
- startupHelpButton = id;
- switchKeyButton = id;
- systemBeepButton = id;
- useDefaultShellMatrix = id;
- useOtherShellField = id;
- useXineramaButton = id;
- window = id;
- };
- SUPERCLASS = NSObject;
- },
- {
- CLASS = XApplication;
- LANGUAGE = ObjC;
- OUTLETS = {preferences = id; xserver = id; };
- SUPERCLASS = NSApplication;
- },
- {
- ACTIONS = {
- bringAllToFront = id;
- closeHelpAndShow = id;
- itemSelected = id;
- nextWindow = id;
- previousWindow = id;
- showAction = id;
- showSwitchPanel = id;
- startFullScreen = id;
- startRootless = id;
- };
- CLASS = XServer;
- LANGUAGE = ObjC;
- OUTLETS = {
- dockMenu = NSMenu;
- helpWindow = NSWindow;
- modeWindow = NSWindow;
- startFullScreenButton = NSButton;
- startRootlessButton = NSButton;
- startupHelpButton = NSButton;
- startupModeButton = NSButton;
- switchWindow = NSPanel;
- windowMenu = NSMenu;
- windowSeparator = NSMenuItem;
- };
- SUPERCLASS = NSObject;
- }
- );
- IBVersion = 1;
-} \ No newline at end of file
diff --git a/hw/darwin/bundle/German.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/German.lproj/MainMenu.nib/objects.nib
deleted file mode 100644
index 28fff8920..000000000
--- a/hw/darwin/bundle/German.lproj/MainMenu.nib/objects.nib
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp
deleted file mode 100644
index 5996285ae..000000000
--- a/hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp,v 1.1 2001/05/21 01:42:17 torrey Exp $ -->
-
-<html>
-<head>
-<title>XDarwin Help</title>
-</head>
-<body>
-<center>
- <h1>XDarwin X Server for Mac OS X</h1>
- X_VENDOR_NAME X_VERSION<br>
- Release Date: X_REL_DATE
-</center>
-<h2>Contents</h2>
-<ol>
- <li><A HREF="#notice">Important Notice</A></li>
- <li><A HREF="#usage">Usage</A></li>
- <li><A HREF="#path">Setting Your Path</A></li>
- <li><A HREF="#prefs">User Preferences</A></li>
- <li><A HREF="#license">License</A></li>
-</ol>
-<center>
- <h2><a NAME="notice">Important Notice</a></h2>
-</center>
-<blockquote>
-#if X_PRE_RELEASE
-This is a pre-release version of XDarwin, and is not supported in any way. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge. Before reporting bugs in pre-release versions, please check the latest version from <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> or the X_VENDOR_LINK.
-#else
-If the server is older than 6-12 months, or if your hardware is newer than the above date, look for a newer version before reporting problems. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge.
-#endif
-</blockquote>
-<blockquote>
-This software is distributed under the terms of the <A HREF="#license">MIT X11 / X Consortium License</A> and is provided AS IS, with no warranty. Please read the <A HREF="#license">License</A> before using.</blockquote>
-
-<h2><a NAME="usage">Usage</a></h2>
-<p>XDarwin is a freely redistributable open-source X server for the <a HREF="http://www.x.org/">X Window System</a>. This version of XDarwin was produced by the X_VENDOR_LINK. XDarwin runs on Mac OS X in full screen or rootless modes.</p>
-<p>In full screen mode, when the X window system is active, it takes over the entire screen. You can switch back to the Mac OS X desktop by holding down Command-Option-A. This key combination can be changed in the user preferences. From the Mac OS X desktop, click on the XDarwin icon in the Dock to switch back to the X window system. (You can change this behavior in the user preferences so that you must click the XDarwin icon in the floating switch window instead.)</p>
-<p>In rootless mode, the X window system and Aqua 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 Aqua handles the desktop background.</p>
-<h3>Multi-Button Mouse Emulation</h3>
-<p>Many X11 applications rely on the use of a 3-button mouse. You can emulate a 3-button mouse with a single button by holding down various modifier keys while you click the mouse button. This is controlled by settings in the "Multi-Button Mouse Emulation" section of the "General" preferences. By default, emulation is on and holding down the command key and clicking the mouse button will simulate clicking the second mouse button. Holding down the option key and clicking will simulate the third button. You can change to any combination of modifiers to emulate buttons two and three in the preferences. Note, even if the modifiers keys are mapped to some other key with xmodmap, you still must use the actual keys specified in the preferences for multi-button mouse emulation.</p>
-
-<h2><a NAME="path">Setting Your Path</a></h2>
-<p>Your path is the list of directories to be searched for executable commands. The X11 commands are located in <code>/usr/X11R6/bin</code>, which needs to be added to your path. XDarwin does this for you by default and can also add additional directories where you have installed command line applications.</p>
-<p>More experienced users will have already set their path correctly using the initialization files for their shell. In this case, you can inform XDarwin not to modify your path in the preferences. XDarwin launches the initial X11 clients in the user's default login shell. (An alternate shell can also be specified in the preferences.) The way to set the path depends on the shell you are using. This is described in the man page documentation for the shell.</p>
-<p>In addition you may also want to add the X11 man pages to the list of pages to be searched when you are looking for documentation. The X11 man pages are located in <code>/usr/X11R6/man</code> and the <code>MANPATH</code> environment variable contains the list of directories to search.</p>
-
-<h2><a NAME="prefs">User Preferences</a></h2>
-<p>A number of options may be set from the user preferences, accessible from the "Preferences..." menu item in the "XDarwin" menu. The options listed as start up options will not take effect until you have restarted XDarwin. All other options take effect immediately. The various options are described below:</p>
-<h3>General</h3>
-<ul>
- <li><b>Use System beep for X11:</b> When enabled the standard Mac OS X alert sound is used as the X11 bell. When disabled (default) a simple tone is used.</li>
- <li><b>Allow X11 to change mouse acceleration:</b> In a standard X window system implementation, the window manager can change the mouse acceleration. This can lead to confusion as the mouse acceleration may be set to different values by the Mac OS X System Preferences and the X window manager. By default, X11 is not allowed to change the mouse acceleration to avoid this problem.</li>
- <li><b>Multi-Button Mouse Emulation:</b> This is described above under <a HREF="#usage">Usage</a>. When emulation is enabled the selected modifiers must be held down when the mouse button is pushed to emulate the second or third mouse buttons.</li>
-</ul>
-<h3>Start Up</h3>
-<ul>
- <li><b>Default Mode:</b> If the user does not indicate whether to run in full screen or rootless mode, the mode specified here will be used.</li>
- <li><b>Show mode pick panel on startup:</b> By default, a panel is displayed when XDarwin is started to allow the user to choose between full screen or rootless mode. If this option is turned off, the default mode will be started automatically.</li>
- <li><b>X11 Display number:</b> X11 allows there to be multiple displays managed by separate X servers on a single computer. The user may specify an integer display number for XDarwin to use if more than one X server is going to be run simultaneously.</li>
- <li><b>Allow Xinerama multiple monitor support:</b> XDarwin supports multiple monitors with Xinerama, which treats all monitors as being part of one large rectangular screen. You can disable Xinerama with this option, but currently XDarwin does not handle multiple monitors correctly without it. If you only have a single monitor, Xinerama is automatically disabled.</li>
- <li><b>Keymapping File:</b> A keymapping file is read at startup and translated to an X11 keymap. Keymapping files, available for a wide variety of languages, are found in <code>/System/Library/Keyboards</code>.</li>
- <li><b>Starting First X11 Clients:</b> When XDarwin is started from the Finder, it will run <code>xinit</code> to launch the X window manager and other X clients. (See "<code>man xinit</code>" for more information.) Before XDarwin runs <code>xinit</code> it will add the specified directories to the user's path. By default only <code>/usr/X11R6/bin</code> is added. Additional directories may added, separated by a colon. The X clients are started in the user's default login shell so that the user's shell initialization files are read. If desired, an alternate shell may be specified.</li>
-</ul>
-<h3>Full Screen</h3>
-<ul>
- <li><b>Key combination button:</b> Click this button and then press any number of modifiers followed by a standard key to change the key combination to switch between Aqua and X11.</li>
- <li><b>Click on icon in Dock switches to X11:</b> Enable this to activate switching to X11 by clicking on the XDarwin icon in the Dock. On some versions of Mac OS X, switching by clicking in the Dock can cause the cursor to disappear on returning to Aqua.</li>
- <li><b>Show help on startup:</b> This will show an introductory splash screen when XDarwin is started in full screen mode.</li>
- <li><b>Color bit depth:</b> In full screen mode, the X11 display can use a different color bit depth than is used by Aqua. If "Current" is specified, the depth used by Aqua when XDarwin starts will be used. Otherwise 8, 15, or 24 bits may be specified.</li>
-</ul>
-
-<h2><a NAME="license">License</a></h2>
-The main license for XDarwin is based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please refer to the source code.
-<H3><A NAME="3"></A>X Consortium License</H3>
-<p>Copyright (C) 1996 X Consortium</p>
-<p>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:</p>
-<p>The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.</p>
-<p>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 X CONSORTIUM 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.</p>
-<p>Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization from
-the X Consortium.</p>
-<p>X Window System is a trademark of X Consortium, Inc.</p>
-</body>
-</html>
diff --git a/hw/darwin/bundle/Japanese.lproj/Credits.rtf b/hw/darwin/bundle/Japanese.lproj/Credits.rtf
deleted file mode 100644
index cf9eae207..000000000
--- a/hw/darwin/bundle/Japanese.lproj/Credits.rtf
+++ /dev/null
@@ -1,193 +0,0 @@
-{\rtf1\mac\ansicpg10001\cocoartf102
-{\fonttbl\f0\fnil\fcharset78 HiraKakuPro-W3;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Bold;
-\f3\fswiss\fcharset77 Helvetica-Oblique;}
-{\colortbl;\red255\green255\blue255;}
-\vieww13980\viewh11160\viewkind0
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
-
-\f0\fs24 \cf0 \'82\'b1\'82\'cc\'90\'bb\'95\'69\'82\'cd
-\f1 XFree86
-\f0 \'83\'76\'83\'8d\'83\'57\'83\'46\'83\'4e\'83\'67
-\f1 (http://www.xfree86.org/)
-\f0 \'82\'a8\'82\'e6\'82\'d1\'82\'bb\'82\'cc\'8d\'76\'8c\'a3\'8e\'d2\'82\'c9\'82\'e6\'82\'c1\'82\'c4\'8a\'4a\'94\'ad\'82\'b3\'82\'ea\'82\'bd\'83\'5c\'83\'74\'83\'67\'83\'45\'83\'46\'83\'41\'82\'f0\'8a\'dc\'82\'f1\'82\'c5\'82\'a2\'82\'dc\'82\'b7\'81\'42\'8e\'9f\'82\'cc\'90\'6c\'81\'58\'82\'cd Darwin
-\f1 /Mac OS X
-\f0 \'82\'cc\'83\'54\'83\'7c\'81\'5b\'83\'67\'82\'c9\'8d\'76\'8c\'a3\'82\'b5\'82\'dc\'82\'b5\'82\'bd\'81\'42
-\f1 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f2\b \cf0 Contributors to Xorg Foundation Release:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Kaleb KEITHLEY\
-
-\f0 \'8d\'b6\'89\'45\'82\'cc Ctrl,Alt(Option),Meta(Command) \'82\'a8\'82\'e6\'82\'d1 Shift \'83\'4c\'81\'5b\'82\'cc\'93\'ae\'8d\'ec
-\f1 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f2\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Contributors to XFree86 4.4:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 John Harper
-\f3\i \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f0\i0 \cf0 \'83\'8b\'81\'5b\'83\'67\'83\'8c\'83\'58 \'83\'41\'83\'4e\'83\'5a\'83\'89\'83\'8c\'81\'5b\'83\'56\'83\'87\'83\'93 \'82\'a8\'82\'e6\'82\'d1 Apple-WM \'8a\'67\'92\'a3
-\f1 \
-Torrey T. Lyons\
-
-\f0 \'83\'76\'83\'8d\'83\'57\'83\'46\'83\'4e\'83\'67 \'83\'8a\'81\'5b\'83\'5f\'81\'5b\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f2\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Additional XonX Contributors to XFree86 4.3:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Fabr\'92cio Luis de Castro\
-
-\f0 \'83\'7c\'83\'8b\'83\'67\'83\'4b\'83\'8b\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
-\f1 \
-Michael Oland\
-
-\f0 \'90\'56\'82\'b5\'82\'a2
-\f1 XDarwin
-\f0 \'83\'41\'83\'43\'83\'52\'83\'93
-\f1 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f2\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 XonX Contributors to XFree86 4.2:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
- Darwin x86
-\f3\i
-\f0\i0 \'83\'54\'83\'7c\'81\'5b\'83\'67
-\f1 \
-Pablo Di Noto\
-
-\f3\i
-\f0\i0 \'83\'58\'83\'79\'83\'43\'83\'93\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
-\f1 \
-Paul Edens\
-
-\f3\i
-\f0\i0 \'83\'49\'83\'89\'83\'93\'83\'5f\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
-\f1 \
-Kyunghwan Kim\
-
-\f3\i
-\f0\i0 \'8a\'d8\'8d\'91\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
-\f1 \
-Mario Klebsch\
-
-\f0 \'94\'f1US\'83\'4c\'81\'5b\'83\'7b\'81\'5b\'83\'68 \'83\'54\'83\'7c\'81\'5b\'83\'67
-\f1 \
-Torrey T. Lyons\
-
-\f0 \'83\'76\'83\'8d\'83\'57\'83\'46\'83\'4e\'83\'67 \'83\'8a\'81\'5b\'83\'5f\'81\'5b
-\f1 \
-Andreas Monitzer\
-
-\f0 \'83\'68\'83\'43\'83\'63\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
-\f1 \
-Patrik Montgomery\
-
-\f3\i
-\f0\i0 \'83\'58\'83\'45\'83\'46\'81\'5b\'83\'66\'83\'93\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
-\f1 \
-Greg Parker\
-
-\f0 \'83\'8b\'81\'5b\'83\'67\'83\'8c\'83\'58 \'83\'54\'83\'7c\'81\'5b\'83\'67
-\f1 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f0 \cf0 \'93\'63\'92\'86 \'8f\'72\'8c\'f5
-\f1 \
-
-\f0 \'93\'fa\'96\'7b\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
-\f1 \
-Olivier Verdier\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f3\i \cf0
-\f0\i0 \'83\'74\'83\'89\'83\'93\'83\'58\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
-\f1 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f2\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Special Thanks:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Devin Poolman and Zero G Software, Inc.\
-
-\f3\i
-\f0\i0 \'83\'43\'83\'93\'83\'58\'83\'67\'81\'5b\'83\'89
-\f1 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f2\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 XonX Team Members\
-Contributing to XFree86 4.1:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
- Darwin x86
-\f0 \'83\'54\'83\'7c\'81\'5b\'83\'67
-\f1 \
-Torrey T. Lyons\
-
-\f0 \'83\'76\'83\'8d\'83\'57\'83\'46\'83\'4e\'83\'67 \'83\'8a\'81\'5b\'83\'5f\'81\'5b
-\f1 \
-Andreas Monitzer\
- Cocoa
-\f0 \'94\'c5 XDarwin \'83\'74\'83\'8d\'83\'93\'83\'67\'83\'47\'83\'93\'83\'68
-\f1 \
-Greg Parker\
-
-\f0 \'8d\'c5\'8f\'89\'82\'cc Quartz \'83\'43\'83\'93\'83\'76\'83\'8a\'83\'81\'83\'93\'83\'67
-\f1 \
-Christoph Pfisterer\
-
-\f0 \'8b\'a4\'97\'4c\'83\'89\'83\'43\'83\'75\'83\'89\'83\'8a
-\f1 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f0 \cf0 \'93\'63\'92\'86 \'8f\'72\'8c\'f5
-\f1 \
-
-\f0 \'93\'fa\'96\'7b\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
-\f1 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f2\b \cf0 Special Thanks:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Tiago Ribeiro\
- XDarwin
-\f0 \'83\'41\'83\'43\'83\'52\'83\'93
-\f1 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f2\b \cf0 History:
-\f1\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 John Carmack\
-
-\f0 XFree86 \'82\'cc Mac OS X Server \'82\'d6\'82\'cc\'8d\'c5\'8f\'89\'82\'cc\'88\'da\'90\'41
-\f1 \
-Dave Zarzycki\
- XFree86 4.0
-\f0 \'82\'f0 Darwin 1.0 \'82\'c9\'88\'da\'90\'41
-\f1 \
-Torrey T. Lyons\
- XFree86 4.0.2
-\f0 \'83\'76\'83\'8d\'83\'57\'83\'46\'83\'4e\'83\'67\'82\'d6\'82\'cc\'93\'9d\'8d\'87} \ No newline at end of file
diff --git a/hw/darwin/bundle/Japanese.lproj/Localizable.strings b/hw/darwin/bundle/Japanese.lproj/Localizable.strings
deleted file mode 100644
index c5c26d61a..000000000
--- a/hw/darwin/bundle/Japanese.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib
deleted file mode 100644
index 77f345a4e..000000000
--- a/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib
+++ /dev/null
@@ -1,72 +0,0 @@
-{
- IBClasses = (
- {
- ACTIONS = {showHelp = id; };
- CLASS = FirstResponder;
- LANGUAGE = ObjC;
- SUPERCLASS = NSObject;
- },
- {
- ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
- CLASS = Preferences;
- LANGUAGE = ObjC;
- OUTLETS = {
- addToPathButton = id;
- addToPathField = id;
- button2ModifiersMatrix = id;
- button3ModifiersMatrix = id;
- depthButton = id;
- displayField = id;
- dockSwitchButton = id;
- fakeButton = id;
- keymapFileField = id;
- modeMatrix = id;
- modeWindowButton = id;
- mouseAccelChangeButton = id;
- startupHelpButton = id;
- switchKeyButton = id;
- systemBeepButton = id;
- useDefaultShellMatrix = id;
- useOtherShellField = id;
- useXineramaButton = id;
- window = id;
- };
- SUPERCLASS = NSObject;
- },
- {
- CLASS = XApplication;
- LANGUAGE = ObjC;
- OUTLETS = {preferences = id; xserver = id; };
- SUPERCLASS = NSApplication;
- },
- {
- ACTIONS = {
- bringAllToFront = id;
- closeHelpAndShow = id;
- itemSelected = id;
- nextWindow = id;
- previousWindow = id;
- showAction = id;
- showSwitchPanel = id;
- startFullScreen = id;
- startRootless = id;
- };
- CLASS = XServer;
- LANGUAGE = ObjC;
- OUTLETS = {
- dockMenu = NSMenu;
- helpWindow = NSWindow;
- modeWindow = NSWindow;
- startFullScreenButton = NSButton;
- startRootlessButton = NSButton;
- startupHelpButton = NSButton;
- startupModeButton = NSButton;
- switchWindow = NSPanel;
- windowMenu = NSMenu;
- windowSeparator = NSMenuItem;
- };
- SUPERCLASS = NSObject;
- }
- );
- IBVersion = 1;
-} \ No newline at end of file
diff --git a/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nib
deleted file mode 100644
index 357002706..000000000
--- a/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nib
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp
deleted file mode 100644
index 6653f5bea..000000000
--- a/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp,v 1.4 2001/11/27 07:27:46 torrey Exp $ -->
-
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=EUC-JP">
-<title>
-XDarwin Help</title></head>
-<body>
-<center>
- <h1>XDarwin X Server for Mac OS X</h1>
- X_VENDOR_NAME X_VERSION<br>
- Release Date: X_REL_DATE
-</center>
-<h2>Ìܼ¡</h2>
-<ol>
- <li><A HREF="#notice">Ãí°Õ»ö¹à</A></li>
- <li><A HREF="#usage">»ÈÍÑË¡</A></li>
- <li><A HREF="#path">¥Ñ¥¹¤ÎÀßÄê</A></li>
- <li><A HREF="#prefs">´Ä¶­ÀßÄê</A></li>
- <li><A HREF="#license">¥é¥¤¥»¥ó¥¹</A></li>
-</ol>
-<center>
- <h2><a NAME="notice">Ãí°Õ»ö¹à</a></h2>
-</center>
-<blockquote>
-#if X_PRE_RELEASE
-¤³¤ì¤Ï¡¤XDarwin ¤Î¥×¥ì¥ê¥ê¡¼¥¹¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ê¡¤¤¤¤«¤Ê¤ë¾ì¹ç¤Ë¤ª¤¤¤Æ¤â¥µ¥Ý¡¼¥È¤µ¤ì¤Þ¤»¤ó¡£
-¥Ð¥°¤ÎÊó¹ð¤ä¥Ñ¥Ã¥Á¤¬ SourceForge ¤Î <A HREF="http://sourceforge.net/projects/xonx/">XonX ¥×¥í¥¸¥§¥¯¥È¥Ú¡¼¥¸</A>¤ËÄó½Ð¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-¥×¥ì¥ê¥ê¡¼¥¹¥Ð¡¼¥¸¥ç¥ó¤Î¥Ð¥°¤òÊó¹ð¤¹¤ëÁ°¤Ë¡¤<A HREF="http://sourceforge.net/projects/xonx/">XonX</A> ¥×¥í¥¸¥§¥¯¥È¥Ú¡¼¥¸¤Þ¤¿¤Ï X_VENDOR_LINK¤ÇºÇ¿·ÈǤΥÁ¥§¥Ã¥¯¤ò¤·¤Æ²¼¤µ¤¤¡£
-#else
-¤â¤·¡¤¥µ¡¼¥Ð¡¼¤¬ 6 -12 ¥ö·î°Ê¾åÁ°¤Î¤â¤Î¤«¡¤¤Þ¤¿¤Ï¤¢¤Ê¤¿¤Î¥Ï¡¼¥É¥¦¥§¥¢¤¬¾åµ­¤ÎÆüÉÕ¤è¤ê¤â¿·¤·¤¤¤â¤Î¤Ê¤é¤Ð¡¤ÌäÂê¤òÊó¹ð¤¹¤ëÁ°¤Ë¤è¤ê¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤òõ¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
-¥Ð¥°¤ÎÊó¹ð¤ä¥Ñ¥Ã¥Á¤¬ SourceForge ¤Î <A HREF="http://sourceforge.net/projects/xonx/">XonX ¥×¥í¥¸¥§¥¯¥È¥Ú¡¼¥¸</A>¤ËÄó½Ð¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-#endif
-</blockquote>
-<blockquote>
-ËÜ¥½¥Õ¥È¥¦¥§¥¢¤Ï¡¤<A HREF="#license">MIT X11/X Consortium License</A> ¤Î¾ò·ï¤Ë´ð¤Å¤­¡¤ÌµÊݾڤǡ¤¡Ö¤½¤Î¤Þ¤Þ¡×¤Î·Á¤Ç¶¡µë¤µ¤ì¤Þ¤¹¡£
-¤´»ÈÍѤˤʤëÁ°¤Ë¡¤<A HREF="#license">¥é¥¤¥»¥ó¥¹¾ò·ï</A>¤ò¤ªÆɤ߲¼¤µ¤¤¡£
-</blockquote>
-
-<h2><a NAME="usage">»ÈÍÑË¡</a></h2>
-<p>XDarwin ¤Ï¡¤ºÆÇÛÉÛ²Äǽ¤Ê¥ª¡¼¥×¥ó¥½¡¼¥¹¤Î <a HREF="http://www.x.org/">X Window System</a> ¤Î¤¿¤á¤Î X ¥µ¡¼¥Ð¡¼¤Î¼ÂÁõ¤Ç¤¹¡£¤³¤Î¥Ð¡¼¥¸¥ç¥ó¤Î XDarwin ¤Ï X_VENDOR_LINK ¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤Þ¤·¤¿¡£XDarwin ¤Ï¡¤Mac OS X ¾å¤Ç¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Þ¤¿¤Ï¥ë¡¼¥È¥ì¥¹¥â¡¼¥É¤ÇÆ°ºî¤·¤Þ¤¹¡£</p>
-
-<p>¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Ç¤Ï¡¤X Window System ¤¬¥¢¥¯¥Æ¥£¥Ö¤Ê»þ¡¤¤½¤ì¤ÏÁ´²èÌ̤òÀêÍ­¤·¤Þ¤¹¡£
-¤¢¤Ê¤¿¤Ï¡¤Command-Option-A ¥­¡¼¤ò²¡¤¹¤³¤È¤Ë¤è¤Ã¤Æ Mac OS X ¥Ç¥¹¥¯¥È¥Ã¥×¤ØÀÚ¤êÂؤ¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤³¤Î¥­¡¼¤ÎÁȤ߹ç¤ï¤»¤Ï¡¤´Ä¶­ÀßÄê¤ÇÊѹ¹²Äǽ¤Ç¤¹¡£
-Mac OS X ¥Ç¥¹¥¯¥È¥Ã¥×¤«¤é X Window System ¤ØÀÚ¤êÂؤ¨¤ë¾ì¹ç¤Ï¡¤¥É¥Ã¥¯¤Ëɽ¼¨¤µ¤ì¤¿ XDarwin ¥¢¥¤¥³¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ²¼¤µ¤¤¡£
-¡Ê´Ä¶­ÀßÄê¤Ç¡¤¥Õ¥í¡¼¥Æ¥£¥ó¥°¡¦¥¦¥£¥ó¥É¥¦¤Ëɽ¼¨¤µ¤ì¤¿ XDarwin ¥¢¥¤¥³¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤è¤¦¤ËÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¡Ë</p>
-
-<p>¥ë¡¼¥È¥ì¥¹¥â¡¼¥É¤Ç¤Ï¡¤X Window System ¤È Aqua ¤Ï²èÌ̤ò¶¦Í­¤·¤Þ¤¹¡£
-X11 ¤¬É½¼¨¤¹¤ë¥ë¡¼¥È¥¦¥£¥ó¥É¥¦¤Ï²èÌ̤Υµ¥¤¥º¤Ç¤¢¤ê¡¤Â¾¤ÎÁ´¤Æ¤Î¥¦¥£¥ó¥É¥¦¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£
-Aqua ¤¬¥Ç¥¹¥¯¥È¥Ã¥×¤ÎÇطʤòÀ©¸æ¤¹¤ë¤Î¤Ç¡¤X11 ¤Î¥ë¡¼¥È¥¦¥£¥ó¥É¥¦¤Ï¥ë¡¼¥È¥ì¥¹¥â¡¼¥É¤Ç¤Ïɽ¼¨¤µ¤ì¤Þ¤»¤ó¡£</p>
-
-<h3>Ê£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó</h3>
-<p>¿¤¯¤Î X11 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¤3 ¥Ü¥¿¥ó¥Þ¥¦¥¹¤òɬÍפȤ·¤Þ¤¹¡£
-¤¢¤Ê¤¿¤Ï¥Þ¥¦¥¹¥Ü¥¿¥ó¤Î¥¯¥ê¥Ã¥¯¤ÈƱ»þ¤Ë¤¤¤¯¤Ä¤«¤Î½¤¾þ¥­¡¼¤ò²¡¤¹¤³¤È¤Ë¤è¤Ã¤Æ¡¤°ì¤Ä¤Î¥Ü¥¿¥ó¤Ç 3 ¥Ü¥¿¥ó¥Þ¥¦¥¹¤ò¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¤³¤ì¤Ï¡¤´Ä¶­ÀßÄê¤Î¡Ö°ìÈÌÀßÄê¡×¤Î¡ÖÊ£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¡×¥»¥¯¥·¥ç¥ó¤ÇÀßÄꤷ¤Þ¤¹¡£
-¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¤¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤ÏÍ­¸ú¤Ç¡¤¥³¥Þ¥ó¥É¥­¡¼¤ò²¡¤·¤Ê¤¬¤é¥Þ¥¦¥¹¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤³¤È¤ÏÂè 2 ¥Þ¥¦¥¹¥Ü¥¿¥ó¤Î¥¯¥ê¥Ã¥¯¤ËÁêÅö¤·¤Þ¤¹¡£
-¥ª¥×¥·¥ç¥ó¥­¡¼¤ò²¡¤·¤Ê¤¬¤é¥¯¥ê¥Ã¥¯¤¹¤ë¤³¤È¤ÏÂè 3 ¥Þ¥¦¥¹¥Ü¥¿¥ó¤Î¥¯¥ê¥Ã¥¯¤ËÁêÅö¤·¤Þ¤¹¡£
-¤¢¤Ê¤¿¤Ï¡¤´Ä¶­ÀßÄê¤Ç¥Ü¥¿¥ó 2 ¤È 3 ¤ò¥¨¥ß¥å¥ì¡¼¥È¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë½¤¾þ¥­¡¼¤ÎÁȹ礻¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-Ãí¡§½¤¾þ¥­¡¼¤ò xmodmap ¤Ç¾¤Î¥­¡¼¤Ë³ä¤êÅö¤Æ¤Æ¤¤¤ë¾ì¹ç¤Ç¤â¡¤Ê£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤Ç¤ÏËÜÍè¤Î¥³¥Þ¥ó¥É¥­¡¼¤ä¥ª¥×¥·¥ç¥ó¥­¡¼¤ò»È¤ï¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£</p>
-
-<h2><a NAME="path">¥Ñ¥¹¤ÎÀßÄê</a></h2>
-<p>¥Ñ¥¹¤Ï¡¤ ¼Â¹Ô²Äǽ¤Ê¥³¥Þ¥ó¥É¤ò¸¡º÷¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¥ê¥¹¥È¤Ç¤¹¡£
-X11 ¥Ð¥¤¥Ê¥ê¤Ï¡¤<code>/usr/X11R6/bin</code> ¤ËÃÖ¤«¤ì¤Þ¤¹¡£¤¢¤Ê¤¿¤Ï¤½¤ì¤ò¥Ñ¥¹¤Ë²Ã¤¨¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-XDarwin ¤Ï¡¤¤³¤ì¤ò¥Ç¥Õ¥©¥ë¥È¤Ç¹Ô¤¤¤Þ¤¹¡£¤Þ¤¿¡¤¤¢¤Ê¤¿¤¬¥³¥Þ¥ó¥É¥é¥¤¥ó¡¦¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿ÄɲäΥǥ£¥ì¥¯¥È¥ê¤ò²Ã¤¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£</p>
-
-<p>·Ð¸³Ë­¤«¤Ê¥æ¡¼¥¶¡¼¤Ï¡¤¤¹¤Ç¤Ë¼«¤é¤Î¥·¥§¥ë¤Î¤¿¤á¤Ë½é´ü²½¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ·¤Æ¥Ñ¥¹¤òÀßÄꤷ¤Æ¤¤¤ë¤Ç¤·¤ç¤¦¡£
-¤³¤Î¾ì¹ç¡¤¤¢¤Ê¤¿¤Ï´Ä¶­ÀßÄê¤Ç XDarwin ¤¬¤¢¤Ê¤¿¤Î¥Ñ¥¹¤òÊѹ¹¤·¤Ê¤¤¤è¤¦¤ËÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-XDarwin ¤Ï¡¤¥æ¡¼¥¶¡¼¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥í¥°¥¤¥ó¥·¥§¥ë¤ÇºÇ½é¤Î X11 ¥¯¥é¥¤¥¢¥ó¥È¤ò³«»Ï¤·¤Þ¤¹¡£
-¡Ê´Ä¶­ÀßÄê¤ÇÂå¤ï¤ê¤Î¥·¥§¥ë¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¡Ë
-¥Ñ¥¹¤òÀßÄꤹ¤ëÊýË¡¤Ï¡¤¤¢¤Ê¤¿¤¬»ÈÍѤ·¤Æ¤¤¤ë¥·¥§¥ë¤Ë°Í¸¤·¤Þ¤¹¡£
-¤³¤ì¤Ï¡¤¥·¥§¥ë¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¥É¥­¥å¥á¥ó¥È¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-
-<p>¤Þ¤¿¡¤¤¢¤Ê¤¿¤Ï¥É¥­¥å¥á¥ó¥È¤òõ¤·¤Æ¤¤¤ë»þ¡¤X11 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò¸¡º÷¤µ¤ì¤ë¥Ú¡¼¥¸¤Î¥ê¥¹¥È¤ËÄɲä·¤¿¤¤¤È»×¤¦¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-X11 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ï <code>/usr/X11R6/man</code> ¤ËÃÖ¤«¤ì¤Þ¤¹¡£¤½¤·¤Æ <code>MANPATH</code> ´Ä¶­ÊÑ¿ô¤Ï¸¡º÷¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¥ê¥¹¥È¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£</p>
-
-<h2><a NAME="prefs">´Ä¶­ÀßÄê</a></h2>
-<p>¡ÖXDarwin¡×¥á¥Ë¥å¡¼¤Î¡Ö´Ä¶­ÀßÄê...¡×¥á¥Ë¥å¡¼¹àÌܤ«¤é¥¢¥¯¥»¥¹¤Ç¤­¤ë´Ä¶­ÀßÄê¥Ñ¥Í¥ë¤Ç¡¤¤¤¤¯¤Ä¤«¤Î¥ª¥×¥·¥ç¥ó¤òÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¡Öµ¯Æ°¥ª¥×¥·¥ç¥ó¡×¤ÎÆâÍƤϡ¤XDarwin ¤òºÆµ¯Æ°¤¹¤ë¤Þ¤ÇÍ­¸ú¤È¤Ê¤ê¤Þ¤»¤ó¡£
-¾¤ÎÁ´¤Æ¤Î¥ª¥×¥·¥ç¥ó¤ÎÆâÍƤϡ¤Ä¾¤Á¤ËÍ­¸ú¤È¤Ê¤ê¤Þ¤¹¡£
-°Ê²¼¡¤¤½¤ì¤¾¤ì¤Î¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Þ¤¹:</p>
-
-<h3>°ìÈÌÀßÄê</h3>
-<ul>
- <li><b>X11 ¤Ç¥·¥¹¥Æ¥à¤Î¥Ó¡¼¥×²»¤ò»ÈÍѤ¹¤ë:</b> ¥ª¥ó¤Î¾ì¹ç¡¤Mac OS X ¤Î¥Ó¡¼¥×²»¤¬ X11 ¤Î¥Ù¥ë¤È¤·¤Æ»ÈÍѤµ¤ì¤Þ¤¹¡£¥ª¥Õ¤Î¾ì¹ç¡Ê¥Ç¥Õ¥©¥ë¥È¡Ë¡¤¥·¥ó¥×¥ë ¥È¡¼¥ó¤¬»È¤ï¤ì¤Þ¤¹¡£</li>
- <li><b>X11 ¤Î¥Þ¥¦¥¹¥¢¥¯¥»¥é¥ì¡¼¥·¥ç¥ó¤òÍ­¸ú¤Ë¤¹¤ë:</b> ɸ½àŪ¤Ê X Window System ¤Î¼ÂÁõ¤Ç¤Ï¡¤¥¦¥£¥ó¥É¥¦¥Þ¥Í¡¼¥¸¥ã¡¼¤Ï¥Þ¥¦¥¹¤Î²Ã®ÅÙ¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
- ¥Þ¥¦¥¹¤Î²Ã®ÅÙ¤Ë Mac OS X ¤Î¥·¥¹¥Æ¥à´Ä¶­ÀßÄê¤È X ¥¦¥£¥ó¥É¥¦¥Þ¥Í¡¼¥¸¥ã¡¼¤¬°Û¤Ê¤ëÃͤòÀßÄꤷ¤¿¾ì¹ç¡¤¤³¤ì¤Ïº®Íð¤ò¾·¤­¤Þ¤¹¡£
- ¤³¤ÎÌäÂê¤òÈò¤±¤ë¤¿¤á¡¤¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï X11 ¤Î¥Þ¥¦¥¹¥¢¥¯¥»¥é¥ì¡¼¥·¥ç¥ó¤òÍ­¸ú¤È¤·¤Þ¤»¤ó¡£</li>
- <li><b>Ê£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó:</b> <a HREF="#usage">»ÈÍÑË¡</a>¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£¥ª¥ó¤Î¾ì¹ç¡¤¥Þ¥¦¥¹¥Ü¥¿¥ó¤¬Âè 2 ¤Þ¤¿¤ÏÂè 3 ¤Î¥Þ¥¦¥¹¥Ü¥¿¥ó¤ò¥¨¥ß¥å¥ì¡¼¥È¤¹¤ë»þ¤Ë¡¤ÁªÂò¤·¤¿½¤¾þ¥­¡¼¤òƱ»þ¤Ë²¡¤·¤Þ¤¹¡£</li>
-</ul>
-
-<h3>µ¯Æ°¥ª¥×¥·¥ç¥ó</h3>
-<ul>
- <li><b>²èÌ̥⡼¥É:</b> ¥æ¡¼¥¶¡¼¤¬¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Þ¤¿¤Ï¥ë¡¼¥È¥ì¥¹¥â¡¼¥É¤Î¤É¤Á¤é¤ò»ÈÍѤ¹¤ë¤«¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¡¤¤³¤³¤Ç»ØÄꤵ¤ì¤¿¥â¡¼¥É¤¬»È¤ï¤ì¤Þ¤¹¡£</li>
- <li><b>µ¯Æ°»þ¤Ë¥â¡¼¥ÉÁªÂò¥Ñ¥Í¥ë¤òɽ¼¨¤¹¤ë:</b> ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¤XDarwin ¤Îµ¯Æ°»þ¤Ë¥æ¡¼¥¶¡¼¤¬¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Þ¤¿¤Ï¥ë¡¼¥È¥ì¥¹¥â¡¼¥É¤Î¤É¤Á¤é¤ò»ÈÍѤ¹¤ë¤«¤òÁªÂò¤¹¤ë¥Ñ¥Í¥ë¤òɽ¼¨¤·¤Þ¤¹¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤¬¥ª¥Õ¤Î¾ì¹ç¡¤²èÌ̥⡼¥É¤Ç»ØÄꤷ¤¿¥â¡¼¥É¤Çµ¯Æ°¤·¤Þ¤¹¡£</li>
- <li><b>X11 ¥Ç¥£¥¹¥×¥ì¥¤ÈÖ¹æ:</b> X11¤Ï¡¤°ì¤Ä¤Î¥³¥ó¥Ô¥å¡¼¥¿¾å¤ÇÊÌ¡¹¤Î X ¥µ¡¼¥Ð¡¼¤¬´ÉÍý¤¹¤ëÊ£¿ô¤Î¥Ç¥£¥¹¥×¥ì¥¤¤¬Â¸ºß¤¹¤ë¤³¤È¤òµö¤·¤Þ¤¹¡£Ê£¿ô¤Î X ¥µ¡¼¥Ð¡¼¤¬Æ±»þ¤Ë¼Â¹Ô¤·¤Æ¤¤¤ë»þ¡¤XDarwin ¤¬»ÈÍѤ¹¤ë¥Ç¥£¥¹¥×¥ì¥¤¤ÎÈÖ¹æ¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£</li>
- <li><b>Xinerama ¥Þ¥ë¥Á¥â¥Ë¥¿¥µ¥Ý¡¼¥È¤òÍ­¸ú¤Ë¤¹¤ë:</b> XDarwin ¤Ï¡¤Xinerama ¥Þ¥ë¥Á¥â¥Ë¥¿¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡£¤½¤ì¤ÏÁ´¤Æ¤Î¥â¥Ë¥¿¤ò°ì¤Ä¤ÎÂ礭¤Ê²èÌ̤ΰìÉô¤È¤ß¤Ê¤·¤Þ¤¹¡£¤¢¤Ê¤¿¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç Xinerama ¤ò̵¸ú¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤¿¤À¤·¡¤¸½ºß XDarwin ¤Ï¤½¤ì̵¤·¤ÇÀµ¤·¤¯Ê£¿ô¤Î¥â¥Ë¥¿¤ò°·¤¦¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£¤â¤·¡¤¤¢¤Ê¤¿¤¬°ì¤Ä¤Î¥â¥Ë¥¿¤ò»È¤¦¤À¤±¤Ê¤é¤Ð¡¤Xinerama ¤Ï¼«Æ°Åª¤Ë̵¸ú¤È¤Ê¤ê¤Þ¤¹¡£</li>
- <li><b>¥­¡¼¥Þ¥Ã¥Ô¥ó¥°¥Õ¥¡¥¤¥ë:</b> ¥­¡¼¥Þ¥Ã¥Ô¥ó¥°¥Õ¥¡¥¤¥ë¤Ïµ¯Æ°»þ¤ËÆɤ߹þ¤Þ¤ì¡¤X11 ¥­¡¼¥Þ¥Ã¥×¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¡£Â¾¸À¸ì¤ËÂбþ¤·¤¿¥­¡¼¥Þ¥Ã¥Ô¥ó¥°¥Õ¥¡¥¤¥ë¤Ï <code>/System/Library/Keyboards</code> ¤Ë¤¢¤ê¤Þ¤¹¡£¡ÊÌõÃí¡§¥­¡¼¥Þ¥Ã¥Ô¥ó¥°¤Ç Japanese ¤òÁªÂò¤¹¤ë¤È¡¤°ìÉô¤Î¥­¡¼¤¬¸ú¤«¤Ê¤¤Åù¤ÎÉÔ¶ñ¹ç¤¬È¯À¸¤¹¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£¤³¤Î¾ì¹ç¤Ï USA ¤òÁªÂò¤·¤¿¾å¤Ç ~/.Xmodmap ¤òŬÍѤ·¤Æ²¼¤µ¤¤¡£¡Ë</li>
- <li><b>ºÇ½é¤Î X11 ¥¯¥é¥¤¥¢¥ó¥È¤Îµ¯Æ°:</b> XDarwin ¤¬ Finder¤«¤éµ¯Æ°¤¹¤ë»þ¡¤X ¥¦¥£¥ó¥É¥¦¥Þ¥Í¡¼¥¸¥ã¡¼¤È X ¥¯¥é¥¤¥¢¥ó¥È¤Îµ¯Æ°¤Ï <code>xinit</code> ¤ò¼Â¹Ô¤·¤Þ¤¹¡£¡Ê¾ÜºÙ¤Ï "<code>man xinit</code>" ¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£¡ËXDarwin ¤Ï <code>xinit</code> ¤ò¼Â¹Ô¤¹¤ëÁ°¤Ë¡¤»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ò¥æ¡¼¥¶¡¼¤Î¥Ñ¥¹¤ËÄɲä·¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï <code>/usr/X11R6/bin</code> ¤À¤±¤òÄɲä·¤Þ¤¹¡£Â¾¤Î¥Ç¥£¥ì¥¯¥È¥ê¤òÄɲä·¤¿¤¤¾ì¹ç¤Ï¡¤¥³¥í¥ó¤Ç¶èÀڤäƻØÄꤷ¤Þ¤¹¡£¥æ¡¼¥¶¡¼¤Î¥·¥§¥ë½é´ü²½¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤à¤¿¤á¤Ë¡¤X ¥¯¥é¥¤¥¢¥ó¥È¤Ï¥æ¡¼¥¶¡¼¤Î¥Ç¥Õ¥©¥ë¥È¥í¥°¥¤¥ó¥·¥§¥ë¤Çµ¯Æ°¤µ¤ì¤Þ¤¹¡£É¬ÍפǤ¢¤ì¤Ð¡¤Âå¤ï¤ê¤Î¥·¥§¥ë¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£</li>
-</ul>
-
-<h3>¥Õ¥ë¥¹¥¯¥ê¡¼¥ó</h3>
-<ul>
- <li><b>¥­¡¼ÀßÄê¥Ü¥¿¥ó:</b> X11 ¤È Aqua ¤òÀÚ¤êÂؤ¨¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¥Ü¥¿¥ó¤ÎÁȤ߹ç¤ï¤»¤ò»ØÄꤷ¤Þ¤¹¡£
- ¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¡¤Ç¤°Õ¤Î¿ô¤Î½¤¾þ¥­¡¼¤Ë³¤¤¤ÆÄ̾ï¤Î¥­¡¼¤ò²¡¤·¤Þ¤¹¡£</li>
- <li><b>¥É¥Ã¥¯¤Î¥¢¥¤¥³¥ó¤Î¥¯¥ê¥Ã¥¯¤Ç X11 ¤ËÌá¤ë:</b> ¥ª¥ó¤Î¾ì¹ç¡¤¥É¥Ã¥¯¤Ëɽ¼¨¤µ¤ì¤¿ XDarwin ¥¢¥¤¥³¥ó¤Î¥¯¥ê¥Ã¥¯¤Ç X11 ¤Ø¤ÎÀڤ괹¤¨¤¬²Äǽ¤È¤Ê¤ê¤Þ¤¹¡£Mac OS X ¤Î¤¤¤¯¤Ä¤«¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¤¥É¥Ã¥¯¤Î¥¢¥¤¥³¥ó¤Î¥¯¥ê¥Ã¥¯¤Ç Aqua ¤ËÌá¤Ã¤¿»þ¡¤¥«¡¼¥½¥ë¤¬¾Ã¼º¤¹¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£</li>
- <li><b>µ¯Æ°»þ¤Ë¥Ø¥ë¥×¤òɽ¼¨¤¹¤ë:</b> XDarwin ¤¬¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Çµ¯Æ°¤¹¤ë»þ¡¤¥¹¥×¥é¥Ã¥·¥å¥¹¥¯¥ê¡¼¥ó¤òɽ¼¨¤·¤Þ¤¹¡£</li>
- <li><b>¿§¿¼ÅÙ:</b> ¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Ç¤Ï¡¤X11 ¥Ç¥£¥¹¥×¥ì¥¤¤¬ Aqua ¤È°Û¤Ê¤ë¿§¿¼ÅÙ¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¡ÖÊѹ¹¤Ê¤·¡×¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¤XDarwin ¤Ï Aqua ¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤ë¿§¿¼ÅÙ¤ò»È¤¤¤Þ¤¹¡£¤³¤ì°Ê³°¤Ë 8¡¤15 ¤Þ¤¿¤Ï24 ¥Ó¥Ã¥È¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£</li>
-</ul>
-
-<h2>
-<a NAME="license">¥é¥¤¥»¥ó¥¹</a>
-</h2>
-XDarwin ¤Î¼çÍפʥ饤¥»¥ó¥¹¤ÏÅÁÅýŪ¤Ê MIT X11/X Consortium License ¤Ë´ð¤Å¤­¤Þ¤¹¡£
-¤½¤ì¤Ï½¤Àµ¤Þ¤¿¤ÏºÆÇÛÉÛ¤µ¤ì¤ë¥½¡¼¥¹¥³¡¼¥É¤Þ¤¿¤Ï¥Ð¥¤¥Ê¥ê¤Ë¡¤¤½¤ÎÃøºî¸¢/¥é¥¤¥»¥ó¥¹É½¼¨¤¬¤½¤Î¤Þ¤Þ»Ä¤µ¤ì¤ë¤³¤È¤òÍ׵᤹¤ë°Ê³°¤Î¾ò·ï¤ò¶¯À©¤·¤Þ¤»¤ó¡£
-¤è¤ê¿¤¯¤Î¾ðÊó¤È¡¤¥³¡¼¥É¤Î°ìÉô¤ò¥«¥Ð¡¼¤¹¤ëÄɲäÎÃøºî¸¢/¥é¥¤¥»¥ó¥¹É½¼¨¤Î¤¿¤á¤Ë¡¤¥½¡¼¥¹¥³¡¼¥É¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£
-<H3>
-<A NAME="3"></A>
-X Consortium License</H3>
-<p>Copyright (C) 1996 X Consortium</p>
-<p>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:</p>
-<p>The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.</p>
-<p>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 X CONSORTIUM 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.</p>
-<p>Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization from
-the X Consortium.</p>
-<p>X Window System is a trademark of X Consortium, Inc.</p>
-</body>
-</html>
diff --git a/hw/darwin/bundle/Portuguese.lproj/Credits.rtf b/hw/darwin/bundle/Portuguese.lproj/Credits.rtf
deleted file mode 100644
index 8dcddc2f7..000000000
--- a/hw/darwin/bundle/Portuguese.lproj/Credits.rtf
+++ /dev/null
@@ -1,171 +0,0 @@
-{\rtf1\mac\ansicpg10000\cocoartf102
-{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fswiss\fcharset77 Helvetica-Oblique;
-}
-{\colortbl;\red255\green255\blue255;}
-\vieww5140\viewh4980\viewkind0
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
-
-\f0\fs24 \cf0 This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors. The following people contributed to Darwin/Mac OS X support.\
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f1\b \cf0 Contributors to Xorg Foundation Release:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Kaleb KEITHLEY\
-
-\f2\i Working left and right Ctrl, Alt (Option), Meta (Command) and Shift keys.
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\f1\b \cf0 Contributors to XFree86 4.4:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 John Harper\
-
-\f2\i Rootless acceleration and Apple-WM extension
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Contribuidores do XonX ao XFree86 4.3:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Fabr\'92cio Luis de Castro
-\f1\b \
-
-\f2\i\b0 Localiza\'8d\'8bo para o Portugu\'90s\
-
-\f0\i0 Michael Oland\
-
-\f2\i New XDarwin icon
-\f1\i0\b \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Contribuidores do XonX ao XFree86 4.2:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Suporte para o Darwin x86\
-
-\f0\i0 Pablo Di Noto\
-
-\f2\i Localiza\'8d\'8bo para o Espanhol
-\f0\i0 \
-Paul Edens\
-
-\f2\i Localiza\'8d\'8bo para o Holand\'90s
-\f0\i0 \
-Kyunghwan Kim\
-
-\f2\i Localiza\'8d\'8bo para o Coreano
-\f0\i0 \
-Mario Klebsch\
-
-\f2\i Suporte para teclados Non-US
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i L\'92der de Projeto
-\f0\i0 \
-Andreas Monitzer\
-
-\f2\i Localiza\'8d\'8bo para o Alem\'8bo
-\f0\i0 \
-Patrik Montgomery\
-
-\f2\i Localiza\'8d\'8bo para o Sueco
-\f0\i0 \
-Greg Parker\
-
-\f2\i Suporte ao modo Compartilhado (Rootless)
-\f0\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Localiza\'8d\'8bo para o Japon\'90s
-\f0\i0 \
-Olivier Verdier\
-
-\f2\i Localiza\'8d\'8bo para o Fran\'8d\'90s
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Agradecimentos Especiais:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Devin Poolman and Zero G Software, Inc.\
-
-\f2\i Instalador
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Membros do Time XonX\
-Contribuindo com o XFree86 4.1:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Suporte ao Darwin x86\
-
-\f0\i0 Torrey T. Lyons\
-
-\f2\i L\'92der de Projeto
-\f0\i0 \
-Andreas Monitzer\
-
-\f2\i Vers\'8bo Cocoa da interface XDarwin
-\f0\i0 \
-Greg Parker\
-
-\f2\i Implementa\'8d\'8bo Original
-\f0\i0
-\f2\i ao Quartz \
-
-\f0\i0 Christoph Pfisterer\
-
-\f2\i Bibliotecas Din\'89micas Compartilhadas
-\f0\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Localiza\'8d\'8bo para o Japon\'90s
-\f0\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f1\b \cf0 Agradecimento Especial:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Tiago Ribeiro\
-
-\f2\i \'eacone do XDarwin
-\f0\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f1\b \cf0 Hist\'97rico:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 John Carmack\
-
-\f2\i Suporte Original do XFree86 no Mac OS X Server
-\f0\i0 \
-Dave Zarzycki\
-
-\f2\i Suporte ao
-\f0\i0
-\f2\i XFree86 4.0 no Darwin 1.0
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Integra\'8d\'8bo dentro do Projeto XFree86 na vers\'8bo 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/Portuguese.lproj/Localizable.strings b/hw/darwin/bundle/Portuguese.lproj/Localizable.strings
deleted file mode 100644
index c79b282f6..000000000
--- a/hw/darwin/bundle/Portuguese.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/classes.nib
deleted file mode 100644
index 77f345a4e..000000000
--- a/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/classes.nib
+++ /dev/null
@@ -1,72 +0,0 @@
-{
- IBClasses = (
- {
- ACTIONS = {showHelp = id; };
- CLASS = FirstResponder;
- LANGUAGE = ObjC;
- SUPERCLASS = NSObject;
- },
- {
- ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
- CLASS = Preferences;
- LANGUAGE = ObjC;
- OUTLETS = {
- addToPathButton = id;
- addToPathField = id;
- button2ModifiersMatrix = id;
- button3ModifiersMatrix = id;
- depthButton = id;
- displayField = id;
- dockSwitchButton = id;
- fakeButton = id;
- keymapFileField = id;
- modeMatrix = id;
- modeWindowButton = id;
- mouseAccelChangeButton = id;
- startupHelpButton = id;
- switchKeyButton = id;
- systemBeepButton = id;
- useDefaultShellMatrix = id;
- useOtherShellField = id;
- useXineramaButton = id;
- window = id;
- };
- SUPERCLASS = NSObject;
- },
- {
- CLASS = XApplication;
- LANGUAGE = ObjC;
- OUTLETS = {preferences = id; xserver = id; };
- SUPERCLASS = NSApplication;
- },
- {
- ACTIONS = {
- bringAllToFront = id;
- closeHelpAndShow = id;
- itemSelected = id;
- nextWindow = id;
- previousWindow = id;
- showAction = id;
- showSwitchPanel = id;
- startFullScreen = id;
- startRootless = id;
- };
- CLASS = XServer;
- LANGUAGE = ObjC;
- OUTLETS = {
- dockMenu = NSMenu;
- helpWindow = NSWindow;
- modeWindow = NSWindow;
- startFullScreenButton = NSButton;
- startRootlessButton = NSButton;
- startupHelpButton = NSButton;
- startupModeButton = NSButton;
- switchWindow = NSPanel;
- windowMenu = NSMenu;
- windowSeparator = NSMenuItem;
- };
- SUPERCLASS = NSObject;
- }
- );
- IBVersion = 1;
-} \ No newline at end of file
diff --git a/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/objects.nib
deleted file mode 100644
index 9cb67cf89..000000000
--- a/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/objects.nib
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp
deleted file mode 100644
index 7ef1ba5d8..000000000
--- a/hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp
+++ /dev/null
@@ -1,211 +0,0 @@
-<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp,v 1.2 2001/11/04 07:02:28 torrey Exp $ --><html><body>
-
-<head>
-<title>XDarwin Help</title>
-</head>
-
-<center>
-
- <h1>XDarwin X Server para Mac OS X</h1>
- X_VENDOR_NAME X_VERSION<br>
- Release Date: X_REL_DATE
-</center>
-<h2>&Iacute;ndice</h2>
-<ol>
- <li><A HREF="#notice">Notas importantes</A></li>
- <li><A HREF="#usage">Uso</A></li>
- <li><A HREF="#path">Ajustando seu Path</A></li>
-
- <li><A HREF="#prefs">Prefer&ecirc;ncias do usu&aacute;rio</A></li>
- <li><A HREF="#license">Licen&ccedil;a</A></li>
-</ol>
-<center>
- <h2><a NAME="notice">Notas importantes</a></h2>
-</center>
-<blockquote>
-#if PRE_RELEASE
- Essa &eacute; uma vers&atilde;o pr&eacute;-lancamento
- do XDarwin, e ela n&atilde;o &eacute; suportada de nenhuma forma. Bugs podem
- ser reportados e corre&ccedil;&otilde;es podem ser enviadas para <A HREF="http://sourceforge.net/projects/xonx/">P&aacute;gina
- do projeto XonX</A> no SourceForge. Antes de informar bugs em vers&otilde;es
- pr&eacute;-lancamento, por favor verifique a þltima vers&atilde;o em <A HREF="http://sourceforge.net/projects/xonx/">XonX</A>
- or X_VENDOR_LINK.
-#else
-Se o servidor &eacute; mais velho que 6-12 semanas, ou seu hardware &eacute;
- mais novo que a data acima, procure por uma nova vers&atilde;o antes de informar
- problemas. Bugs podem ser reportados e corre&ccedil;&otilde;es podem ser enviadas
- para a <A HREF="http://sourceforge.net/projects/xonx/">P&aacute;gina do projeto
- XonX</A> na SourceForge.
-#endif
-</blockquote>
-<blockquote> Este software &eacute; distribu&iacute;do sob os termos da <a href="#license">licen&ccedil;a
- MIT X11 / X Consortium</a> e &eacute; provido, sem nenhuma garantia. Por favor
- leia a <a href="#license">Licen&ccedil;a</a> antes de come&ccedil;ar a usar
- o programa.</blockquote>
-
-<h2><a NAME="usage">Uso</a></h2>
-<p>O XDarwin &eacute; uma X server &quot;open-source&quot; livremente
- redistribu&iacute;da do <a HREF
-="http://www.x.org/">Sistema X Window</a>. This version of XDarwin was produced by the X_VENDOR_LINK.
- XDarwin roda sobre Mac OS X no modo Tela Cheia ou no modo Compartilhado.</p>
-<p>No modo Tela Cheia, quando o sistema X window est&aacute; ativo, ele ocupa
- a tela toda. Voc&ecirc; pode voltar ao desktop do Mac OS X clicando Command-Option-A.
- Essa combina&ccedil;&atilde;o de teclas pode ser mudada nas prefer&ecirc;ncias.
- Pelo desktop Mac OS X, clique no &iacute;cone XDarwin no Dock para voltar ao
- sistema X window. (Voc&ecirc; pode mudar esse comportamento nas prefer&ecirc;ncias
- da&iacute; voc&ecirc; dever&aacute; clicar no &iacute;cone XDarwin na janela
- flutuante que aparecer&aacute;.)</p>
-<p>No modo Compartilhado, o sistema X window e Aqua dividem a mesma tela. A janela
- raiz da tela X11 est&aacute; do tamanho da tela (monitor) e cont&eacute;m todas
- as outras janelas. A janela raiz do X11 no modo compartilhado n&atilde;o &eacute;
- mostrada pois o Aqua controla o fundo de tela.</p>
-<h3>Emula&ccedil;&atilde;o de Mouse Multi-Bot&otilde;es</h3>
-<p>Muitas aplica&ccedil;&otilde;es X11 insistem em usar um mouse de 3 bot&otilde;es.
- Voc&ecirc; pode emular um mouse de 3 bot&otilde;es com um simples bot&atilde;o,
- mantendo pressionando teclas modificadoras enquanto voc&ecirc; clica no bot&atilde;o
- do mouse. Isto &eacute; controlado pela configura&ccedil;&atilde;o da &quot;Emula&ccedil;&atilde;o
- de Mouse Multi-Bot&otilde;es&quot; da prefer&ecirc;ncia &quot;Geral&quot;. Por
- padr&atilde;o, a emula&ccedil;&atilde;o est&aacute; habilitada e mantendo pressionada
- a tecla Command e clicando no bot&atilde;o do mouse ele simular&aacute; o clique
- no segundo bot&atilde;o do mouse. Mantendo pressionada a tecla Option e clicando
- no bot&atilde;o do mouse ele simular&aacute; o terceiro bot&atilde;o. Voc&ecirc;
- pode mudar a combina&ccedil;&atilde;o de teclas modificadoras para emular os
- bot&otilde;es dois e tr&ecirc;s nas prefer&ecirc;ncias. Nota, se a tecla modificadora
- foi mapeada para alguma outra tecla no xmodmap, voc&ecirc; ainda ter&aacute;
- que usar a tecla atual especificada nas prefer&ecirc;ncias para a emula&ccedil;&atilde;o
- do mouse multi-bot&otilde;es.</p>
-<h2><a NAME="path">Ajustando seu Path</a></h2>
-<p>Seu path &eacute; a lista de diret&oacute;rios a serem procurados por arquivos
- execut&aacute;veis. O comando X11 est&aacute; localizado em <code>/usr/X11R6/bin</code>,
- que precisa ser adicionado ao seu path. XDarwin faz isso para voc&ecirc; por
- padr&atilde;o e pode-se tamb&eacute;m adicionar diret&oacute;rios onde voc&ecirc;
- instalou aplica&ccedil;&otilde;es de linha de comando.</p>
-<p>Usu&aacute;rios experientes j&aacute; ter&atilde;o configurado corretamente
- seu path usando arquivos de inicializa&ccedil;&atilde;o de seu shell. Neste
- caso, voc&ecirc; pode informar o XDarwin para n&atilde;o modificar seu path
- nas prefer&ecirc;ncias. O XDarwin inicia o cliente inicial X11 no shell padr&atilde;o
- do usu&aacute;rio corrente. (Um shell alternativo pode ser tamb&eacute;m expecificado
- nas prefer&ecirc;ncias.) O modo para ajustar o path depende do shell que voc&ecirc;
- est&aacute; usando. Isto &eacute; descrito na man page do seu shell.</p>
-<p>Voc&ecirc; pode tamb&eacute;m querer adicionar as man pages do X11 para
- a lista de p&aacute;ginas a serem procuradas quando voc&ecirc; est&aacute; procurando
- por documenta&ccedil;&atilde;o. As man pages do X11 est&atilde;o localizadas
- em <code>/usr/X11R6/man</code> e a vari&aacute;vel de ambiente <code>MANPATH</code>
- cont&eacute;m a lista de diret&oacute;rios a buscar.</p>
-<h2><a NAME="prefs">Prefer&ecirc;ncias do Usu&aacute;rio</a></h2>
-<p>V&aacute;rias op&ccedil;&otilde;es podem ser ajustadas nas prefer&ecirc;ncias
- do usu&aacute;rio, acess&iacute;vel pelo item &quot;Prefer&ecirc;ncias...&quot;
- no menu &quot;XDarwin&quot;. As op&ccedil;&otilde;es listadas como op&ccedil;&otilde;es
- de inicializa&ccedil;&atilde;o, n&atilde;o ter&atilde;o efeito at&eacute; voc&ecirc;
- reiniciar o XDarwin. Todas as outras op&ccedil;&otilde;es ter&atilde;o efeito
- imediatamente. V&aacute;rias das op&ccedil;&otilde;es est&atilde;o descritas
- abaixo:</p>
-<h3>Geral</h3>
-<ul>
- <li><b>Usar o Beep do Sistema para o X11: </b>Quando habilitado som de alerta
- padr&atilde;o do Mac OS X ser&aacute; usado como alerta no X11. Quando desabilitado
- (padr&atilde;o) um tom simples ser&aacute; usado.</li>
- <li><b>Permitir o X11 mudar a acelera&ccedil;&atilde;o do mouse: </b>Por implementa&ccedil;&atilde;o
- padr&atilde;o no sistema X window, o gerenciador de janelas pode mudar a acelera&ccedil;&atilde;o
- do mouse. Isso pode gerar uma confus&atilde;o pois a acelera&ccedil;&atilde;o
- do mouse pode ser ajustada diferentemente nas prefer&ecirc;ncias do Mac OS
- X e nas prefer&ecirc;ncias do X window. Por padr&atilde;o, o X11 n&atilde;o
- est&aacute; habilitado a mudar a acelera&ccedil;&atilde;o do mouse para evitar
- este problema.</li>
- <li><b>Emula&ccedil;&atilde;o de Mouse de Multi-Bot&otilde;es: </b>Esta op&ccedil;&atilde;o
- est&aacute; escrita acima em <a href="#usage">Uso</a>. Quando a emula&ccedil;&atilde;o
- est&aacute; habilitada as teclas modificadoras selecionadas tem que estar
- pressionadas quando o bot&atilde;o do mouse for pressionado, para emular o
- segundo e terceiro bot&otilde;es.</li>
-</ul>
-<h3>Inicial</h3>
-<ul>
- <li><b>Modo Padr&atilde;o: </b>Se o usu&aacute;rio n&atilde;o indicar qual modo
- de exibi&ccedil;&atilde;o quer usar (Tela Cheia ou Compartilhado) o modo especificado
- aqui ser&aacute; usado .</li>
- <li><b>Mostrar o painel de escolha na inicializa&ccedil;&atilde;o: </b> Por
- padr&atilde;o, uma painel &eacute; mostrado quando o XDarwin &eacute;
- iniciado para permitir que o usu&aacute;rio escolha ente o modo tela cheia
- ou modo compartilhado. Se esta op&ccedil;&atilde;o estiver desligada, o modo
- padr&atilde;o ser&aacute; inicializado automaticamente.</li>
- <li><b>N&uacute;mero do Monitor X11: </b>O X11 permite ser administrado em multiplos
- monitores por servidores X separados num mesmo computador. O usu&aacute;rio
- pode indicar o n&uacute;mero do monitor para o XDarwin usar se mais de um
- servidor X se estiver rodando simultaneamente.</li>
- <li><b>Habilitar suporte a m&uacute;ltiplos monitores pelo Xinerama: </b>o XDarwin
- suporta m&uacute;ltiplos monitores com o Xinerama, que trata todos os monitores
- como parte de uma grande e retangular tela. Voc&ecirc; pode desabilitar o
- Xinerama com est&aacute; op&ccedil;&atilde;o, mas normalmente o XDarwin n&atilde;o
- controla m&uacute;ltiplos monitores corretamente sem est&aacute; op&ccedil;&atilde;o.
- Se voc&ecirc; s&oacute; tiver um monotor, Xinerama &eacute; automaticamente
- desabilitado. </li>
- <li><b>Arquivo de Mapa de Teclado: </b> O mapa de teclado &eacute; lido na inicializa&ccedil;&atilde;o
- e traduzido para um mapa de teclado X11. Arquivos de mapa de teclado, est&atilde;o
- dispon&iacute;veis numa grande variedade de l&iacute;nguas e s&atilde;o encontradas
- em <code>/System/Library/Keyboards</code>.</li>
- <li><b>Iniciando Clientes X11 primeiro: </b>Quando o XDrawin &eacute; inicializado
- pelo Finder, ele ir&aacute; rodar o <code>xinit</code> para abrir o controlador
- X window e outros clientes X. (Veja o manual "<code>man xinit</code>" para
- mais informa&ccedil;&otilde;es.) Antes do XDarwin rodar o <code>xinit</code>
- ele ir&aacute; adicionar espec&iacute;ficos diret&oacute;rios a seu path.
- Por padr&atilde;o somente o <code>/usr/X11R6/bin</code> &eacute; adicionado.
- separado por um ponto-e-v&iacute;rgula. Os clientes X s&atilde;o inicializados
- no shell padr&atilde;o do usu&aacute;rio e os arquivos de inicializa&ccedil;&atilde;o
- do shell ser&atilde;o lidos. Se desejado, um shell alternativo pode ser especificado.</li>
-</ul>
-<h3>Tela Cheia</h3>
-<ul>
- <li><b>Bot&atilde;o de Combina&ccedil;&atilde;o de Teclas: </b> Clique no bot&atilde;o
- e pressione qualquer quantidade de teclas modificadoras seguidas por uma tecla
- padr&atilde;o para modificar a combina&ccedil;&atilde;o quando se quer mudar
- entre o Aqua e X11.</li>
- <li><b>Clique no &Iacute;cone no Dock para mudar para o X11: </b>Habilitando
- esta op&ccedil;&atilde;o voc&ecirc; ir&aacute; ativar a mudan&ccedil;a para
- o X11 clicando no &iacute;cone do XDarwin no Dock. Em algumas vers&otilde;es
- do Mac OS X, mudando pelo clique no Dock pode causar o desaparecimento do
- cursor quando retornar ao Aqua.</li>
- <li><b>Mostrar a Ajuda na inicializa&ccedil;&atilde;o: </b>Isto ir&aacute; mostrar
- uma tela introdut&oacute;ria quando o XDarwin for inicializado no modo Tela
- Cheia. </li>
- <li><b>Profundidade de Cores em bits: </b> No modo Tela Cheia, a tela do X11
- pode usar uma profundiadde de cor diferente da usada no Aqua. Se a op&ccedil;&atilde;o
- &quot;Atual&quot; est&aacute; especificada, a profundidade usada pelo Aqua
- quando o XDarwin iniciar ser&aacute; a mesma. Al&eacute;m das op&ccedil;&otilde;es
- 8, 15 ou 24 bits que podem ser especificadas.</li>
-</ul>
-
-<h2><a NAME="license">Licen&ccedil;a</a></h2>
-<p>A licen&ccedil;a
- principal n&oacute;s por XDarwin baseada na licen&ccedil;a tradicional MIT X11
- / X Consortium, que n&atilde;o imp&otilde;e nenhuma condi&ccedil;&atilde;o sobre
- modifica&ccedil;&otilde;es ou redistribui&ccedil;&atilde;o do c&oacute;digo-fonte
- ou dos bin&aacute;rios desde que o copyright/licen&ccedil;a sejam mantidos intactos.
- Para mais informa&ccedil;&otilde;es e not&iacute;cias adicionais de copyright/licensing
- em algumas se&ccedil;&atilde;o do c&oacute;digo, por favor refer to the source code.</p>
-<H3><A NAME="3"></A>Licen&ccedil;a do X Consortium</H3>
-<p>Copyright (C) 1996 X Consortium</p>
-<p>Permiss&otilde;es s&atilde;o em virtude garantidas, livre de mudan&ccedil;as,
- para qualquer pessoa que possua uma c&oacute;pia deste software e aos arquivos
- de documenta&ccedil;&atilde;o associada (o &quot;Software&quot;), para lidar
- com o software sem restri&ccedil;&otilde;es, incluindo limita&ccedil;&otilde;es
- dos direitos de uso, c&oacute;pia, modifica&ccedil;&atilde;o, inclus&atilde;o,
- publica&ccedil;&atilde;o, distribui&ccedil;&atilde;o, sub licen&ccedil;a, e/ou
- venda de c&oacute;pias deste Software, e permitir pessoas to whom o Software
- &eacute; fornecido para ser desta forma, verifique as seguintes condi&ccedil;&otilde;es:</p>
-<p>O nota de copyright abaixo e a permiss&atilde;o dever&atilde;o ser inclu&iacute;das
- em todas as c&oacute;pias ou substanciais por&ccedil;&otilde;es do Software.</p>
-<p>O SOFTWARE 'E PROVIDO &quot;COMO TAL&quot;, SEM GARANTIAS DE NENHUM TIPO, EXPLICITA
- OU IMPLICITA, INCLUINDO MAS N&Atilde;O LIMITADO NOS AVISOS DE COM&Eacute;RCIO,
- TAMANHO OU PARA PROPOSTAS PARTICULARES E N&Atilde;O INFRA&Ccedil;&Atilde;O.
- EM NENHUM ACONTECIMENTO O X CONSORTIUM SER&Aacute; RESPONSAV&Eacute;L POR NENHUMA
- RECLAMA&Ccedil;&Atilde;O, DANOS OU OUTRAS RESPONSABILIDADES, SE NUMA A&Ccedil;&Atilde;O
- DE CONTRATO, OU OUTRA COISA, SURGINDO DE, FORA DE OU EM CONEX&Atilde;O COM O
- SOFTWARE OU O USO OU OUTRO MODO DE LIDAR COM O SOFTWARE.</p>
-<p>Exceto o contido nesta nota, o nome do X Consortium n&atilde;o pode ser usado
- em propagandas ou outra forma de promo&ccedil;&atilde;o de vendas, uso ou outro
- modo de lidar com este Software sem ter recebido uma autoriza&ccedil;&atilde;o
- escrita pelo X Consortium.</p>
-<p>O Sistema X Window &eacute; marca registrada do X Consortium, Inc.</p>
-</body>
-</html>
-
diff --git a/hw/darwin/bundle/Spanish.lproj/Credits.rtf b/hw/darwin/bundle/Spanish.lproj/Credits.rtf
deleted file mode 100644
index 34408e78c..000000000
--- a/hw/darwin/bundle/Spanish.lproj/Credits.rtf
+++ /dev/null
@@ -1,168 +0,0 @@
-{\rtf1\mac\ansicpg10000\cocoartf102
-{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fswiss\fcharset77 Helvetica-Oblique;
-}
-{\colortbl;\red255\green255\blue255;}
-\vieww5160\viewh6300\viewkind0
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
-
-\f0\fs24 \cf0 This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors. The following people contributed to Darwin/Mac OS X support.\
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f1\b \cf0 Contributors to Xorg Foundation Release:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Kaleb KEITHLEY\
-
-\f2\i Working left and right Ctrl, Alt (Option), Meta (Command) and Shift keys.
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\f1\b \cf0 Contributors to XFree86 4.4:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 John Harper\
-
-\f2\i Rootless acceleration and Apple-WM extension
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Additional XonX Contributors to XFree86 4.3:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Fabr\'92cio Luis de Castro\
-
-\f2\i Portuguese localization
-\f0\i0 \
-Michael Oland\
-
-\f2\i New XDarwin icon
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 XonX Contributors to XFree86 4.2:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Darwin x86 support
-\f0\i0 \
-Pablo Di Noto\
-
-\f2\i Spanish localization
-\f0\i0 \
-Paul Edens\
-
-\f2\i Dutch localization
-\f0\i0 \
-Kyunghwan Kim\
-
-\f2\i Korean localization
-\f0\i0 \
-Mario Klebsch\
-
-\f2\i Non-US keyboard support
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f0\i0 \
-Andreas Monitzer\
-
-\f2\i German localization
-\f0\i0 \
-Patrik Montgomery\
-
-\f2\i Swedish localization
-\f0\i0 \
-Greg Parker\
-
-\f2\i Rootless support
-\f0\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Japanese localization
-\f0\i0 \
-Olivier Verdier\
-
-\f2\i French localization
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Special Thanks:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Devin Poolman and Zero G Software, Inc.\
-
-\f2\i Installer
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 XonX Team Members\
-Contributing to XFree86 4.1:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Darwin x86 support
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f0\i0 \
-Andreas Monitzer\
-
-\f2\i Cocoa version of XDarwin front end
-\f0\i0 \
-Greg Parker\
-
-\f2\i Original Quartz implementation
-\f0\i0 \
-Christoph Pfisterer\
-
-\f2\i Dynamic shared libraries
-\f0\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Japanese localization
-\f0\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f1\b \cf0 Special Thanks:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Tiago Ribeiro\
-
-\f2\i XDarwin icon
-\f0\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f1\b \cf0 History:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 John Carmack\
-
-\f2\i Original XFree86 port to Mac OS X Server
-\f0\i0 \
-Dave Zarzycki\
-
-\f2\i XFree86 4.0 port to Darwin 1.0
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/Spanish.lproj/Localizable.strings b/hw/darwin/bundle/Spanish.lproj/Localizable.strings
deleted file mode 100644
index 5bf813f1f..000000000
--- a/hw/darwin/bundle/Spanish.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/classes.nib
deleted file mode 100644
index 77f345a4e..000000000
--- a/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/classes.nib
+++ /dev/null
@@ -1,72 +0,0 @@
-{
- IBClasses = (
- {
- ACTIONS = {showHelp = id; };
- CLASS = FirstResponder;
- LANGUAGE = ObjC;
- SUPERCLASS = NSObject;
- },
- {
- ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
- CLASS = Preferences;
- LANGUAGE = ObjC;
- OUTLETS = {
- addToPathButton = id;
- addToPathField = id;
- button2ModifiersMatrix = id;
- button3ModifiersMatrix = id;
- depthButton = id;
- displayField = id;
- dockSwitchButton = id;
- fakeButton = id;
- keymapFileField = id;
- modeMatrix = id;
- modeWindowButton = id;
- mouseAccelChangeButton = id;
- startupHelpButton = id;
- switchKeyButton = id;
- systemBeepButton = id;
- useDefaultShellMatrix = id;
- useOtherShellField = id;
- useXineramaButton = id;
- window = id;
- };
- SUPERCLASS = NSObject;
- },
- {
- CLASS = XApplication;
- LANGUAGE = ObjC;
- OUTLETS = {preferences = id; xserver = id; };
- SUPERCLASS = NSApplication;
- },
- {
- ACTIONS = {
- bringAllToFront = id;
- closeHelpAndShow = id;
- itemSelected = id;
- nextWindow = id;
- previousWindow = id;
- showAction = id;
- showSwitchPanel = id;
- startFullScreen = id;
- startRootless = id;
- };
- CLASS = XServer;
- LANGUAGE = ObjC;
- OUTLETS = {
- dockMenu = NSMenu;
- helpWindow = NSWindow;
- modeWindow = NSWindow;
- startFullScreenButton = NSButton;
- startRootlessButton = NSButton;
- startupHelpButton = NSButton;
- startupModeButton = NSButton;
- switchWindow = NSPanel;
- windowMenu = NSMenu;
- windowSeparator = NSMenuItem;
- };
- SUPERCLASS = NSObject;
- }
- );
- IBVersion = 1;
-} \ No newline at end of file
diff --git a/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/objects.nib
deleted file mode 100644
index 2df75ee0c..000000000
--- a/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/objects.nib
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp
deleted file mode 100644
index 5cd27862d..000000000
--- a/hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp,v 1.2 2001/11/04 07:02:28 torrey Exp $ -->
-
-<html>
-<head>
-<title>XDarwin Ayuda</title>
-</head>
-<body>
-<center>
- <h1>XDarwin X Server for Mac OS X</h1>
- X_VENDOR_NAME X_VERSION<br>
- Fecha de release: X_REL_DATE
-</center>
-<h2>Contenido</h2>
-<ol>
- <li><A HREF="#notice">Aviso Importante</A></li>
- <li><A HREF="#usage">Modo de uso</A></li>
- <li><A HREF="#path">Configurando su Path</A></li>
- <li><A HREF="#prefs">Preferencias del Usuario</A></li>
- <li><A HREF="#license">Licencia</A></li>
-</ol>
-<center>
- <h2><a NAME="notice">Aviso Importante</a></h2>
-</center>
-<blockquote>
-#if PRE_RELEASE
-Esta es una versi&oacuten pre-release de XDarwin, y no tiene ning&uacuten soporte. Patches y reportes de error pueden ser enviados a la <A HREF="http://sourceforge.net/projects/xonx/">p&aacutegina del proyecto XonX</A> en SourceForge. Antes de reportar errores en versiones pre-release, por favor verifique la ultima versi&oacuten en <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> o bien el X_VENDOR_LINK.
-#else
-Si el server el m&aacutes antiguo que 6 a 12 meses, o si su hardware es posterior a la fecha indicada m&aacutes arriba, por favor verifique la &uacuteltima versi&oacuten antes de reportar problemas. Patches y reportes de error pueden ser enviados a la <A HREF="http://sourceforge.net/projects/xonx/">p&aacutegina del proyecto XonX</A> en SourceForge.
-#endif
-</blockquote>
-<blockquote>
-Este software es distribuido bajo los t&eacuterminos de la <A HREF="#license">Licencia MIT X11 / X Consortium</A> y es provisto sin garant&iacutea alguna y en el estado en que se encuentra. Por favor lea la <A HREF="#license">Licencia</A> antes de utilizarlo.</blockquote>
-
-<h2><a NAME="usage">Modo de uso</a></h2>
-<p>XDarwin es una X server open-source de distribuci&oacuten libre del <a HREF
-="http://www.x.org/">X Window System</a>. This version of XDarwin was produced by the X_VENDOR_LINK. XDarwin funciona en Mac OS X en modo pantalla completa o en modo rootless (integrado al escritorio).</p>
-<p>En modo pantalla completa, el X window system toma control total de la pantalla mientras esta activo. Presionando Command-Option-A puede regresar al Escritorio de Mac OS X. Esta combinaci&oacuten de teclas puede cambiarse en las Preferencias de Usuario. Desde el Escritorio de Mac OS X, haga click en &iacutecono de XDarwin en el Dock para volver al X window system. (Puede cambiar esta comportamiento en las Preferencias de Usuario y configurar que XDarwin vuelva al X window system haciendo click en la ventana flotante con el logo X.)</p>
-<p>En modo rootless, el X window system comparte la pantalla con Aqua. La ventana root de X11 es del tama&ntildeo de la pantalla y contiene a todas las dem&aacutes ventanas. La ventana root de X11 no se muestra en este modo, ya que Aqua maneja el fondo de pantalla.</p>
-<h3>Emulaci&oacuten de mouse multi-bot&oacuten</h3>
-<p>Muchas aplicaciones X11 requieren del uso de un mouse de 3 botones. Es posible emular un mouse de 3 botones con un mouse de solo un bot&oacuten presionando teclas modificadoras mientras hace click. Esto es controlado en de la seccion "Emulaci&oacuten mouse" dentro de la secci&oacuten "General" de las Preferencias del Usuario. Por defecto, la emulaci&oacuten est&aacute activa y utiliza la tecla Command para simular el 2do bot&oacuten y la tecla Option para simlar el 3er bot&oacuten. La conbinaci&oacuten para simular el 2do y 3er bot&oacuten pueden ser modificada por cualquier combinaci&oacuten de teclas modificadoras dentro de las Preferencias del Usuario. Tenga en cuenta que aunque las teclas modificadoras hayan sido mapeadas a otras teclas con xmodmap, las teclas configuradas en las Preferencias del Usuario seguir&aacuten siendo las utilizadas por la emulaci&oacuten de mouse multi-bot&oacuten.</p>
-
-<h2><a NAME="path">Configurando su Path</a></h2>
-<p>El path es la lista de directorios donde se buscar&aacuten los comandos ejecutables. Los comandos de X11 se encuentran en <code>/usr/X11R6/bin</code>, y &eacuteste necesita estar dentro de su path. XDarwin hace &eacutesto autom&aacuteticamente por defecto, y puede adem&aacutes agregar directorios adicionales donde tenga otros comandos de l&iacutenea.</p>
-<p>Usuarios experimentados pueden tener su path correctamente configurado mediante los archivos de inicio de su interprete de comandos. En este caso, puede informarle a XDarwin en las Preferencias de Usuario para que no modifique su path. XDarwin arrancar&aacute los clientes X11 iniciales usando el int&eacuterprete de comandos del usuario, seg&uacuten su configuraci&oacuten de login. Un int&eacuterprete de comandos alternativo puede ser especificado en las Preferencias del Usuario. La manera de configurar el path de su int&eacuterprete de comandos depende de cual est&aacute usando, y es generalmente descripta en las p&aacuteginas man del mismo.</p>
-<p>Adem&aacutes, Ud. puede agregar las p&aacuteginas man de X11 a la lista de p&aacuteginas que son consultadas. Estas est&aacuten ubicadas en <code>/usr/X11R6/man</code> y <code>MANPATH</code> es la variable de entorno que contiene los directorios que son consultados.</p>
-
-<h2><a NAME="prefs">Preferencias del Usuario</a></h2>
-<p>Ciertas opciones pueden definirse dentro de "Preferencias...", en el men&uacute de XDarwin. Las opciones dentro de de "Inicio" no surtir&aacuten efecto hasta que la aplicaci&oacuten se reinicie. Las restantes opciones surten efecto inmediatamente. Las diferentes opciones se describen a continuaci&oacuten:</p>
-<h3>General</h3>
-<ul>
- <li><b>Usar beep del sistema en X11:</b> Cuando esta opci&oacuten est&aacute activa, el sonido de alerta est&aacutendar de Mac OS X se usar&aacute como alerta de X11. Cuando est&aacute desactivada, un simple tono es utilizado (esta es la opci&oacuten por defecto).</li>
- <li><b>Permitir que X11 cambie la aceleraci&oacuten del mouse:</b> En una implementaci&oacuten est&aacutendard de X11, el window manager puede cambiar la aceleraci&oacuten del mouse. Esto puede llevar a una gran confusi&oacuten si la aceleraci&oacuten es diferente en XDarwin y en Mac OS X. Por defecto, no se le permite a X11 alterar la aceleraci&oacuten para evitar este inconveniente.</li>
- <li><b>Emulaci&oacuten de mouse multi-bot&oacuten:</b> Esta opci&oacuten es descripta m&aacutes arriba bajo <a HREF="#usage">Modo de Uso</a>. Cuando esta emulaci&oacuten est&aacute activa los modificadores seleccionados deben ser presionados cuando se hace click para emular el bot&oacuten 2 o el bot&oacuten 3.</li>
-</ul>
-<h3>Inicio</h3>
-<ul>
- <li><b>Modo inicial:</b> Si el usuario no indica si desea utilizar la Pantalla Completa o el modo Rootless, el modo especificado aqu&iacute ser&aacute el usado.</li>
- <li><b>Mostrar panel de selecci&oacuten al inicio:</b> Por defecto, un di&aacutelogo permite al usuario elegir entre Pantalla Completa o Rootless al inicio. Si esta opci&oacuten esta desactivada, XDarwin arrancar&aacute utilizando el modo por defecto sin consultar al usuario.</li>
- <li><b>N&uacutemero de display X11:</b> X11 permite que existan m&uacuteltiples pantallas manejadas por servidores X11 separados funcionando en una misma computadora. El usuario puede especificar aqui un n&uacutemero entero para indicar el n&uacutemero de pantalla (display) que XDarwin utilizar&aacute si m&aacutes de un servidor X funciona en forma simult&aacutenea.</li>
- <li><b>Habilitar soporte Xinerama para m&uacuteltipes monitores:</b> XDarwin suporta m&uacuteltiple monitores con Xinerama, que maneja todos los monitores como si fueran parte de una gran pantalla rectangular. Puede deshabilitar Xinerama con esta opci&oacuten, pero XDarwin no maneja m&uacuteltiples monitores en forma correcta sin esta opci&oacuten habilitada. Si tiene solo un monitor, Xinerama es autom&aacuteticamente deshabilitado.</li>
- <li><b>Archivo de mapa de teclado:</b> Un archivo de mapa de teclas es le&iacutedo al inicio y es traducido a un keymap X11 (un archivo est&aacutendard de X11 para especificar la funci&oacuten de cada tecla). Estos archivos, disponibles para una amplia variedad de lenguajes, pueden encontrarse en <code>/System/Library/Keyboards</code>.</li>
- <li><b>Al iniciar clientes X11:</b> Cuando XDarwin arranca desde el Finder, &eacuteste ejecutar&aacute <code>xinit</code> para a su vez arrancar el window manager y otros clientes. (Vea en "<code>man xinit</code>" para mayor informaci&oacuten). Antes de ejecutar <code>xinit</code> XDarwin agregar&aacute los directorios especificados al path del usuario. Por defecto, solo <code>/usr/X11R6/bin</code> es agregado. Otros directorios adicionales puede agregarse separados por dos puntos (:). Los clientes X son ejecutados con el int&eacuterprete de comandos del usuario, por lo que los archivos de inicio de &eacuteste son le&iacutedos. Si se desea, un int&eacuterprete de comandos diferente puede ser especificado.</li>
-</ul>
-<h3>Pantalla Completa</h3>
-<ul>
- <li><b>Bot&oacuten para definir combinaci&oacuten de teclas:</b> Haga click en este bot&oacuten y luego presione cualquier combinaci&oacuten de modificadores seguidos de una tecla convencional para definir que combinaci&oacuten usar&aacute para intercambiar entre X11 y Aqua.</li>
- <li><b>Click en el &iacutecono del Dock cambia a X11:</b> Habilite esta opci&oacuten para volver a X11 al hacer click en &iacutecono de XDarwin en el Dock. En algunas versiones de Mac OS X, al volver haciendo click en el Dock puede causar al desaparci&oacuten del cursor al volver a Aqua.</li>
- <li><b>Mostrar ayuda al inicio:</b> Esta opci&oacuten habilitada har&aacute que una pantalla inicial de introducci&oacuten aparezca cuando XDarwin es arrancado en modo Pantalla Completa.</li>
- <li><b>Profundidad de color (bits):</b> En modo Pantalla Completa, el display X11 puede utilizar una profundidad de color diferente de la utilizada por Aqua. Si se especifica "Actual", la misma profundidad de color que Aqua utiliza ser&aacute adoptada por X11. Al contrario, puede especificar 8, 15, o 24 bits.</li>
-</ul>
-
-<h2><a NAME="license">Licencia</a></h2>
-La licencia principal de XDarwin es basada en la Licencia MIT X11 tradicional, que no impone condiciones a la modificaci&oacuten o redistribuci&oacuten del c&oacutedigo fuente o de archivos binarios m&aacutes all&aacute de requerir que los mensajes de Licencia y Copyright se mantengan intactos. Para mayor informaci&oacuten y para mensajes adicionales de Licencia y Copyright que cubren algunas secciones del c&oacutedigo fuente, por favor consulte the source code.
-<H3><A NAME="3"></A>Licencia del X Consortium</H3>
-<p>Copyright (C) 1996 X Consortium</p>
-<p>Se otorga aqui permiso, libre de costo, a toda persona que obtenga una copia de este Software y los archivos de documentaci&oacuten asociados (el "Software"),
-para utilizar el Software sin restricciones, incluyendo sin l&iacutemites los derechos de usar, copiar, modificar, integrar con otros productos, publicar, distribuir, sub-licenciar y/o comercializar copias del Software, y de permitir a las personas que lo reciben para hacer lo propio, sujeto a las siguientes condiciones:</p>
-<p>El mensaje de Copyright indicado m&aacutes arriba y este permiso ser&aacute inclu&iacutedo en todas las copias o porciones sustanciales del Software.</p>
-<p>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 X CONSORTIUM 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.</p>
-<p>Excepto lo indicado en este mensaje, el nombre del X Consortium no ser&aacute utilizado en propaganda o como medio de promoci&oacuten para la venta, utilizaci&oacuten u otros manejos de este Software sin previa autorizaci&oacuten escrita del X Consortium.</p>
-<p>X Window System es una marca registrada de X Consortium, Inc.</p>
-<H3><A NAME="3"></A>X Consortium License (English)</H3>
-<p>Copyright (C) 1996 X Consortium</p>
-<p>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:</p>
-<p>The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.</p>
-<p>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 X CONSORTIUM 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.</p>
-<p>Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization from
-the X Consortium.</p>
-<p>X Window System is a trademark of X Consortium, Inc.</p>
-</body>
-</html>
diff --git a/hw/darwin/bundle/Swedish.lproj/Credits.rtf b/hw/darwin/bundle/Swedish.lproj/Credits.rtf
deleted file mode 100644
index 34408e78c..000000000
--- a/hw/darwin/bundle/Swedish.lproj/Credits.rtf
+++ /dev/null
@@ -1,168 +0,0 @@
-{\rtf1\mac\ansicpg10000\cocoartf102
-{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fswiss\fcharset77 Helvetica-Oblique;
-}
-{\colortbl;\red255\green255\blue255;}
-\vieww5160\viewh6300\viewkind0
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
-
-\f0\fs24 \cf0 This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors. The following people contributed to Darwin/Mac OS X support.\
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f1\b \cf0 Contributors to Xorg Foundation Release:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Kaleb KEITHLEY\
-
-\f2\i Working left and right Ctrl, Alt (Option), Meta (Command) and Shift keys.
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\f1\b \cf0 Contributors to XFree86 4.4:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 John Harper\
-
-\f2\i Rootless acceleration and Apple-WM extension
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Additional XonX Contributors to XFree86 4.3:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Fabr\'92cio Luis de Castro\
-
-\f2\i Portuguese localization
-\f0\i0 \
-Michael Oland\
-
-\f2\i New XDarwin icon
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 XonX Contributors to XFree86 4.2:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Darwin x86 support
-\f0\i0 \
-Pablo Di Noto\
-
-\f2\i Spanish localization
-\f0\i0 \
-Paul Edens\
-
-\f2\i Dutch localization
-\f0\i0 \
-Kyunghwan Kim\
-
-\f2\i Korean localization
-\f0\i0 \
-Mario Klebsch\
-
-\f2\i Non-US keyboard support
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f0\i0 \
-Andreas Monitzer\
-
-\f2\i German localization
-\f0\i0 \
-Patrik Montgomery\
-
-\f2\i Swedish localization
-\f0\i0 \
-Greg Parker\
-
-\f2\i Rootless support
-\f0\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Japanese localization
-\f0\i0 \
-Olivier Verdier\
-
-\f2\i French localization
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Special Thanks:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Devin Poolman and Zero G Software, Inc.\
-
-\f2\i Installer
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 XonX Team Members\
-Contributing to XFree86 4.1:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Darwin x86 support
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f0\i0 \
-Andreas Monitzer\
-
-\f2\i Cocoa version of XDarwin front end
-\f0\i0 \
-Greg Parker\
-
-\f2\i Original Quartz implementation
-\f0\i0 \
-Christoph Pfisterer\
-
-\f2\i Dynamic shared libraries
-\f0\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Japanese localization
-\f0\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f1\b \cf0 Special Thanks:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Tiago Ribeiro\
-
-\f2\i XDarwin icon
-\f0\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f1\b \cf0 History:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 John Carmack\
-
-\f2\i Original XFree86 port to Mac OS X Server
-\f0\i0 \
-Dave Zarzycki\
-
-\f2\i XFree86 4.0 port to Darwin 1.0
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/Swedish.lproj/Localizable.strings b/hw/darwin/bundle/Swedish.lproj/Localizable.strings
deleted file mode 100644
index 9709e5469..000000000
--- a/hw/darwin/bundle/Swedish.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/classes.nib
deleted file mode 100644
index 77f345a4e..000000000
--- a/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/classes.nib
+++ /dev/null
@@ -1,72 +0,0 @@
-{
- IBClasses = (
- {
- ACTIONS = {showHelp = id; };
- CLASS = FirstResponder;
- LANGUAGE = ObjC;
- SUPERCLASS = NSObject;
- },
- {
- ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
- CLASS = Preferences;
- LANGUAGE = ObjC;
- OUTLETS = {
- addToPathButton = id;
- addToPathField = id;
- button2ModifiersMatrix = id;
- button3ModifiersMatrix = id;
- depthButton = id;
- displayField = id;
- dockSwitchButton = id;
- fakeButton = id;
- keymapFileField = id;
- modeMatrix = id;
- modeWindowButton = id;
- mouseAccelChangeButton = id;
- startupHelpButton = id;
- switchKeyButton = id;
- systemBeepButton = id;
- useDefaultShellMatrix = id;
- useOtherShellField = id;
- useXineramaButton = id;
- window = id;
- };
- SUPERCLASS = NSObject;
- },
- {
- CLASS = XApplication;
- LANGUAGE = ObjC;
- OUTLETS = {preferences = id; xserver = id; };
- SUPERCLASS = NSApplication;
- },
- {
- ACTIONS = {
- bringAllToFront = id;
- closeHelpAndShow = id;
- itemSelected = id;
- nextWindow = id;
- previousWindow = id;
- showAction = id;
- showSwitchPanel = id;
- startFullScreen = id;
- startRootless = id;
- };
- CLASS = XServer;
- LANGUAGE = ObjC;
- OUTLETS = {
- dockMenu = NSMenu;
- helpWindow = NSWindow;
- modeWindow = NSWindow;
- startFullScreenButton = NSButton;
- startRootlessButton = NSButton;
- startupHelpButton = NSButton;
- startupModeButton = NSButton;
- switchWindow = NSPanel;
- windowMenu = NSMenu;
- windowSeparator = NSMenuItem;
- };
- SUPERCLASS = NSObject;
- }
- );
- IBVersion = 1;
-} \ No newline at end of file
diff --git a/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/objects.nib
deleted file mode 100644
index 3157d72cb..000000000
--- a/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/objects.nib
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp
deleted file mode 100644
index 4210878c0..000000000
--- a/hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp,v 1.2 2001/11/04 07:02:28 torrey Exp $ -->
-
-<html>
-<head>
-<title>XDarwin Help</title>
-</head>
-<body>
-<center>
- <h1>XDarwin X Server for Mac OS X</h1>
- X_VENDOR_NAME X_VERSION<br>
- F&auml;rdigst&auml;llt: X_REL_DATE
-</center>
-<h2>Inneh&aring;ll</h2>
-<ol>
- <li><A HREF="#notice">Viktigt!</A></li>
- <li><A HREF="#usage">Anv&auml;ndande</A></li>
- <li><A HREF="#path">Att st&auml;lla in sin s&ouml;kv&auml;g</A></li>
- <li><A HREF="#prefs">Inst&auml;llningar</A></li>
- <li><A HREF="#license">Licens</A></li>
-</ol>
-<center>
- <h2><a NAME="notice">Viktigt!</a></h2>
-</center>
-<blockquote>
-#if PRE_RELEASE
-Detta &auml;r en testversion av XDarwin, och du kan inte garranteras n&aring;gon som helst support f&ouml;r den. Buggar och fel kan rapporteras och f&ouml;rslag till fixar kan skickas till <A HREF="http://sourceforge.net/projects/xonx/">XonX-projektets sida</A> p&aring; SourceForge. Innan du rapporterar buggar i testversioner, var god pr&ouml;va den senaste versionen fr&aring;n <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> eller i X_VENDOR_LINK.
-#else
-Om servern &auml;r &auml;ldre &auml;n 6-12 m&aring;nader, eller om din h&aring;rdvara &auml;r nyare &auml;n datumet ovan, leta efter en nyare version innan du rapporterar fel. Buggar och fel kan rapporteras och f&ouml;rslag till fixar kan skickas till <A HREF="http://sourceforge.net/projects/xonx/">XonX-projektets sida</A> p&aring; SourceForge.
-#endif
-</blockquote>
-<blockquote>
-Denna programvara distrubueras i enlighet med <A HREF="#license">MIT X11 / X Consortium License</A> och tilhandh&aring;lls som den &auml;r, helt utan garantier. Var god l&auml;s igenom <A HREF="#license">licensdokumentet (engelska)</A> innan du anv&auml;nder programmet.</blockquote>
-
-<h2><a NAME="usage">Anv&auml;ndande</a></h2>
-<p>XDarwin &auml;r en fritt spridd X server av <a HREF
-="http://www.x.org/">X Window-systemet</a>. This version of XDarwin was produced by the X_VENDOR_LINK. XDarwin kan k&ouml;ras p&aring; Mac OS X i fullsk&auml;rmsl&auml;ge eller rotl&ouml;st l&auml;ge.</p>
-<p>I fullsk&auml;rmsl&auml;ge kommer X window-systemet att ta &ouml;ver hela sk&auml;rmen n&auml;r det &auml;r aktivt. Du kan byta tillbaka till Mac OS Xs skrivbord genom att trycka Kommando-Alt-A. Denna tangentkombination kan &auml;ndra i inst&auml;llningarna. N&auml;r du &auml;r p&aring; Mac OS Xs skrivbord kan du klicka p&aring; XDarwin-ikonen i dockan f&ouml;r att byta tillbaka till X Window-systemet. (Du kan f&ouml;r&auml;ndra detta beteende i inst&auml;llningarna s&aring; att du ist&auml;llet m&aring;ste klicka i det fltande bytesf&ouml;nstret ist&auml;llet.)</p>
-<p>I rotl&ouml;stl&auml;ge delar X11 och Aqua p&aring; din sk&auml;rm. Rotf&ouml;nstret p&aring; X11-sk&auml;rmen &auml;r av samma storlek som hela sk&auml;rmen och inneh&aring;ller alla andra f&ouml;nster - det fungerar som bakgrund. I rotl&ouml;stl&auml;ge visas inte detta rotf&ouml;nster, eftersom Aqua hanterar skrvbordbakgrunden.</p>
-
-<h3>Emulering av flerknapparsmus</h3>
-<p>M&aring;nga X11-program utnyttjar en treknapparsmus. Du kan emulera en treknapparsmus med en knapp genom att h&aring;lla ner olika knappar p&aring; tangentbordet medan du klickar med musens enda knapp. Denna funktion styrs av inst&auml;llningarna i "Emulera flerknapparsmus" under fliken "Diverse" i inst&auml;llningarna. Grundinst&auml;llningen &auml;r att emulationen &auml;r aktiv och att ett kommando-klick (H&aring;ll ner kommando och klicka) simulerar den andra musknappen. Den tredje musknappen f&aring;s genom att h&aring;lla ner alt och klicka. Du kan &auml;ndra detta till n&aring;gon annan kombination av de fem tangenterna kommando, alt, kontrol, skift och fn (Powerbook/iBook). Notera att om dessa knappar har flyttats med hj&auml;lp av kommandot xmodmap kommer denna f&ouml;r&auml;ndring inte att p&aring;verka vilka knappar som anv&auml;nds vid flerknappsemulationen.</p>
-
-<h2><a NAME="path">Att st&auml;lla in sin s&ouml;kv&auml;g</a></h2>
-<p>Din s&ouml;kv&auml;g &auml;r en lista av kataloger som s&ouml;ks igenom n&auml;r terminalen letar efter kommandon att exekvera. Kommandon som h&ouml;r till X11 ligger i <code>/usr/X11R6/bin</code>, en katalog som inte ligger i din s&ouml;kv&auml;g fr&aring;n b&ouml;rjan. XDarwin l&auml;gger till denna katalog &aring;t dig, och du kan ocks&aring; l&auml;gga till ytterligare kataloger i vilka du lagt program som skall k&ouml;ras fr&aring;n kommandoraden.</p>
-<p>Mer erfarna anv&auml;ndare har antagligen redan st&auml;llt in sin s&ouml;kv&auml;g i skalets inst&auml;llningsfiler. Om detta g&auml;ller dig kan st&auml;lla in XDarwin s&aring; att din s&ouml;kv&auml;g inte modifieras. XDarwin startar de f&ouml;rsta X11-klienterna i anv&auml;ndarens inloggningsskal (Vill du anv&auml;nda ett alternativt skall, kan du specificera detta i inst&auml;llningarna). Hur du st&auml;ller in din s&ouml;kv&auml;g beror p&aring; vilket skal du anv&auml;nder. Exakt hur beskrivs i skalets man-sidor.</p>
-
-<p>Ut&ouml;ver detta kan du ocks&aring; vilja l&auml;gga till X11s man-sidor (dokumentation) till listan &auml;ver sidor som som skall s&ouml;kas n&auml;r du vill l&auml;sa efter dokumentationen. X11s man-sidor ligger i <code>/usr/X11R6/man</code> och listan &auml;ver kataloger att s&ouml;ka best&auml;mms av variabeln<code>MANPATH</code>.</p>
-
-<h2><a NAME="prefs">Inst&auml;llningar</a></h2>
-<p>I inst&auml;llningarna finns ett antal alternativ d&auml;r du kan p&aring;verka hur XDarwin beter sig i vissa fall. Inst&auml;llningarna kommer du till genom att v&auml;lja "Inst&auml;llningar..." i menyn "XDarwin". De alternativ som finns under fliken "Starta" tr&auml;der inte i kraft f&ouml;rr&auml;n du startat om programmet. Alla andra alternativ tr&auml;der i kraft omedelbart. De olika alternativen beskrivs nedan:</p>
-<h3>Diverse</h3>
-<ul>
- <li><b>Anv&auml;nd Mac OS varningsljud i X11:</b> N&auml;r detta alternativ &auml;r valt anv&auml;nds Mac OS vanliga varningsljud &auml;r X11s varningsljud (bell). N&auml;r detta alternativ inte &auml;r valt (f&ouml;rvalt) anv&auml;nds en vanlig ton.</li>
- <li><b>Till&aring;t X11 att &auml;ndra musens acceleration:</b> I ett vanligt X11-system kan f&ouml;nsterhanteraren &auml;ndra musens acceleration. Detta kan vara f&ouml;rvirrande eftersom musens acceleration kan vara olika i Mac OS Xs System Preferences och i f&ouml;nsterhanteraren i X11. F&ouml;rvalet &auml;r att X11 inte kan &auml;ndra musens acceleration f&ouml;r att p&aring; detta s&auml;tt undvika detta problem.</li>
- <li><b>Emulera flerknapparsmus:</b> Detta beskrivs ovan under <a HREF="#usage">Anv&auml;ndande</a>. N&auml;r emulationen &auml;r aktiv m&aring;ste du h&aring;lla ner de valda knapparna f&ouml;r att emulera en andra eller tredje musknapp.</li>
-</ul>
-<h3>Starta</h3>
-<ul>
- <li><b>F&ouml;rvalt l&auml;ge:</b> Om anv&auml;ndaren inte p&aring; annat s&auml;tt v&auml;ljer vilket l&auml;ge som skall anv&auml;ndas kommer alternativet h&auml;r att anv&auml;ndas.</li>
- <li><b>Visa val av sk&auml;rml&auml;ge vid start:</b> F&ouml;rvalet &auml;r att visa ett f&ouml;nster n&auml;r XDarwin startar som l&aring;ter anv&auml;ndaren v&auml;lja mellan fullsk&auml;rmsl&auml;ge och rotl&ouml;st l&auml;ge. Om detta alternativ inte &auml;r aktivt kommer XDarwin automatiskt att startas i det l&auml;ge som valts ovan.</li>
- <li><b>Sk&auml;rmnummer i X11:</b> X11 till&aring;ter att det finns flera sk&auml;rmar styrda av varsin X-server p&aring; en och samma dator. Anv&auml;ndaren kan ange vilket nummer XDarwin skall anv&auml;nda om mer &auml;n en X-server skall anv&auml;ndas samtidigt.</li>
- <li><b>Aktivera Xinerama (st&ouml;d f&ouml;r flera sk&auml;rmar):</b> XDarwin st&ouml;djer flera sk&auml;rmar genom Xinerama, vilket hanterar alla skr&auml;mar som delar av en enda stor rektangul&auml;r sk&auml;rm. Du kan anv&auml;nda detta alternativ f&ouml;r att st&auml;nga av Xinerama, men f&ouml;r n&auml;rvarande kan inte XDarwin hantera flera sk&auml;rmar utan det. Om du bara har en sk&auml;rm kommer Xinerama automatiskt att deaktiveras.</li>
- <li><b>Fil med tangentbordsupps&auml;ttning:</b> En fil som anger tangentbordsupps&auml;ttning l&auml;ses vid start och &ouml;vers&auml;tts till en tangentborsupps&auml;ttningsfil f&ouml;r X11. Filer med tangentbordsupps&auml;ttningar f&ouml;r ett stort antal spr&aring;k finns i <code>/System/Library/Keyboards</code>.</li>
- <li><b>Startar f&ouml;rsta X11-klienterna:</b> N&auml;r X11 startas fr&aring;n Finder kommer det att exekvera filen <code>xinit</code> f&ouml;r att starta f&ouml;nsterhanteraren i X11 och andra program. (Se "<code>man xinit</code>" f&ouml;r mer information.) Innan XDarwin k&ouml;r xinit kommer det att l&auml;gga till katalogern h&auml;r till anv&auml;ndarens s&ouml;kv&auml;g. F&ouml;rvalet &auml;r att endast l&auml;gga till katalogen <code>/usr/X11R6/bin</code>. Ytterligare kataloger kan l&auml;ggas till - separera dem med kolon. X11-klienterna startas i anv&auml;ndarens inloggningsskal s&aring; att anv&auml;ndarens inst&auml;llningsfiler i skalet l&auml;ses. Om s&aring; &ouml;nskas kan de startas i ett annat skal.</li>
-</ul>
-<h3>Fullsk&auml;rm</h3>
-<ul>
- <li><b>Tangentkombinationsknappen:</b> Tryck p&aring; denna knapp och en tangentkombination f&ouml;r att &auml;ndra den tangentkombination som anv&auml;nds f&ouml;r att byta mellan X11 och Aqua.</li>
- <li><b>Klick p&aring; ikonen i dockan byter till X11:</b> Aktivera detta alternativ f&ouml;r att byta till X11 genom att klicka p&aring; ikonen i dockan. I vissa versioner av Mac OS X kommer ett bte p&aring; detta s&auml;tt att g&ouml;mma pekaren n&auml;r du &aring;terv&auml;nder till Aqua.</li>
- <li><b>Visa fullsk&auml;rmshj&auml;lp vid start:</b> Detta kommer att visa en informationsruta n&auml;r XDarwin startas i fullsk&auml;rmsl&auml;ge.</li>
- <li><b>F&auml;rgdjup:</b> I fullsk&auml;rmsl&auml;ge kan X11 anv&auml;nda ett annat f&auml;rgdjup &auml;n Aquas. Om du v&auml;jer "Nuvarande" kommer X11 att anv&auml;nda det f&auml;rgdjup som Aqua har just d&aring;. Annars kan du v&auml;lja 8, 15, eller 24 bitare f&auml;rg.</li>
-</ul>
-
-<h2><a NAME="license">Licens (svenska)</a></h2>
-<p>Den huvudsakliga licens vi anv&auml;nder oss av &auml;r baserad p&aring; den traditionella MIT X11 / XConsortium-licensen, vilken inte p&aring; n&aring;got s&auml;tt begr&auml;nsar f&ouml;r&auml;ndringar eller vidarespridning av vare sig k&auml;llkod eller kompilerad programvara annat &auml;n genom att kr&auml;va att delarna som r&ouml;r copyright och licensiering l&auml;mnas intakta. F&ouml;r mer information och ytterligare copyright/licensieringsinfromation r&ouml;rande vissa speciella delar av koden, se the source code.</p>
-
-<h3>Licence (english)</h3>
-<p>The main license for XDarwin is based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please refer to the source code.</p>
-
-<H3><A NAME="3"></A>X Consortium License</H3>
-<p>Copyright (C) 1996 X Consortium</p>
-<p>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:</p>
-<p>The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.</p>
-<p>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 X CONSORTIUM 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.</p>
-<p>Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization from
-the X Consortium.</p>
-<p>X Window System is a trademark of X Consortium, Inc.</p>
-</body>
-</html>
diff --git a/hw/darwin/bundle/XDarwin.icns b/hw/darwin/bundle/XDarwin.icns
deleted file mode 100644
index 9c560846e..000000000
--- a/hw/darwin/bundle/XDarwin.icns
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/ko.lproj/Credits.rtf b/hw/darwin/bundle/ko.lproj/Credits.rtf
deleted file mode 100644
index 34408e78c..000000000
--- a/hw/darwin/bundle/ko.lproj/Credits.rtf
+++ /dev/null
@@ -1,168 +0,0 @@
-{\rtf1\mac\ansicpg10000\cocoartf102
-{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fswiss\fcharset77 Helvetica-Oblique;
-}
-{\colortbl;\red255\green255\blue255;}
-\vieww5160\viewh6300\viewkind0
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
-
-\f0\fs24 \cf0 This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors. The following people contributed to Darwin/Mac OS X support.\
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f1\b \cf0 Contributors to Xorg Foundation Release:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Kaleb KEITHLEY\
-
-\f2\i Working left and right Ctrl, Alt (Option), Meta (Command) and Shift keys.
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\f1\b \cf0 Contributors to XFree86 4.4:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 John Harper\
-
-\f2\i Rootless acceleration and Apple-WM extension
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Additional XonX Contributors to XFree86 4.3:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Fabr\'92cio Luis de Castro\
-
-\f2\i Portuguese localization
-\f0\i0 \
-Michael Oland\
-
-\f2\i New XDarwin icon
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 XonX Contributors to XFree86 4.2:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Darwin x86 support
-\f0\i0 \
-Pablo Di Noto\
-
-\f2\i Spanish localization
-\f0\i0 \
-Paul Edens\
-
-\f2\i Dutch localization
-\f0\i0 \
-Kyunghwan Kim\
-
-\f2\i Korean localization
-\f0\i0 \
-Mario Klebsch\
-
-\f2\i Non-US keyboard support
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f0\i0 \
-Andreas Monitzer\
-
-\f2\i German localization
-\f0\i0 \
-Patrik Montgomery\
-
-\f2\i Swedish localization
-\f0\i0 \
-Greg Parker\
-
-\f2\i Rootless support
-\f0\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Japanese localization
-\f0\i0 \
-Olivier Verdier\
-
-\f2\i French localization
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 Special Thanks:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Devin Poolman and Zero G Software, Inc.\
-
-\f2\i Installer
-\f0\i0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-
-\f1\b \cf0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\cf0 XonX Team Members\
-Contributing to XFree86 4.1:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Rob Braun\
-
-\f2\i Darwin x86 support
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Project Lead
-\f0\i0 \
-Andreas Monitzer\
-
-\f2\i Cocoa version of XDarwin front end
-\f0\i0 \
-Greg Parker\
-
-\f2\i Original Quartz implementation
-\f0\i0 \
-Christoph Pfisterer\
-
-\f2\i Dynamic shared libraries
-\f0\i0 \
-Toshimitsu Tanaka\
-
-\f2\i Japanese localization
-\f0\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f1\b \cf0 Special Thanks:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 Tiago Ribeiro\
-
-\f2\i XDarwin icon
-\f0\i0 \
-\
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-
-\f1\b \cf0 History:
-\f0\b0 \
-\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
-\cf0 John Carmack\
-
-\f2\i Original XFree86 port to Mac OS X Server
-\f0\i0 \
-Dave Zarzycki\
-
-\f2\i XFree86 4.0 port to Darwin 1.0
-\f0\i0 \
-Torrey T. Lyons\
-
-\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/ko.lproj/Localizable.strings b/hw/darwin/bundle/ko.lproj/Localizable.strings
deleted file mode 100644
index fb8c77e0d..000000000
--- a/hw/darwin/bundle/ko.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/ko.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/ko.lproj/MainMenu.nib/classes.nib
deleted file mode 100644
index 77f345a4e..000000000
--- a/hw/darwin/bundle/ko.lproj/MainMenu.nib/classes.nib
+++ /dev/null
@@ -1,72 +0,0 @@
-{
- IBClasses = (
- {
- ACTIONS = {showHelp = id; };
- CLASS = FirstResponder;
- LANGUAGE = ObjC;
- SUPERCLASS = NSObject;
- },
- {
- ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
- CLASS = Preferences;
- LANGUAGE = ObjC;
- OUTLETS = {
- addToPathButton = id;
- addToPathField = id;
- button2ModifiersMatrix = id;
- button3ModifiersMatrix = id;
- depthButton = id;
- displayField = id;
- dockSwitchButton = id;
- fakeButton = id;
- keymapFileField = id;
- modeMatrix = id;
- modeWindowButton = id;
- mouseAccelChangeButton = id;
- startupHelpButton = id;
- switchKeyButton = id;
- systemBeepButton = id;
- useDefaultShellMatrix = id;
- useOtherShellField = id;
- useXineramaButton = id;
- window = id;
- };
- SUPERCLASS = NSObject;
- },
- {
- CLASS = XApplication;
- LANGUAGE = ObjC;
- OUTLETS = {preferences = id; xserver = id; };
- SUPERCLASS = NSApplication;
- },
- {
- ACTIONS = {
- bringAllToFront = id;
- closeHelpAndShow = id;
- itemSelected = id;
- nextWindow = id;
- previousWindow = id;
- showAction = id;
- showSwitchPanel = id;
- startFullScreen = id;
- startRootless = id;
- };
- CLASS = XServer;
- LANGUAGE = ObjC;
- OUTLETS = {
- dockMenu = NSMenu;
- helpWindow = NSWindow;
- modeWindow = NSWindow;
- startFullScreenButton = NSButton;
- startRootlessButton = NSButton;
- startupHelpButton = NSButton;
- startupModeButton = NSButton;
- switchWindow = NSPanel;
- windowMenu = NSMenu;
- windowSeparator = NSMenuItem;
- };
- SUPERCLASS = NSObject;
- }
- );
- IBVersion = 1;
-} \ No newline at end of file
diff --git a/hw/darwin/bundle/ko.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/ko.lproj/MainMenu.nib/objects.nib
deleted file mode 100644
index 8f9b5e01c..000000000
--- a/hw/darwin/bundle/ko.lproj/MainMenu.nib/objects.nib
+++ /dev/null
Binary files differ
diff --git a/hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp
deleted file mode 100644
index 5996285ae..000000000
--- a/hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp,v 1.1 2001/05/21 01:42:17 torrey Exp $ -->
-
-<html>
-<head>
-<title>XDarwin Help</title>
-</head>
-<body>
-<center>
- <h1>XDarwin X Server for Mac OS X</h1>
- X_VENDOR_NAME X_VERSION<br>
- Release Date: X_REL_DATE
-</center>
-<h2>Contents</h2>
-<ol>
- <li><A HREF="#notice">Important Notice</A></li>
- <li><A HREF="#usage">Usage</A></li>
- <li><A HREF="#path">Setting Your Path</A></li>
- <li><A HREF="#prefs">User Preferences</A></li>
- <li><A HREF="#license">License</A></li>
-</ol>
-<center>
- <h2><a NAME="notice">Important Notice</a></h2>
-</center>
-<blockquote>
-#if X_PRE_RELEASE
-This is a pre-release version of XDarwin, and is not supported in any way. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge. Before reporting bugs in pre-release versions, please check the latest version from <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> or the X_VENDOR_LINK.
-#else
-If the server is older than 6-12 months, or if your hardware is newer than the above date, look for a newer version before reporting problems. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge.
-#endif
-</blockquote>
-<blockquote>
-This software is distributed under the terms of the <A HREF="#license">MIT X11 / X Consortium License</A> and is provided AS IS, with no warranty. Please read the <A HREF="#license">License</A> before using.</blockquote>
-
-<h2><a NAME="usage">Usage</a></h2>
-<p>XDarwin is a freely redistributable open-source X server for the <a HREF="http://www.x.org/">X Window System</a>. This version of XDarwin was produced by the X_VENDOR_LINK. XDarwin runs on Mac OS X in full screen or rootless modes.</p>
-<p>In full screen mode, when the X window system is active, it takes over the entire screen. You can switch back to the Mac OS X desktop by holding down Command-Option-A. This key combination can be changed in the user preferences. From the Mac OS X desktop, click on the XDarwin icon in the Dock to switch back to the X window system. (You can change this behavior in the user preferences so that you must click the XDarwin icon in the floating switch window instead.)</p>
-<p>In rootless mode, the X window system and Aqua 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 Aqua handles the desktop background.</p>
-<h3>Multi-Button Mouse Emulation</h3>
-<p>Many X11 applications rely on the use of a 3-button mouse. You can emulate a 3-button mouse with a single button by holding down various modifier keys while you click the mouse button. This is controlled by settings in the "Multi-Button Mouse Emulation" section of the "General" preferences. By default, emulation is on and holding down the command key and clicking the mouse button will simulate clicking the second mouse button. Holding down the option key and clicking will simulate the third button. You can change to any combination of modifiers to emulate buttons two and three in the preferences. Note, even if the modifiers keys are mapped to some other key with xmodmap, you still must use the actual keys specified in the preferences for multi-button mouse emulation.</p>
-
-<h2><a NAME="path">Setting Your Path</a></h2>
-<p>Your path is the list of directories to be searched for executable commands. The X11 commands are located in <code>/usr/X11R6/bin</code>, which needs to be added to your path. XDarwin does this for you by default and can also add additional directories where you have installed command line applications.</p>
-<p>More experienced users will have already set their path correctly using the initialization files for their shell. In this case, you can inform XDarwin not to modify your path in the preferences. XDarwin launches the initial X11 clients in the user's default login shell. (An alternate shell can also be specified in the preferences.) The way to set the path depends on the shell you are using. This is described in the man page documentation for the shell.</p>
-<p>In addition you may also want to add the X11 man pages to the list of pages to be searched when you are looking for documentation. The X11 man pages are located in <code>/usr/X11R6/man</code> and the <code>MANPATH</code> environment variable contains the list of directories to search.</p>
-
-<h2><a NAME="prefs">User Preferences</a></h2>
-<p>A number of options may be set from the user preferences, accessible from the "Preferences..." menu item in the "XDarwin" menu. The options listed as start up options will not take effect until you have restarted XDarwin. All other options take effect immediately. The various options are described below:</p>
-<h3>General</h3>
-<ul>
- <li><b>Use System beep for X11:</b> When enabled the standard Mac OS X alert sound is used as the X11 bell. When disabled (default) a simple tone is used.</li>
- <li><b>Allow X11 to change mouse acceleration:</b> In a standard X window system implementation, the window manager can change the mouse acceleration. This can lead to confusion as the mouse acceleration may be set to different values by the Mac OS X System Preferences and the X window manager. By default, X11 is not allowed to change the mouse acceleration to avoid this problem.</li>
- <li><b>Multi-Button Mouse Emulation:</b> This is described above under <a HREF="#usage">Usage</a>. When emulation is enabled the selected modifiers must be held down when the mouse button is pushed to emulate the second or third mouse buttons.</li>
-</ul>
-<h3>Start Up</h3>
-<ul>
- <li><b>Default Mode:</b> If the user does not indicate whether to run in full screen or rootless mode, the mode specified here will be used.</li>
- <li><b>Show mode pick panel on startup:</b> By default, a panel is displayed when XDarwin is started to allow the user to choose between full screen or rootless mode. If this option is turned off, the default mode will be started automatically.</li>
- <li><b>X11 Display number:</b> X11 allows there to be multiple displays managed by separate X servers on a single computer. The user may specify an integer display number for XDarwin to use if more than one X server is going to be run simultaneously.</li>
- <li><b>Allow Xinerama multiple monitor support:</b> XDarwin supports multiple monitors with Xinerama, which treats all monitors as being part of one large rectangular screen. You can disable Xinerama with this option, but currently XDarwin does not handle multiple monitors correctly without it. If you only have a single monitor, Xinerama is automatically disabled.</li>
- <li><b>Keymapping File:</b> A keymapping file is read at startup and translated to an X11 keymap. Keymapping files, available for a wide variety of languages, are found in <code>/System/Library/Keyboards</code>.</li>
- <li><b>Starting First X11 Clients:</b> When XDarwin is started from the Finder, it will run <code>xinit</code> to launch the X window manager and other X clients. (See "<code>man xinit</code>" for more information.) Before XDarwin runs <code>xinit</code> it will add the specified directories to the user's path. By default only <code>/usr/X11R6/bin</code> is added. Additional directories may added, separated by a colon. The X clients are started in the user's default login shell so that the user's shell initialization files are read. If desired, an alternate shell may be specified.</li>
-</ul>
-<h3>Full Screen</h3>
-<ul>
- <li><b>Key combination button:</b> Click this button and then press any number of modifiers followed by a standard key to change the key combination to switch between Aqua and X11.</li>
- <li><b>Click on icon in Dock switches to X11:</b> Enable this to activate switching to X11 by clicking on the XDarwin icon in the Dock. On some versions of Mac OS X, switching by clicking in the Dock can cause the cursor to disappear on returning to Aqua.</li>
- <li><b>Show help on startup:</b> This will show an introductory splash screen when XDarwin is started in full screen mode.</li>
- <li><b>Color bit depth:</b> In full screen mode, the X11 display can use a different color bit depth than is used by Aqua. If "Current" is specified, the depth used by Aqua when XDarwin starts will be used. Otherwise 8, 15, or 24 bits may be specified.</li>
-</ul>
-
-<h2><a NAME="license">License</a></h2>
-The main license for XDarwin is based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please refer to the source code.
-<H3><A NAME="3"></A>X Consortium License</H3>
-<p>Copyright (C) 1996 X Consortium</p>
-<p>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:</p>
-<p>The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.</p>
-<p>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 X CONSORTIUM 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.</p>
-<p>Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization from
-the X Consortium.</p>
-<p>X Window System is a trademark of X Consortium, Inc.</p>
-</body>
-</html>
diff --git a/hw/darwin/bundle/startXClients.cpp b/hw/darwin/bundle/startXClients.cpp
deleted file mode 100644
index 51cdb5c9e..000000000
--- a/hw/darwin/bundle/startXClients.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-XCOMM!/bin/sh
-
-XCOMM This script is used by XDarwin to start X clients when XDarwin is
-XCOMM launched from the Finder.
-XCOMM
-XCOMM $XFree86: $
-
-userclientrc=$HOME/.xinitrc
-sysclientrc=XINITDIR/xinitrc
-clientargs=""
-
-if [ -f $userclientrc ]; then
- clientargs=$userclientrc
-else if [ -f $sysclientrc ]; then
- clientargs=$sysclientrc
-fi
-fi
-
-if [ "x$2" != "x" ]; then
- PATH="$PATH:$2"
- export PATH
-fi
-
-exec xinit $clientargs -- XBINDIR/XDarwinStartup "$1" -idle
diff --git a/hw/darwin/iokit/xfIOKit.c b/hw/darwin/iokit/xfIOKit.c
deleted file mode 100644
index 95a7fb32c..000000000
--- a/hw/darwin/iokit/xfIOKit.c
+++ /dev/null
@@ -1,770 +0,0 @@
-/**************************************************************
- *
- * IOKit support for the Darwin X Server
- *
- * HISTORY:
- * Original port to Mac OS X Server by John Carmack
- * Port to Darwin 1.0 by Dave Zarzycki
- * Significantly rewritten for XFree86 4.0.1 by Torrey Lyons
- *
- **************************************************************/
-/*
- * Copyright (c) 2001-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.
- */
-
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include "os.h"
-#include "servermd.h"
-#include "inputstr.h"
-#include "scrnintstr.h"
-#include "mi.h"
-#include "mibstore.h"
-#include "mipointer.h"
-#include "micmap.h"
-#include "shadow.h"
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <pthread.h>
-
-#include <mach/mach_interface.h>
-
-#define NO_CFPLUGIN
-#include <IOKit/IOKitLib.h>
-#include <IOKit/hidsystem/IOHIDShared.h>
-#include <IOKit/graphics/IOGraphicsLib.h>
-#include <drivers/event_status_driver.h>
-
-// Define this to work around bugs in the display drivers for
-// older PowerBook G3's. If the X server starts without this
-// #define, you don't need it.
-#undef OLD_POWERBOOK_G3
-
-#include "darwin.h"
-#include "xfIOKit.h"
-
-// Globals
-int xfIOKitScreenIndex = 0;
-io_connect_t xfIOKitInputConnect = 0;
-
-static pthread_t inputThread;
-static EvGlobals * evg;
-static mach_port_t masterPort;
-static mach_port_t notificationPort;
-static IONotificationPortRef NotificationPortRef;
-static mach_port_t pmNotificationPort;
-static io_iterator_t fbIter;
-
-
-/*
- * XFIOKitStoreColors
- * This is a callback from X to change the hardware colormap
- * when using PsuedoColor.
- */
-static void XFIOKitStoreColors(
- ColormapPtr pmap,
- int numEntries,
- xColorItem *pdefs)
-{
- kern_return_t kr;
- int i;
- IOColorEntry *newColors;
- ScreenPtr pScreen = pmap->pScreen;
- XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen);
-
- assert( newColors = (IOColorEntry *)
- xalloc( numEntries*sizeof(IOColorEntry) ));
-
- // Convert xColorItem values to IOColorEntry
- // assume the colormap is PsuedoColor
- // as we do not support DirectColor
- for (i = 0; i < numEntries; i++) {
- newColors[i].index = pdefs[i].pixel;
- newColors[i].red = pdefs[i].red;
- newColors[i].green = pdefs[i].green;
- newColors[i].blue = pdefs[i].blue;
- }
-
- kr = IOFBSetCLUT( iokitScreen->fbService, 0, numEntries,
- kSetCLUTByValue, newColors );
- kern_assert( kr );
-
- xfree( newColors );
-}
-
-
-/*
- * DarwinModeBell
- * FIXME
- */
-void DarwinModeBell(
- int loud,
- DeviceIntPtr pDevice,
- pointer ctrl,
- int fbclass)
-{
-}
-
-
-/*
- * DarwinModeGiveUp
- * Closes the connections to IOKit services
- */
-void DarwinModeGiveUp( void )
-{
- int i;
-
- // we must close the HID System first
- // because it is a client of the framebuffer
- NXCloseEventStatus( darwinParamConnect );
- IOServiceClose( xfIOKitInputConnect );
- for (i = 0; i < screenInfo.numScreens; i++) {
- XFIOKitScreenPtr iokitScreen =
- XFIOKIT_SCREEN_PRIV(screenInfo.screens[i]);
- IOServiceClose( iokitScreen->fbService );
- }
-}
-
-
-/*
- * ClearEvent
- * Clear an event from the HID System event queue
- */
-static void ClearEvent(NXEvent * ep)
-{
- static NXEvent nullEvent = {NX_NULLEVENT, {0, 0 }, 0, -1, 0 };
-
- *ep = nullEvent;
- ep->data.compound.subType = ep->data.compound.misc.L[0] =
- ep->data.compound.misc.L[1] = 0;
-}
-
-
-/*
- * XFIOKitHIDThread
- * Read the HID System event queue, translate it to an X event,
- * and queue it for processing.
- */
-static void *XFIOKitHIDThread(void *unused)
-{
- for (;;) {
- NXEQElement *oldHead;
- mach_msg_return_t kr;
- mach_msg_empty_rcv_t msg;
-
- kr = mach_msg((mach_msg_header_t*) &msg, MACH_RCV_MSG, 0,
- sizeof(msg), notificationPort, 0, MACH_PORT_NULL);
- kern_assert(kr);
-
- while (evg->LLEHead != evg->LLETail) {
- NXEvent ev;
- xEvent xe;
-
- // Extract the next event from the kernel queue
- oldHead = (NXEQElement*)&evg->lleq[evg->LLEHead];
- ev_lock(&oldHead->sema);
- ev = oldHead->event;
- ClearEvent(&oldHead->event);
- evg->LLEHead = oldHead->next;
- ev_unlock(&oldHead->sema);
-
- memset(&xe, 0, sizeof(xe));
-
- // These fields should be filled in for every event
- xe.u.keyButtonPointer.rootX = ev.location.x;
- xe.u.keyButtonPointer.rootY = ev.location.y;
- xe.u.keyButtonPointer.time = GetTimeInMillis();
-
- switch( ev.type ) {
- case NX_MOUSEMOVED:
- xe.u.u.type = MotionNotify;
- break;
-
- case NX_LMOUSEDOWN:
- xe.u.u.type = ButtonPress;
- xe.u.u.detail = 1;
- break;
-
- case NX_LMOUSEUP:
- xe.u.u.type = ButtonRelease;
- xe.u.u.detail = 1;
- break;
-
- // A newer kernel generates multi-button events with
- // NX_SYSDEFINED. Button 2 isn't handled correctly by
- // older kernels anyway. Just let NX_SYSDEFINED events
- // handle these.
-#if 0
- case NX_RMOUSEDOWN:
- xe.u.u.type = ButtonPress;
- xe.u.u.detail = 2;
- break;
-
- case NX_RMOUSEUP:
- xe.u.u.type = ButtonRelease;
- xe.u.u.detail = 2;
- break;
-#endif
-
- case NX_KEYDOWN:
- xe.u.u.type = KeyPress;
- xe.u.u.detail = ev.data.key.keyCode;
- break;
-
- case NX_KEYUP:
- xe.u.u.type = KeyRelease;
- xe.u.u.detail = ev.data.key.keyCode;
- break;
-
- case NX_FLAGSCHANGED:
- xe.u.u.type = kXDarwinUpdateModifiers;
- xe.u.clientMessage.u.l.longs0 = ev.flags;
- break;
-
- case NX_SYSDEFINED:
- if (ev.data.compound.subType == 7) {
- xe.u.u.type = kXDarwinUpdateButtons;
- xe.u.clientMessage.u.l.longs0 =
- ev.data.compound.misc.L[0];
- xe.u.clientMessage.u.l.longs1 =
- ev.data.compound.misc.L[1];
- } else {
- continue;
- }
- break;
-
- case NX_SCROLLWHEELMOVED:
- xe.u.u.type = kXDarwinScrollWheel;
- xe.u.clientMessage.u.s.shorts0 =
- ev.data.scrollWheel.deltaAxis1;
- break;
-
- default:
- continue;
- }
-
- DarwinEQEnqueue(&xe);
- }
- }
-
- return NULL;
-}
-
-
-/*
- * XFIOKitPMThread
- * Handle power state notifications
- */
-static void *XFIOKitPMThread(void *arg)
-{
- ScreenPtr pScreen = (ScreenPtr)arg;
- XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen);
-
- for (;;) {
- mach_msg_return_t kr;
- mach_msg_empty_rcv_t msg;
-
- kr = mach_msg((mach_msg_header_t*) &msg, MACH_RCV_MSG, 0,
- sizeof(msg), pmNotificationPort, 0, MACH_PORT_NULL);
- kern_assert(kr);
-
- // display is powering down
- if (msg.header.msgh_id == 0) {
- IOFBAcknowledgePM( iokitScreen->fbService );
- xf86SetRootClip(pScreen, FALSE);
- }
- // display just woke up
- else if (msg.header.msgh_id == 1) {
- xf86SetRootClip(pScreen, TRUE);
- }
- }
- return NULL;
-}
-
-
-/*
- * SetupFBandHID
- * Setup an IOFramebuffer service and connect the HID system to it.
- */
-static Bool SetupFBandHID(
- int index,
- DarwinFramebufferPtr dfb,
- XFIOKitScreenPtr iokitScreen)
-{
- kern_return_t kr;
- io_service_t service;
- io_connect_t fbService;
- vm_address_t vram;
- vm_size_t shmemSize;
- int i;
- UInt32 numModes;
- IODisplayModeInformation modeInfo;
- IODisplayModeID displayMode, *allModes;
- IOIndex displayDepth;
- IOFramebufferInformation fbInfo;
- IOPixelInformation pixelInfo;
- StdFBShmem_t *cshmem;
-
- // find and open the IOFrameBuffer service
- service = IOIteratorNext(fbIter);
- if (service == 0)
- return FALSE;
-
- kr = IOServiceOpen( service, mach_task_self(),
- kIOFBServerConnectType, &iokitScreen->fbService );
- IOObjectRelease( service );
- if (kr != KERN_SUCCESS) {
- ErrorF("Failed to connect as window server to screen %i.\n", index);
- return FALSE;
- }
- fbService = iokitScreen->fbService;
-
- // create the slice of shared memory containing cursor state data
- kr = IOFBCreateSharedCursor( fbService,
- kIOFBCurrentShmemVersion,
- 32, 32 );
- if (kr != KERN_SUCCESS)
- return FALSE;
-
- // Register for power management events for the framebuffer's device
- kr = IOCreateReceivePort(kOSNotificationMessageID, &pmNotificationPort);
- kern_assert(kr);
- kr = IOConnectSetNotificationPort( fbService, 0,
- pmNotificationPort, 0 );
- if (kr != KERN_SUCCESS) {
- ErrorF("Power management registration failed.\n");
- }
-
- // SET THE SCREEN PARAMETERS
- // get the current screen resolution, refresh rate and depth
- kr = IOFBGetCurrentDisplayModeAndDepth( fbService,
- &displayMode,
- &displayDepth );
- if (kr != KERN_SUCCESS)
- return FALSE;
-
- // use the current screen resolution if the user
- // only wants to change the refresh rate
- if (darwinDesiredRefresh != -1 && darwinDesiredWidth == 0) {
- kr = IOFBGetDisplayModeInformation( fbService,
- displayMode,
- &modeInfo );
- if (kr != KERN_SUCCESS)
- return FALSE;
- darwinDesiredWidth = modeInfo.nominalWidth;
- darwinDesiredHeight = modeInfo.nominalHeight;
- }
-
- // use the current resolution and refresh rate
- // if the user doesn't have a preference
- if (darwinDesiredWidth == 0) {
-
- // change the pixel depth if desired
- if (darwinDesiredDepth != -1) {
- kr = IOFBGetDisplayModeInformation( fbService,
- displayMode,
- &modeInfo );
- if (kr != KERN_SUCCESS)
- return FALSE;
- if (modeInfo.maxDepthIndex < darwinDesiredDepth) {
- ErrorF("Discarding screen %i:\n", index);
- ErrorF("Current screen resolution does not support desired pixel depth.\n");
- return FALSE;
- }
-
- displayDepth = darwinDesiredDepth;
- kr = IOFBSetDisplayModeAndDepth( fbService, displayMode,
- displayDepth );
- if (kr != KERN_SUCCESS)
- return FALSE;
- }
-
- // look for display mode with correct resolution and refresh rate
- } else {
-
- // get an array of all supported display modes
- kr = IOFBGetDisplayModeCount( fbService, &numModes );
- if (kr != KERN_SUCCESS)
- return FALSE;
- assert(allModes = (IODisplayModeID *)
- xalloc( numModes * sizeof(IODisplayModeID) ));
- kr = IOFBGetDisplayModes( fbService, numModes, allModes );
- if (kr != KERN_SUCCESS)
- return FALSE;
-
- for (i = 0; i < numModes; i++) {
- kr = IOFBGetDisplayModeInformation( fbService, allModes[i],
- &modeInfo );
- if (kr != KERN_SUCCESS)
- return FALSE;
-
- if (modeInfo.flags & kDisplayModeValidFlag &&
- modeInfo.nominalWidth == darwinDesiredWidth &&
- modeInfo.nominalHeight == darwinDesiredHeight) {
-
- if (darwinDesiredDepth == -1)
- darwinDesiredDepth = modeInfo.maxDepthIndex;
- if (modeInfo.maxDepthIndex < darwinDesiredDepth) {
- ErrorF("Discarding screen %i:\n", index);
- ErrorF("Desired screen resolution does not support desired pixel depth.\n");
- return FALSE;
- }
-
- if ((darwinDesiredRefresh == -1 ||
- (darwinDesiredRefresh << 16) == modeInfo.refreshRate)) {
- displayMode = allModes[i];
- displayDepth = darwinDesiredDepth;
- kr = IOFBSetDisplayModeAndDepth(fbService,
- displayMode,
- displayDepth);
- if (kr != KERN_SUCCESS)
- return FALSE;
- break;
- }
- }
- }
-
- xfree( allModes );
- if (i >= numModes) {
- ErrorF("Discarding screen %i:\n", index);
- ErrorF("Desired screen resolution or refresh rate is not supported.\n");
- return FALSE;
- }
- }
-
- kr = IOFBGetPixelInformation( fbService, displayMode, displayDepth,
- kIOFBSystemAperture, &pixelInfo );
- if (kr != KERN_SUCCESS)
- return FALSE;
-
-#ifdef __i386__
- /* x86 in 8bit mode currently needs fixed color map... */
- if (pixelInfo.bitsPerComponent == 8 &&
- pixelInfo.componentCount == 1)
- {
- pixelInfo.pixelType = kIOFixedCLUTPixels;
- }
-#endif
-
-#ifdef OLD_POWERBOOK_G3
- if (pixelInfo.pixelType == kIOCLUTPixels)
- pixelInfo.pixelType = kIOFixedCLUTPixels;
-#endif
-
- kr = IOFBGetFramebufferInformationForAperture( fbService,
- kIOFBSystemAperture,
- &fbInfo );
- if (kr != KERN_SUCCESS)
- return FALSE;
-
- // FIXME: 1x1 IOFramebuffers are sometimes used to indicate video
- // outputs without a monitor connected to them. Since IOKit Xinerama
- // does not really work, this often causes problems on PowerBooks.
- // For now we explicitly check and ignore these screens.
- if (fbInfo.activeWidth <= 1 || fbInfo.activeHeight <= 1) {
- ErrorF("Discarding screen %i:\n", index);
- ErrorF("Invalid width or height.\n");
- return FALSE;
- }
-
- kr = IOConnectMapMemory( fbService, kIOFBCursorMemory,
- mach_task_self(), (vm_address_t *) &cshmem,
- &shmemSize, kIOMapAnywhere );
- if (kr != KERN_SUCCESS)
- return FALSE;
- iokitScreen->cursorShmem = cshmem;
-
- kr = IOConnectMapMemory( fbService, kIOFBSystemAperture,
- mach_task_self(), &vram, &shmemSize,
- kIOMapAnywhere );
- if (kr != KERN_SUCCESS)
- return FALSE;
-
- iokitScreen->framebuffer = (void*)vram;
- dfb->x = cshmem->screenBounds.minx;
- dfb->y = cshmem->screenBounds.miny;
- dfb->width = fbInfo.activeWidth;
- dfb->height = fbInfo.activeHeight;
- dfb->pitch = fbInfo.bytesPerRow;
- dfb->bitsPerPixel = fbInfo.bitsPerPixel;
- dfb->colorBitsPerPixel = pixelInfo.componentCount *
- pixelInfo.bitsPerComponent;
- dfb->bitsPerComponent = pixelInfo.bitsPerComponent;
-
- // allocate shadow framebuffer
- iokitScreen->shadowPtr = xalloc(dfb->pitch * dfb->height);
- dfb->framebuffer = iokitScreen->shadowPtr;
-
- // Note: Darwin kIORGBDirectPixels = X TrueColor, not DirectColor
- if (pixelInfo.pixelType == kIORGBDirectPixels) {
- dfb->colorType = TrueColor;
- } else if (pixelInfo.pixelType == kIOCLUTPixels) {
- dfb->colorType = PseudoColor;
- } else if (pixelInfo.pixelType == kIOFixedCLUTPixels) {
- dfb->colorType = StaticColor;
- }
-
- // Inform the HID system that the framebuffer is also connected to it.
- kr = IOConnectAddClient( xfIOKitInputConnect, fbService );
- kern_assert( kr );
-
- // We have to have added at least one screen
- // before we can enable the cursor.
- kr = IOHIDSetCursorEnable(xfIOKitInputConnect, TRUE);
- kern_assert( kr );
-
- return TRUE;
-}
-
-
-/*
- * DarwinModeAddScreen
- * IOKit specific initialization for each screen.
- */
-Bool DarwinModeAddScreen(
- int index,
- ScreenPtr pScreen)
-{
- DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
- XFIOKitScreenPtr iokitScreen;
-
- // allocate space for private per screen storage
- iokitScreen = xalloc(sizeof(XFIOKitScreenRec));
- XFIOKIT_SCREEN_PRIV(pScreen) = iokitScreen;
-
- // setup hardware framebuffer
- iokitScreen->fbService = 0;
- if (! SetupFBandHID(index, dfb, iokitScreen)) {
- if (iokitScreen->fbService) {
- IOServiceClose(iokitScreen->fbService);
- }
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * XFIOKitShadowUpdate
- * Update the damaged regions of the shadow framebuffer on the screen.
- */
-static void XFIOKitShadowUpdate(ScreenPtr pScreen,
- shadowBufPtr pBuf)
-{
- DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
- XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen);
- RegionPtr damage = &pBuf->damage;
- int numBox = REGION_NUM_RECTS(damage);
- BoxPtr pBox = REGION_RECTS(damage);
- int pitch = dfb->pitch;
- int bpp = dfb->bitsPerPixel/8;
-
- // Loop through all the damaged boxes
- while (numBox--) {
- int width, height, offset;
- unsigned char *src, *dst;
-
- width = (pBox->x2 - pBox->x1) * bpp;
- height = pBox->y2 - pBox->y1;
- offset = (pBox->y1 * pitch) + (pBox->x1 * bpp);
- src = iokitScreen->shadowPtr + offset;
- dst = iokitScreen->framebuffer + offset;
-
- while (height--) {
- memcpy(dst, src, width);
- dst += pitch;
- src += pitch;
- }
-
- // Get the next box
- pBox++;
- }
-}
-
-
-/*
- * DarwinModeSetupScreen
- * Finalize IOKit specific initialization of each screen.
- */
-Bool DarwinModeSetupScreen(
- int index,
- ScreenPtr pScreen)
-{
- DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
- pthread_t pmThread;
-
- // initalize cursor support
- if (! XFIOKitInitCursor(pScreen)) {
- return FALSE;
- }
-
- // initialize shadow framebuffer support
- if (! shadowInit(pScreen, XFIOKitShadowUpdate, NULL)) {
- ErrorF("Failed to initalize shadow framebuffer for screen %i.\n",
- index);
- return FALSE;
- }
-
- // initialize colormap handling as needed
- if (dfb->colorType == PseudoColor) {
- pScreen->StoreColors = XFIOKitStoreColors;
- }
-
- // initialize power manager handling
- pthread_create( &pmThread, NULL, XFIOKitPMThread,
- (void *) pScreen );
-
- return TRUE;
-}
-
-
-/*
- * DarwinModeInitOutput
- * One-time initialization of IOKit output support.
- */
-void DarwinModeInitOutput(
- int argc,
- char **argv)
-{
- static unsigned long generation = 0;
- kern_return_t kr;
- io_iterator_t iter;
- io_service_t service;
- vm_address_t shmem;
- vm_size_t shmemSize;
-
- ErrorF("Display mode: IOKit\n");
-
- // Allocate private storage for each screen's IOKit specific info
- if (generation != serverGeneration) {
- xfIOKitScreenIndex = AllocateScreenPrivateIndex();
- generation = serverGeneration;
- }
-
- kr = IOMasterPort(bootstrap_port, &masterPort);
- kern_assert( kr );
-
- // Find and open the HID System Service
- // Do this now to be sure the Mac OS X window server is not running.
- kr = IOServiceGetMatchingServices( masterPort,
- IOServiceMatching( kIOHIDSystemClass ),
- &iter );
- kern_assert( kr );
-
- assert( service = IOIteratorNext( iter ) );
-
- kr = IOServiceOpen( service, mach_task_self(), kIOHIDServerConnectType,
- &xfIOKitInputConnect );
- if (kr != KERN_SUCCESS) {
- ErrorF("Failed to connect to the HID System as the window server!\n");
-#ifdef DARWIN_WITH_QUARTZ
- FatalError("Quit the Mac OS X window server or use the -quartz option.\n");
-#else
- FatalError("Make sure you have quit the Mac OS X window server.\n");
-#endif
- }
-
- IOObjectRelease( service );
- IOObjectRelease( iter );
-
- // Setup the event queue in memory shared by the kernel and X server
- kr = IOHIDCreateSharedMemory( xfIOKitInputConnect,
- kIOHIDCurrentShmemVersion );
- kern_assert( kr );
-
- kr = IOConnectMapMemory( xfIOKitInputConnect, kIOHIDGlobalMemory,
- mach_task_self(), &shmem, &shmemSize,
- kIOMapAnywhere );
- kern_assert( kr );
-
- evg = (EvGlobals *)(shmem + ((EvOffsets *)shmem)->evGlobalsOffset);
-
- assert(sizeof(EvGlobals) == evg->structSize);
-
- NotificationPortRef = IONotificationPortCreate( masterPort );
-
- notificationPort = IONotificationPortGetMachPort(NotificationPortRef);
-
- kr = IOConnectSetNotificationPort( xfIOKitInputConnect,
- kIOHIDEventNotification,
- notificationPort, 0 );
- kern_assert( kr );
-
- evg->movedMask |= NX_MOUSEMOVEDMASK;
-
- // find number of framebuffers
- kr = IOServiceGetMatchingServices( masterPort,
- IOServiceMatching( IOFRAMEBUFFER_CONFORMSTO ),
- &fbIter );
- kern_assert( kr );
-
- darwinScreensFound = 0;
- while ((service = IOIteratorNext(fbIter))) {
- IOObjectRelease( service );
- darwinScreensFound++;
- }
- IOIteratorReset(fbIter);
-}
-
-
-/*
- * DarwinModeInitInput
- * One-time initialization of IOKit input support.
- */
-void DarwinModeInitInput(
- int argc,
- char **argv)
-{
- kern_return_t kr;
- int fd[2];
-
- kr = IOHIDSetEventsEnable(xfIOKitInputConnect, TRUE);
- kern_assert( kr );
-
- // Start event passing thread
- assert( pipe(fd) == 0 );
- darwinEventReadFD = fd[0];
- darwinEventWriteFD = fd[1];
- fcntl(darwinEventReadFD, F_SETFL, O_NONBLOCK);
- pthread_create(&inputThread, NULL,
- XFIOKitHIDThread, NULL);
-
-}
-
-
-/*
- * DarwinModeProcessEvent
- * Process IOKit specific events.
- */
-void DarwinModeProcessEvent(
- xEvent *xe)
-{
- // No mode specific events
- ErrorF("Unknown X event caught: %d\n", xe->u.u.type);
-}
diff --git a/hw/darwin/iokit/xfIOKit.h b/hw/darwin/iokit/xfIOKit.h
deleted file mode 100644
index 27d27bc70..000000000
--- a/hw/darwin/iokit/xfIOKit.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- xfIOKit.h
-
- IOKit specific functions and definitions
-*/
-/*
- * Copyright (c) 2001-2002 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 _XFIOKIT_H
-#define _XFIOKIT_H
-
-#include <pthread.h>
-#include <IOKit/graphics/IOFramebufferShared.h>
-#include <X11/Xproto.h>
-#include "screenint.h"
-#include "darwin.h"
-
-typedef struct {
- io_connect_t fbService;
- StdFBShmem_t *cursorShmem;
- unsigned char *framebuffer;
- unsigned char *shadowPtr;
-} XFIOKitScreenRec, *XFIOKitScreenPtr;
-
-#define XFIOKIT_SCREEN_PRIV(pScreen) \
- ((XFIOKitScreenPtr)pScreen->devPrivates[xfIOKitScreenIndex].ptr)
-
-extern int xfIOKitScreenIndex; // index into pScreen.devPrivates
-extern io_connect_t xfIOKitInputConnect;
-
-Bool XFIOKitInitCursor(ScreenPtr pScreen);
-
-#endif /* _XFIOKIT_H */
diff --git a/hw/darwin/iokit/xfIOKitCursor.c b/hw/darwin/iokit/xfIOKitCursor.c
deleted file mode 100644
index ef3e254d7..000000000
--- a/hw/darwin/iokit/xfIOKitCursor.c
+++ /dev/null
@@ -1,734 +0,0 @@
-/**************************************************************
- *
- * Cursor support for Darwin X Server
- *
- * Three different cursor modes are possible:
- * X (0) - tracking via Darwin kernel,
- * display via X machine independent
- * Kernel (1) - tracking and display via Darwin kernel
- * (not currently supported)
- * Hardware (2) - tracking and display via hardware
- *
- * The X software cursor uses the Darwin software cursor
- * routines in IOFramebuffer.cpp to track the cursor, but
- * displays the cursor image using the X machine
- * independent display cursor routines in midispcur.c.
- *
- * The kernel cursor uses IOFramebuffer.cpp routines to
- * track and display the cursor. This gives better
- * performance as the display calls don't have to cross
- * the kernel boundary. Unfortunately, this mode has
- * synchronization issues with the user land X server
- * and isn't currently used.
- *
- * Hardware cursor support lets the hardware handle these
- * details.
- *
- * Kernel and hardware cursor mode only work for cursors
- * up to a certain size, currently 16x16 pixels. If a
- * bigger cursor is set, we fallback to X cursor mode.
- *
- * HISTORY:
- * 1.0 by Torrey T. Lyons, October 30, 2000
- *
- **************************************************************/
-/*
- * Copyright (c) 2001-2002 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.
- */
-
-#include "scrnintstr.h"
-#include "cursorstr.h"
-#include "mipointrst.h"
-#include "micmap.h"
-#define NO_CFPLUGIN
-#include <IOKit/graphics/IOGraphicsLib.h>
-#include <IOKit/hidsystem/IOHIDLib.h>
-#include "darwin.h"
-#include "xfIOKit.h"
-
-#define DUMP_DARWIN_CURSOR FALSE
-
-#define CURSOR_PRIV(pScreen) \
- ((XFIOKitCursorScreenPtr)pScreen->devPrivates[darwinCursorScreenIndex].ptr)
-
-// The cursors format are documented in IOFramebufferShared.h.
-#define RGBto34WithGamma(red, green, blue) \
- ( 0x000F \
- | (((red) & 0xF) << 12) \
- | (((green) & 0xF) << 8) \
- | (((blue) & 0xF) << 4) )
-#define RGBto38WithGamma(red, green, blue) \
- ( 0xFF << 24 \
- | (((red) & 0xFF) << 16) \
- | (((green) & 0xFF) << 8) \
- | (((blue) & 0xFF)) )
-#define HighBitOf32 0x80000000
-
-typedef struct {
- Bool canHWCursor;
- short cursorMode;
- RecolorCursorProcPtr RecolorCursor;
- InstallColormapProcPtr InstallColormap;
- QueryBestSizeProcPtr QueryBestSize;
- miPointerSpriteFuncPtr spriteFuncs;
- ColormapPtr pInstalledMap;
-} XFIOKitCursorScreenRec, *XFIOKitCursorScreenPtr;
-
-static int darwinCursorScreenIndex = -1;
-static unsigned long darwinCursorGeneration = 0;
-
-/*
-===========================================================================
-
- Pointer sprite functions
-
-===========================================================================
-*/
-
-/*
- Realizing the Darwin hardware cursor (ie. converting from the
- X representation to the IOKit representation) is complicated
- by the fact that we have three different potential cursor
- formats to go to, one for each bit depth (8, 15, or 24).
- The IOKit formats are documented in IOFramebufferShared.h.
- X cursors are represented as two pieces, a source and a mask.
- The mask is a bitmap indicating which parts of the cursor are
- transparent and which parts are drawn. The source is a bitmap
- indicating which parts of the non-transparent portion of the the
- cursor should be painted in the foreground color and which should
- be painted in the background color. The bitmaps are given in
- 32-bit format with least significant byte and bit first.
- (This is opposite PowerPC Darwin.)
-*/
-
-typedef struct {
- unsigned char image[CURSORWIDTH*CURSORHEIGHT];
- unsigned char mask[CURSORWIDTH*CURSORHEIGHT];
-} cursorPrivRec, *cursorPrivPtr;
-
-/*
- * XFIOKitRealizeCursor8
- * Convert the X cursor representation to an 8-bit depth
- * format for Darwin. This function assumes the maximum cursor
- * width is a multiple of 8.
- */
-static Bool
-XFIOKitRealizeCursor8(
- ScreenPtr pScreen,
- CursorPtr pCursor)
-{
- cursorPrivPtr newCursor;
- unsigned char *newSourceP, *newMaskP;
- CARD32 *oldSourceP, *oldMaskP;
- xColorItem fgColor, bgColor;
- int index, x, y, rowPad;
- int cursorWidth, cursorHeight;
- ColormapPtr pmap;
-
- // check cursor size just to be sure
- cursorWidth = pCursor->bits->width;
- cursorHeight = pCursor->bits->height;
- if (cursorHeight > CURSORHEIGHT || cursorWidth > CURSORWIDTH)
- return FALSE;
-
- // get cursor colors in colormap
- index = pScreen->myNum;
- pmap = miInstalledMaps[index];
- if (!pmap) return FALSE;
-
- fgColor.red = pCursor->foreRed;
- fgColor.green = pCursor->foreGreen;
- fgColor.blue = pCursor->foreBlue;
- FakeAllocColor(pmap, &fgColor);
- bgColor.red = pCursor->backRed;
- bgColor.green = pCursor->backGreen;
- bgColor.blue = pCursor->backBlue;
- FakeAllocColor(pmap, &bgColor);
- FakeFreeColor(pmap, fgColor.pixel);
- FakeFreeColor(pmap, bgColor.pixel);
-
- // allocate memory for new cursor image
- newCursor = xalloc( sizeof(cursorPrivRec) );
- if (!newCursor)
- return FALSE;
- memset( newCursor->image, pScreen->blackPixel, CURSORWIDTH*CURSORHEIGHT );
- memset( newCursor->mask, 0, CURSORWIDTH*CURSORHEIGHT );
-
- // convert to 8-bit Darwin cursor format
- oldSourceP = (CARD32 *) pCursor->bits->source;
- oldMaskP = (CARD32 *) pCursor->bits->mask;
- newSourceP = newCursor->image;
- newMaskP = newCursor->mask;
- rowPad = CURSORWIDTH - cursorWidth;
-
- for (y = 0; y < cursorHeight; y++) {
- for (x = 0; x < cursorWidth; x++) {
- if (*oldSourceP & (HighBitOf32 >> x))
- *newSourceP = fgColor.pixel;
- else
- *newSourceP = bgColor.pixel;
- if (*oldMaskP & (HighBitOf32 >> x))
- *newMaskP = 255;
- else
- *newSourceP = pScreen->blackPixel;
- newSourceP++; newMaskP++;
- }
- oldSourceP++; oldMaskP++;
- newSourceP += rowPad; newMaskP += rowPad;
- }
-
- // save the result
- pCursor->devPriv[pScreen->myNum] = (pointer) newCursor;
- return TRUE;
-}
-
-
-/*
- * XFIOKitRealizeCursor15
- * Convert the X cursor representation to an 15-bit depth
- * format for Darwin.
- */
-static Bool
-XFIOKitRealizeCursor15(
- ScreenPtr pScreen,
- CursorPtr pCursor)
-{
- unsigned short *newCursor;
- unsigned short fgPixel, bgPixel;
- unsigned short *newSourceP;
- CARD32 *oldSourceP, *oldMaskP;
- int x, y, rowPad;
- int cursorWidth, cursorHeight;
-
- // check cursor size just to be sure
- cursorWidth = pCursor->bits->width;
- cursorHeight = pCursor->bits->height;
- if (cursorHeight > CURSORHEIGHT || cursorWidth > CURSORWIDTH)
- return FALSE;
-
- // allocate memory for new cursor image
- newCursor = xalloc( CURSORWIDTH*CURSORHEIGHT*sizeof(short) );
- if (!newCursor)
- return FALSE;
- memset( newCursor, 0, CURSORWIDTH*CURSORHEIGHT*sizeof(short) );
-
- // calculate pixel values
- fgPixel = RGBto34WithGamma( pCursor->foreRed, pCursor->foreGreen,
- pCursor->foreBlue );
- bgPixel = RGBto34WithGamma( pCursor->backRed, pCursor->backGreen,
- pCursor->backBlue );
-
- // convert to 15-bit Darwin cursor format
- oldSourceP = (CARD32 *) pCursor->bits->source;
- oldMaskP = (CARD32 *) pCursor->bits->mask;
- newSourceP = newCursor;
- rowPad = CURSORWIDTH - cursorWidth;
-
- for (y = 0; y < cursorHeight; y++) {
- for (x = 0; x < cursorWidth; x++) {
- if (*oldMaskP & (HighBitOf32 >> x)) {
- if (*oldSourceP & (HighBitOf32 >> x))
- *newSourceP = fgPixel;
- else
- *newSourceP = bgPixel;
- } else {
- *newSourceP = 0;
- }
- newSourceP++;
- }
- oldSourceP++; oldMaskP++;
- newSourceP += rowPad;
- }
-
-#if DUMP_DARWIN_CURSOR
- // Write out the cursor
- ErrorF("Cursor: 0x%x\n", pCursor);
- ErrorF("Width = %i, Height = %i, RowPad = %i\n", cursorWidth,
- cursorHeight, rowPad);
- for (y = 0; y < cursorHeight; y++) {
- newSourceP = newCursor + y*CURSORWIDTH;
- for (x = 0; x < cursorWidth; x++) {
- if (*newSourceP == fgPixel)
- ErrorF("x");
- else if (*newSourceP == bgPixel)
- ErrorF("o");
- else
- ErrorF(" ");
- newSourceP++;
- }
- ErrorF("\n");
- }
-#endif
-
- // save the result
- pCursor->devPriv[pScreen->myNum] = (pointer) newCursor;
- return TRUE;
-}
-
-
-/*
- * XFIOKitRealizeCursor24
- * Convert the X cursor representation to an 24-bit depth
- * format for Darwin. This function assumes the maximum cursor
- * width is a multiple of 8.
- */
-static Bool
-XFIOKitRealizeCursor24(
- ScreenPtr pScreen,
- CursorPtr pCursor)
-{
- unsigned int *newCursor;
- unsigned int fgPixel, bgPixel;
- unsigned int *newSourceP;
- CARD32 *oldSourceP, *oldMaskP;
- int x, y, rowPad;
- int cursorWidth, cursorHeight;
-
- // check cursor size just to be sure
- cursorWidth = pCursor->bits->width;
- cursorHeight = pCursor->bits->height;
- if (cursorHeight > CURSORHEIGHT || cursorWidth > CURSORWIDTH)
- return FALSE;
-
- // allocate memory for new cursor image
- newCursor = xalloc( CURSORWIDTH*CURSORHEIGHT*sizeof(int) );
- if (!newCursor)
- return FALSE;
- memset( newCursor, 0, CURSORWIDTH*CURSORHEIGHT*sizeof(int) );
-
- // calculate pixel values
- fgPixel = RGBto38WithGamma( pCursor->foreRed, pCursor->foreGreen,
- pCursor->foreBlue );
- bgPixel = RGBto38WithGamma( pCursor->backRed, pCursor->backGreen,
- pCursor->backBlue );
-
- // convert to 24-bit Darwin cursor format
- oldSourceP = (CARD32 *) pCursor->bits->source;
- oldMaskP = (CARD32 *) pCursor->bits->mask;
- newSourceP = newCursor;
- rowPad = CURSORWIDTH - cursorWidth;
-
- for (y = 0; y < cursorHeight; y++) {
- for (x = 0; x < cursorWidth; x++) {
- if (*oldMaskP & (HighBitOf32 >> x)) {
- if (*oldSourceP & (HighBitOf32 >> x))
- *newSourceP = fgPixel;
- else
- *newSourceP = bgPixel;
- } else {
- *newSourceP = 0;
- }
- newSourceP++;
- }
- oldSourceP++; oldMaskP++;
- newSourceP += rowPad;
- }
-
-#if DUMP_DARWIN_CURSOR
- // Write out the cursor
- ErrorF("Cursor: 0x%x\n", pCursor);
- ErrorF("Width = %i, Height = %i, RowPad = %i\n", cursorWidth,
- cursorHeight, rowPad);
- for (y = 0; y < cursorHeight; y++) {
- newSourceP = newCursor + y*CURSORWIDTH;
- for (x = 0; x < cursorWidth; x++) {
- if (*newSourceP == fgPixel)
- ErrorF("x");
- else if (*newSourceP == bgPixel)
- ErrorF("o");
- else
- ErrorF(" ");
- newSourceP++;
- }
- ErrorF("\n");
- }
-#endif
-
- // save the result
- pCursor->devPriv[pScreen->myNum] = (pointer) newCursor;
- return TRUE;
-}
-
-
-/*
- * XFIOKitRealizeCursor
- *
- */
-static Bool
-XFIOKitRealizeCursor(
- ScreenPtr pScreen,
- CursorPtr pCursor)
-{
- Bool result;
- XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
- DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
-
- if ((pCursor->bits->height > CURSORHEIGHT) ||
- (pCursor->bits->width > CURSORWIDTH) ||
- // FIXME: this condition is not needed after kernel cursor works
- !ScreenPriv->canHWCursor) {
- result = (*ScreenPriv->spriteFuncs->RealizeCursor)(pScreen, pCursor);
- } else if (dfb->bitsPerPixel == 8) {
- result = XFIOKitRealizeCursor8(pScreen, pCursor);
- } else if (dfb->bitsPerPixel == 16) {
- result = XFIOKitRealizeCursor15(pScreen, pCursor);
- } else {
- result = XFIOKitRealizeCursor24(pScreen, pCursor);
- }
-
- return result;
-}
-
-
-/*
- * XFIOKitUnrealizeCursor
- *
- */
-static Bool
-XFIOKitUnrealizeCursor(
- ScreenPtr pScreen,
- CursorPtr pCursor)
-{
- Bool result;
- XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- if ((pCursor->bits->height > CURSORHEIGHT) ||
- (pCursor->bits->width > CURSORWIDTH) ||
- // FIXME: this condition is not needed after kernel cursor works
- !ScreenPriv->canHWCursor) {
- result = (*ScreenPriv->spriteFuncs->UnrealizeCursor)(pScreen, pCursor);
- } else {
- xfree( pCursor->devPriv[pScreen->myNum] );
- result = TRUE;
- }
-
- return result;
-}
-
-
-/*
- * XFIOKitSetCursor
- * Set the cursor sprite and position
- * Use hardware cursor if possible
- */
-static void
-XFIOKitSetCursor(
- ScreenPtr pScreen,
- CursorPtr pCursor,
- int x,
- int y)
-{
- kern_return_t kr;
- DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
- XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen);
- StdFBShmem_t *cshmem = iokitScreen->cursorShmem;
- XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- // are we supposed to remove the cursor?
- if (!pCursor) {
- if (ScreenPriv->cursorMode == 0)
- (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y);
- else {
- if (!cshmem->cursorShow) {
- cshmem->cursorShow++;
- if (cshmem->hardwareCursorActive) {
- kr = IOFBSetCursorVisible(iokitScreen->fbService, FALSE);
- kern_assert( kr );
- }
- }
- }
- return;
- }
-
- // can we use the kernel or hardware cursor?
- if ((pCursor->bits->height <= CURSORHEIGHT) &&
- (pCursor->bits->width <= CURSORWIDTH) &&
- // FIXME: condition not needed when kernel cursor works
- ScreenPriv->canHWCursor) {
-
- if (ScreenPriv->cursorMode == 0) // remove the X cursor
- (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y);
- ScreenPriv->cursorMode = 1; // kernel cursor
-
- // change the cursor image in shared memory
- if (dfb->bitsPerPixel == 8) {
- cursorPrivPtr newCursor =
- (cursorPrivPtr) pCursor->devPriv[pScreen->myNum];
- memcpy(cshmem->cursor.bw8.image[0], newCursor->image,
- CURSORWIDTH*CURSORHEIGHT);
- memcpy(cshmem->cursor.bw8.mask[0], newCursor->mask,
- CURSORWIDTH*CURSORHEIGHT);
- } else if (dfb->bitsPerPixel == 16) {
- unsigned short *newCursor =
- (unsigned short *) pCursor->devPriv[pScreen->myNum];
- memcpy(cshmem->cursor.rgb.image[0], newCursor,
- 2*CURSORWIDTH*CURSORHEIGHT);
- } else {
- unsigned int *newCursor =
- (unsigned int *) pCursor->devPriv[pScreen->myNum];
- memcpy(cshmem->cursor.rgb24.image[0], newCursor,
- 4*CURSORWIDTH*CURSORHEIGHT);
- }
-
- // FIXME: We always use a full size cursor, even if the image
- // is smaller because I couldn't get the padding to come out
- // right otherwise.
- cshmem->cursorSize[0].width = CURSORWIDTH;
- cshmem->cursorSize[0].height = CURSORHEIGHT;
- cshmem->hotSpot[0].x = pCursor->bits->xhot;
- cshmem->hotSpot[0].y = pCursor->bits->yhot;
-
- // try to use a hardware cursor
- if (ScreenPriv->canHWCursor) {
- kr = IOFBSetNewCursor(iokitScreen->fbService, 0, 0, 0);
- // FIXME: this is a fatal error without the kernel cursor
- kern_assert( kr );
-#if 0
- if (kr != KERN_SUCCESS) {
- ErrorF("Could not set new cursor with kernel return 0x%x.\n", kr);
- ScreenPriv->canHWCursor = FALSE;
- }
-#endif
- }
-
- // make the new cursor visible
- if (cshmem->cursorShow)
- cshmem->cursorShow--;
-
- if (!cshmem->cursorShow && ScreenPriv->canHWCursor) {
- kr = IOFBSetCursorVisible(iokitScreen->fbService, TRUE);
- // FIXME: this is a fatal error without the kernel cursor
- kern_assert( kr );
-#if 0
- if (kr != KERN_SUCCESS) {
- ErrorF("Couldn't set hardware cursor visible with kernel return 0x%x.\n", kr);
- ScreenPriv->canHWCursor = FALSE;
- } else
-#endif
- ScreenPriv->cursorMode = 2; // hardware cursor
- }
-
- return;
- }
-
- // otherwise we use a software cursor
- if (ScreenPriv->cursorMode) {
- /* remove the kernel or hardware cursor */
- XFIOKitSetCursor(pScreen, 0, x, y);
- }
-
- ScreenPriv->cursorMode = 0;
- (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, pCursor, x, y);
-}
-
-
-/*
- * XFIOKitMoveCursor
- * Move the cursor. This is a noop for a kernel or hardware cursor.
- */
-static void
-XFIOKitMoveCursor(
- ScreenPtr pScreen,
- int x,
- int y)
-{
- XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- // only the X cursor needs to be explicitly moved
- if (!ScreenPriv->cursorMode)
- (*ScreenPriv->spriteFuncs->MoveCursor)(pScreen, x, y);
-}
-
-static miPointerSpriteFuncRec darwinSpriteFuncsRec = {
- XFIOKitRealizeCursor,
- XFIOKitUnrealizeCursor,
- XFIOKitSetCursor,
- XFIOKitMoveCursor
-};
-
-
-/*
-===========================================================================
-
- Pointer screen functions
-
-===========================================================================
-*/
-
-/*
- * XFIOKitCursorOffScreen
- */
-static Bool XFIOKitCursorOffScreen(ScreenPtr *pScreen, int *x, int *y)
-{ return FALSE;
-}
-
-
-/*
- * XFIOKitCrossScreen
- */
-static void XFIOKitCrossScreen(ScreenPtr pScreen, Bool entering)
-{ return;
-}
-
-
-/*
- * XFIOKitWarpCursor
- * Change the cursor position without generating an event or motion history
- */
-static void
-XFIOKitWarpCursor(
- ScreenPtr pScreen,
- int x,
- int y)
-{
- kern_return_t kr;
-
- kr = IOHIDSetMouseLocation( xfIOKitInputConnect, x, y );
- if (kr != KERN_SUCCESS) {
- ErrorF("Could not set cursor position with kernel return 0x%x.\n", kr);
- }
- miPointerWarpCursor(pScreen, x, y);
-}
-
-static miPointerScreenFuncRec darwinScreenFuncsRec = {
- XFIOKitCursorOffScreen,
- XFIOKitCrossScreen,
- XFIOKitWarpCursor,
- DarwinEQPointerPost,
- DarwinEQSwitchScreen
-};
-
-
-/*
-===========================================================================
-
- Other screen functions
-
-===========================================================================
-*/
-
-/*
- * XFIOKitCursorQueryBestSize
- * Handle queries for best cursor size
- */
-static void
-XFIOKitCursorQueryBestSize(
- int class,
- unsigned short *width,
- unsigned short *height,
- ScreenPtr pScreen)
-{
- XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
-
- if (class == CursorShape) {
- *width = CURSORWIDTH;
- *height = CURSORHEIGHT;
- } else
- (*ScreenPriv->QueryBestSize)(class, width, height, pScreen);
-}
-
-
-/*
- * XFIOKitInitCursor
- * Initialize cursor support
- */
-Bool
-XFIOKitInitCursor(
- ScreenPtr pScreen)
-{
- XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen);
- XFIOKitCursorScreenPtr ScreenPriv;
- miPointerScreenPtr PointPriv;
- kern_return_t kr;
-
- // start with no cursor displayed
- if (!iokitScreen->cursorShmem->cursorShow++) {
- if (iokitScreen->cursorShmem->hardwareCursorActive) {
- kr = IOFBSetCursorVisible(iokitScreen->fbService, FALSE);
- kern_assert( kr );
- }
- }
-
- // initialize software cursor handling (always needed as backup)
- if (!miDCInitialize(pScreen, &darwinScreenFuncsRec)) {
- return FALSE;
- }
-
- // allocate private storage for this screen's hardware cursor info
- if (darwinCursorGeneration != serverGeneration) {
- if ((darwinCursorScreenIndex = AllocateScreenPrivateIndex()) < 0)
- return FALSE;
- darwinCursorGeneration = serverGeneration;
- }
-
- ScreenPriv = xcalloc( 1, sizeof(XFIOKitCursorScreenRec) );
- if (!ScreenPriv) return FALSE;
-
- pScreen->devPrivates[darwinCursorScreenIndex].ptr = (pointer) ScreenPriv;
-
- // check if a hardware cursor is supported
- if (!iokitScreen->cursorShmem->hardwareCursorCapable) {
- ScreenPriv->canHWCursor = FALSE;
- ErrorF("Hardware cursor not supported.\n");
- } else {
- // we need to make sure that the hardware cursor really works
- ScreenPriv->canHWCursor = TRUE;
- kr = IOFBSetNewCursor(iokitScreen->fbService, 0, 0, 0);
- if (kr != KERN_SUCCESS) {
- ErrorF("Could not set hardware cursor with kernel return 0x%x.\n", kr);
- ScreenPriv->canHWCursor = FALSE;
- }
- kr = IOFBSetCursorVisible(iokitScreen->fbService, TRUE);
- if (kr != KERN_SUCCESS) {
- ErrorF("Couldn't set hardware cursor visible with kernel return 0x%x.\n", kr);
- ScreenPriv->canHWCursor = FALSE;
- }
- IOFBSetCursorVisible(iokitScreen->fbService, FALSE);
- }
-
- ScreenPriv->cursorMode = 0;
- ScreenPriv->pInstalledMap = NULL;
-
- // override some screen procedures
- ScreenPriv->QueryBestSize = pScreen->QueryBestSize;
- pScreen->QueryBestSize = XFIOKitCursorQueryBestSize;
-// ScreenPriv->ConstrainCursor = pScreen->ConstrainCursor;
-// pScreen->ConstrainCursor = XFIOKitConstrainCursor;
-
- // initialize hardware cursor handling
- PointPriv = (miPointerScreenPtr)
- pScreen->devPrivates[miPointerScreenIndex].ptr;
-
- ScreenPriv->spriteFuncs = PointPriv->spriteFuncs;
- PointPriv->spriteFuncs = &darwinSpriteFuncsRec;
-
- /* Other routines that might be overridden */
-/*
- CursorLimitsProcPtr CursorLimits;
- RecolorCursorProcPtr RecolorCursor;
-*/
-
- return TRUE;
-}
diff --git a/hw/darwin/iokit/xfIOKitStartup.c b/hw/darwin/iokit/xfIOKitStartup.c
deleted file mode 100644
index 512793aa5..000000000
--- a/hw/darwin/iokit/xfIOKitStartup.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/**************************************************************
- *
- * Startup code for the IOKit Darwin X Server
- *
- **************************************************************/
-/*
- * Copyright (c) 2001-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.
- */
-
-#include "darwin.h"
-#include "darwinKeyboard.h"
-#include "micmap.h"
-
-void GlxExtensionInit(void);
-void GlxWrapInitVisuals(miInitVisualsProcPtr *procPtr);
-
-
-/*
- * DarwinHandleGUI
- * This function is called first from main().
- * It does nothing for the IOKit X server.
- */
-void DarwinHandleGUI(
- int argc,
- char *argv[],
- char *envp[] )
-{
-}
-
-
-/*
- * DarwinGlxExtensionInit
- * Initialize the GLX extension.
- * Mesa is linked into the IOKit mode X server so we just call directly.
- */
-void DarwinGlxExtensionInit(void)
-{
- GlxExtensionInit();
-}
-
-
-/*
- * DarwinGlxWrapInitVisuals
- */
-void DarwinGlxWrapInitVisuals(
- miInitVisualsProcPtr *procPtr)
-{
- GlxWrapInitVisuals(procPtr);
-}
-
-
-/*
- * DarwinModeProcessArgument
- * Process IOKit specific command line arguments.
- */
-int DarwinModeProcessArgument(
- int argc,
- char *argv[],
- int i)
-{
-#ifdef DARWIN_WITH_QUARTZ
- // XDarwinStartup uses these arguments to indicate which X server
- // should be started. Ignore them here.
- if (!strcmp( argv[i], "-fullscreen" ) ||
- !strcmp( argv[i], "-rootless" ) ||
- !strcmp( argv[i], "-quartz" ))
- {
- return 1;
- }
-#else
- if (!strcmp( argv[i], "-fullscreen" ) ||
- !strcmp( argv[i], "-rootless" ) ||
- !strcmp( argv[i], "-quartz" ))
- {
- FatalError("Command line option %s is not available without Quartz "
- "support.\n", argv[i]);
- }
-#endif
-
- return 0;
-}
-
-
-/*
- * DarwinModeSystemKeymapSeed
- * Changes to NXKeyMapping are not tracked.
- */
-unsigned int
-DarwinModeSystemKeymapSeed(void)
-{
- return 0;
-}
-
-
-/*
- * DarwinModeReadSystemKeymap
- * IOKit has no alternative to NXKeyMapping API.
- */
-Bool DarwinModeReadSystemKeymap(
- darwinKeyboardInfo *info)
-{
- return FALSE;
-}
diff --git a/hw/darwin/quartz/Preferences.h b/hw/darwin/quartz/Preferences.h
deleted file mode 100644
index cf43758e7..000000000
--- a/hw/darwin/quartz/Preferences.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 2002-2003 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.
- */
-
-#import <Cocoa/Cocoa.h>
-
-@interface Preferences : NSObject
-{
- IBOutlet NSPanel *window;
- IBOutlet id displayField;
- IBOutlet id dockSwitchButton;
- IBOutlet id fakeButton;
- IBOutlet id button2ModifiersMatrix;
- IBOutlet id button3ModifiersMatrix;
- IBOutlet id switchKeyButton;
- IBOutlet id keymapFileField;
- IBOutlet id modeMatrix;
- IBOutlet id modeWindowButton;
- IBOutlet id startupHelpButton;
- IBOutlet id systemBeepButton;
- IBOutlet id mouseAccelChangeButton;
- IBOutlet id useXineramaButton;
- IBOutlet id addToPathButton;
- IBOutlet id addToPathField;
- IBOutlet id useDefaultShellMatrix;
- IBOutlet id useOtherShellField;
- IBOutlet id depthButton;
-
- BOOL isGettingKeyCode;
- int keyCode;
- int modifiers;
- NSMutableString *switchString;
-}
-
-- (IBAction)close:(id)sender;
-- (IBAction)pickFile:(id)sender;
-- (IBAction)saveChanges:(id)sender;
-- (IBAction)setKey:(id)sender;
-
-- (BOOL)sendEvent:(NSEvent *)anEvent;
-
-- (void)awakeFromNib;
-- (void)windowWillClose:(NSNotification *)aNotification;
-
-+ (void)setUseKeymapFile:(BOOL)newUseKeymapFile;
-+ (void)setKeymapFile:(NSString *)newFile;
-+ (void)setSwitchString:(NSString *)newString;
-+ (void)setKeyCode:(int)newKeyCode;
-+ (void)setModifiers:(int)newModifiers;
-+ (void)setDisplay:(int)newDisplay;
-+ (void)setDockSwitch:(BOOL)newDockSwitch;
-+ (void)setFakeButtons:(BOOL)newFakeButtons;
-+ (void)setButton2Mask:(int)newFakeMask;
-+ (void)setButton3Mask:(int)newFakeMask;
-+ (void)setMouseAccelChange:(BOOL)newMouseAccelChange;
-+ (void)setUseQDCursor:(int)newUseQDCursor;
-+ (void)setRootless:(BOOL)newRootless;
-+ (void)setUseAGL:(BOOL)newUseAGL;
-+ (void)setModeWindow:(BOOL)newModeWindow;
-+ (void)setStartupHelp:(BOOL)newStartupHelp;
-+ (void)setSystemBeep:(BOOL)newSystemBeep;
-+ (void)setEnableKeyEquivalents:(BOOL)newKeyEquivs;
-+ (void)setXinerama:(BOOL)newXinerama;
-+ (void)setAddToPath:(BOOL)newAddToPath;
-+ (void)setAddToPathString:(NSString *)newAddToPathString;
-+ (void)setUseDefaultShell:(BOOL)newUseDefaultShell;
-+ (void)setShellString:(NSString *)newShellString;
-+ (void)setDepth:(int)newDepth;
-+ (void)setDisplayModeBundles:(NSArray *)newBundles;
-+ (void)saveToDisk;
-
-+ (BOOL)useKeymapFile;
-+ (NSString *)keymapFile;
-+ (NSString *)switchString;
-+ (unsigned int)keyCode;
-+ (unsigned int)modifiers;
-+ (int)display;
-+ (BOOL)dockSwitch;
-+ (BOOL)fakeButtons;
-+ (int)button2Mask;
-+ (int)button3Mask;
-+ (BOOL)mouseAccelChange;
-+ (int)useQDCursor;
-+ (BOOL)rootless;
-+ (BOOL)useAGL;
-+ (BOOL)modeWindow;
-+ (BOOL)startupHelp;
-+ (BOOL)systemBeep;
-+ (BOOL)enableKeyEquivalents;
-+ (BOOL)xinerama;
-+ (BOOL)addToPath;
-+ (NSString *)addToPathString;
-+ (BOOL)useDefaultShell;
-+ (NSString *)shellString;
-+ (int)depth;
-+ (NSArray *)displayModeBundles;
-
-@end
-
-// Possible settings for useQDCursor
-enum {
- qdCursor_Never, // never use QuickDraw cursor
- qdCursor_Not8Bit, // don't try to use QuickDraw with 8-bit depth
- qdCursor_Always // always try to use QuickDraw cursor
-};
-
-// Possible settings for depth
-enum {
- depth_Current,
- depth_8Bit,
- depth_15Bit,
- depth_24Bit
-};
diff --git a/hw/darwin/quartz/Preferences.m b/hw/darwin/quartz/Preferences.m
deleted file mode 100644
index 6c14f4982..000000000
--- a/hw/darwin/quartz/Preferences.m
+++ /dev/null
@@ -1,597 +0,0 @@
-//
-// Preferences.m
-//
-// This class keeps track of the user preferences.
-//
-/*
- * Copyright (c) 2002-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.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/Preferences.m,v 1.5 2004/06/08 22:58:10 torrey Exp $ */
-
-#import "quartzCommon.h"
-
-#define BOOL xBOOL
-#include "darwin.h"
-#undef BOOL
-
-#import "Preferences.h"
-
-#include <IOKit/hidsystem/IOLLEvent.h> // for modifier masks
-
-// Macros to build the path name
-#ifndef XBINDIR
-#define XBINDIR /usr/X11R6/bin
-#endif
-#define STR(s) #s
-#define XSTRPATH(s) STR(s)
-
-// Keys for user defaults dictionary
-static NSString *X11EnableKeyEquivalentsKey = @"EnableKeyEquivalents";
-
-
-@implementation Preferences
-
-+ (void)initialize
-{
- // Provide user defaults if needed
- NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSNumber numberWithInt:0], @"Display",
- @"YES", @"FakeButtons",
- [NSNumber numberWithInt:NX_COMMANDMASK], @"Button2Mask",
- [NSNumber numberWithInt:NX_ALTERNATEMASK], @"Button3Mask",
- NSLocalizedString(@"USA.keymapping",@""), @"KeymappingFile",
- @"YES", @"UseKeymappingFile",
- NSLocalizedString(@"Cmd-Opt-a",@""), @"SwitchString",
- @"YES", @"UseRootlessMode",
- @"YES", @"UseAGLforGLX",
- @"YES", @"ShowModePickWindow",
- @"YES", @"ShowStartupHelp",
- [NSNumber numberWithInt:0], @"SwitchKeyCode",
- [NSNumber numberWithInt:(NSCommandKeyMask | NSAlternateKeyMask)],
- @"SwitchModifiers", @"NO", @"UseSystemBeep",
- @"YES", X11EnableKeyEquivalentsKey,
- @"YES", @"DockSwitch",
- @"NO", @"AllowMouseAccelChange",
- [NSNumber numberWithInt:qdCursor_Not8Bit], @"UseQDCursor",
- @"YES", @"Xinerama",
- @"YES", @"AddToPath",
- [NSString stringWithCString:XSTRPATH(XBINDIR)], @"AddToPathString",
- @"YES", @"UseDefaultShell",
- @"/bin/tcsh", @"Shell",
- [NSNumber numberWithInt:depth_Current], @"Depth",
-#ifdef BUILD_XPR
- [NSArray arrayWithObjects:@"xpr.bundle", @"cr.bundle", nil],
-#else
- [NSArray arrayWithObjects:@"cr.bundle", nil],
-#endif
- @"DisplayModeBundles", nil];
-
- [super initialize];
- [[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults];
-}
-
-// Initialize internal state info of switch key button
-- (void)initSwitchKey
-{
- keyCode = [Preferences keyCode];
- modifiers = [Preferences modifiers];
- [switchString setString:[Preferences switchString]];
-}
-
-- (id)init
-{
- self = [super init];
-
- isGettingKeyCode=NO;
- switchString=[[NSMutableString alloc] init];
- [self initSwitchKey];
-
- return self;
-}
-
-// Set a modifiers checkbox matrix to match a modifier mask
-- (void)resetMatrix:(NSMatrix *)aMatrix withMask:(int)aMask
-{
- [aMatrix setState:(aMask & NX_SHIFTMASK) atRow:0 column:0];
- [aMatrix setState:(aMask & NX_CONTROLMASK) atRow:1 column:0];
- [aMatrix setState:(aMask & NX_COMMANDMASK) atRow:2 column:0];
- [aMatrix setState:(aMask & NX_ALTERNATEMASK) atRow:3 column:0];
- [aMatrix setState:(aMask & NX_SECONDARYFNMASK) atRow:4 column:0];
-}
-
-// Generate a modifiers mask from a modifiers checkbox matrix
-- (int)getMaskFromMatrix:(NSMatrix *)aMatrix
-{
- int theMask = 0;
-
- if ([[aMatrix cellAtRow:0 column:0] state])
- theMask |= NX_SHIFTMASK;
- if ([[aMatrix cellAtRow:1 column:0] state])
- theMask |= NX_CONTROLMASK;
- if ([[aMatrix cellAtRow:2 column:0] state])
- theMask |= NX_COMMANDMASK;
- if ([[aMatrix cellAtRow:3 column:0] state])
- theMask |= NX_ALTERNATEMASK;
- if ([[aMatrix cellAtRow:4 column:0] state])
- theMask |= NX_SECONDARYFNMASK;
-
- return theMask;
-}
-
-// Set the window controls to the state in user defaults
-- (void)resetWindow
-{
- if ([Preferences keymapFile] == nil)
- [keymapFileField setStringValue:@" "];
- else
- [keymapFileField setStringValue:[Preferences keymapFile]];
-
- if ([Preferences switchString] == nil)
- [switchKeyButton setTitle:@"--"];
- else
- [switchKeyButton setTitle:[Preferences switchString]];
-
- [displayField setIntValue:[Preferences display]];
- [dockSwitchButton setIntValue:[Preferences dockSwitch]];
- [fakeButton setIntValue:[Preferences fakeButtons]];
- [self resetMatrix:button2ModifiersMatrix
- withMask:[Preferences button2Mask]];
- [self resetMatrix:button3ModifiersMatrix
- withMask:[Preferences button3Mask]];
- [modeMatrix setState:[Preferences rootless] atRow:0 column:1];
- [startupHelpButton setIntValue:[Preferences startupHelp]];
- [modeWindowButton setIntValue:[Preferences modeWindow]];
- [systemBeepButton setIntValue:[Preferences systemBeep]];
- [mouseAccelChangeButton setIntValue:[Preferences mouseAccelChange]];
- [useXineramaButton setIntValue:[Preferences xinerama]];
- [addToPathButton setIntValue:[Preferences addToPath]];
- [addToPathField setStringValue:[Preferences addToPathString]];
- [useDefaultShellMatrix setState:![Preferences useDefaultShell]
- atRow:1 column:0];
- [useOtherShellField setStringValue:[Preferences shellString]];
- [depthButton selectItemAtIndex:[Preferences depth]];
-}
-
-- (void)awakeFromNib
-{
- [self resetWindow];
-}
-
-// Preference window delegate
-- (void)windowWillClose:(NSNotification *)aNotification
-{
- [self resetWindow];
- [self initSwitchKey];
-}
-
-// User cancelled the changes
-- (IBAction)close:(id)sender
-{
- [window orderOut:nil];
- [self resetWindow]; // reset window controls
- [self initSwitchKey]; // reset switch key state
-}
-
-// Pick keymapping file
-- (IBAction)pickFile:(id)sender
-{
- int result;
- NSArray *fileTypes = [NSArray arrayWithObject:@"keymapping"];
- NSOpenPanel *oPanel = [NSOpenPanel openPanel];
-
- [oPanel setAllowsMultipleSelection:NO];
- result = [oPanel runModalForDirectory:@"/System/Library/Keyboards"
- file:nil types:fileTypes];
- if (result == NSOKButton) {
- [keymapFileField setStringValue:[oPanel filename]];
- }
-}
-
-// User saved changes
-- (IBAction)saveChanges:(id)sender
-{
- [Preferences setKeyCode:keyCode];
- [Preferences setModifiers:modifiers];
- [Preferences setSwitchString:switchString];
- [Preferences setKeymapFile:[keymapFileField stringValue]];
- [Preferences setUseKeymapFile:YES];
- [Preferences setDisplay:[displayField intValue]];
- [Preferences setDockSwitch:[dockSwitchButton intValue]];
- [Preferences setFakeButtons:[fakeButton intValue]];
- [Preferences setButton2Mask:
- [self getMaskFromMatrix:button2ModifiersMatrix]];
- [Preferences setButton3Mask:
- [self getMaskFromMatrix:button3ModifiersMatrix]];
- [Preferences setRootless:[[modeMatrix cellAtRow:0 column:1] state]];
- [Preferences setModeWindow:[modeWindowButton intValue]];
- [Preferences setStartupHelp:[startupHelpButton intValue]];
- [Preferences setSystemBeep:[systemBeepButton intValue]];
- [Preferences setMouseAccelChange:[mouseAccelChangeButton intValue]];
- [Preferences setXinerama:[useXineramaButton intValue]];
- [Preferences setAddToPath:[addToPathButton intValue]];
- [Preferences setAddToPathString:[addToPathField stringValue]];
- [Preferences setUseDefaultShell:
- [[useDefaultShellMatrix cellAtRow:0 column:0] state]];
- [Preferences setShellString:[useOtherShellField stringValue]];
- [Preferences setDepth:[depthButton indexOfSelectedItem]];
- [Preferences saveToDisk];
-
- [window orderOut:nil];
-}
-
-- (IBAction)setKey:(id)sender
-{
- [switchKeyButton setTitle:NSLocalizedString(@"Press key",@"")];
- isGettingKeyCode=YES;
- [switchString setString:@""];
-}
-
-- (BOOL)sendEvent:(NSEvent *)anEvent
-{
- if(isGettingKeyCode) {
- if([anEvent type]==NSKeyDown) // wait for keyup
- return YES;
- if([anEvent type]!=NSKeyUp)
- return NO;
-
- if([anEvent modifierFlags] & NSCommandKeyMask)
- [switchString appendString:@"Cmd-"];
- if([anEvent modifierFlags] & NSControlKeyMask)
- [switchString appendString:@"Ctrl-"];
- if([anEvent modifierFlags] & NSAlternateKeyMask)
- [switchString appendString:@"Opt-"];
- if([anEvent modifierFlags] & NSNumericPadKeyMask) // doesn't work
- [switchString appendString:@"Num-"];
- if([anEvent modifierFlags] & NSHelpKeyMask)
- [switchString appendString:@"Help-"];
- if([anEvent modifierFlags] & NSFunctionKeyMask) // powerbooks only
- [switchString appendString:@"Fn-"];
-
- [switchString appendString:[anEvent charactersIgnoringModifiers]];
- [switchKeyButton setTitle:switchString];
-
- keyCode = [anEvent keyCode];
- modifiers = [anEvent modifierFlags];
- isGettingKeyCode=NO;
-
- return YES;
- }
- return NO;
-}
-
-+ (void)setKeymapFile:(NSString *)newFile
-{
- [[NSUserDefaults standardUserDefaults] setObject:newFile
- forKey:@"KeymappingFile"];
-}
-
-+ (void)setUseKeymapFile:(BOOL)newUseKeymapFile
-{
- [[NSUserDefaults standardUserDefaults] setBool:newUseKeymapFile
- forKey:@"UseKeymappingFile"];
-}
-
-+ (void)setSwitchString:(NSString *)newString
-{
- [[NSUserDefaults standardUserDefaults] setObject:newString
- forKey:@"SwitchString"];
-}
-
-+ (void)setKeyCode:(int)newKeyCode
-{
- [[NSUserDefaults standardUserDefaults] setInteger:newKeyCode
- forKey:@"SwitchKeyCode"];
-}
-
-+ (void)setModifiers:(int)newModifiers
-{
- [[NSUserDefaults standardUserDefaults] setInteger:newModifiers
- forKey:@"SwitchModifiers"];
-}
-
-+ (void)setDisplay:(int)newDisplay
-{
- [[NSUserDefaults standardUserDefaults] setInteger:newDisplay
- forKey:@"Display"];
-}
-
-+ (void)setDockSwitch:(BOOL)newDockSwitch
-{
- [[NSUserDefaults standardUserDefaults] setBool:newDockSwitch
- forKey:@"DockSwitch"];
-}
-
-+ (void)setFakeButtons:(BOOL)newFakeButtons
-{
- [[NSUserDefaults standardUserDefaults] setBool:newFakeButtons
- forKey:@"FakeButtons"];
- // Update the setting used by the X server thread
- darwinFakeButtons = newFakeButtons;
-}
-
-+ (void)setButton2Mask:(int)newFakeMask
-{
- [[NSUserDefaults standardUserDefaults] setInteger:newFakeMask
- forKey:@"Button2Mask"];
- // Update the setting used by the X server thread
- darwinFakeMouse2Mask = newFakeMask;
-}
-
-+ (void)setButton3Mask:(int)newFakeMask
-{
- [[NSUserDefaults standardUserDefaults] setInteger:newFakeMask
- forKey:@"Button3Mask"];
- // Update the setting used by the X server thread
- darwinFakeMouse3Mask = newFakeMask;
-}
-
-+ (void)setMouseAccelChange:(BOOL)newMouseAccelChange
-{
- [[NSUserDefaults standardUserDefaults] setBool:newMouseAccelChange
- forKey:@"AllowMouseAccelChange"];
- // Update the setting used by the X server thread
- darwinMouseAccelChange = newMouseAccelChange;
-}
-
-+ (void)setUseQDCursor:(int)newUseQDCursor
-{
- [[NSUserDefaults standardUserDefaults] setInteger:newUseQDCursor
- forKey:@"UseQDCursor"];
-}
-
-+ (void)setModeWindow:(BOOL)newModeWindow
-{
- [[NSUserDefaults standardUserDefaults] setBool:newModeWindow
- forKey:@"ShowModePickWindow"];
-}
-
-+ (void)setRootless:(BOOL)newRootless
-{
- [[NSUserDefaults standardUserDefaults] setBool:newRootless
- forKey:@"UseRootlessMode"];
-}
-
-+ (void)setUseAGL:(BOOL)newUseAGL
-{
- [[NSUserDefaults standardUserDefaults] setBool:newUseAGL
- forKey:@"UseAGLforGLX"];
-}
-
-+ (void)setStartupHelp:(BOOL)newStartupHelp
-{
- [[NSUserDefaults standardUserDefaults] setBool:newStartupHelp
- forKey:@"ShowStartupHelp"];
-}
-
-+ (void)setSystemBeep:(BOOL)newSystemBeep
-{
- [[NSUserDefaults standardUserDefaults] setBool:newSystemBeep
- forKey:@"UseSystemBeep"];
- // Update the setting used by the X server thread
- quartzUseSysBeep = newSystemBeep;
-}
-
-+ (void)setEnableKeyEquivalents:(BOOL)newKeyEquivs
-{
- [[NSUserDefaults standardUserDefaults] setBool:newKeyEquivs
- forKey:X11EnableKeyEquivalentsKey];
- // Update the setting used by the X server thread
- quartzEnableKeyEquivalents = newKeyEquivs;
-}
-
-+ (void)setXinerama:(BOOL)newXinerama
-{
- [[NSUserDefaults standardUserDefaults] setBool:newXinerama
- forKey:@"Xinerama"];
-}
-
-+ (void)setAddToPath:(BOOL)newAddToPath
-{
- [[NSUserDefaults standardUserDefaults] setBool:newAddToPath
- forKey:@"AddToPath"];
-}
-
-+ (void)setAddToPathString:(NSString *)newAddToPathString
-{
- [[NSUserDefaults standardUserDefaults] setObject:newAddToPathString
- forKey:@"AddToPathString"];
-}
-
-+ (void)setUseDefaultShell:(BOOL)newUseDefaultShell
-{
- [[NSUserDefaults standardUserDefaults] setBool:newUseDefaultShell
- forKey:@"UseDefaultShell"];
-}
-
-+ (void)setShellString:(NSString *)newShellString
-{
- [[NSUserDefaults standardUserDefaults] setObject:newShellString
- forKey:@"Shell"];
-}
-
-+ (void)setDepth:(int)newDepth
-{
- [[NSUserDefaults standardUserDefaults] setInteger:newDepth
- forKey:@"Depth"];
-}
-
-+ (void)setDisplayModeBundles:(NSArray *)newBundles
-{
- [[NSUserDefaults standardUserDefaults] setObject:newBundles
- forKey:@"DisplayModeBundles"];
-}
-
-+ (void)saveToDisk
-{
- [[NSUserDefaults standardUserDefaults] synchronize];
-}
-
-+ (BOOL)useKeymapFile
-{
- return [[NSUserDefaults standardUserDefaults]
- boolForKey:@"UseKeymappingFile"];
-}
-
-+ (NSString *)keymapFile
-{
- return [[NSUserDefaults standardUserDefaults]
- stringForKey:@"KeymappingFile"];
-}
-
-+ (NSString *)switchString
-{
- return [[NSUserDefaults standardUserDefaults]
- stringForKey:@"SwitchString"];
-}
-
-+ (unsigned int)keyCode
-{
- return [[NSUserDefaults standardUserDefaults]
- integerForKey:@"SwitchKeyCode"];
-}
-
-+ (unsigned int)modifiers
-{
- return [[NSUserDefaults standardUserDefaults]
- integerForKey:@"SwitchModifiers"];
-}
-
-+ (int)display
-{
- return [[NSUserDefaults standardUserDefaults]
- integerForKey:@"Display"];
-}
-
-+ (BOOL)dockSwitch
-{
- return [[NSUserDefaults standardUserDefaults] boolForKey:@"DockSwitch"];
-}
-
-+ (BOOL)fakeButtons
-{
- return [[NSUserDefaults standardUserDefaults] boolForKey:@"FakeButtons"];
-}
-
-+ (int)button2Mask
-{
- return [[NSUserDefaults standardUserDefaults]
- integerForKey:@"Button2Mask"];
-}
-
-+ (int)button3Mask
-{
- return [[NSUserDefaults standardUserDefaults]
- integerForKey:@"Button3Mask"];
-}
-
-+ (BOOL)mouseAccelChange
-{
- return [[NSUserDefaults standardUserDefaults]
- boolForKey:@"AllowMouseAccelChange"];
-}
-
-+ (int)useQDCursor
-{
- return [[NSUserDefaults standardUserDefaults]
- integerForKey:@"UseQDCursor"];
-}
-
-+ (BOOL)rootless
-{
- return [[NSUserDefaults standardUserDefaults]
- boolForKey:@"UseRootlessMode"];
-}
-
-+ (BOOL)useAGL
-{
- return [[NSUserDefaults standardUserDefaults]
- boolForKey:@"UseAGLforGLX"];
-}
-
-+ (BOOL)modeWindow
-{
- return [[NSUserDefaults standardUserDefaults]
- boolForKey:@"ShowModePickWindow"];
-}
-
-+ (BOOL)startupHelp
-{
- return [[NSUserDefaults standardUserDefaults]
- boolForKey:@"ShowStartupHelp"];
-}
-
-+ (BOOL)systemBeep
-{
- return [[NSUserDefaults standardUserDefaults] boolForKey:@"UseSystemBeep"];
-}
-
-+ (BOOL)enableKeyEquivalents
-{
- return [[NSUserDefaults standardUserDefaults] boolForKey:X11EnableKeyEquivalentsKey];
-}
-
-+ (BOOL)xinerama
-{
- return [[NSUserDefaults standardUserDefaults] boolForKey:@"Xinerama"];
-}
-
-+ (BOOL)addToPath
-{
- return [[NSUserDefaults standardUserDefaults] boolForKey:@"AddToPath"];
-}
-
-+ (NSString *)addToPathString
-{
- return [[NSUserDefaults standardUserDefaults]
- stringForKey:@"AddToPathString"];
-}
-
-+ (BOOL)useDefaultShell
-{
- return [[NSUserDefaults standardUserDefaults]
- boolForKey:@"UseDefaultShell"];
-}
-
-+ (NSString *)shellString
-{
- return [[NSUserDefaults standardUserDefaults]
- stringForKey:@"Shell"];
-}
-
-+ (int)depth
-{
- return [[NSUserDefaults standardUserDefaults]
- integerForKey:@"Depth"];
-}
-
-+ (NSArray *)displayModeBundles
-{
- return [[NSUserDefaults standardUserDefaults]
- objectForKey:@"DisplayModeBundles"];
-}
-
-@end
diff --git a/hw/darwin/quartz/XApplication.h b/hw/darwin/quartz/XApplication.h
deleted file mode 100644
index a2622e060..000000000
--- a/hw/darwin/quartz/XApplication.h
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// XApplication.h
-//
-// Created by Andreas Monitzer on January 6, 2001.
-//
-/*
- * Copyright (c) 2001 Andreas Monitzer. 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.
- */
-/* $XFree86: $ */
-
-#import <Cocoa/Cocoa.h>
-
-#import "XServer.h"
-#import "Preferences.h"
-
-@interface XApplication : NSApplication {
- IBOutlet XServer *xserver;
- IBOutlet Preferences *preferences;
-}
-
-- (void)sendEvent:(NSEvent *)anEvent;
-
-@end
diff --git a/hw/darwin/quartz/XApplication.m b/hw/darwin/quartz/XApplication.m
deleted file mode 100644
index e0ee8d9c6..000000000
--- a/hw/darwin/quartz/XApplication.m
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// XApplication.m
-//
-// Created by Andreas Monitzer on January 6, 2001.
-//
-/*
- * Copyright (c) 2001 Andreas Monitzer. 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.
- */
-/* $XFree86: $ */
-
-#import "XApplication.h"
-
-
-@implementation XApplication
-
-- (void)sendEvent:(NSEvent *)anEvent {
- if (![xserver translateEvent:anEvent]) {
- if (![preferences sendEvent:anEvent])
- [super sendEvent:anEvent];
- }
-}
-
-@end
diff --git a/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj b/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj
deleted file mode 100644
index 90002db56..000000000
--- a/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj
+++ /dev/null
@@ -1,2519 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 39;
- objects = {
- 01279092000747AA0A000002 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.objc;
- path = XServer.m;
- refType = 4;
- sourceTree = "<group>";
- };
- 0127909600074AF60A000002 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.objc;
- path = XApplication.m;
- refType = 4;
- sourceTree = "<group>";
- };
- 0127909800074B1A0A000002 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = XApplication.h;
- refType = 4;
- sourceTree = "<group>";
- };
- 015698ED003DF345CE6F79C2 = {
- isa = PBXFileReference;
- lastKnownFileType = image.icns;
- path = XDarwin.icns;
- refType = 4;
- sourceTree = "<group>";
- };
- 0157A37D002CF6D7CE6F79C2 = {
- children = (
- F533214601A4B45401000001,
- 0157A37E002CF6D7CE6F79C2,
- F58D65DF018F79B101000001,
- F533213D0193CBE001000001,
- 43B962E200617B93416877C2,
- F5ACD263C5BE031F01000001,
- F51BF62E02026E3501000001,
- F5ACD25CC5B5E96601000001,
- F587E16401924C6901000001,
- );
- isa = PBXVariantGroup;
- name = Credits.rtf;
- path = "";
- refType = 4;
- sourceTree = "<group>";
- };
- 0157A37E002CF6D7CE6F79C2 = {
- isa = PBXFileReference;
- lastKnownFileType = text.rtf;
- name = English;
- path = English.lproj/Credits.rtf;
- refType = 4;
- sourceTree = "<group>";
- };
- 015EDCEA004203A8CE6F79C2 = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.framework;
- name = IOKit.framework;
- path = /System/Library/Frameworks/IOKit.framework;
- refType = 0;
- sourceTree = "<absolute>";
- };
- 018F40F2003E1902CE6F79C2 = {
- children = (
- 018F40F3003E1916CE6F79C2,
- 021D6BA9003E1BACCE6F79C2,
- 3E74E03600863F047F000001,
- F5A94EF10314BAC70100011B,
- 018F40F6003E1974CE6F79C2,
- 6E5F5F0005537A1A008FEAD7,
- );
- isa = PBXGroup;
- name = "X Server";
- path = ..;
- refType = 4;
- sourceTree = "<group>";
- };
- 018F40F3003E1916CE6F79C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = darwin.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 018F40F6003E1974CE6F79C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = darwinKeyboard.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 018F40F8003E1979CE6F79C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = quartz.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 018F40FA003E197ECE6F79C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = quartz.h;
- refType = 4;
- sourceTree = "<group>";
- };
- 018F40FC003E1983CE6F79C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = xfIOKit.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 018F40FE003E1988CE6F79C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = xfIOKit.h;
- refType = 4;
- sourceTree = "<group>";
- };
- 018F4100003E19E4CE6F79C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = xfIOKitCursor.c;
- refType = 4;
- sourceTree = "<group>";
- };
-//010
-//011
-//012
-//013
-//014
-//020
-//021
-//022
-//023
-//024
- 021D6BA9003E1BACCE6F79C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = darwin.h;
- refType = 4;
- sourceTree = "<group>";
- };
- 02A1FEA6006D34BE416877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = xfIOKitStartup.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 02A1FEA8006D38F0416877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = quartzStartup.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 02E03CA000348209CE6F79C2 = {
- children = (
- F533214701A4B48301000001,
- 02E03CA100348209CE6F79C2,
- F58D65E0018F79C001000001,
- F533213E0193CBF401000001,
- 43B962E300617B93416877C2,
- F5ACD268C5BE046401000001,
- F51BF62F02026E5C01000001,
- F5ACD261C5B5EA2001000001,
- F587E16501924C7401000001,
- );
- isa = PBXVariantGroup;
- name = XDarwinHelp.html;
- path = "";
- refType = 4;
- sourceTree = "<group>";
- };
- 02E03CA100348209CE6F79C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = text.html;
- name = English;
- path = English.lproj/XDarwinHelp.html;
- refType = 4;
- sourceTree = "<group>";
- };
-//020
-//021
-//022
-//023
-//024
-//030
-//031
-//032
-//033
-//034
- 0338412F0083BFE57F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = quartzCursor.h;
- refType = 4;
- sourceTree = "<group>";
- };
-//030
-//031
-//032
-//033
-//034
-//040
-//041
-//042
-//043
-//044
- 04329610000763920A000002 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.objc;
- path = Preferences.m;
- refType = 4;
- sourceTree = "<group>";
- };
- 04329611000763920A000002 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = Preferences.h;
- refType = 4;
- sourceTree = "<group>";
- };
-//040
-//041
-//042
-//043
-//044
-//080
-//081
-//082
-//083
-//084
- 080E96DDFE201D6D7F000001 = {
- children = (
- 04329610000763920A000002,
- 04329611000763920A000002,
- 0127909600074AF60A000002,
- 0127909800074B1A0A000002,
- 01279092000747AA0A000002,
- 1C4A3109004D8F24CE6F79C2,
- );
- isa = PBXGroup;
- name = Classes;
- refType = 4;
- sourceTree = "<group>";
- };
- 089C165CFE840E0CC02AAC07 = {
- children = (
- F533214301A4B3F001000001,
- 089C165DFE840E0CC02AAC07,
- F58D65DD018F798F01000001,
- F533213A0193CBA201000001,
- 43B962E100617B49416877C2,
- F5ACD269C5BE049301000001,
- F51BF62B02026DDA01000001,
- F5ACD262C5B5EA4D01000001,
- F587E16101924C2F01000001,
- );
- isa = PBXVariantGroup;
- name = InfoPlist.strings;
- refType = 4;
- sourceTree = "<group>";
- };
- 089C165DFE840E0CC02AAC07 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = text.plist.strings;
- name = English;
- path = English.lproj/InfoPlist.strings;
- refType = 4;
- sourceTree = "<group>";
- };
-//080
-//081
-//082
-//083
-//084
-//0A0
-//0A1
-//0A2
-//0A3
-//0A4
- 0A79E19E004499A1CE6F79C2 = {
- explicitFileType = wrapper.application;
- isa = PBXFileReference;
- path = XDarwin.app;
- refType = 3;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- 0A79E19F004499A1CE6F79C2 = {
- buildPhases = (
- 0A79E1A0004499A1CE6F79C2,
- 0A79E1A1004499A1CE6F79C2,
- 0A79E1A2004499A1CE6F79C2,
- 0A79E1A3004499A1CE6F79C2,
- 0A79E1A4004499A1CE6F79C2,
- );
- buildSettings = {
- INSTALL_PATH = /;
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = XDarwin;
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
- WRAPPER_EXTENSION = app;
- };
- dependencies = (
- 6EF065C903D4F0CA006877C2,
- 6EF065C703D4EE19006877C2,
- 6E11A986048BDFFB006877C2,
- 6E7904110500F33B00EEC080,
- );
- isa = PBXApplicationTarget;
- name = XDarwin;
- productInstallPath = /;
- productName = XDarwin;
- productReference = 0A79E19E004499A1CE6F79C2;
- productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
-<plist version=\"1.0\">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleDocumentTypes</key>
- <array>
- <dict>
- <key>CFBundleTypeExtensions</key>
- <array>
- <string>x11app</string>
- </array>
- <key>CFBundleTypeName</key>
- <string>X11 Application</string>
- <key>CFBundleTypeOSTypes</key>
- <array>
- <string>****</string>
- </array>
- <key>CFBundleTypeRole</key>
- <string>Viewer</string>
- </dict>
- <dict>
- <key>CFBundleTypeExtensions</key>
- <array>
- <string>tool</string>
- <string>*</string>
- </array>
- <key>CFBundleTypeName</key>
- <string>UNIX Application</string>
- <key>CFBundleTypeOSTypes</key>
- <array>
- <string>****</string>
- </array>
- <key>CFBundleTypeRole</key>
- <string>Viewer</string>
- </dict>
- </array>
- <key>CFBundleExecutable</key>
- <string>XDarwin</string>
- <key>CFBundleGetInfoString</key>
- <string>XDarwin 1.4.0, X.Org Foundation</string>
- <key>CFBundleIconFile</key>
- <string>XDarwin.icns</string>
- <key>CFBundleIdentifier</key>
- <string>org.xfree86.XDarwin</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>XDarwin</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleShortVersionString</key>
- <string>XDarwin 1.4.0</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string></string>
- <key>NSHelpFile</key>
- <string>XDarwinHelp.html</string>
- <key>NSMainNibFile</key>
- <string>MainMenu</string>
- <key>NSPrincipalClass</key>
- <string>XApplication</string>
-</dict>
-</plist>
-";
- };
- 0A79E1A0004499A1CE6F79C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXHeadersBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 0A79E1A1004499A1CE6F79C2 = {
- buildActionMask = 2147483647;
- files = (
- 0A79E1A600449EB2CE6F79C2,
- 0A79E1A700449EB2CE6F79C2,
- 0A79E1A800449EB2CE6F79C2,
- 0A79E1A900449EB2CE6F79C2,
- 0A79E1AA00449EB2CE6F79C2,
- 1220774500712D2D416877C2,
- F54BF6ED017D506E01000001,
- );
- isa = PBXResourcesBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 0A79E1A2004499A1CE6F79C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXSourcesBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 0A79E1A3004499A1CE6F79C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXFrameworksBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 0A79E1A4004499A1CE6F79C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXRezBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 0A79E1A600449EB2CE6F79C2 = {
- fileRef = 29B97318FDCFA39411CA2CEA;
- isa = PBXBuildFile;
- settings = {
- };
- };
- 0A79E1A700449EB2CE6F79C2 = {
- fileRef = 089C165CFE840E0CC02AAC07;
- isa = PBXBuildFile;
- settings = {
- };
- };
- 0A79E1A800449EB2CE6F79C2 = {
- fileRef = 0157A37D002CF6D7CE6F79C2;
- isa = PBXBuildFile;
- settings = {
- };
- };
- 0A79E1A900449EB2CE6F79C2 = {
- fileRef = 02E03CA000348209CE6F79C2;
- isa = PBXBuildFile;
- settings = {
- };
- };
- 0A79E1AA00449EB2CE6F79C2 = {
- fileRef = 015698ED003DF345CE6F79C2;
- isa = PBXBuildFile;
- settings = {
- };
- };
-//0A0
-//0A1
-//0A2
-//0A3
-//0A4
-//100
-//101
-//102
-//103
-//104
- 1058C7A0FEA54F0111CA2CBB = {
- children = (
- F53321400193CCF001000001,
- 1BE4F84D0006C9890A000002,
- 1058C7A1FEA54F0111CA2CBB,
- F53321410193CCF001000001,
- 015EDCEA004203A8CE6F79C2,
- );
- isa = PBXGroup;
- name = "Linked Frameworks";
- refType = 4;
- sourceTree = "<group>";
- };
- 1058C7A1FEA54F0111CA2CBB = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.framework;
- name = Cocoa.framework;
- path = /System/Library/Frameworks/Cocoa.framework;
- refType = 0;
- sourceTree = "<absolute>";
- };
- 1058C7A2FEA54F0111CA2CBB = {
- children = (
- 29B97325FDCFA39411CA2CEA,
- 29B97324FDCFA39411CA2CEA,
- );
- isa = PBXGroup;
- name = "Other Frameworks";
- refType = 4;
- sourceTree = "<group>";
- };
-//100
-//101
-//102
-//103
-//104
-//120
-//121
-//122
-//123
-//124
- 1220774300712D2D416877C2 = {
- children = (
- F533214501A4B42501000001,
- 1220774400712D2D416877C2,
- F58D65DE018F79A001000001,
- F533213C0193CBC901000001,
- 1220774600712D75416877C2,
- F5ACD266C5BE03C501000001,
- F51BF62D02026E1C01000001,
- F5ACD25FC5B5E9AA01000001,
- F587E16301924C5E01000001,
- );
- isa = PBXVariantGroup;
- name = Localizable.strings;
- path = "";
- refType = 4;
- sourceTree = "<group>";
- };
- 1220774400712D2D416877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = text.plist.strings;
- name = English;
- path = English.lproj/Localizable.strings;
- refType = 4;
- sourceTree = "<group>";
- };
- 1220774500712D2D416877C2 = {
- fileRef = 1220774300712D2D416877C2;
- isa = PBXBuildFile;
- settings = {
- };
- };
- 1220774600712D75416877C2 = {
- fileEncoding = 10;
- isa = PBXFileReference;
- lastKnownFileType = text.plist.strings;
- name = Japanese;
- path = Japanese.lproj/Localizable.strings;
- refType = 4;
- sourceTree = "<group>";
- };
-//120
-//121
-//122
-//123
-//124
-//170
-//171
-//172
-//173
-//174
- 170DFAFF00729A35416877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = XDarwinStartup.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 170DFB0000729C86416877C2 = {
- children = (
- 018F40FC003E1983CE6F79C2,
- 018F40FE003E1988CE6F79C2,
- 018F4100003E19E4CE6F79C2,
- 02A1FEA6006D34BE416877C2,
- );
- isa = PBXGroup;
- name = IOKit;
- path = ../iokit;
- refType = 4;
- sourceTree = "<group>";
- };
-//170
-//171
-//172
-//173
-//174
-//190
-//191
-//192
-//193
-//194
- 19C28FACFE9D520D11CA2CBB = {
- children = (
- 0A79E19E004499A1CE6F79C2,
- 6EF7C58703D3BC6D00000104,
- 6EF065C603D4EE19006877C2,
- 6E11A985048BDFEE006877C2,
- 6E7904100500F05600EEC080,
- );
- isa = PBXGroup;
- name = Products;
- refType = 4;
- sourceTree = "<group>";
- };
-//190
-//191
-//192
-//193
-//194
-//1B0
-//1B1
-//1B2
-//1B3
-//1B4
- 1BD8DE4200B8A3567F000001 = {
- children = (
- F533214401A4B40F01000001,
- 1BD8DE4300B8A3567F000001,
- F58D65DC018F794D01000001,
- F533213B0193CBB401000001,
- 1BD8DE4700B8A3C77F000001,
- F5ACD264C5BE035B01000001,
- F51BF62C02026E0601000001,
- F5ACD25DC5B5E97701000001,
- F587E16201924C5301000001,
- );
- isa = PBXVariantGroup;
- name = InfoPlist.strings.cpp;
- path = "";
- refType = 4;
- sourceTree = "<group>";
- };
- 1BD8DE4300B8A3567F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.cpp.cpp;
- name = English;
- path = English.lproj/InfoPlist.strings.cpp;
- refType = 4;
- sourceTree = "<group>";
- };
- 1BD8DE4400B8A38E7F000001 = {
- children = (
- F533214801A4B4D701000001,
- 1BD8DE4500B8A38E7F000001,
- F58D65E1018F79E001000001,
- F533213F0193CC2501000001,
- 1BD8DE4800B8A4167F000001,
- F5ACD267C5BE03FC01000001,
- F51BF63002026E8D01000001,
- F5ACD260C5B5E9DF01000001,
- F587E16601924C9D01000001,
- );
- isa = PBXVariantGroup;
- name = XDarwinHelp.html.cpp;
- path = "";
- refType = 4;
- sourceTree = "<group>";
- };
- 1BD8DE4500B8A38E7F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.cpp.cpp;
- name = English;
- path = English.lproj/XDarwinHelp.html.cpp;
- refType = 4;
- sourceTree = "<group>";
- };
- 1BD8DE4700B8A3C77F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.cpp.cpp;
- name = Japanese;
- path = Japanese.lproj/InfoPlist.strings.cpp;
- refType = 4;
- sourceTree = "<group>";
- };
- 1BD8DE4800B8A4167F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.cpp.cpp;
- name = Japanese;
- path = Japanese.lproj/XDarwinHelp.html.cpp;
- refType = 4;
- sourceTree = "<group>";
- };
- 1BE4F84D0006C9890A000002 = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.framework;
- name = Carbon.framework;
- path = /System/Library/Frameworks/Carbon.framework;
- refType = 0;
- sourceTree = "<absolute>";
- };
-//1B0
-//1B1
-//1B2
-//1B3
-//1B4
-//1C0
-//1C1
-//1C2
-//1C3
-//1C4
- 1C4A3109004D8F24CE6F79C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = XServer.h;
- refType = 4;
- sourceTree = "<group>";
- };
-//1C0
-//1C1
-//1C2
-//1C3
-//1C4
-//230
-//231
-//232
-//233
-//234
- 237A34C10076E37E7F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = quartzAudio.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 237A34C20076E37E7F000001 = {
- buildSettings = {
- COPY_PHASE_STRIP = NO;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = YES;
- GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
- OPTIMIZATION_CFLAGS = "-O0";
- ZERO_LINK = YES;
- };
- isa = PBXBuildStyle;
- name = Development;
- };
- 237A34C30076E37E7F000001 = {
- buildSettings = {
- COPY_PHASE_STRIP = YES;
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
- ZERO_LINK = NO;
- };
- isa = PBXBuildStyle;
- name = Deployment;
- };
- 237A34C40076F4F07F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = quartzAudio.h;
- refType = 4;
- sourceTree = "<group>";
- };
-//230
-//231
-//232
-//233
-//234
-//290
-//291
-//292
-//293
-//294
- 29B97313FDCFA39411CA2CEA = {
- buildSettings = {
- };
- buildStyles = (
- 237A34C20076E37E7F000001,
- 237A34C30076E37E7F000001,
- );
- hasScannedForEncodings = 1;
- isa = PBXProject;
- knownRegions = (
- English,
- Japanese,
- French,
- German,
- Swedish,
- Dutch,
- Spanish,
- ko,
- Portuguese,
- );
- mainGroup = 29B97314FDCFA39411CA2CEA;
- projectDirPath = "";
- targets = (
- 0A79E19F004499A1CE6F79C2,
- 6EF7C58603D3BC6D00000104,
- 6E11A984048BDFEE006877C2,
- 6EF065C503D4EE19006877C2,
- 6E79040F0500F05600EEC080,
- );
- };
- 29B97314FDCFA39411CA2CEA = {
- children = (
- 080E96DDFE201D6D7F000001,
- 018F40F2003E1902CE6F79C2,
- 170DFB0000729C86416877C2,
- 43B962CE00617089416877C2,
- F5614B3D025112D901000114,
- 6EC4A64C042A9597006877C2,
- 32FEE13C00E07C3E7F000001,
- 6EE1214104968658006877C2,
- 6EC4A66D042A97FC006877C2,
- 29B97315FDCFA39411CA2CEA,
- 29B97317FDCFA39411CA2CEA,
- 29B97323FDCFA39411CA2CEA,
- 19C28FACFE9D520D11CA2CBB,
- );
- isa = PBXGroup;
- name = "Xmaster-Cocoa";
- path = "";
- refType = 4;
- sourceTree = "<group>";
- };
- 29B97315FDCFA39411CA2CEA = {
- children = (
- 170DFAFF00729A35416877C2,
- );
- isa = PBXGroup;
- name = "Other Sources";
- path = "";
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- 29B97317FDCFA39411CA2CEA = {
- children = (
- 29B97318FDCFA39411CA2CEA,
- 089C165CFE840E0CC02AAC07,
- 1BD8DE4200B8A3567F000001,
- 1220774300712D2D416877C2,
- 0157A37D002CF6D7CE6F79C2,
- 02E03CA000348209CE6F79C2,
- 1BD8DE4400B8A38E7F000001,
- 015698ED003DF345CE6F79C2,
- F54BF6EA017D500901000001,
- F54BF6EC017D506E01000001,
- );
- isa = PBXGroup;
- name = Resources;
- path = ../bundle;
- refType = 4;
- sourceTree = "<group>";
- };
- 29B97318FDCFA39411CA2CEA = {
- children = (
- F533214201A4B3CE01000001,
- 29B97319FDCFA39411CA2CEA,
- F58D65DB018F793801000001,
- F53321390193CB6A01000001,
- 43B962E000617B49416877C2,
- F5ACD265C5BE038601000001,
- F51BF62A02026DAF01000001,
- F5ACD25EC5B5E98D01000001,
- F587E16001924C1D01000001,
- );
- isa = PBXVariantGroup;
- name = MainMenu.nib;
- path = "";
- refType = 4;
- sourceTree = "<group>";
- };
- 29B97319FDCFA39411CA2CEA = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.nib;
- name = English;
- path = English.lproj/MainMenu.nib;
- refType = 4;
- sourceTree = "<group>";
- };
- 29B97323FDCFA39411CA2CEA = {
- children = (
- 1058C7A0FEA54F0111CA2CBB,
- 1058C7A2FEA54F0111CA2CBB,
- );
- isa = PBXGroup;
- name = Frameworks;
- path = "";
- refType = 4;
- sourceTree = "<group>";
- };
- 29B97324FDCFA39411CA2CEA = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.framework;
- name = AppKit.framework;
- path = /System/Library/Frameworks/AppKit.framework;
- refType = 0;
- sourceTree = "<absolute>";
- };
- 29B97325FDCFA39411CA2CEA = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.framework;
- name = Foundation.framework;
- path = /System/Library/Frameworks/Foundation.framework;
- refType = 0;
- sourceTree = "<absolute>";
- };
-//290
-//291
-//292
-//293
-//294
-//320
-//321
-//322
-//323
-//324
- 32FEE13C00E07C3E7F000001 = {
- children = (
- F5269C2D01D5BC3501000001,
- F5269C2E01D5BC3501000001,
- );
- isa = PBXGroup;
- name = "Old Cocoa Imp";
- path = "";
- refType = 4;
- sourceTree = "<group>";
- };
-//320
-//321
-//322
-//323
-//324
-//350
-//351
-//352
-//353
-//354
- 3576829A0077B8F17F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = quartzCursor.c;
- refType = 4;
- sourceTree = "<group>";
- };
-//350
-//351
-//352
-//353
-//354
-//3E0
-//3E1
-//3E2
-//3E3
-//3E4
- 3E74E03600863F047F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = darwinClut8.h;
- refType = 4;
- sourceTree = "<group>";
- };
-//3E0
-//3E1
-//3E2
-//3E3
-//3E4
-//430
-//431
-//432
-//433
-//434
- 43B962CE00617089416877C2 = {
- children = (
- 6EE9B21604E859C200CA7FEA,
- 6E97A0F505079F9100B8294C,
- 6E5F5F030553815A008FEAD7,
- 6E5F5F040553815A008FEAD7,
- 018F40F8003E1979CE6F79C2,
- 018F40FA003E197ECE6F79C2,
- 237A34C10076E37E7F000001,
- 237A34C40076F4F07F000001,
- 43B962CF00617089416877C2,
- F5582948015DAD3B01000001,
- 6E5F5F0105537A5F008FEAD7,
- 43B962D000617089416877C2,
- 43B962D100617089416877C2,
- 02A1FEA8006D38F0416877C2,
- );
- isa = PBXGroup;
- name = Quartz;
- path = "";
- refType = 4;
- sourceTree = "<group>";
- };
- 43B962CF00617089416877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.objc;
- path = quartzCocoa.m;
- refType = 4;
- sourceTree = "<group>";
- };
- 43B962D000617089416877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = quartzPasteboard.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 43B962D100617089416877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = quartzPasteboard.h;
- refType = 4;
- sourceTree = "<group>";
- };
- 43B962E000617B49416877C2 = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.nib;
- name = Japanese;
- path = Japanese.lproj/MainMenu.nib;
- refType = 4;
- sourceTree = "<group>";
- };
- 43B962E100617B49416877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = text.plist.strings;
- name = Japanese;
- path = Japanese.lproj/InfoPlist.strings;
- refType = 4;
- sourceTree = "<group>";
- };
- 43B962E200617B93416877C2 = {
- isa = PBXFileReference;
- lastKnownFileType = text.rtf;
- name = Japanese;
- path = Japanese.lproj/Credits.rtf;
- refType = 4;
- sourceTree = "<group>";
- };
- 43B962E300617B93416877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = text.html;
- name = Japanese;
- path = Japanese.lproj/XDarwinHelp.html;
- refType = 4;
- sourceTree = "<group>";
- };
-//430
-//431
-//432
-//433
-//434
-//6E0
-//6E1
-//6E2
-//6E3
-//6E4
- 6E11A97F048BDFEE006877C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXHeadersBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6E11A980048BDFEE006877C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXResourcesBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6E11A981048BDFEE006877C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXSourcesBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6E11A982048BDFEE006877C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXFrameworksBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6E11A983048BDFEE006877C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXRezBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6E11A984048BDFEE006877C2 = {
- buildPhases = (
- 6E11A97F048BDFEE006877C2,
- 6E11A980048BDFEE006877C2,
- 6E11A981048BDFEE006877C2,
- 6E11A982048BDFEE006877C2,
- 6E11A983048BDFEE006877C2,
- );
- buildSettings = {
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = glxCGL;
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
- WRAPPER_EXTENSION = bundle;
- };
- dependencies = (
- );
- isa = PBXBundleTarget;
- name = glxCGL;
- productInstallPath = "$(USER_LIBRARY_DIR)/Bundles";
- productName = glxCGL;
- productReference = 6E11A985048BDFEE006877C2;
- productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
-<plist version=\"1.0\">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>glxCGL</string>
- <key>CFBundleGetInfoString</key>
- <string></string>
- <key>CFBundleIconFile</key>
- <string></string>
- <key>CFBundleIdentifier</key>
- <string></string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>GLX bundle using Apple's OpenGL</string>
- <key>CFBundlePackageType</key>
- <string>BNDL</string>
- <key>CFBundleShortVersionString</key>
- <string>0.1</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>0.1</string>
-</dict>
-</plist>
-";
- };
- 6E11A985048BDFEE006877C2 = {
- explicitFileType = wrapper.cfbundle;
- isa = PBXFileReference;
- path = glxCGL.bundle;
- refType = 3;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- 6E11A986048BDFFB006877C2 = {
- isa = PBXTargetDependency;
- target = 6E11A984048BDFEE006877C2;
- targetProxy = 6E4CAF650702464F001A7398;
- };
- 6E4CAF630702464F001A7398 = {
- containerPortal = 29B97313FDCFA39411CA2CEA;
- isa = PBXContainerItemProxy;
- proxyType = 1;
- remoteGlobalIDString = 6EF7C58603D3BC6D00000104;
- remoteInfo = glxAGL;
- };
- 6E4CAF640702464F001A7398 = {
- containerPortal = 29B97313FDCFA39411CA2CEA;
- isa = PBXContainerItemProxy;
- proxyType = 1;
- remoteGlobalIDString = 6E79040F0500F05600EEC080;
- remoteInfo = xpr;
- };
- 6E4CAF650702464F001A7398 = {
- containerPortal = 29B97313FDCFA39411CA2CEA;
- isa = PBXContainerItemProxy;
- proxyType = 1;
- remoteGlobalIDString = 6E11A984048BDFEE006877C2;
- remoteInfo = glxCGL;
- };
- 6E4CAF660702464F001A7398 = {
- containerPortal = 29B97313FDCFA39411CA2CEA;
- isa = PBXContainerItemProxy;
- proxyType = 1;
- remoteGlobalIDString = 6EF065C503D4EE19006877C2;
- remoteInfo = glxMesa;
- };
- 6E5F5F0005537A1A008FEAD7 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = darwinKeyboard.h;
- refType = 4;
- sourceTree = "<group>";
- };
- 6E5F5F0105537A5F008FEAD7 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = quartzKeyboard.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 6E5F5F030553815A008FEAD7 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = keysym2ucs.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 6E5F5F040553815A008FEAD7 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = keysym2ucs.h;
- refType = 4;
- sourceTree = "<group>";
- };
- 6E6656EC048832CF006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = "x-hook.c";
- refType = 4;
- sourceTree = "<group>";
- };
- 6E6656ED048832CF006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = "x-hook.h";
- refType = 4;
- sourceTree = "<group>";
- };
- 6E6656F0048832EC006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = dri.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 6E6656F1048832EC006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = dri.h;
- refType = 4;
- sourceTree = "<group>";
- };
- 6E6656F2048832EC006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = dristruct.h;
- refType = 4;
- sourceTree = "<group>";
- };
- 6E6656F3048832F9006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = appledri.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 6E79040104FD5ED900EEC080 = {
- children = (
- 6E79040204FD5EDA00EEC080,
- 6E79040304FD5EDA00EEC080,
- 6E79040404FD5EDA00EEC080,
- );
- isa = PBXGroup;
- name = "Safe Alpha";
- path = safeAlpha;
- refType = 4;
- sourceTree = "<group>";
- };
- 6E79040204FD5EDA00EEC080 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = safeAlpha.h;
- refType = 4;
- sourceTree = "<group>";
- };
- 6E79040304FD5EDA00EEC080 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = safeAlphaPicture.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 6E79040404FD5EDA00EEC080 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = safeAlphaWindow.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 6E79040A0500F05600EEC080 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXHeadersBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6E79040B0500F05600EEC080 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXResourcesBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6E79040C0500F05600EEC080 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXSourcesBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6E79040D0500F05600EEC080 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXFrameworksBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6E79040E0500F05600EEC080 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXRezBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6E79040F0500F05600EEC080 = {
- buildPhases = (
- 6E79040A0500F05600EEC080,
- 6E79040B0500F05600EEC080,
- 6E79040C0500F05600EEC080,
- 6E79040D0500F05600EEC080,
- 6E79040E0500F05600EEC080,
- );
- buildSettings = {
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = xpr;
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
- WRAPPER_EXTENSION = bundle;
- };
- dependencies = (
- );
- isa = PBXBundleTarget;
- name = xpr;
- productInstallPath = "$(USER_LIBRARY_DIR)/Bundles";
- productName = xpr;
- productReference = 6E7904100500F05600EEC080;
- productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
-<plist version=\"1.0\">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>xpr</string>
- <key>CFBundleGetInfoString</key>
- <string></string>
- <key>CFBundleIconFile</key>
- <string></string>
- <key>CFBundleIdentifier</key>
- <string></string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>Xplugin rootless implementation</string>
- <key>CFBundlePackageType</key>
- <string>BNDL</string>
- <key>CFBundleShortVersionString</key>
- <string>0.1</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>0.1</string>
-</dict>
-</plist>
-";
- };
- 6E7904100500F05600EEC080 = {
- explicitFileType = wrapper.cfbundle;
- isa = PBXFileReference;
- path = xpr.bundle;
- refType = 3;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- 6E7904110500F33B00EEC080 = {
- isa = PBXTargetDependency;
- target = 6E79040F0500F05600EEC080;
- targetProxy = 6E4CAF640702464F001A7398;
- };
- 6E97A0F2050798B100B8294C = {
- fileEncoding = 4;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = xprAppleWM.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 6E97A0F305079B6500B8294C = {
- fileEncoding = 4;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.objc;
- path = crAppleWM.m;
- refType = 4;
- sourceTree = "<group>";
- };
- 6E97A0F505079F9100B8294C = {
- fileEncoding = 4;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = applewmExt.h;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EA0B3AF0544A9CC006877C2 = {
- children = (
- 6EA0B3B00544A9CC006877C2,
- 6EA0B3B10544A9CC006877C2,
- 6EA0B3B20544A9CC006877C2,
- 6EA0B3B30544A9CC006877C2,
- 6EA0B3B40544A9CC006877C2,
- 6EA0B3B50544A9CC006877C2,
- 6EA0B3B60544A9CC006877C2,
- 6EA0B3B70544A9CC006877C2,
- );
- isa = PBXGroup;
- name = Acceleration;
- path = accel;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EA0B3B00544A9CC006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = rlAccel.h;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EA0B3B10544A9CC006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = rlBlt.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EA0B3B20544A9CC006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = rlCopy.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EA0B3B30544A9CC006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = rlFill.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EA0B3B40544A9CC006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = rlFillRect.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EA0B3B50544A9CC006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = rlFillSpans.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EA0B3B60544A9CC006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = rlGlyph.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EA0B3B70544A9CC006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = rlSolid.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EA8EEC80445E25C006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = rootlessConfig.h;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EC4A64C042A9597006877C2 = {
- children = (
- 6EC4A65D042A9654006877C2,
- 6EC4A65E042A9654006877C2,
- 6EC4A65F042A9654006877C2,
- 6EA8EEC80445E25C006877C2,
- 6EC4A661042A9654006877C2,
- 6EC4A662042A9654006877C2,
- 6EC4A660042A9654006877C2,
- 6EC4A663042A9654006877C2,
- 6EC4A664042A9654006877C2,
- 6EA0B3AF0544A9CC006877C2,
- 6E79040104FD5ED900EEC080,
- );
- isa = PBXGroup;
- name = Rootless;
- path = ../../../miext/rootless;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- 6EC4A65D042A9654006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = rootless.h;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EC4A65E042A9654006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = rootlessCommon.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EC4A65F042A9654006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = rootlessCommon.h;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EC4A660042A9654006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = rootlessWindow.h;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EC4A661042A9654006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = rootlessScreen.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EC4A662042A9654006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = rootlessWindow.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EC4A663042A9654006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = rootlessGC.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EC4A664042A9654006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = rootlessValTree.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EC4A66D042A97FC006877C2 = {
- children = (
- 6EF471A004478DE0006877C2,
- 6E6656F3048832F9006877C2,
- 6E6656F0048832EC006877C2,
- 6E6656F1048832EC006877C2,
- 6E6656F2048832EC006877C2,
- 6ECF218404589E4D006877C2,
- 6E97A0F2050798B100B8294C,
- 6ECF218604589F40006877C2,
- 6EF4719E04478B08006877C2,
- 6EDDB2DF04508B2C006877C2,
- 6EF471A204479263006877C2,
- 6EF471A404479263006877C2,
- 6E6656EC048832CF006877C2,
- 6E6656ED048832CF006877C2,
- 6EF471A504479263006877C2,
- 6EF471A304479263006877C2,
- );
- isa = PBXGroup;
- path = xpr;
- refType = 4;
- sourceTree = "<group>";
- };
- 6ECF218404589E4D006877C2 = {
- fileEncoding = 4;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = xpr.h;
- refType = 4;
- sourceTree = "<group>";
- };
- 6ECF218604589F40006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = xprCursor.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EDDB2DF04508B2C006877C2 = {
- fileEncoding = 4;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = xprScreen.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EE1214104968658006877C2 = {
- children = (
- 6EE1214304968692006877C2,
- 6EE1214404968692006877C2,
- 6EE1214204968692006877C2,
- 6E97A0F305079B6500B8294C,
- 6EE1214504968692006877C2,
- 6EE1214604968692006877C2,
- );
- isa = PBXGroup;
- path = cr;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EE1214204968692006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = cr.h;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EE1214304968692006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.objc;
- path = XView.m;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EE1214404968692006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = XView.h;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EE1214504968692006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.objc;
- path = crFrame.m;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EE1214604968692006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.objc;
- path = crScreen.m;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EE9B21604E859C200CA7FEA = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = applewm.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EF065C003D4EE19006877C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXHeadersBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6EF065C103D4EE19006877C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXResourcesBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6EF065C203D4EE19006877C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXSourcesBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6EF065C303D4EE19006877C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXFrameworksBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6EF065C403D4EE19006877C2 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXRezBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6EF065C503D4EE19006877C2 = {
- buildPhases = (
- 6EF065C003D4EE19006877C2,
- 6EF065C103D4EE19006877C2,
- 6EF065C203D4EE19006877C2,
- 6EF065C303D4EE19006877C2,
- 6EF065C403D4EE19006877C2,
- );
- buildSettings = {
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = glxMesa;
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
- WRAPPER_EXTENSION = bundle;
- };
- dependencies = (
- );
- isa = PBXBundleTarget;
- name = glxMesa;
- productInstallPath = "$(USER_LIBRARY_DIR)/Bundles";
- productName = glxMesa;
- productReference = 6EF065C603D4EE19006877C2;
- productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
-<plist version=\"1.0\">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>glxMesa</string>
- <key>CFBundleGetInfoString</key>
- <string></string>
- <key>CFBundleIconFile</key>
- <string></string>
- <key>CFBundleIdentifier</key>
- <string></string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>GLX bundle with Mesa</string>
- <key>CFBundlePackageType</key>
- <string>BNDL</string>
- <key>CFBundleShortVersionString</key>
- <string>0.1</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>0.1</string>
-</dict>
-</plist>
-";
- };
- 6EF065C603D4EE19006877C2 = {
- explicitFileType = wrapper.cfbundle;
- isa = PBXFileReference;
- path = glxMesa.bundle;
- refType = 3;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- 6EF065C703D4EE19006877C2 = {
- isa = PBXTargetDependency;
- target = 6EF065C503D4EE19006877C2;
- targetProxy = 6E4CAF660702464F001A7398;
- };
- 6EF065C903D4F0CA006877C2 = {
- isa = PBXTargetDependency;
- target = 6EF7C58603D3BC6D00000104;
- targetProxy = 6E4CAF630702464F001A7398;
- };
- 6EF4719E04478B08006877C2 = {
- fileEncoding = 4;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = xprFrame.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EF471A004478DE0006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = Xplugin.h;
- refType = 4;
- sourceTree = "<group>";
- };
- 6EF471A204479263006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = "x-hash.c";
- refType = 4;
- sourceTree = "<group>";
- };
- 6EF471A304479263006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = "x-list.h";
- refType = 4;
- sourceTree = "<group>";
- };
- 6EF471A404479263006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = "x-hash.h";
- refType = 4;
- sourceTree = "<group>";
- };
- 6EF471A504479263006877C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = "x-list.c";
- refType = 4;
- sourceTree = "<group>";
- };
- 6EF7C58103D3BC6D00000104 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXHeadersBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6EF7C58203D3BC6D00000104 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXResourcesBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6EF7C58303D3BC6D00000104 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXSourcesBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6EF7C58403D3BC6D00000104 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXFrameworksBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6EF7C58503D3BC6D00000104 = {
- buildActionMask = 2147483647;
- files = (
- );
- isa = PBXRezBuildPhase;
- runOnlyForDeploymentPostprocessing = 0;
- };
- 6EF7C58603D3BC6D00000104 = {
- buildPhases = (
- 6EF7C58103D3BC6D00000104,
- 6EF7C58203D3BC6D00000104,
- 6EF7C58303D3BC6D00000104,
- 6EF7C58403D3BC6D00000104,
- 6EF7C58503D3BC6D00000104,
- );
- buildSettings = {
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = glxAGL;
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
- WRAPPER_EXTENSION = bundle;
- };
- dependencies = (
- );
- isa = PBXBundleTarget;
- name = glxAGL;
- productName = glxAGL;
- productReference = 6EF7C58703D3BC6D00000104;
- productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
-<plist version=\"1.0\">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>glxAGL</string>
- <key>CFBundleGetInfoString</key>
- <string></string>
- <key>CFBundleIconFile</key>
- <string></string>
- <key>CFBundleIdentifier</key>
- <string></string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>GLX bundle using AGL framework</string>
- <key>CFBundlePackageType</key>
- <string>BNDL</string>
- <key>CFBundleShortVersionString</key>
- <string>0.1</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>0.1</string>
-</dict>
-</plist>
-";
- };
- 6EF7C58703D3BC6D00000104 = {
- explicitFileType = wrapper.cfbundle;
- isa = PBXFileReference;
- path = glxAGL.bundle;
- refType = 3;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
-//6E0
-//6E1
-//6E2
-//6E3
-//6E4
-//F50
-//F51
-//F52
-//F53
-//F54
- F51BF62A02026DAF01000001 = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.nib;
- name = Portuguese;
- path = Portuguese.lproj/MainMenu.nib;
- refType = 4;
- sourceTree = "<group>";
- };
- F51BF62B02026DDA01000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = text.plist.strings;
- name = Portuguese;
- path = Portuguese.lproj/InfoPlist.strings;
- refType = 4;
- sourceTree = "<group>";
- };
- F51BF62C02026E0601000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.cpp.cpp;
- name = Portuguese;
- path = Portuguese.lproj/InfoPlist.strings.cpp;
- refType = 4;
- sourceTree = "<group>";
- };
- F51BF62D02026E1C01000001 = {
- fileEncoding = 10;
- isa = PBXFileReference;
- lastKnownFileType = text.plist.strings;
- name = Portuguese;
- path = Portuguese.lproj/Localizable.strings;
- refType = 4;
- sourceTree = "<group>";
- };
- F51BF62E02026E3501000001 = {
- isa = PBXFileReference;
- lastKnownFileType = text.rtf;
- name = Portuguese;
- path = Portuguese.lproj/Credits.rtf;
- refType = 4;
- sourceTree = "<group>";
- };
- F51BF62F02026E5C01000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = text.html;
- name = Portuguese;
- path = Portuguese.lproj/XDarwinHelp.html;
- refType = 4;
- sourceTree = "<group>";
- };
- F51BF63002026E8D01000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.cpp.cpp;
- name = Portuguese;
- path = Portuguese.lproj/XDarwinHelp.html.cpp;
- refType = 4;
- sourceTree = "<group>";
- };
- F5269C2D01D5BC3501000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = pseudoramiX.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F5269C2E01D5BC3501000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = pseudoramiX.h;
- refType = 4;
- sourceTree = "<group>";
- };
- F53321390193CB6A01000001 = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.nib;
- name = German;
- path = German.lproj/MainMenu.nib;
- refType = 4;
- sourceTree = "<group>";
- };
- F533213A0193CBA201000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = text.plist.strings;
- name = German;
- path = German.lproj/InfoPlist.strings;
- refType = 4;
- sourceTree = "<group>";
- };
- F533213B0193CBB401000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.cpp.cpp;
- name = German;
- path = German.lproj/InfoPlist.strings.cpp;
- refType = 4;
- sourceTree = "<group>";
- };
- F533213C0193CBC901000001 = {
- fileEncoding = 10;
- isa = PBXFileReference;
- lastKnownFileType = text.plist.strings;
- name = German;
- path = German.lproj/Localizable.strings;
- refType = 4;
- sourceTree = "<group>";
- };
- F533213D0193CBE001000001 = {
- isa = PBXFileReference;
- lastKnownFileType = text.rtf;
- name = German;
- path = German.lproj/Credits.rtf;
- refType = 4;
- sourceTree = "<group>";
- };
- F533213E0193CBF401000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = text.html;
- name = German;
- path = German.lproj/XDarwinHelp.html;
- refType = 4;
- sourceTree = "<group>";
- };
- F533213F0193CC2501000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.cpp.cpp;
- name = German;
- path = German.lproj/XDarwinHelp.html.cpp;
- refType = 4;
- sourceTree = "<group>";
- };
- F53321400193CCF001000001 = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.framework;
- name = ApplicationServices.framework;
- path = /System/Library/Frameworks/ApplicationServices.framework;
- refType = 0;
- sourceTree = "<absolute>";
- };
- F53321410193CCF001000001 = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.framework;
- name = CoreAudio.framework;
- path = /System/Library/Frameworks/CoreAudio.framework;
- refType = 0;
- sourceTree = "<absolute>";
- };
- F533214201A4B3CE01000001 = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.nib;
- name = Dutch;
- path = Dutch.lproj/MainMenu.nib;
- refType = 4;
- sourceTree = "<group>";
- };
- F533214301A4B3F001000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = text.plist.strings;
- name = Dutch;
- path = Dutch.lproj/InfoPlist.strings;
- refType = 4;
- sourceTree = "<group>";
- };
- F533214401A4B40F01000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.cpp.cpp;
- name = Dutch;
- path = Dutch.lproj/InfoPlist.strings.cpp;
- refType = 4;
- sourceTree = "<group>";
- };
- F533214501A4B42501000001 = {
- fileEncoding = 10;
- isa = PBXFileReference;
- lastKnownFileType = text.plist.strings;
- name = Dutch;
- path = Dutch.lproj/Localizable.strings;
- refType = 4;
- sourceTree = "<group>";
- };
- F533214601A4B45401000001 = {
- isa = PBXFileReference;
- lastKnownFileType = text.rtf;
- name = Dutch;
- path = Dutch.lproj/Credits.rtf;
- refType = 4;
- sourceTree = "<group>";
- };
- F533214701A4B48301000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = text.html;
- name = Dutch;
- path = Dutch.lproj/XDarwinHelp.html;
- refType = 4;
- sourceTree = "<group>";
- };
- F533214801A4B4D701000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.cpp.cpp;
- name = Dutch;
- path = Dutch.lproj/XDarwinHelp.html.cpp;
- refType = 4;
- sourceTree = "<group>";
- };
- F54BF6EA017D500901000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.cpp.cpp;
- path = startXClients.cpp;
- refType = 4;
- sourceTree = "<group>";
- };
- F54BF6EC017D506E01000001 = {
- isa = PBXFileReference;
- lastKnownFileType = text.script.sh;
- path = startXClients;
- refType = 4;
- sourceTree = "<group>";
- };
- F54BF6ED017D506E01000001 = {
- fileRef = F54BF6EC017D506E01000001;
- isa = PBXBuildFile;
- settings = {
- };
- };
- F5582948015DAD3B01000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = quartzCommon.h;
- refType = 4;
- sourceTree = "<group>";
- };
- F5614B3B0251124C01000114 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = fullscreen.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F5614B3D025112D901000114 = {
- children = (
- F5614B3B0251124C01000114,
- 3576829A0077B8F17F000001,
- 0338412F0083BFE57F000001,
- );
- isa = PBXGroup;
- path = fullscreen;
- refType = 4;
- sourceTree = "<group>";
- };
- F587E16001924C1D01000001 = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.nib;
- name = Swedish;
- path = Swedish.lproj/MainMenu.nib;
- refType = 4;
- sourceTree = "<group>";
- };
- F587E16101924C2F01000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = text.plist.strings;
- name = Swedish;
- path = Swedish.lproj/InfoPlist.strings;
- refType = 4;
- sourceTree = "<group>";
- };
- F587E16201924C5301000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.cpp.cpp;
- name = Swedish;
- path = Swedish.lproj/InfoPlist.strings.cpp;
- refType = 4;
- sourceTree = "<group>";
- };
- F587E16301924C5E01000001 = {
- fileEncoding = 10;
- isa = PBXFileReference;
- lastKnownFileType = text.plist.strings;
- name = Swedish;
- path = Swedish.lproj/Localizable.strings;
- refType = 4;
- sourceTree = "<group>";
- };
- F587E16401924C6901000001 = {
- isa = PBXFileReference;
- lastKnownFileType = text.rtf;
- name = Swedish;
- path = Swedish.lproj/Credits.rtf;
- refType = 4;
- sourceTree = "<group>";
- };
- F587E16501924C7401000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = text.html;
- name = Swedish;
- path = Swedish.lproj/XDarwinHelp.html;
- refType = 4;
- sourceTree = "<group>";
- };
- F587E16601924C9D01000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.cpp.cpp;
- name = Swedish;
- path = Swedish.lproj/XDarwinHelp.html.cpp;
- refType = 4;
- sourceTree = "<group>";
- };
- F58D65DB018F793801000001 = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.nib;
- name = French;
- path = French.lproj/MainMenu.nib;
- refType = 4;
- sourceTree = "<group>";
- };
- F58D65DC018F794D01000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.cpp.cpp;
- name = French;
- path = French.lproj/InfoPlist.strings.cpp;
- refType = 4;
- sourceTree = "<group>";
- };
- F58D65DD018F798F01000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = text.plist.strings;
- name = French;
- path = French.lproj/InfoPlist.strings;
- refType = 4;
- sourceTree = "<group>";
- };
- F58D65DE018F79A001000001 = {
- fileEncoding = 10;
- isa = PBXFileReference;
- lastKnownFileType = text.plist.strings;
- name = French;
- path = French.lproj/Localizable.strings;
- refType = 4;
- sourceTree = "<group>";
- };
- F58D65DF018F79B101000001 = {
- isa = PBXFileReference;
- lastKnownFileType = text.rtf;
- name = French;
- path = French.lproj/Credits.rtf;
- refType = 4;
- sourceTree = "<group>";
- };
- F58D65E0018F79C001000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = text.html;
- name = French;
- path = French.lproj/XDarwinHelp.html;
- refType = 4;
- sourceTree = "<group>";
- };
- F58D65E1018F79E001000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.cpp.cpp;
- name = French;
- path = French.lproj/XDarwinHelp.html.cpp;
- refType = 4;
- sourceTree = "<group>";
- };
- F5A94EF10314BAC70100011B = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = darwinEvents.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F5ACD25CC5B5E96601000001 = {
- isa = PBXFileReference;
- lastKnownFileType = text.rtf;
- name = Spanish;
- path = Spanish.lproj/Credits.rtf;
- refType = 4;
- sourceTree = "<group>";
- };
- F5ACD25DC5B5E97701000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.cpp.cpp;
- name = Spanish;
- path = Spanish.lproj/InfoPlist.strings.cpp;
- refType = 4;
- sourceTree = "<group>";
- };
- F5ACD25EC5B5E98D01000001 = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.nib;
- name = Spanish;
- path = Spanish.lproj/MainMenu.nib;
- refType = 4;
- sourceTree = "<group>";
- };
- F5ACD25FC5B5E9AA01000001 = {
- fileEncoding = 10;
- isa = PBXFileReference;
- lastKnownFileType = text.plist.strings;
- name = Spanish;
- path = Spanish.lproj/Localizable.strings;
- refType = 4;
- sourceTree = "<group>";
- };
- F5ACD260C5B5E9DF01000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.cpp.cpp;
- name = Spanish;
- path = Spanish.lproj/XDarwinHelp.html.cpp;
- refType = 4;
- sourceTree = "<group>";
- };
- F5ACD261C5B5EA2001000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = text.html;
- name = Spanish;
- path = Spanish.lproj/XDarwinHelp.html;
- refType = 4;
- sourceTree = "<group>";
- };
- F5ACD262C5B5EA4D01000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = text.plist.strings;
- name = Spanish;
- path = Spanish.lproj/InfoPlist.strings;
- refType = 4;
- sourceTree = "<group>";
- };
- F5ACD263C5BE031F01000001 = {
- isa = PBXFileReference;
- lastKnownFileType = text.rtf;
- name = ko;
- path = ko.lproj/Credits.rtf;
- refType = 4;
- sourceTree = "<group>";
- };
- F5ACD264C5BE035B01000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.cpp.cpp;
- name = ko;
- path = ko.lproj/InfoPlist.strings.cpp;
- refType = 4;
- sourceTree = "<group>";
- };
- F5ACD265C5BE038601000001 = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.nib;
- name = ko;
- path = ko.lproj/MainMenu.nib;
- refType = 4;
- sourceTree = "<group>";
- };
- F5ACD266C5BE03C501000001 = {
- fileEncoding = 10;
- isa = PBXFileReference;
- lastKnownFileType = text.plist.strings;
- name = ko;
- path = ko.lproj/Localizable.strings;
- refType = 4;
- sourceTree = "<group>";
- };
- F5ACD267C5BE03FC01000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.cpp.cpp;
- name = ko;
- path = ko.lproj/XDarwinHelp.html.cpp;
- refType = 4;
- sourceTree = "<group>";
- };
- F5ACD268C5BE046401000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = text.html;
- name = ko;
- path = ko.lproj/XDarwinHelp.html;
- refType = 4;
- sourceTree = "<group>";
- };
- F5ACD269C5BE049301000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = text.plist.strings;
- name = ko;
- path = ko.lproj/InfoPlist.strings;
- refType = 4;
- sourceTree = "<group>";
- };
- };
- rootObject = 29B97313FDCFA39411CA2CEA;
-}
diff --git a/hw/darwin/quartz/XDarwinStartup.c b/hw/darwin/quartz/XDarwinStartup.c
deleted file mode 100644
index 8697776bf..000000000
--- a/hw/darwin/quartz/XDarwinStartup.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/**************************************************************
- *
- * Startup program for Darwin X servers
- *
- * This program selects the appropriate X server to launch:
- * XDarwin IOKit X server (default)
- * XDarwinQuartz A soft link to the Quartz X server
- * executable (-quartz etc. option)
- *
- * If told to idle, the program will simply pause and not
- * launch any X server. This is to support startx being
- * run by XDarwin.app.
- *
- **************************************************************/
-/*
- * Copyright (c) 2001-2002 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
- * TORREY T. LYONS 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 of Torrey T. Lyons shall not
- * be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from
- * Torrey T. Lyons.
- */
-
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <sys/syslimits.h>
-#include <ApplicationServices/ApplicationServices.h>
-
-// Macros to build the path name
-#ifndef XBINDIR
-#define XBINDIR /usr/X11R6/bin
-#endif
-#define STR(s) #s
-#define XSTRPATH(s) STR(s) "/"
-#define XPATH(file) XSTRPATH(XBINDIR) STR(file)
-
-int main(
- int argc,
- char *argv[] )
-{
- int i, j, quartzMode = -1;
- char **newargv;
-
- // Check if we are going to run in Quartz mode or idle
- // to support startx from the Quartz server. The last
- // parameter in the list is the one used.
- for (i = argc-1; i; i--) {
- if (!strcmp(argv[i], "-idle")) {
- pause();
- return 0;
-
- } else if (!strcmp(argv[i], "-quartz") ||
- !strcmp(argv[i], "-rootless") ||
- !strcmp(argv[i], "-fullscreen"))
- {
- quartzMode = 1;
- break;
-
- } else if (!strcmp(argv[i], "-iokit")) {
- quartzMode = 0;
- break;
- }
- }
-
- if (quartzMode == -1) {
-#ifdef HAS_CG_MACH_PORT
- // Check if the CoreGraphics window server is running.
- // Mike Paquette says this is the fastest way to determine if it is running.
- CFMachPortRef cgMachPortRef = CGWindowServerCFMachPort();
- if (cgMachPortRef == NULL)
- quartzMode = 0;
- else
- quartzMode = 1;
-#else
- // On older systems we assume IOKit mode.
- quartzMode = 0;
-#endif
- }
-
- if (quartzMode) {
- // Launch the X server for the quartz modes
-
- char quartzPath[PATH_MAX+1];
- int pathLength;
- OSStatus theStatus;
- CFURLRef appURL;
- CFStringRef appPath;
- Boolean success;
-
- // Build the new argument list
- newargv = (char **) malloc((argc+2) * sizeof(char *));
- for (j = argc; j; j--)
- newargv[j] = argv[j];
- newargv[argc] = "-nostartx";
- newargv[argc+1] = NULL;
-
- // Use the XDarwinQuartz soft link if it is valid
- pathLength = readlink(XPATH(XDarwinQuartz), quartzPath, PATH_MAX);
- if (pathLength != -1) {
- quartzPath[pathLength] = '\0';
- newargv[0] = quartzPath;
- execv(newargv[0], newargv);
- }
-
- // Otherwise query LaunchServices for the location of the XDarwin application
- theStatus = LSFindApplicationForInfo(kLSUnknownCreator,
- CFSTR("org.xfree86.XDarwin"),
- NULL, NULL, &appURL);
- if (theStatus) {
- fprintf(stderr, "Could not find the XDarwin application. (Error = 0x%lx)\n", theStatus);
- fprintf(stderr, "Launch XDarwin once from the Finder.\n");
- return theStatus;
- }
-
- appPath = CFURLCopyFileSystemPath (appURL, kCFURLPOSIXPathStyle);
- success = CFStringGetCString(appPath, quartzPath, PATH_MAX, CFStringGetSystemEncoding());
- if (! success) {
- fprintf(stderr, "Could not find path to XDarwin application.\n");
- return success;
- }
-
- // Launch the XDarwin application
- strncat(quartzPath, "/Contents/MacOS/XDarwin", PATH_MAX);
- newargv[0] = quartzPath;
- execv(newargv[0], newargv);
- fprintf(stderr, "Could not start XDarwin application at %s.\n", newargv[0]);
- return errno;
-
- } else {
-
- // Build the new argument list
- newargv = (char **) malloc((argc+1) * sizeof(char *));
- for (j = argc; j; j--)
- newargv[j] = argv[j];
- newargv[0] = "XDarwin";
- newargv[argc] = NULL;
-
- // Launch the IOKit X server
- execvp(newargv[0], newargv);
- fprintf(stderr, "Could not start XDarwin IOKit X server.\n");
- return errno;
- }
-}
diff --git a/hw/darwin/quartz/XDarwinStartup.man b/hw/darwin/quartz/XDarwinStartup.man
deleted file mode 100644
index 9bf7dfabd..000000000
--- a/hw/darwin/quartz/XDarwinStartup.man
+++ /dev/null
@@ -1,75 +0,0 @@
-.\" $XFree86: xc/programs/Xserver/hw/darwin/bundle/XDarwinStartup.man,v 1.1 2002/02/05 19:16:14 torrey Exp $
-.TH XDarwinStartup 1
-.SH NAME
-XDarwinStartup - Startup program for the XDarwin X window server
-.SH SYNOPSIS
-.B XDarwinStartup
-[\fI-iokit\fP]
-[\fI-fullscreen\fP]
-[\fI-rootless\fP]
-[\fI-quartz\fP]
-[\fI-idle\fP]
-[\fIoptions\fP]
-.SH DESCRIPTION
-The \fIXDarwin(1)\fP X window server can be run in a variety of different
-modes and is actually two different executables. The IOKit X server,
-XDarwin, is used when running from the console. It is most commonly
-located in __XBinDir__. The Quartz X server, for running in parallel with
-Aqua, is a full-fledged Mac OS X application that can be started from
-the Finder. Its application bundle is XDarwin.app, which is typically
-located in /Applications.
-.I XDarwinStartup
-allows easy switching between these X servers and auto-detection of the
-appropriate one to use when launching from the command line.
-When run without any arguments,
-.I XDarwinStartup
-will start the Quartz X server if the Core Graphics window server
-is currently running. Otherwise it will start the IOKit X server.
-.PP
-To locate the Quartz X server,
-.I XDarwinStartup
-will try to read the soft link at __XBinDir__/XDarwinQuartz.
-This is typically a soft link to the executable of the XDarwin.app
-application. If this fails,
-.I XDarwinStartup
-will call Launch Services to locate XDarwin.app.
-.PP
-To start the IOKit X server,
-.I XDarwinStartup
-will run the XDarwin executable, which should be present in the
-user's path.
-.SH OPTIONS
-.I XDarwinStartup
-accepts and passes on all options to the X server it
-launches. In addition the following options have specific effects:
-.TP 8
-.B \-iokit
-Launch the IOKit X server.
-.TP 8
-.B \-fullscreen
-Launch the Quartz X server to run in full screen mode.
-.TP 8
-.B \-rootless
-Launch the Quartz X server to run in rootless mode.
-.TP 8
-.B \-quartz
-Launch the Quartz X server.
-.TP 8
-.B \-idle
-Pause and do nothing. This option is used by XDarwin.app when it is
-started from the Finder.
-.SH FILES
-.TP 30
-__XBinDir__/XDarwin
-IOKit mode X server
-.TP 30
-/Applications/XDarwin.app
-Quartz mode X server
-.TP 30
-__XBinDir__/XDarwinQuartz
-Soft link to Quartz mode X server executable
-.SH SEE ALSO
-XDarwin(1)
-.SH BUGS
-The path to XDarwinQuartz should not be hard coded.
-
diff --git a/hw/darwin/quartz/XServer.h b/hw/darwin/quartz/XServer.h
deleted file mode 100644
index 030ccb51f..000000000
--- a/hw/darwin/quartz/XServer.h
+++ /dev/null
@@ -1,136 +0,0 @@
-//
-// XServer.h
-//
-/*
- * Copyright (c) 2001 Andreas Monitzer. All Rights Reserved.
- * Copyright (c) 2002-2003 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.
- */
-
-#define BOOL xBOOL
-#include <X11/Xproto.h>
-#undef BOOL
-
-#import <Cocoa/Cocoa.h>
-
-@interface XServer : NSObject {
- // Server state
- int serverState;
- NSRecursiveLock *serverLock;
- NSMutableArray *pendingClients;
- BOOL serverVisible;
- BOOL rootlessMenuBarVisible;
- BOOL queueShowServer;
- BOOL quitWithoutQuery;
- BOOL pendingAppQuitReply;
- UInt32 mouseState;
- unsigned short swallowedKey;
- BOOL sendServerEvents;
- BOOL x11Active;
-
- // Aqua interface
- IBOutlet NSWindow *modeWindow;
- IBOutlet NSButton *startupModeButton;
- IBOutlet NSButton *startFullScreenButton;
- IBOutlet NSButton *startRootlessButton;
- IBOutlet NSWindow *helpWindow;
- IBOutlet NSButton *startupHelpButton;
- IBOutlet NSPanel *switchWindow;
-
- // Menu elements setable by Apple-WM extension
- IBOutlet NSMenu *windowMenu;
- IBOutlet NSMenuItem *windowSeparator;
- IBOutlet NSMenu *dockMenu;
- int checkedWindowItem;
-}
-
-- (id)init;
-
-- (BOOL)translateEvent:(NSEvent *)anEvent;
-- (BOOL)getMousePosition:(xEvent *)xe fromEvent:(NSEvent *)anEvent;
-
-- (NSString *)makeSafePath:(NSString *)path;
-
-- (BOOL)loadDisplayBundle;
-- (void)startX;
-- (void)finishStartX;
-- (BOOL)startXClients;
-- (void)runClient:(NSString *)filename;
-- (void)run;
-- (void)toggle;
-- (void)showServer:(BOOL)show;
-- (void)forceShowServer:(BOOL)show;
-- (void)setRootClip:(BOOL)enable;
-- (void)readPasteboard;
-- (void)writePasteboard;
-- (void)quitServer;
-- (void)sendXEvent:(xEvent *)xe;
-- (void)sendShowHide:(BOOL)show;
-- (void)clientProcessDone:(int)clientStatus;
-- (void)activateX11:(BOOL)state;
-- (void)windowBecameKey:(NSNotification *)notification;
-- (void)setX11WindowList:(NSArray *)list;
-- (void)setX11WindowCheck:(NSNumber *)nn;
-
-// Aqua interface actions
-- (IBAction)startFullScreen:(id)sender;
-- (IBAction)startRootless:(id)sender;
-- (IBAction)closeHelpAndShow:(id)sender;
-- (IBAction)showSwitchPanel:(id)sender;
-- (IBAction)showAction:(id)sender;
-- (IBAction)itemSelected:(id)sender;
-- (IBAction)nextWindow:(id)sender;
-- (IBAction)previousWindow:(id)sender;
-- (IBAction)performClose:(id)sender;
-- (IBAction)performMiniaturize:(id)sender;
-- (IBAction)performZoom:(id)sender;
-- (IBAction)bringAllToFront:(id)sender;
-- (IBAction)copy:(id)sender;
-
-// NSApplication delegate
-- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
-- (void)applicationWillTerminate:(NSNotification *)aNotification;
-- (void)applicationDidFinishLaunching:(NSNotification *)aNotification;
-- (void)applicationDidHide:(NSNotification *)aNotification;
-- (void)applicationDidUnhide:(NSNotification *)aNotification;
-- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag;
-- (void)applicationWillResignActive:(NSNotification *)aNotification;
-- (void)applicationWillBecomeActive:(NSNotification *)aNotification;
-- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename;
-
-// NSPort delegate
-- (void)handlePortMessage:(NSPortMessage *)portMessage;
-
-@end
-
-// X server states
-enum {
- server_NotStarted,
- server_Starting,
- server_Running,
- server_Quitting,
- server_Done
-};
diff --git a/hw/darwin/quartz/XServer.m b/hw/darwin/quartz/XServer.m
deleted file mode 100644
index a5a1011e9..000000000
--- a/hw/darwin/quartz/XServer.m
+++ /dev/null
@@ -1,1539 +0,0 @@
-//
-// XServer.m
-//
-// This class handles the interaction between the Cocoa front-end
-// and the Darwin X server thread.
-//
-// Created by Andreas Monitzer on January 6, 2001.
-//
-/*
- * Copyright (c) 2001 Andreas Monitzer. All Rights Reserved.
- * Copyright (c) 2002-2005 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.
- */
-/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/XServer.m,v 1.3 2004/07/30 19:12:17 torrey Exp $ */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.m,v 1.19 2003/11/24 05:39:01 torrey Exp $ */
-
-#include "quartzCommon.h"
-
-#define BOOL xBOOL
-#include "X.h"
-#include "Xproto.h"
-#include "os.h"
-#include "opaque.h"
-#include "darwin.h"
-#include "quartz.h"
-#define _APPLEWM_SERVER_
-#include "applewm.h"
-#include "applewmExt.h"
-#undef BOOL
-
-#import "XServer.h"
-#import "Preferences.h"
-
-#include <unistd.h>
-#include <stdio.h>
-#include <sys/syslimits.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <pwd.h>
-#include <signal.h>
-#include <fcntl.h>
-
-// For power management notifications
-#import <mach/mach_port.h>
-#import <mach/mach_interface.h>
-#import <mach/mach_init.h>
-#import <IOKit/pwr_mgt/IOPMLib.h>
-#import <IOKit/IOMessage.h>
-
-// Types of shells
-enum {
- shell_Unknown,
- shell_Bourne,
- shell_C
-};
-
-typedef struct {
- char *name;
- int type;
-} shellList_t;
-
-static shellList_t const shellList[] = {
- { "csh", shell_C }, // standard C shell
- { "tcsh", shell_C }, // ... needs no introduction
- { "sh", shell_Bourne }, // standard Bourne shell
- { "zsh", shell_Bourne }, // Z shell
- { "bash", shell_Bourne }, // GNU Bourne again shell
- { NULL, shell_Unknown }
-};
-
-extern int argcGlobal;
-extern char **argvGlobal;
-extern char **envpGlobal;
-extern int main(int argc, char *argv[], char *envp[]);
-extern void HideMenuBar(void);
-extern void ShowMenuBar(void);
-static void childDone(int sig);
-static void powerDidChange(void *x, io_service_t y, natural_t messageType,
- void *messageArgument);
-
-static NSPort *signalPort;
-static NSPort *returnPort;
-static NSPortMessage *signalMessage;
-static pid_t clientPID;
-static XServer *oneXServer;
-static NSRect aquaMenuBarBox;
-static io_connect_t root_port;
-
-
-@implementation XServer
-
-- (id)init
-{
- self = [super init];
- oneXServer = self;
-
- serverState = server_NotStarted;
- serverLock = [[NSRecursiveLock alloc] init];
- pendingClients = nil;
- clientPID = 0;
- sendServerEvents = NO;
- x11Active = YES;
- serverVisible = NO;
- rootlessMenuBarVisible = YES;
- queueShowServer = YES;
- quartzServerQuitting = NO;
- pendingAppQuitReply = NO;
- mouseState = 0;
-
- // set up a port to safely send messages to main thread from server thread
- signalPort = [[NSPort port] retain];
- returnPort = [[NSPort port] retain];
- signalMessage = [[NSPortMessage alloc] initWithSendPort:signalPort
- receivePort:returnPort components:nil];
-
- // set up receiving end
- [signalPort setDelegate:self];
- [[NSRunLoop currentRunLoop] addPort:signalPort
- forMode:NSDefaultRunLoopMode];
- [[NSRunLoop currentRunLoop] addPort:signalPort
- forMode:NSModalPanelRunLoopMode];
-
- return self;
-}
-
-- (NSApplicationTerminateReply)
- applicationShouldTerminate:(NSApplication *)sender
-{
- // Quit if the X server is not running
- if ([serverLock tryLock]) {
- quartzServerQuitting = YES;
- serverState = server_Done;
- if (clientPID != 0)
- kill(clientPID, SIGINT);
- return NSTerminateNow;
- }
-
- // Hide the X server and stop sending it events
- [self showServer:NO];
- sendServerEvents = NO;
-
- if (!quitWithoutQuery && (clientPID != 0 || !quartzStartClients)) {
- int but;
-
- but = NSRunAlertPanel(NSLocalizedString(@"Quit X server?",@""),
- NSLocalizedString(@"Quitting the X server will terminate any running X Window System programs.",@""),
- NSLocalizedString(@"Quit",@""),
- NSLocalizedString(@"Cancel",@""),
- nil);
-
- switch (but) {
- case NSAlertDefaultReturn: // quit
- break;
- case NSAlertAlternateReturn: // cancel
- if (serverState == server_Running)
- sendServerEvents = YES;
- return NSTerminateCancel;
- }
- }
-
- quartzServerQuitting = YES;
- if (clientPID != 0)
- kill(clientPID, SIGINT);
-
- // At this point the X server is either running or starting.
- if (serverState == server_Starting) {
- // Quit will be queued later when server is running
- pendingAppQuitReply = YES;
- return NSTerminateLater;
- } else if (serverState == server_Running) {
- [self quitServer];
- }
-
- return NSTerminateNow;
-}
-
-// Ensure that everything has quit cleanly
-- (void)applicationWillTerminate:(NSNotification *)aNotification
-{
- // Make sure the client process has finished
- if (clientPID != 0) {
- NSLog(@"Waiting on client process...");
- sleep(2);
-
- // If the client process hasn't finished yet, kill it off
- if (clientPID != 0) {
- int clientStatus;
- NSLog(@"Killing client process...");
- killpg(clientPID, SIGKILL);
- waitpid(clientPID, &clientStatus, 0);
- }
- }
-
- // Wait until the X server thread quits
- [serverLock lock];
-}
-
-// returns YES when event was handled
-- (BOOL)translateEvent:(NSEvent *)anEvent
-{
- xEvent xe;
- static BOOL mouse1Pressed = NO;
- NSEventType type;
- unsigned int flags;
-
- if (!sendServerEvents) {
- return NO;
- }
-
- type = [anEvent type];
- flags = [anEvent modifierFlags];
-
- if (!quartzRootless) {
- // Check for switch keypress
- if ((type == NSKeyDown) && (![anEvent isARepeat]) &&
- ([anEvent keyCode] == [Preferences keyCode]))
- {
- unsigned int switchFlags = [Preferences modifiers];
-
- // Switch if all the switch modifiers are pressed, while none are
- // pressed that should not be, except for caps lock.
- if (((flags & switchFlags) == switchFlags) &&
- ((flags & ~(switchFlags | NSAlphaShiftKeyMask)) == 0))
- {
- [self toggle];
- return YES;
- }
- }
-
- if (!serverVisible)
- return NO;
- }
-
- memset(&xe, 0, sizeof(xe));
-
- switch (type) {
- case NSLeftMouseUp:
- if (quartzRootless && !mouse1Pressed) {
- // MouseUp after MouseDown in menu - ignore
- return NO;
- }
- mouse1Pressed = NO;
- [self getMousePosition:&xe fromEvent:anEvent];
- xe.u.u.type = ButtonRelease;
- xe.u.u.detail = 1;
- break;
-
- case NSLeftMouseDown:
- if (quartzRootless) {
- // Check that event is in X11 window
- if (!quartzProcs->IsX11Window([anEvent window],
- [anEvent windowNumber]))
- {
- if (x11Active)
- [self activateX11:NO];
- return NO;
- } else {
- if (!x11Active)
- [self activateX11:YES];
- }
- }
- mouse1Pressed = YES;
- [self getMousePosition:&xe fromEvent:anEvent];
- xe.u.u.type = ButtonPress;
- xe.u.u.detail = 1;
- break;
-
- case NSRightMouseUp:
- [self getMousePosition:&xe fromEvent:anEvent];
- xe.u.u.type = ButtonRelease;
- xe.u.u.detail = 3;
- break;
-
- case NSRightMouseDown:
- [self getMousePosition:&xe fromEvent:anEvent];
- xe.u.u.type = ButtonPress;
- xe.u.u.detail = 3;
- break;
-
- case NSOtherMouseUp:
- {
- int hwButton = [anEvent buttonNumber];
-
- [self getMousePosition:&xe fromEvent:anEvent];
- xe.u.u.type = ButtonRelease;
- xe.u.u.detail = (hwButton == 2) ? hwButton : hwButton + 1;
- break;
- }
-
- case NSOtherMouseDown:
- {
- int hwButton = [anEvent buttonNumber];
-
- [self getMousePosition:&xe fromEvent:anEvent];
- xe.u.u.type = ButtonPress;
- xe.u.u.detail = (hwButton == 2) ? hwButton : hwButton + 1;
- break;
- }
-
- case NSMouseMoved:
- case NSLeftMouseDragged:
- case NSRightMouseDragged:
- case NSOtherMouseDragged:
- [self getMousePosition:&xe fromEvent:anEvent];
- xe.u.u.type = MotionNotify;
- break;
-
- case NSScrollWheel:
- [self getMousePosition:&xe fromEvent:anEvent];
- xe.u.u.type = kXDarwinScrollWheel;
- xe.u.clientMessage.u.s.shorts0 = [anEvent deltaX] +
- [anEvent deltaY];
- break;
-
- case NSKeyDown:
- case NSKeyUp:
- if (!x11Active) {
- swallowedKey = 0;
- return NO;
- }
-
- if (type == NSKeyDown) {
- // If the mouse is not on the valid X display area,
- // don't send the X server key events.
- if (![self getMousePosition:&xe fromEvent:nil]) {
- swallowedKey = [anEvent keyCode];
- return NO;
- }
-
- // See if there are any global shortcuts for this key combo.
- if (quartzEnableKeyEquivalents
- && [[NSApp mainMenu] performKeyEquivalent:anEvent])
- {
- swallowedKey = [anEvent keyCode];
- return YES;
- }
- } else {
- // If the down key event was a valid key combo,
- // don't pass the up event to X11.
- if (swallowedKey != 0 && [anEvent keyCode] == swallowedKey) {
- swallowedKey = 0;
- return NO;
- }
- }
-
- xe.u.u.type = (type == NSKeyDown) ? KeyPress : KeyRelease;
- xe.u.u.detail = [anEvent keyCode];
- break;
-
- case NSFlagsChanged:
- if (!x11Active)
- return NO;
- xe.u.u.type = kXDarwinUpdateModifiers;
- xe.u.clientMessage.u.l.longs0 = flags;
- break;
-
- default:
- return NO;
- }
-
- [self sendXEvent:&xe];
-
- // Rootless: Send first NSLeftMouseDown to Cocoa windows and views so
- // window ordering can be suppressed.
- // Don't pass further events - they (incorrectly?) bring the window
- // forward no matter what.
- if (quartzRootless &&
- (type == NSLeftMouseDown || type == NSLeftMouseUp) &&
- [anEvent clickCount] == 1 && [anEvent window])
- {
- return NO;
- }
-
- return YES;
-}
-
-// Return mouse coordinates, inverting y coordinate.
-// The coordinates are extracted from an event or the current mouse position.
-// For rootless mode, the menu bar is treated as not part of the usable
-// X display area and the cursor position is adjusted accordingly.
-// Returns YES if the cursor is not in the menu bar.
-- (BOOL)getMousePosition:(xEvent *)xe fromEvent:(NSEvent *)anEvent
-{
- NSPoint pt;
-
- if (anEvent) {
- NSWindow *eventWindow = [anEvent window];
-
- if (eventWindow) {
- pt = [anEvent locationInWindow];
- pt.x += [eventWindow frame].origin.x;
- pt.y += [eventWindow frame].origin.y;
- } else {
- pt = [NSEvent mouseLocation];
- }
- } else {
- pt = [NSEvent mouseLocation];
- }
-
- xe->u.keyButtonPointer.rootX = (int)(pt.x);
-
- if (quartzRootless && NSMouseInRect(pt, aquaMenuBarBox, NO)) {
- // mouse in menu bar - tell X11 that it's just below instead
- xe->u.keyButtonPointer.rootY = aquaMenuBarHeight;
- return NO;
- } else {
- xe->u.keyButtonPointer.rootY =
- NSHeight([[NSScreen mainScreen] frame]) - (int)(pt.y);
- return YES;
- }
-}
-
-
-// Make a safe path
-//
-// Return the path in single quotes in case there are problematic characters in it.
-// We still have to worry about there being single quotes in the path. So, replace
-// all instances of the ' character in the path with '\''.
-- (NSString *)makeSafePath:(NSString *)path
-{
- NSMutableString *safePath = [NSMutableString stringWithString:path];
- NSRange aRange = NSMakeRange(0, [safePath length]);
-
- while (aRange.length) {
- aRange = [safePath rangeOfString:@"'" options:0 range:aRange];
- if (!aRange.length)
- break;
- [safePath replaceCharactersInRange:aRange
- withString:@"\'\\'\'"];
- aRange.location += 4;
- aRange.length = [safePath length] - aRange.location;
- }
-
- safePath = [NSMutableString stringWithFormat:@"'%@'", safePath];
-
- return safePath;
-}
-
-
-- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
-{
- // Block SIGPIPE
- // SIGPIPE repeatably killed the (rootless) server when closing a
- // dozen xterms in rapid succession. Those SIGPIPEs should have been
- // sent to the X server thread, which ignores them, but somehow they
- // ended up in this thread instead.
- {
- sigset_t set;
- sigemptyset(&set);
- sigaddset(&set, SIGPIPE);
- // pthread_sigmask not implemented yet
- // pthread_sigmask(SIG_BLOCK, &set, NULL);
- sigprocmask(SIG_BLOCK, &set, NULL);
- }
-
- if (quartzRootless == -1) {
- // The display mode was not set from the command line.
- // Show mode pick panel?
- if ([Preferences modeWindow]) {
- if ([Preferences rootless])
- [startRootlessButton setKeyEquivalent:@"\r"];
- else
- [startFullScreenButton setKeyEquivalent:@"\r"];
- [modeWindow makeKeyAndOrderFront:nil];
- } else {
- // Otherwise use default mode
- quartzRootless = [Preferences rootless];
- [self startX];
- }
- } else {
- [self startX];
- }
-}
-
-
-// Load the appropriate display mode bundle
-- (BOOL)loadDisplayBundle
-{
- if (quartzRootless) {
- NSEnumerator *enumerator = [[Preferences displayModeBundles]
- objectEnumerator];
- NSString *bundleName;
-
- while ((bundleName = [enumerator nextObject])) {
- if (QuartzLoadDisplayBundle([bundleName cString]))
- return YES;
- }
-
- return NO;
- } else {
- return QuartzLoadDisplayBundle("fullscreen.bundle");
- }
-}
-
-
-// Start the X server thread and the client process
-- (void)startX
-{
- NSDictionary *appDictionary;
- NSString *appVersion;
-
- [modeWindow close];
-
- // Calculate the height of the menu bar so rootless mode can avoid it
- if (quartzRootless) {
- aquaMenuBarHeight = NSHeight([[NSScreen mainScreen] frame]) -
- NSMaxY([[NSScreen mainScreen] visibleFrame]) - 1;
- aquaMenuBarBox =
- NSMakeRect(0, NSMaxY([[NSScreen mainScreen] visibleFrame]) + 1,
- NSWidth([[NSScreen mainScreen] frame]),
- aquaMenuBarHeight);
- }
-
- // Write the XDarwin version to the console log
- appDictionary = [[NSBundle mainBundle] infoDictionary];
- appVersion = [appDictionary objectForKey:@"CFBundleShortVersionString"];
- if (appVersion)
- NSLog(@"\n%@", appVersion);
- else
- NSLog(@"No version");
-
- if (![self loadDisplayBundle])
- [NSApp terminate:nil];
-
- if (quartzRootless) {
- // We need to track whether the key window is an X11 window
- [[NSNotificationCenter defaultCenter]
- addObserver:self
- selector:@selector(windowBecameKey:)
- name:NSWindowDidBecomeKeyNotification
- object:nil];
-
- // Request notification of screen layout changes even when this
- // is not the active application
- [[NSDistributedNotificationCenter defaultCenter]
- addObserver:self
- selector:@selector(applicationDidChangeScreenParameters:)
- name:NSApplicationDidChangeScreenParametersNotification
- object:nil];
- }
-
- // Start the X server thread
- serverState = server_Starting;
- [NSThread detachNewThreadSelector:@selector(run) toTarget:self
- withObject:nil];
-
- // Start the X clients if started from GUI
- if (quartzStartClients) {
- [self startXClients];
- }
-
- if (quartzRootless) {
- // There is no help window for rootless; just start
- [helpWindow close];
- helpWindow = nil;
- } else {
- IONotificationPortRef notify;
- io_object_t anIterator;
-
- // Register for system power notifications
- root_port = IORegisterForSystemPower(0, &notify, powerDidChange,
- &anIterator);
- if (root_port) {
- CFRunLoopAddSource([[NSRunLoop currentRunLoop] getCFRunLoop],
- IONotificationPortGetRunLoopSource(notify),
- kCFRunLoopDefaultMode);
- } else {
- NSLog(@"Failed to register for system power notifications.");
- }
-
- // Show the X switch window if not using dock icon switching
- if (![Preferences dockSwitch])
- [switchWindow orderFront:nil];
-
- if ([Preferences startupHelp]) {
- // display the full screen mode help
- [helpWindow makeKeyAndOrderFront:nil];
- queueShowServer = NO;
- } else {
- // start running full screen and make sure X is visible
- ShowMenuBar();
- [self closeHelpAndShow:nil];
- }
- }
-}
-
-// Finish starting the X server thread
-// This includes anything that must be done after the X server is
-// ready to process events after the first or subsequent generations.
-- (void)finishStartX
-{
- sendServerEvents = YES;
- serverState = server_Running;
-
- if (quartzRootless) {
- [self forceShowServer:[NSApp isActive]];
- } else {
- [self forceShowServer:queueShowServer];
- }
-
- if (quartzServerQuitting) {
- [self quitServer];
- if (pendingAppQuitReply)
- [NSApp replyToApplicationShouldTerminate:YES];
- return;
- }
-
- if (pendingClients) {
- NSEnumerator *enumerator = [pendingClients objectEnumerator];
- NSString *filename;
-
- while ((filename = [enumerator nextObject])) {
- [self runClient:filename];
- }
-
- [pendingClients release];
- pendingClients = nil;
- }
-}
-
-// Start the first X clients in a separate process
-- (BOOL)startXClients
-{
- struct passwd *passwdUser;
- NSString *shellPath, *dashShellName, *commandStr, *startXPath;
- NSString *safeStartXPath;
- NSBundle *thisBundle;
- const char *shellPathStr, *newargv[3], *shellNameStr;
- int fd[2], outFD, length, shellType, i;
-
- // Register to catch the signal when the client processs finishes
- signal(SIGCHLD, childDone);
-
- // Get user's password database entry
- passwdUser = getpwuid(getuid());
-
- // Find the shell to use
- if ([Preferences useDefaultShell])
- shellPath = [NSString stringWithCString:passwdUser->pw_shell];
- else
- shellPath = [Preferences shellString];
-
- dashShellName = [NSString stringWithFormat:@"-%@",
- [shellPath lastPathComponent]];
- shellPathStr = [shellPath cString];
- shellNameStr = [[shellPath lastPathComponent] cString];
-
- if (access(shellPathStr, X_OK)) {
- NSLog(@"Shell %s is not valid!", shellPathStr);
- return NO;
- }
-
- // Find the type of shell
- for (i = 0; shellList[i].name; i++) {
- if (!strcmp(shellNameStr, shellList[i].name))
- break;
- }
- shellType = shellList[i].type;
-
- newargv[0] = [dashShellName cString];
- if (shellType == shell_Bourne) {
- // Bourne shells need to be told they are interactive to make
- // sure they read all their initialization files.
- newargv[1] = "-i";
- newargv[2] = NULL;
- } else {
- newargv[1] = NULL;
- }
-
- // Create a pipe to communicate with the X client process
- NSAssert(pipe(fd) == 0, @"Could not create new pipe.");
-
- // Open a file descriptor for writing to stdout and stderr
- outFD = open("/dev/console", O_WRONLY, 0);
- if (outFD == -1) {
- outFD = open("/dev/null", O_WRONLY, 0);
- NSAssert(outFD != -1, @"Could not open shell output.");
- }
-
- // Fork process to start X clients in user's default shell
- // Sadly we can't use NSTask because we need to start a login shell.
- // Login shells are started by passing "-" as the first character of
- // argument 0. NSTask forces argument 0 to be the shell's name.
- clientPID = vfork();
- if (clientPID == 0) {
-
- // Inside the new process:
- if (fd[0] != STDIN_FILENO) {
- dup2(fd[0], STDIN_FILENO); // Take stdin from pipe
- close(fd[0]);
- }
- close(fd[1]); // Close write end of pipe
- if (outFD == STDOUT_FILENO) { // Setup stdout and stderr
- dup2(outFD, STDERR_FILENO);
- } else if (outFD == STDERR_FILENO) {
- dup2(outFD, STDOUT_FILENO);
- } else {
- dup2(outFD, STDERR_FILENO);
- dup2(outFD, STDOUT_FILENO);
- close(outFD);
- }
-
- // Setup environment
- setenv("HOME", passwdUser->pw_dir, 1);
- setenv("SHELL", shellPathStr, 1);
- setenv("LOGNAME", passwdUser->pw_name, 1);
- setenv("USER", passwdUser->pw_name, 1);
- setenv("TERM", "unknown", 1);
- if (chdir(passwdUser->pw_dir)) // Change to user's home dir
- NSLog(@"Could not change to user's home directory.");
-
- execv(shellPathStr, (char * const *)newargv); // Start user's shell
-
- NSLog(@"Could not start X client process with errno = %i.", errno);
- _exit(127);
- }
-
- // In parent process:
- close(fd[0]); // Close read end of pipe
- close(outFD); // Close output file descriptor
-
- thisBundle = [NSBundle bundleForClass:[self class]];
- startXPath = [thisBundle pathForResource:@"startXClients" ofType:nil];
- if (!startXPath) {
- NSLog(@"Could not find startXClients in application bundle!");
- return NO;
- }
-
- safeStartXPath = [self makeSafePath:startXPath];
-
- if ([Preferences addToPath]) {
- commandStr = [NSString stringWithFormat:@"%@ :%d %@\n",
- safeStartXPath, [Preferences display],
- [Preferences addToPathString]];
- } else {
- commandStr = [NSString stringWithFormat:@"%@ :%d\n",
- safeStartXPath, [Preferences display]];
- }
-
- length = [commandStr cStringLength];
- if (write(fd[1], [commandStr cString], length) != length) {
- NSLog(@"Write to X client process failed.");
- return NO;
- }
-
- // Close the pipe so that shell will terminate when xinit quits
- close(fd[1]);
-
- return YES;
-}
-
-// Start the specified client in its own task
-// FIXME: This should be unified with startXClients
-- (void)runClient:(NSString *)filename
-{
- const char *command = [[self makeSafePath:filename] UTF8String];
- const char *shell;
- const char *argv[5];
- int child1, child2 = 0;
- int status;
-
- shell = getenv("SHELL");
- if (shell == NULL)
- shell = "/bin/bash";
-
- /* At least [ba]sh, [t]csh and zsh all work with this syntax. We
- need to use an interactive shell to force it to load the user's
- environment. */
-
- argv[0] = shell;
- argv[1] = "-i";
- argv[2] = "-c";
- argv[3] = command;
- argv[4] = NULL;
-
- /* Do the fork-twice trick to avoid having to reap zombies */
-
- child1 = fork();
-
- switch (child1) {
- case -1: /* error */
- break;
-
- case 0: /* child1 */
- child2 = fork();
-
- switch (child2) {
- int max_files, i;
- char buf[1024], *tem;
-
- 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);
-
- /* cd $HOME */
- tem = getenv("HOME");
- if (tem != NULL)
- chdir(tem);
-
- /* Setup environment */
- snprintf(buf, sizeof(buf), ":%s", display);
- setenv("DISPLAY", buf, TRUE);
- tem = getenv("PATH");
- if (tem != NULL && tem[0] != NULL)
- snprintf(buf, sizeof(buf), "%s:/usr/X11R6/bin", tem);
- else
- snprintf(buf, sizeof(buf), "/bin:/usr/bin:/usr/X11R6/bin");
- setenv("PATH", buf, TRUE);
-
- execvp(argv[0], (char **const) argv);
-
- _exit(2);
-
- default: /* parent (child1) */
- _exit(0);
- }
- break;
-
- default: /* parent */
- waitpid(child1, &status, 0);
- }
-}
-
-// Run the X server thread
-- (void)run
-{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- [serverLock lock];
- main(argcGlobal, argvGlobal, envpGlobal);
- serverVisible = NO;
- [pool release];
- [serverLock unlock];
- QuartzMessageMainThread(kQuartzServerDied, nil, 0);
-}
-
-// Full screen mode was picked in the mode pick panel
-- (IBAction)startFullScreen:(id)sender
-{
- [Preferences setModeWindow:[startupModeButton intValue]];
- [Preferences saveToDisk];
- quartzRootless = FALSE;
- [self startX];
-}
-
-// Rootless mode was picked in the mode pick panel
-- (IBAction)startRootless:(id)sender
-{
- [Preferences setModeWindow:[startupModeButton intValue]];
- [Preferences saveToDisk];
- quartzRootless = TRUE;
- [self startX];
-}
-
-// Close the help splash screen and show the X server
-- (IBAction)closeHelpAndShow:(id)sender
-{
- if (sender) {
- int helpVal = [startupHelpButton intValue];
- [Preferences setStartupHelp:helpVal];
- [Preferences saveToDisk];
- }
- [helpWindow close];
- helpWindow = nil;
-
- [self forceShowServer:YES];
- [NSApp activateIgnoringOtherApps:YES];
-}
-
-// Show the Aqua-X11 switch panel useful for fullscreen mode
-- (IBAction)showSwitchPanel:(id)sender
-{
- [switchWindow orderFront:nil];
-}
-
-// Show the X server when sent message from GUI
-- (IBAction)showAction:(id)sender
-{
- [self forceShowServer:YES];
-}
-
-// Show or hide the X server or menu bar in rootless mode
-- (void)toggle
-{
- if (quartzRootless) {
-#if 0
- // FIXME: Remove or add option to not dodge menubar
- if (rootlessMenuBarVisible)
- HideMenuBar();
- else
- ShowMenuBar();
- rootlessMenuBarVisible = !rootlessMenuBarVisible;
-#endif
- } else {
- [self showServer:!serverVisible];
- }
-}
-
-// Show or hide the X server on screen
-- (void)showServer:(BOOL)show
-{
- // Do not show or hide multiple times in a row
- if (serverVisible == show)
- return;
-
- if (sendServerEvents) {
- [self sendShowHide:show];
- } else if (serverState == server_Starting) {
- queueShowServer = show;
- }
-}
-
-// Show or hide the X server irregardless of the current state
-- (void)forceShowServer:(BOOL)show
-{
- serverVisible = !show;
- [self showServer:show];
-}
-
-// Tell the X server to show or hide itself.
-// This ignores the current X server visible state.
-//
-// In full screen mode, the order we do things is important and must be
-// preserved between the threads. X drawing operations have to be performed
-// in the X server thread. It appears that we have the additional
-// constraint that we must hide and show the menu bar in the main thread.
-//
-// To show the X server:
-// 1. Capture the displays. (Main thread)
-// 2. Hide the menu bar. (Must be in main thread)
-// 3. Send event to X server thread to redraw X screen.
-// 4. Redraw the X screen. (Must be in X server thread)
-//
-// To hide the X server:
-// 1. Send event to X server thread to stop drawing.
-// 2. Stop drawing to the X screen. (Must be in X server thread)
-// 3. Message main thread that drawing is stopped.
-// 4. If main thread still wants X server hidden:
-// a. Release the displays. (Main thread)
-// b. Unhide the menu bar. (Must be in main thread)
-// Otherwise we have already queued an event to start drawing again.
-//
-- (void)sendShowHide:(BOOL)show
-{
- xEvent xe;
-
- [self getMousePosition:&xe fromEvent:nil];
-
- if (show) {
- if (!quartzRootless) {
- quartzProcs->CaptureScreens();
- HideMenuBar();
- }
- [self activateX11:YES];
-
- // the mouse location will have moved; track it
- xe.u.u.type = MotionNotify;
- [self sendXEvent:&xe];
-
- // inform the X server of the current modifier state
- xe.u.u.type = kXDarwinUpdateModifiers;
- xe.u.clientMessage.u.l.longs0 = [[NSApp currentEvent] modifierFlags];
- [self sendXEvent:&xe];
-
- // If there is no AppleWM-aware cut and paste manager, do what we can.
- if ((AppleWMSelectedEvents() & AppleWMPasteboardNotifyMask) == 0) {
- // put the pasteboard into the X cut buffer
- [self readPasteboard];
- }
- } else {
- // If there is no AppleWM-aware cut and paste manager, do what we can.
- if ((AppleWMSelectedEvents() & AppleWMPasteboardNotifyMask) == 0) {
- // put the X cut buffer on the pasteboard
- [self writePasteboard];
- }
-
- [self activateX11:NO];
- }
-
- serverVisible = show;
-}
-
-// Enable or disable rendering to the X screen
-- (void)setRootClip:(BOOL)enable
-{
- xEvent xe;
-
- xe.u.u.type = kXDarwinSetRootClip;
- xe.u.clientMessage.u.l.longs0 = enable;
- [self sendXEvent:&xe];
-}
-
-// Tell the X server to read from the pasteboard into the X cut buffer
-- (void)readPasteboard
-{
- xEvent xe;
-
- xe.u.u.type = kXDarwinReadPasteboard;
- [self sendXEvent:&xe];
-}
-
-// Tell the X server to write the X cut buffer into the pasteboard
-- (void)writePasteboard
-{
- xEvent xe;
-
- xe.u.u.type = kXDarwinWritePasteboard;
- [self sendXEvent:&xe];
-}
-
-- (void)quitServer
-{
- xEvent xe;
-
- xe.u.u.type = kXDarwinQuit;
- [self sendXEvent:&xe];
-
- // Revert to the Mac OS X arrow cursor. The main thread sets the cursor
- // and it won't be responding to future requests to change it.
- [[NSCursor arrowCursor] set];
-
- serverState = server_Quitting;
-}
-
-- (void)sendXEvent:(xEvent *)xe
-{
- // This field should be filled in for every event
- xe->u.keyButtonPointer.time = GetTimeInMillis();
-
- DarwinEQEnqueue(xe);
-}
-
-// Handle messages from the X server thread
-- (void)handlePortMessage:(NSPortMessage *)portMessage
-{
- unsigned msg = [portMessage msgid];
-
- switch (msg) {
- case kQuartzServerHidden:
- // Make sure the X server wasn't queued to be shown again while
- // the hide was pending.
- if (!quartzRootless && !serverVisible) {
- quartzProcs->ReleaseScreens();
- ShowMenuBar();
- }
- break;
-
- case kQuartzServerStarted:
- [self finishStartX];
- break;
-
- case kQuartzServerDied:
- sendServerEvents = NO;
- serverState = server_Done;
- if (!quartzServerQuitting) {
- [NSApp terminate:nil]; // quit if we aren't already
- }
- break;
-
- case kQuartzCursorUpdate:
- if (quartzProcs->CursorUpdate)
- quartzProcs->CursorUpdate();
- break;
-
- case kQuartzPostEvent:
- {
- const xEvent *xe = [[[portMessage components] lastObject] bytes];
- DarwinEQEnqueue(xe);
- break;
- }
-
- case kQuartzSetWindowMenu:
- {
- NSArray *list;
- [[[portMessage components] lastObject] getBytes:&list];
- [self setX11WindowList:list];
- [list release];
- break;
- }
-
- case kQuartzSetWindowMenuCheck:
- {
- int n;
- [[[portMessage components] lastObject] getBytes:&n];
- [self setX11WindowCheck:[NSNumber numberWithInt:n]];
- break;
- }
-
- case kQuartzSetFrontProcess:
- [NSApp activateIgnoringOtherApps:YES];
- break;
-
- case kQuartzSetCanQuit:
- {
- int n;
- [[[portMessage components] lastObject] getBytes:&n];
- quitWithoutQuery = (BOOL) n;
- break;
- }
-
- default:
- NSLog(@"Unknown message from server thread.");
- }
-}
-
-// Quit the X server when the X client process finishes
-- (void)clientProcessDone:(int)clientStatus
-{
- if (WIFEXITED(clientStatus)) {
- int exitStatus = WEXITSTATUS(clientStatus);
- if (exitStatus != 0)
- NSLog(@"X client process terminated with status %i.", exitStatus);
- } else {
- NSLog(@"X client process terminated abnormally.");
- }
-
- if (!quartzServerQuitting) {
- [NSApp terminate:nil]; // quit if we aren't already
- }
-}
-
-// User selected an X11 window from a menu
-- (IBAction)itemSelected:(id)sender
-{
- xEvent xe;
-
- [NSApp activateIgnoringOtherApps:YES];
-
- // Notify the client of the change through the X server thread
- xe.u.u.type = kXDarwinControllerNotify;
- xe.u.clientMessage.u.l.longs0 = AppleWMWindowMenuItem;
- xe.u.clientMessage.u.l.longs1 = [sender tag];
- [self sendXEvent:&xe];
-}
-
-// User selected Next from window menu
-- (IBAction)nextWindow:(id)sender
-{
- QuartzMessageServerThread(kXDarwinControllerNotify, 1,
- AppleWMNextWindow);
-}
-
-// User selected Previous from window menu
-- (IBAction)previousWindow:(id)sender
-{
- QuartzMessageServerThread(kXDarwinControllerNotify, 1,
- AppleWMPreviousWindow);
-}
-
-/*
- * The XPR implementation handles close, minimize, and zoom actions for X11
- * windows here, while CR handles these in the NSWindow class.
- */
-
-// Handle Close from window menu for X11 window in XPR implementation
-- (IBAction)performClose:(id)sender
-{
- QuartzMessageServerThread(kXDarwinControllerNotify, 1,
- AppleWMCloseWindow);
-}
-
-// Handle Minimize from window menu for X11 window in XPR implementation
-- (IBAction)performMiniaturize:(id)sender
-{
- QuartzMessageServerThread(kXDarwinControllerNotify, 1,
- AppleWMMinimizeWindow);
-}
-
-// Handle Zoom from window menu for X11 window in XPR implementation
-- (IBAction)performZoom:(id)sender
-{
- QuartzMessageServerThread(kXDarwinControllerNotify, 1,
- AppleWMZoomWindow);
-}
-
-// Handle "Bring All to Front" from window menu
-- (IBAction)bringAllToFront:(id)sender
-{
- if ((AppleWMSelectedEvents() & AppleWMControllerNotifyMask) != 0) {
- QuartzMessageServerThread(kXDarwinControllerNotify, 1,
- AppleWMBringAllToFront);
- } else {
- [NSApp arrangeInFront:nil];
- }
-}
-
-// This ends up at the end of the responder chain.
-- (IBAction)copy:(id)sender
-{
- QuartzMessageServerThread(kXDarwinPasteboardNotify, 1,
- AppleWMCopyToPasteboard);
-}
-
-// Set whether or not X11 is active and should receive all key events
-- (void)activateX11:(BOOL)state
-{
- if (state) {
- QuartzMessageServerThread(kXDarwinActivate, 0);
- }
- else {
- QuartzMessageServerThread(kXDarwinDeactivate, 0);
- }
-
- x11Active = state;
-}
-
-// Some NSWindow became the key window
-- (void)windowBecameKey:(NSNotification *)notification
-{
- NSWindow *window = [notification object];
-
- if (quartzProcs->IsX11Window(window, [window windowNumber])) {
- if (!x11Active)
- [self activateX11:YES];
- } else {
- if (x11Active)
- [self activateX11:NO];
- }
-}
-
-// Set the Apple-WM specifiable part of the window menu
-- (void)setX11WindowList:(NSArray *)list
-{
- NSMenuItem *item;
- int first, count, i;
- xEvent xe;
-
- /* Work backwards so we don't mess up the indices */
- first = [windowMenu indexOfItem:windowSeparator] + 1;
- if (first > 0) {
- count = [windowMenu numberOfItems];
- for (i = count - 1; i >= first; i--)
- [windowMenu removeItemAtIndex:i];
- } else {
- windowSeparator = (NSMenuItem *)[windowMenu addItemWithTitle:@""
- action:nil
- keyEquivalent:@""];
- }
-
- count = [dockMenu numberOfItems];
- for (i = 0; i < count; i++)
- [dockMenu removeItemAtIndex:0];
-
- count = [list count];
-
- for (i = 0; i < count; i++)
- {
- NSString *name, *shortcut;
-
- name = [[list objectAtIndex:i] objectAtIndex:0];
- shortcut = [[list objectAtIndex:i] objectAtIndex:1];
-
- item = (NSMenuItem *)[windowMenu addItemWithTitle:name
- action:@selector(itemSelected:)
- keyEquivalent:shortcut];
- [item setTarget:self];
- [item setTag:i];
- [item setEnabled:YES];
-
- item = (NSMenuItem *)[dockMenu insertItemWithTitle:name
- action:@selector(itemSelected:)
- keyEquivalent:shortcut atIndex:i];
- [item setTarget:self];
- [item setTag:i];
- [item setEnabled:YES];
- }
-
- if (checkedWindowItem >= 0 && checkedWindowItem < count)
- {
- item = (NSMenuItem *)[windowMenu itemAtIndex:first + checkedWindowItem];
- [item setState:NSOnState];
- item = (NSMenuItem *)[dockMenu itemAtIndex:checkedWindowItem];
- [item setState:NSOnState];
- }
-
- // Notify the client of the change through the X server thread
- xe.u.u.type = kXDarwinControllerNotify;
- xe.u.clientMessage.u.l.longs0 = AppleWMWindowMenuNotify;
- [self sendXEvent:&xe];
-}
-
-// Set the checked item on the Apple-WM specifiable window menu
-- (void)setX11WindowCheck:(NSNumber *)nn
-{
- NSMenuItem *item;
- int first, count;
- int n = [nn intValue];
-
- first = [windowMenu indexOfItem:windowSeparator] + 1;
- count = [windowMenu numberOfItems] - first;
-
- if (checkedWindowItem >= 0 && checkedWindowItem < count)
- {
- item = (NSMenuItem *)[windowMenu itemAtIndex:first + checkedWindowItem];
- [item setState:NSOffState];
- item = (NSMenuItem *)[dockMenu itemAtIndex:checkedWindowItem];
- [item setState:NSOffState];
- }
- if (n >= 0 && n < count)
- {
- item = (NSMenuItem *)[windowMenu itemAtIndex:first + n];
- [item setState:NSOnState];
- item = (NSMenuItem *)[dockMenu itemAtIndex:n];
- [item setState:NSOnState];
- }
- checkedWindowItem = n;
-}
-
-// Return whether or not a menu item should be enabled
-- (BOOL)validateMenuItem:(NSMenuItem *)item
-{
- NSMenu *menu = [item menu];
-
- if (menu == windowMenu && [item tag] == 30) {
- // Mode switch panel is for fullscreen only
- return !quartzRootless;
- }
- else if ((menu == windowMenu && [item tag] != 40) || menu == dockMenu) {
- // The special window and dock menu items should not be active unless
- // there is an AppleWM-aware window manager running.
- return (AppleWMSelectedEvents() & AppleWMControllerNotifyMask) != 0;
- }
- else {
- return TRUE;
- }
-}
-
-/*
- * Application Delegate Methods
- */
-
-- (void)applicationDidChangeScreenParameters:(NSNotification *)aNotification
-{
- if (quartzProcs->ScreenChanged)
- quartzProcs->ScreenChanged();
-}
-
-- (void)applicationDidHide:(NSNotification *)aNotification
-{
- if ((AppleWMSelectedEvents() & AppleWMControllerNotifyMask) != 0) {
- QuartzMessageServerThread(kXDarwinControllerNotify, 1,
- AppleWMHideAll);
- } else {
- if (quartzProcs->HideWindows)
- quartzProcs->HideWindows(YES);
- }
-}
-
-- (void)applicationDidUnhide:(NSNotification *)aNotification
-{
- if ((AppleWMSelectedEvents() & AppleWMControllerNotifyMask) != 0) {
- QuartzMessageServerThread(kXDarwinControllerNotify, 1,
- AppleWMShowAll);
- } else {
- if (quartzProcs->HideWindows)
- quartzProcs->HideWindows(NO);
- }
-}
-
-// Called when the user clicks the application icon,
-// but not when Cmd-Tab is used.
-// Rootless: Don't switch until applicationWillBecomeActive.
-- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication
- hasVisibleWindows:(BOOL)flag
-{
- if ([Preferences dockSwitch] && !quartzRootless) {
- [self showServer:YES];
- }
- return NO;
-}
-
-- (void)applicationWillResignActive:(NSNotification *)aNotification
-{
- [self showServer:NO];
-}
-
-- (void)applicationWillBecomeActive:(NSNotification *)aNotification
-{
- if (quartzRootless) {
- [self showServer:YES];
-
- // If there is no AppleWM-aware window manager, we can't allow
- // interleaving of Aqua and X11 windows.
- if ((AppleWMSelectedEvents() & AppleWMControllerNotifyMask) == 0) {
- [NSApp arrangeInFront:nil];
- }
- }
-}
-
-// Called when the user opens a document type that we claim (ie. an X11 executable).
-- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
-{
- if (serverState == server_Running) {
- [self runClient:filename];
- return YES;
- }
- else if (serverState == server_NotStarted || serverState == server_Starting) {
- if ([filename UTF8String][0] != ':') { // Ignore display names
- if (!pendingClients) {
- pendingClients = [[NSMutableArray alloc] initWithCapacity:1];
- }
- [pendingClients addObject:filename];
- return YES; // Assume it will launch successfully
- }
- return NO;
- }
-
- // If the server is quitting or done,
- // its too late to launch new clients this time.
- return NO;
-}
-
-@end
-
-
-// Send a message to the main thread, which calls handlePortMessage in
-// response. Must only be called from the X server thread because
-// NSPort is not thread safe.
-void QuartzMessageMainThread(unsigned msg, void *data, unsigned length)
-{
- if (length > 0) {
- NSData *eventData = [NSData dataWithBytes:data length:length];
- NSArray *eventArray = [NSArray arrayWithObject:eventData];
- NSPortMessage *newMessage =
- [[NSPortMessage alloc]
- initWithSendPort:signalPort
- receivePort:returnPort components:eventArray];
- [newMessage setMsgid:msg];
- [newMessage sendBeforeDate:[NSDate distantPast]];
- [newMessage release];
- } else {
- [signalMessage setMsgid:msg];
- [signalMessage sendBeforeDate:[NSDate distantPast]];
- }
-}
-
-void
-QuartzSetWindowMenu(int nitems, const char **items,
- const char *shortcuts)
-{
- NSMutableArray *array;
- int i;
-
- array = [[NSMutableArray alloc] initWithCapacity:nitems];
-
- for (i = 0; i < nitems; i++) {
- NSMutableArray *subarray = [NSMutableArray arrayWithCapacity:2];
- NSString *string = [NSString stringWithUTF8String:items[i]];
-
- [subarray addObject:string];
-
- if (shortcuts[i] != 0) {
- NSString *number = [NSString stringWithFormat:@"%d",
- shortcuts[i]];
- [subarray addObject:number];
- } else
- [subarray addObject:@""];
-
- [array addObject:subarray];
- }
-
- /* Send the array of strings over to the main thread. */
- /* Will be released in main thread. */
- QuartzMessageMainThread(kQuartzSetWindowMenu, &array, sizeof(NSArray *));
-}
-
-// Handle SIGCHLD signals
-static void childDone(int sig)
-{
- int clientStatus;
-
- if (clientPID == 0)
- return;
-
- // Make sure it was the client task that finished
- if (waitpid(clientPID, &clientStatus, WNOHANG) == clientPID) {
- if (WIFSTOPPED(clientStatus))
- return;
- clientPID = 0;
- [oneXServer clientProcessDone:clientStatus];
- }
-}
-
-static void powerDidChange(
- void *x,
- io_service_t y,
- natural_t messageType,
- void *messageArgument)
-{
- switch (messageType) {
- case kIOMessageSystemWillSleep:
- if (!quartzRootless) {
- [oneXServer setRootClip:FALSE];
- }
- IOAllowPowerChange(root_port, (long)messageArgument);
- break;
- case kIOMessageCanSystemSleep:
- IOAllowPowerChange(root_port, (long)messageArgument);
- break;
- case kIOMessageSystemHasPoweredOn:
- if (!quartzRootless) {
- [oneXServer setRootClip:TRUE];
- }
- break;
- }
-
-}
diff --git a/hw/darwin/quartz/cr/XView.m b/hw/darwin/quartz/cr/XView.m
deleted file mode 100644
index 5feac6b42..000000000
--- a/hw/darwin/quartz/cr/XView.m
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * NSView subclass for Mac OS X rootless X server
- *
- * Each rootless window contains an instance of this class.
- * This class handles events while drawing is handled by Carbon
- * code in the rootless Aqua implementation.
- *
- * Copyright (c) 2001 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.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/XView.m,v 1.1 2003/06/07 05:49:07 torrey Exp $ */
-
-#import "XView.h"
-
-
-@implementation XView
-
-- (BOOL)isFlipped
-{
- return NO;
-}
-
-- (BOOL)isOpaque
-{
- return YES;
-}
-
-- (BOOL)acceptsFirstResponder
-{
- return YES;
-}
-
-- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent
-{
- return YES;
-}
-
-- (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent *)theEvent
-{
- return YES;
-}
-
-- (void)mouseDown:(NSEvent *)anEvent
-{
- // Only X is allowed to restack windows.
- [NSApp preventWindowOrdering];
- if (! [NSApp isActive]) {
- [NSApp activateIgnoringOtherApps:YES];
- }
- [[self nextResponder] mouseDown:anEvent];
-}
-
-@end
diff --git a/hw/darwin/quartz/cr/cr.h b/hw/darwin/quartz/cr/cr.h
deleted file mode 100644
index 94133e4af..000000000
--- a/hw/darwin/quartz/cr/cr.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Internal definitions of the Cocoa rootless implementation
- */
-/*
- * Copyright (c) 2003 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.
- */
-/* $XFree86$ */
-
-#ifndef _CR_H
-#define _CR_H
-
-#ifdef __OBJC__
-#import <Cocoa/Cocoa.h>
-#import "XView.h"
-#else
-typedef struct OpaqueNSWindow NSWindow;
-typedef struct OpaqueXView XView;
-#endif
-
-#undef BOOL
-#define BOOL xBOOL
-#include "screenint.h"
-#include "window.h"
-#undef BOOL
-
-// Predefined style for the window which is about to be framed
-extern WindowPtr nextWindowToFrame;
-extern unsigned int nextWindowStyle;
-
-typedef struct {
- NSWindow *window;
- XView *view;
- GrafPtr port;
- CGContextRef context;
-} CRWindowRec, *CRWindowPtr;
-
-Bool CRInit(ScreenPtr pScreen);
-void CRAppleWMInit(void);
-
-#endif /* _CR_H */
diff --git a/hw/darwin/quartz/cr/crAppleWM.m b/hw/darwin/quartz/cr/crAppleWM.m
deleted file mode 100644
index a2e97ff81..000000000
--- a/hw/darwin/quartz/cr/crAppleWM.m
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Cocoa rootless implementation functions for AppleWM extension
- */
-/*
- * Copyright (c) 2003 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.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c,v 1.2 2003/06/30 01:45:13 torrey Exp $ */
-
-#include "quartzCommon.h"
-#include "cr.h"
-
-#undef BOOL
-#define BOOL xBOOL
-#include "rootless.h"
-#include "X.h"
-#define _APPLEWM_SERVER_
-#include "applewm.h"
-#include "applewmExt.h"
-#undef BOOL
-
-#define StdDocumentStyleMask (NSTitledWindowMask | \
- NSClosableWindowMask | \
- NSMiniaturizableWindowMask | \
- NSResizableWindowMask)
-
-static int
-CRDisableUpdate(void)
-{
- return Success;
-}
-
-
-static int
-CREnableUpdate(void)
-{
- return Success;
-}
-
-
-static int CRSetWindowLevel(
- WindowPtr pWin,
- int level)
-{
- CRWindowPtr crWinPtr;
-
- crWinPtr = (CRWindowPtr) RootlessFrameForWindow(pWin, TRUE);
- if (crWinPtr == 0)
- return BadWindow;
-
- RootlessStopDrawing(pWin, FALSE);
-
- [crWinPtr->window setLevel:level];
-
- return Success;
-}
-
-
-static int CRFrameGetRect(
- int type,
- int class,
- const BoxRec *outer,
- const BoxRec *inner,
- BoxRec *ret)
-{
- return Success;
-}
-
-
-static int CRFrameHitTest(
- int class,
- int x,
- int y,
- const BoxRec *outer,
- const BoxRec *inner,
- int *ret)
-{
- return 0;
-}
-
-
-static int CRFrameDraw(
- WindowPtr pWin,
- int class,
- unsigned int attr,
- const BoxRec *outer,
- const BoxRec *inner,
- unsigned int title_len,
- const unsigned char *title_bytes)
-{
- CRWindowPtr crWinPtr;
- NSWindow *window;
- Bool hasResizeIndicator;
-
- /* We assume the window has not yet been framed so
- RootlessFrameForWindow() will cause it to be. Record the window
- style so that the appropriate one will be used when it is framed.
- If the window is already framed, we can't change the window
- style and the following will have no effect. */
-
- nextWindowToFrame = pWin;
- if (class == AppleWMFrameClassDocument)
- nextWindowStyle = StdDocumentStyleMask;
- else
- nextWindowStyle = NSBorderlessWindowMask;
-
- crWinPtr = (CRWindowPtr) RootlessFrameForWindow(pWin, TRUE);
- if (crWinPtr == 0)
- return BadWindow;
-
- window = crWinPtr->window;
-
- [window setTitle:[NSString stringWithCString:title_bytes
- length:title_len]];
-
- hasResizeIndicator = (attr & AppleWMFrameGrowBox) ? YES : NO;
- [window setShowsResizeIndicator:hasResizeIndicator];
-
- return Success;
-}
-
-
-static AppleWMProcsRec crAppleWMProcs = {
- CRDisableUpdate,
- CREnableUpdate,
- CRSetWindowLevel,
- CRFrameGetRect,
- CRFrameHitTest,
- CRFrameDraw
-};
-
-
-void CRAppleWMInit(void)
-{
- AppleWMExtensionInit(&crAppleWMProcs);
-}
diff --git a/hw/darwin/quartz/cr/crFrame.m b/hw/darwin/quartz/cr/crFrame.m
deleted file mode 100644
index 79d55a4d1..000000000
--- a/hw/darwin/quartz/cr/crFrame.m
+++ /dev/null
@@ -1,439 +0,0 @@
-/*
- * Cocoa rootless implementation frame functions
- */
-/*
- * Copyright (c) 2001 Greg Parker. All Rights Reserved.
- * Copyright (c) 2002-2003 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.
- */
-/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/cr/crFrame.m,v 1.2 2004/04/23 19:15:51 eich Exp $ */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/crFrame.m,v 1.9 2004/03/19 02:05:29 torrey Exp $ */
-
-#include "quartzCommon.h"
-#include "cr.h"
-
-#undef BOOL
-#define BOOL xBOOL
-#include "rootless.h"
-#include "applewmExt.h"
-#include "windowstr.h"
-#undef BOOL
-
-WindowPtr nextWindowToFrame = NULL;
-unsigned int nextWindowStyle = 0;
-
-static void CRReshapeFrame(RootlessFrameID wid, RegionPtr pShape);
-
-
-/*
- * CRCreateFrame
- * Create a new physical window.
- * Rootless windows must not autodisplay! Autodisplay can cause a deadlock.
- * Event thread - autodisplay: locks view hierarchy, then window
- * X Server thread - window resize: locks window, then view hierarchy
- * Deadlock occurs if each thread gets one lock and waits for the other.
- */
-static Bool
-CRCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
- int newX, int newY, RegionPtr pShape)
-{
- CRWindowPtr crWinPtr;
- NSRect bounds;
- NSWindow *theWindow;
- XView *theView;
- unsigned int theStyleMask = NSBorderlessWindowMask;
-
- crWinPtr = (CRWindowPtr) xalloc(sizeof(CRWindowRec));
-
- bounds = NSMakeRect(newX,
- NSHeight([[NSScreen mainScreen] frame]) -
- newY - pFrame->height,
- pFrame->width, pFrame->height);
-
- // Check if AppleWM has specified a style for this window
- if (pFrame->win == nextWindowToFrame) {
- theStyleMask = nextWindowStyle;
- }
- nextWindowToFrame = NULL;
-
- // Create an NSWindow for the new X11 window
- theWindow = [[NSWindow alloc] initWithContentRect:bounds
- styleMask:theStyleMask
- backing:NSBackingStoreBuffered
-#ifdef DEFER_NSWINDOW
- defer:YES];
-#else
- defer:NO];
-#endif
-
- if (!theWindow) return FALSE;
-
- [theWindow setBackgroundColor:[NSColor clearColor]]; // erase transparent
- [theWindow setAlphaValue:1.0]; // draw opaque
- [theWindow setOpaque:YES]; // changed when window is shaped
-
- [theWindow useOptimizedDrawing:YES]; // Has no overlapping sub-views
- [theWindow setAutodisplay:NO]; // See comment above
- [theWindow disableFlushWindow]; // We do all the flushing manually
- [theWindow setHasShadow:YES]; // All windows have shadows
- [theWindow setReleasedWhenClosed:YES]; // Default, but we want to be sure
-
- theView = [[XView alloc] initWithFrame:bounds];
- [theWindow setContentView:theView];
- [theWindow setInitialFirstResponder:theView];
-
-#ifdef DEFER_NSWINDOW
- // We need the NSWindow to actually be created now.
- // If we had to defer creating it, we have to order it
- // onto the screen to force it to be created.
-
- if (pFrame->win->prevSib) {
- CRWindowPtr crWinPtr = (CRWindowPtr) RootlessFrameForWindow(
- pFrame->win->prevSib, FALSE);
- int upperNum = [crWinPtr->window windowNumber];
- [theWindow orderWindow:NSWindowBelow relativeTo:upperNum];
- } else {
- [theWindow orderFront:nil];
- }
-#endif
-
- [theWindow setAcceptsMouseMovedEvents:YES];
-
- crWinPtr->window = theWindow;
- crWinPtr->view = theView;
-
- [theView lockFocus];
- // Fill the window with white to make sure alpha channel is set
- NSEraseRect(bounds);
- crWinPtr->port = [theView qdPort];
- crWinPtr->context = [[NSGraphicsContext currentContext] graphicsPort];
- // CreateCGContextForPort(crWinPtr->port, &crWinPtr->context);
- [theView unlockFocus];
-
- // Store the implementation private frame ID
- pFrame->wid = (RootlessFrameID) crWinPtr;
-
- // Reshape the frame if it was created shaped.
- if (pShape != NULL)
- CRReshapeFrame(pFrame->wid, pShape);
-
- return TRUE;
-}
-
-
-/*
- * CRDestroyFrame
- * Destroy a frame.
- */
-static void
-CRDestroyFrame(RootlessFrameID wid)
-{
- CRWindowPtr crWinPtr = (CRWindowPtr) wid;
-
- [crWinPtr->window orderOut:nil];
- [crWinPtr->window close];
- [crWinPtr->view release];
- free(crWinPtr);
-}
-
-
-/*
- * CRMoveFrame
- * Move a frame on screen.
- */
-static void
-CRMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY)
-{
- CRWindowPtr crWinPtr = (CRWindowPtr) wid;
- NSPoint topLeft;
-
- topLeft = NSMakePoint(newX,
- NSHeight([[NSScreen mainScreen] frame]) - newY);
-
- [crWinPtr->window setFrameTopLeftPoint:topLeft];
-}
-
-
-/*
- * CRResizeFrame
- * Move and resize a frame.
- */
-static void
-CRResizeFrame(RootlessFrameID wid, ScreenPtr pScreen,
- int newX, int newY, unsigned int newW, unsigned int newH,
- unsigned int gravity)
-{
- CRWindowPtr crWinPtr = (CRWindowPtr) wid;
- NSRect bounds = NSMakeRect(newX, NSHeight([[NSScreen mainScreen] frame]) -
- newY - newH, newW, newH);
-
- [crWinPtr->window setFrame:bounds display:NO];
-}
-
-
-/*
- * CRRestackFrame
- * Change the frame order. Put the frame behind nextWid or on top if
- * it is NULL. Unmapped frames are mapped by restacking them.
- */
-static void
-CRRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid)
-{
- CRWindowPtr crWinPtr = (CRWindowPtr) wid;
- CRWindowPtr crNextWinPtr = (CRWindowPtr) nextWid;
-
- if (crNextWinPtr) {
- int upperNum = [crNextWinPtr->window windowNumber];
-
- [crWinPtr->window orderWindow:NSWindowBelow relativeTo:upperNum];
- } else {
- [crWinPtr->window makeKeyAndOrderFront:nil];
- }
-}
-
-
-/*
- * CRReshapeFrame
- * Set the shape of a frame.
- */
-static void
-CRReshapeFrame(RootlessFrameID wid, RegionPtr pShape)
-{
- CRWindowPtr crWinPtr = (CRWindowPtr) wid;
- NSRect bounds = [crWinPtr->view frame];
- int winHeight = NSHeight(bounds);
- BoxRec localBox = {0, 0, NSWidth(bounds), winHeight};
-
- [crWinPtr->view lockFocus];
-
- if (pShape != NULL) {
- // Calculate the region outside the new shape.
- miInverse(pShape, pShape, &localBox);
- }
-
- // If window is currently shaped we need to undo the previous shape.
- if (![crWinPtr->window isOpaque]) {
- [[NSColor whiteColor] set];
- NSRectFillUsingOperation(bounds, NSCompositeDestinationAtop);
- }
-
- if (pShape != NULL) {
- int count = REGION_NUM_RECTS(pShape);
- BoxRec *extRects = REGION_RECTS(pShape);
- BoxRec *rects, *end;
-
- // Make transparent if window is now shaped.
- [crWinPtr->window setOpaque:NO];
-
- // Clear the areas outside the window shape
- [[NSColor clearColor] set];
- for (rects = extRects, end = extRects+count; rects < end; rects++) {
- int rectHeight = rects->y2 - rects->y1;
- NSRectFill( NSMakeRect(rects->x1,
- winHeight - rects->y1 - rectHeight,
- rects->x2 - rects->x1, rectHeight) );
- }
- [[NSGraphicsContext currentContext] flushGraphics];
-
- // force update of window shadow
- [crWinPtr->window setHasShadow:NO];
- [crWinPtr->window setHasShadow:YES];
-
- } else {
- [crWinPtr->window setOpaque:YES];
- [[NSGraphicsContext currentContext] flushGraphics];
- }
-
- [crWinPtr->view unlockFocus];
-}
-
-
-/*
- * CRUnmapFrame
- * Unmap a frame.
- */
-static void
-CRUnmapFrame(RootlessFrameID wid)
-{
- CRWindowPtr crWinPtr = (CRWindowPtr) wid;
-
- [crWinPtr->window orderOut:nil];
-}
-
-
-/*
- * CRStartDrawing
- * When a window's buffer is not being drawn to, the CoreGraphics
- * window server may compress or move it. Call this routine
- * to lock down the buffer during direct drawing. It returns
- * a pointer to the backing buffer.
- */
-static void
-CRStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow)
-{
- CRWindowPtr crWinPtr = (CRWindowPtr) wid;
- PixMapHandle pix;
-
- [crWinPtr->view lockFocus];
- crWinPtr->port = [crWinPtr->view qdPort];
- LockPortBits(crWinPtr->port);
- [crWinPtr->view unlockFocus];
- pix = GetPortPixMap(crWinPtr->port);
-
- *pixelData = GetPixBaseAddr(pix);
- *bytesPerRow = GetPixRowBytes(pix) & 0x3fff; // fixme is mask needed?
-}
-
-
-/*
- * CRStopDrawing
- * When direct access to a window's buffer is no longer needed, this
- * routine should be called to allow CoreGraphics to compress or
- * move it.
- */
-static void
-CRStopDrawing(RootlessFrameID wid, Bool flush)
-{
- CRWindowPtr crWinPtr = (CRWindowPtr) wid;
-
- UnlockPortBits(crWinPtr->port);
-
- if (flush) {
- QDFlushPortBuffer(crWinPtr->port, NULL);
- }
-}
-
-
-/*
- * CRUpdateRegion
- * Flush a region from a window's backing buffer to the screen.
- */
-static void
-CRUpdateRegion(RootlessFrameID wid, RegionPtr pDamage)
-{
- CRWindowPtr crWinPtr = (CRWindowPtr) wid;
-
-#ifdef ROOTLESS_TRACK_DAMAGE
- int count = REGION_NUM_RECTS(pDamage);
- BoxRec *rects = REGION_RECTS(pDamage);
- BoxRec *end;
-
- static RgnHandle rgn = NULL;
- static RgnHandle box = NULL;
-
- if (!rgn) rgn = NewRgn();
- if (!box) box = NewRgn();
-
- for (end = rects+count; rects < end; rects++) {
- Rect qdRect;
- qdRect.left = rects->x1;
- qdRect.top = rects->y1;
- qdRect.right = rects->x2;
- qdRect.bottom = rects->y2;
-
- RectRgn(box, &qdRect);
- UnionRgn(rgn, box, rgn);
- }
-
- QDFlushPortBuffer(crWinPtr->port, rgn);
-
- SetEmptyRgn(rgn);
- SetEmptyRgn(box);
-
-#else /* !ROOTLESS_TRACK_DAMAGE */
- QDFlushPortBuffer(crWinPtr->port, NULL);
-#endif
-}
-
-
-/*
- * CRDamageRects
- * Mark damaged rectangles as requiring redisplay to screen.
- */
-static void
-CRDamageRects(RootlessFrameID wid, int count, const BoxRec *rects,
- int shift_x, int shift_y)
-{
- CRWindowPtr crWinPtr = (CRWindowPtr) wid;
- const BoxRec *end;
-
- for (end = rects + count; rects < end; rects++) {
- Rect qdRect;
- qdRect.left = rects->x1 + shift_x;
- qdRect.top = rects->y1 + shift_y;
- qdRect.right = rects->x2 + shift_x;
- qdRect.bottom = rects->y2 + shift_y;
-
- QDAddRectToDirtyRegion(crWinPtr->port, &qdRect);
- }
-}
-
-
-/*
- * Called to check if the frame should be reordered when it is restacked.
- */
-Bool CRDoReorderWindow(RootlessWindowPtr pFrame)
-{
- WindowPtr pWin = pFrame->win;
-
- return AppleWMDoReorderWindow(pWin);
-}
-
-
-static RootlessFrameProcsRec CRRootlessProcs = {
- CRCreateFrame,
- CRDestroyFrame,
- CRMoveFrame,
- CRResizeFrame,
- CRRestackFrame,
- CRReshapeFrame,
- CRUnmapFrame,
- CRStartDrawing,
- CRStopDrawing,
- CRUpdateRegion,
- CRDamageRects,
- NULL,
- CRDoReorderWindow,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-
-/*
- * Initialize CR implementation
- */
-Bool
-CRInit(ScreenPtr pScreen)
-{
- RootlessInit(pScreen, &CRRootlessProcs);
-
- rootless_CopyBytes_threshold = 0;
- rootless_FillBytes_threshold = 0;
- rootless_CompositePixels_threshold = 0;
- rootless_CopyWindow_threshold = 0;
-
- return TRUE;
-}
diff --git a/hw/darwin/quartz/cr/crScreen.m b/hw/darwin/quartz/cr/crScreen.m
deleted file mode 100644
index 21a79e006..000000000
--- a/hw/darwin/quartz/cr/crScreen.m
+++ /dev/null
@@ -1,381 +0,0 @@
-/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/cr/crScreen.m,v 1.4 2004/08/12 20:24:36 torrey Exp $ */
-/*
- * Cocoa rootless implementation initialization
- */
-/*
- * Copyright (c) 2001 Greg Parker. All Rights Reserved.
- * Copyright (c) 2002-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.
- */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/crScreen.m,v 1.5 2003/11/12 20:21:52 torrey Exp $ */
-
-#include "quartzCommon.h"
-#include "cr.h"
-
-#undef BOOL
-#define BOOL xBOOL
-#include "darwin.h"
-#include "quartz.h"
-#include "quartzCursor.h"
-#include "rootless.h"
-#include "safeAlpha.h"
-#include "pseudoramiX.h"
-#include "applewmExt.h"
-
-#include "regionstr.h"
-#include "scrnintstr.h"
-#include "picturestr.h"
-#include "globals.h"
-#ifdef DAMAGE
-# include "damage.h"
-#endif
-#undef BOOL
-
-// Name of GLX bundle using AGL framework
-static const char *crOpenGLBundle = "glxAGL.bundle";
-
-static Class classXView = nil;
-
-
-/*
- * CRDisplayInit
- * Find all screens.
- *
- * Multihead note: When rootless mode uses PseudoramiX, the
- * X server only sees one screen; only PseudoramiX itself knows
- * about all of the screens.
- */
-static void
-CRDisplayInit(void)
-{
- ErrorF("Display mode: Rootless Quartz -- Cocoa implementation\n");
-
- if (noPseudoramiXExtension) {
- darwinScreensFound = [[NSScreen screens] count];
- } else {
- darwinScreensFound = 1; // only PseudoramiX knows about the rest
- }
-
- CRAppleWMInit();
-}
-
-
-/*
- * CRAddPseudoramiXScreens
- * Add a single virtual screen encompassing all the physical screens
- * with PseudoramiX.
- */
-static void
-CRAddPseudoramiXScreens(int *x, int *y, int *width, int *height)
-{
- int i;
- NSRect unionRect = NSMakeRect(0, 0, 0, 0);
- NSArray *screens = [NSScreen screens];
-
- // Get the union of all screens (minus the menu bar on main screen)
- for (i = 0; i < [screens count]; i++) {
- NSScreen *screen = [screens objectAtIndex:i];
- NSRect frame = [screen frame];
- frame.origin.y = [[NSScreen mainScreen] frame].size.height -
- frame.size.height - frame.origin.y;
- if (NSEqualRects([screen frame], [[NSScreen mainScreen] frame])) {
- frame.origin.y += aquaMenuBarHeight;
- frame.size.height -= aquaMenuBarHeight;
- }
- unionRect = NSUnionRect(unionRect, frame);
- }
-
- // Use unionRect as the screen size for the X server.
- *x = unionRect.origin.x;
- *y = unionRect.origin.y;
- *width = unionRect.size.width;
- *height = unionRect.size.height;
-
- // Tell PseudoramiX about the real screens.
- // InitOutput() will move the big screen to (0,0),
- // so compensate for that here.
- for (i = 0; i < [screens count]; i++) {
- NSScreen *screen = [screens objectAtIndex:i];
- NSRect frame = [screen frame];
- int j;
-
- // Skip this screen if it's a mirrored copy of an earlier screen.
- for (j = 0; j < i; j++) {
- if (NSEqualRects(frame, [[screens objectAtIndex:j] frame])) {
- ErrorF("PseudoramiX screen %d is a mirror of screen %d.\n",
- i, j);
- break;
- }
- }
- if (j < i) continue; // this screen is a mirrored copy
-
- frame.origin.y = [[NSScreen mainScreen] frame].size.height -
- frame.size.height - frame.origin.y;
-
- if (NSEqualRects([screen frame], [[NSScreen mainScreen] frame])) {
- frame.origin.y += aquaMenuBarHeight;
- frame.size.height -= aquaMenuBarHeight;
- }
-
- 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);
-
- PseudoramiXAddScreen(frame.origin.x, frame.origin.y,
- frame.size.width, frame.size.height);
- }
-}
-
-
-/*
- * CRScreenParams
- * Set the basic screen parameters.
- */
-static void
-CRScreenParams(int index, DarwinFramebufferPtr dfb)
-{
- dfb->bitsPerComponent = CGDisplayBitsPerSample(kCGDirectMainDisplay);
- dfb->bitsPerPixel = CGDisplayBitsPerPixel(kCGDirectMainDisplay);
- dfb->colorBitsPerPixel = 3 * dfb->bitsPerComponent;
-
- if (noPseudoramiXExtension) {
- NSScreen *screen = [[NSScreen screens] objectAtIndex:index];
- NSRect frame = [screen frame];
-
- // set x, y so (0,0) is top left of main screen
- dfb->x = NSMinX(frame);
- dfb->y = NSHeight([[NSScreen mainScreen] frame]) -
- NSHeight(frame) - NSMinY(frame);
-
- dfb->width = NSWidth(frame);
- dfb->height = NSHeight(frame);
-
- // Shift the usable part of main screen down to avoid the menu bar.
- if (NSEqualRects(frame, [[NSScreen mainScreen] frame])) {
- dfb->y += aquaMenuBarHeight;
- dfb->height -= aquaMenuBarHeight;
- }
-
- } else {
- CRAddPseudoramiXScreens(&dfb->x, &dfb->y, &dfb->width, &dfb->height);
- }
-}
-
-
-/*
- * CRAddScreen
- * Init the framebuffer and record pixmap parameters for the screen.
- */
-static Bool
-CRAddScreen(int index, ScreenPtr pScreen)
-{
- DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
- QuartzScreenPtr displayInfo = QUARTZ_PRIV(pScreen);
- CGRect cgRect;
- CGDisplayCount numDisplays;
- CGDisplayCount allocatedDisplays = 0;
- CGDirectDisplayID *displays = NULL;
- CGDisplayErr cgErr;
-
- CRScreenParams(index, dfb);
-
- dfb->colorType = TrueColor;
-
- /* Passing zero width (pitch) makes miCreateScreenResources set the
- screen pixmap to the framebuffer pointer, i.e. NULL. The generic
- rootless code takes care of making this work. */
- dfb->pitch = 0;
- dfb->framebuffer = NULL;
-
- // Get all CoreGraphics displays covered by this X11 display.
- cgRect = CGRectMake(dfb->x, dfb->y, dfb->width, dfb->height);
- do {
- cgErr = CGGetDisplaysWithRect(cgRect, 0, NULL, &numDisplays);
- if (cgErr) break;
- allocatedDisplays = numDisplays;
- displays = xrealloc(displays,
- numDisplays * sizeof(CGDirectDisplayID));
- cgErr = CGGetDisplaysWithRect(cgRect, allocatedDisplays, displays,
- &numDisplays);
- if (cgErr != CGDisplayNoErr) break;
- } while (numDisplays > allocatedDisplays);
-
- if (cgErr != CGDisplayNoErr || numDisplays == 0) {
- ErrorF("Could not find CGDirectDisplayID(s) for X11 screen %d: %dx%d @ %d,%d.\n",
- index, dfb->width, dfb->height, dfb->x, dfb->y);
- return FALSE;
- }
-
- // This X11 screen covers all CoreGraphics displays we just found.
- // If there's more than one CG display, then video mirroring is on
- // or PseudoramiX is on.
- displayInfo->displayCount = allocatedDisplays;
- displayInfo->displayIDs = displays;
-
- return TRUE;
-}
-
-
-/*
- * CRSetupScreen
- * Setup the screen for rootless access.
- */
-static Bool
-CRSetupScreen(int index, ScreenPtr pScreen)
-{
- // Add alpha protecting replacements for fb screen functions
- pScreen->PaintWindowBackground = SafeAlphaPaintWindow;
- pScreen->PaintWindowBorder = SafeAlphaPaintWindow;
-
-#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);
-
-#ifdef DAMAGE
- // The Damage extension needs to wrap underneath the
- // generic rootless layer, so do it now.
- if (!DamageSetup(pScreen))
- return FALSE;
-#endif
-
- // Initialize generic rootless code
- return CRInit(pScreen);
-}
-
-
-/*
- * CRScreenChanged
- * Configuration of displays has changed.
- */
-static void
-CRScreenChanged(void)
-{
- QuartzMessageServerThread(kXDarwinDisplayChanged, 0);
-}
-
-
-/*
- * CRUpdateScreen
- * Update screen after configuation change.
- */
-static void
-CRUpdateScreen(ScreenPtr pScreen)
-{
- rootlessGlobalOffsetX = darwinMainScreenX;
- rootlessGlobalOffsetY = darwinMainScreenY;
-
- AppleWMSetScreenOrigin(WindowTable[pScreen->myNum]);
-
- RootlessRepositionWindows(pScreen);
- RootlessUpdateScreenPixmap(pScreen);
-}
-
-
-/*
- * CRInitInput
- * Finalize CR specific setup.
- */
-static void
-CRInitInput(int argc, char **argv)
-{
- int i;
-
- rootlessGlobalOffsetX = darwinMainScreenX;
- rootlessGlobalOffsetY = darwinMainScreenY;
-
- for (i = 0; i < screenInfo.numScreens; i++)
- AppleWMSetScreenOrigin(WindowTable[i]);
-}
-
-
-/*
- * CRIsX11Window
- * Returns TRUE if cr is displaying this window.
- */
-static Bool
-CRIsX11Window(void *nsWindow, int windowNumber)
-{
- NSWindow *theWindow = nsWindow;
-
- if (!theWindow)
- return FALSE;
-
- if ([[theWindow contentView] isKindOfClass:classXView])
- return TRUE;
- else
- return FALSE;
-}
-
-
-/*
- * Quartz display mode function list.
- */
-static QuartzModeProcsRec crModeProcs = {
- CRDisplayInit,
- CRAddScreen,
- CRSetupScreen,
- CRInitInput,
- QuartzInitCursor,
- QuartzReallySetCursor,
- QuartzSuspendXCursor,
- QuartzResumeXCursor,
- NULL, // No capture or release in rootless mode
- NULL,
- CRScreenChanged,
- CRAddPseudoramiXScreens,
- CRUpdateScreen,
- CRIsX11Window,
- NULL, // Cocoa NSWindows hide themselves
- RootlessFrameForWindow,
- TopLevelParent,
- NULL, // No support for DRI surfaces
- NULL
-};
-
-
-/*
- * QuartzModeBundleInit
- * Initialize the display mode bundle after loading.
- */
-Bool
-QuartzModeBundleInit(void)
-{
- quartzProcs = &crModeProcs;
- quartzOpenGLBundle = crOpenGLBundle;
- classXView = [XView class];
- return TRUE;
-}
diff --git a/hw/darwin/quartz/fullscreen/fullscreen.c b/hw/darwin/quartz/fullscreen/fullscreen.c
deleted file mode 100644
index a4881f9d9..000000000
--- a/hw/darwin/quartz/fullscreen/fullscreen.c
+++ /dev/null
@@ -1,567 +0,0 @@
-/*
- * Screen routines for full screen Quartz mode
- *
- * Copyright (c) 2002-2003 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
- * TORREY T. LYONS 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 "quartzCommon.h"
-#include "darwin.h"
-#include "quartz.h"
-#include "quartzCursor.h"
-#include "colormapst.h"
-#include "scrnintstr.h"
-#include "micmap.h"
-#include "shadow.h"
-
-// Full screen specific per screen storage structure
-typedef struct {
- CGDirectDisplayID displayID;
- CFDictionaryRef xDisplayMode;
- CFDictionaryRef aquaDisplayMode;
- CGDirectPaletteRef xPalette;
- CGDirectPaletteRef aquaPalette;
- unsigned char *framebuffer;
- unsigned char *shadowPtr;
-} FSScreenRec, *FSScreenPtr;
-
-#define FULLSCREEN_PRIV(pScreen) \
- ((FSScreenPtr)pScreen->devPrivates[fsScreenIndex].ptr)
-
-static int fsScreenIndex;
-static CGDirectDisplayID *quartzDisplayList = NULL;
-static int quartzNumScreens = 0;
-static FSScreenPtr quartzScreens[MAXSCREENS];
-
-static int darwinCmapPrivateIndex = -1;
-static unsigned long darwinCmapGeneration = 0;
-
-#define CMAP_PRIV(pCmap) \
- ((CGDirectPaletteRef) (pCmap)->devPrivates[darwinCmapPrivateIndex].ptr)
-
-/*
- =============================================================================
-
- Colormap handling
-
- =============================================================================
-*/
-
-/*
- * FSInitCmapPrivates
- * Colormap privates may be allocated after the default colormap has
- * already been created for some screens. This initialization procedure
- * is called for each default colormap that is found.
- */
-static Bool
-FSInitCmapPrivates(
- ColormapPtr pCmap)
-{
- return TRUE;
-}
-
-
-/*
- * FSCreateColormap
- * This is a callback from X after a new colormap is created.
- * We allocate a new CoreGraphics pallete for each colormap.
- */
-static Bool
-FSCreateColormap(
- ColormapPtr pCmap)
-{
- CGDirectPaletteRef pallete;
-
- // Allocate private storage for the hardware dependent colormap info.
- if (darwinCmapGeneration != serverGeneration) {
- if ((darwinCmapPrivateIndex =
- AllocateColormapPrivateIndex(FSInitCmapPrivates)) < 0)
- {
- return FALSE;
- }
- darwinCmapGeneration = serverGeneration;
- }
-
- pallete = CGPaletteCreateDefaultColorPalette();
- if (!pallete) return FALSE;
-
- CMAP_PRIV(pCmap) = pallete;
- return TRUE;
-}
-
-
-/*
- * FSDestroyColormap
- * This is called by DIX FreeColormap after it has uninstalled a colormap
- * and notified all interested parties. We deallocated the corresponding
- * CoreGraphics pallete.
- */
-static void
-FSDestroyColormap(
- ColormapPtr pCmap)
-{
- CGPaletteRelease( CMAP_PRIV(pCmap) );
-}
-
-
-/*
- * FSInstallColormap
- * Set the current CoreGraphics pallete to the pallete corresponding
- * to the provided colormap.
- */
-static void
-FSInstallColormap(
- ColormapPtr pCmap)
-{
- CGDirectPaletteRef palette = CMAP_PRIV(pCmap);
- ScreenPtr pScreen = pCmap->pScreen;
- FSScreenPtr fsDisplayInfo = FULLSCREEN_PRIV(pScreen);
-
- // Inform all interested parties that the map is being changed.
- miInstallColormap(pCmap);
-
- if (quartzServerVisible)
- CGDisplaySetPalette(fsDisplayInfo->displayID, palette);
-
- fsDisplayInfo->xPalette = palette;
-}
-
-
-/*
- * FSStoreColors
- * This is a callback from X to change the hardware colormap
- * when using PsuedoColor in full screen mode.
- */
-static void
-FSStoreColors(
- ColormapPtr pCmap,
- int numEntries,
- xColorItem *pdefs)
-{
- CGDirectPaletteRef palette = CMAP_PRIV(pCmap);
- ScreenPtr pScreen = pCmap->pScreen;
- FSScreenPtr fsDisplayInfo = FULLSCREEN_PRIV(pScreen);
- CGDeviceColor color;
- int i;
-
- if (! palette)
- return;
-
- for (i = 0; i < numEntries; i++) {
- color.red = pdefs[i].red / 65535.0;
- color.green = pdefs[i].green / 65535.0;
- color.blue = pdefs[i].blue / 65535.0;
- CGPaletteSetColorAtIndex(palette, color, pdefs[i].pixel);
- }
-
- // Update hardware colormap
- if (quartzServerVisible)
- CGDisplaySetPalette(fsDisplayInfo->displayID, palette);
-}
-
-
-/*
- =============================================================================
-
- Switching between Aqua and X
-
- =============================================================================
-*/
-
-/*
- * FSCapture
- * Capture the screen so we can draw. Called directly from the main thread
- * to synchronize with hiding the menubar.
- */
-static void FSCapture(void)
-{
- int i;
-
- if (quartzRootless) return;
-
- for (i = 0; i < quartzNumScreens; i++) {
- FSScreenPtr fsDisplayInfo = quartzScreens[i];
- CGDirectDisplayID cgID = fsDisplayInfo->displayID;
-
- if (!CGDisplayIsCaptured(cgID)) {
- CGDisplayCapture(cgID);
- fsDisplayInfo->aquaDisplayMode = CGDisplayCurrentMode(cgID);
- if (fsDisplayInfo->xDisplayMode != fsDisplayInfo->aquaDisplayMode)
- CGDisplaySwitchToMode(cgID, fsDisplayInfo->xDisplayMode);
- if (fsDisplayInfo->xPalette)
- CGDisplaySetPalette(cgID, fsDisplayInfo->xPalette);
- }
- }
-}
-
-
-/*
- * FSRelease
- * Release the screen so others can draw.
- */
-static void FSRelease(void)
-{
- int i;
-
- if (quartzRootless) return;
-
- for (i = 0; i < quartzNumScreens; i++) {
- FSScreenPtr fsDisplayInfo = quartzScreens[i];
- CGDirectDisplayID cgID = fsDisplayInfo->displayID;
-
- if (CGDisplayIsCaptured(cgID)) {
- if (fsDisplayInfo->xDisplayMode != fsDisplayInfo->aquaDisplayMode)
- CGDisplaySwitchToMode(cgID, fsDisplayInfo->aquaDisplayMode);
- if (fsDisplayInfo->aquaPalette)
- CGDisplaySetPalette(cgID, fsDisplayInfo->aquaPalette);
- CGDisplayRelease(cgID);
- }
- }
-}
-
-
-/*
- * FSSuspendScreen
- * Suspend X11 cursor and drawing to the screen.
- */
-static void FSSuspendScreen(
- ScreenPtr pScreen)
-{
- QuartzSuspendXCursor(pScreen);
- xf86SetRootClip(pScreen, FALSE);
-}
-
-
-/*
- * FSResumeScreen
- * Resume X11 cursor and drawing to the screen.
- */
-static void FSResumeScreen(
- ScreenPtr pScreen,
- int x, // cursor location
- int y )
-{
- QuartzResumeXCursor(pScreen, x, y);
- xf86SetRootClip(pScreen, TRUE);
-}
-
-
-/*
- =============================================================================
-
- Screen initialization
-
- =============================================================================
-*/
-
-/*
- * FSDisplayInit
- * Full screen specific initialization called from InitOutput.
- */
-static void FSDisplayInit(void)
-{
- static unsigned long generation = 0;
- CGDisplayCount quartzDisplayCount = 0;
-
- ErrorF("Display mode: Full screen Quartz -- Direct Display\n");
-
- // Allocate private storage for each screen's mode specific info
- if (generation != serverGeneration) {
- fsScreenIndex = AllocateScreenPrivateIndex();
- generation = serverGeneration;
- }
-
- // Find all the CoreGraphics displays
- CGGetActiveDisplayList(0, NULL, &quartzDisplayCount);
- quartzDisplayList = xalloc(quartzDisplayCount * sizeof(CGDirectDisplayID));
- CGGetActiveDisplayList(quartzDisplayCount, quartzDisplayList,
- &quartzDisplayCount);
-
- darwinScreensFound = quartzDisplayCount;
- atexit(FSRelease);
-}
-
-
-/*
- * FSFindDisplayMode
- * Find the appropriate display mode to use in full screen mode.
- * If display mode is not the same as the current Aqua mode, switch
- * to the new mode.
- */
-static Bool FSFindDisplayMode(
- FSScreenPtr fsDisplayInfo)
-{
- CGDirectDisplayID cgID = fsDisplayInfo->displayID;
- size_t height, width, bpp;
- boolean_t exactMatch;
-
- fsDisplayInfo->aquaDisplayMode = CGDisplayCurrentMode(cgID);
-
- // If no user options, use current display mode
- if (darwinDesiredWidth == 0 && darwinDesiredDepth == -1 &&
- darwinDesiredRefresh == -1)
- {
- fsDisplayInfo->xDisplayMode = fsDisplayInfo->aquaDisplayMode;
- return TRUE;
- }
-
- // If the user has no choice for size, use current
- if (darwinDesiredWidth == 0) {
- width = CGDisplayPixelsWide(cgID);
- height = CGDisplayPixelsHigh(cgID);
- } else {
- width = darwinDesiredWidth;
- height = darwinDesiredHeight;
- }
-
- switch (darwinDesiredDepth) {
- case 0:
- bpp = 8;
- break;
- case 1:
- bpp = 16;
- break;
- case 2:
- bpp = 32;
- break;
- default:
- bpp = CGDisplayBitsPerPixel(cgID);
- }
-
- if (darwinDesiredRefresh == -1) {
- fsDisplayInfo->xDisplayMode =
- CGDisplayBestModeForParameters(cgID, bpp, width, height,
- &exactMatch);
- } else {
- fsDisplayInfo->xDisplayMode =
- CGDisplayBestModeForParametersAndRefreshRate(cgID, bpp,
- width, height, darwinDesiredRefresh, &exactMatch);
- }
- if (!exactMatch) {
- fsDisplayInfo->xDisplayMode = fsDisplayInfo->aquaDisplayMode;
- return FALSE;
- }
-
- // Switch to the new display mode
- CGDisplaySwitchToMode(cgID, fsDisplayInfo->xDisplayMode);
- return TRUE;
-}
-
-
-/*
- * FSAddScreen
- * Do initialization of each screen for Quartz in full screen mode.
- */
-static Bool FSAddScreen(
- int index,
- ScreenPtr pScreen)
-{
- DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
- QuartzScreenPtr displayInfo = QUARTZ_PRIV(pScreen);
- CGDirectDisplayID cgID = quartzDisplayList[index];
- CGRect bounds;
- FSScreenPtr fsDisplayInfo;
-
- // Allocate space for private per screen fullscreen specific storage.
- fsDisplayInfo = xalloc(sizeof(FSScreenRec));
- FULLSCREEN_PRIV(pScreen) = fsDisplayInfo;
-
- displayInfo->displayCount = 1;
- displayInfo->displayIDs = xrealloc(displayInfo->displayIDs,
- 1 * sizeof(CGDirectDisplayID));
- displayInfo->displayIDs[0] = cgID;
-
- fsDisplayInfo->displayID = cgID;
- fsDisplayInfo->xDisplayMode = 0;
- fsDisplayInfo->aquaDisplayMode = 0;
- fsDisplayInfo->xPalette = 0;
- fsDisplayInfo->aquaPalette = 0;
-
- // Capture full screen because X doesn't like read-only framebuffer.
- // We need to do this before we (potentially) switch the display mode.
- CGDisplayCapture(cgID);
-
- if (! FSFindDisplayMode(fsDisplayInfo)) {
- ErrorF("Could not support specified display mode on screen %i.\n",
- index);
- xfree(fsDisplayInfo);
- return FALSE;
- }
-
- // Don't need to flip y-coordinate as CoreGraphics treats (0, 0)
- // as the top left of main screen.
- bounds = CGDisplayBounds(cgID);
- dfb->x = bounds.origin.x;
- dfb->y = bounds.origin.y;
- dfb->width = bounds.size.width;
- dfb->height = bounds.size.height;
- dfb->pitch = CGDisplayBytesPerRow(cgID);
- dfb->bitsPerPixel = CGDisplayBitsPerPixel(cgID);
-
- if (dfb->bitsPerPixel == 8) {
- if (CGDisplayCanSetPalette(cgID)) {
- dfb->colorType = PseudoColor;
- } else {
- dfb->colorType = StaticColor;
- }
- dfb->bitsPerComponent = 8;
- dfb->colorBitsPerPixel = 8;
- } else {
- dfb->colorType = TrueColor;
- dfb->bitsPerComponent = CGDisplayBitsPerSample(cgID);
- dfb->colorBitsPerPixel = CGDisplaySamplesPerPixel(cgID) *
- dfb->bitsPerComponent;
- }
-
- fsDisplayInfo->framebuffer = CGDisplayBaseAddress(cgID);
-
- // allocate shadow framebuffer
- fsDisplayInfo->shadowPtr = xalloc(dfb->pitch * dfb->height);
- dfb->framebuffer = fsDisplayInfo->shadowPtr;
-
- return TRUE;
-}
-
-
-/*
- * FSShadowUpdate
- * Update the damaged regions of the shadow framebuffer on the display.
- */
-static void FSShadowUpdate(
- ScreenPtr pScreen,
- shadowBufPtr pBuf)
-{
- DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
- FSScreenPtr fsDisplayInfo = FULLSCREEN_PRIV(pScreen);
- RegionPtr damage = &pBuf->damage;
- int numBox = REGION_NUM_RECTS(damage);
- BoxPtr pBox = REGION_RECTS(damage);
- int pitch = dfb->pitch;
- int bpp = dfb->bitsPerPixel/8;
-
- // Don't update if the X server is not visible
- if (!quartzServerVisible)
- return;
-
- // Loop through all the damaged boxes
- while (numBox--) {
- int width, height, offset;
- unsigned char *src, *dst;
-
- width = (pBox->x2 - pBox->x1) * bpp;
- height = pBox->y2 - pBox->y1;
- offset = (pBox->y1 * pitch) + (pBox->x1 * bpp);
- src = fsDisplayInfo->shadowPtr + offset;
- dst = fsDisplayInfo->framebuffer + offset;
-
- while (height--) {
- memcpy(dst, src, width);
- dst += pitch;
- src += pitch;
- }
-
- // Get the next box
- pBox++;
- }
-}
-
-
-/*
- * FSSetupScreen
- * Finalize full screen specific setup of each screen.
- */
-static Bool FSSetupScreen(
- int index,
- ScreenPtr pScreen)
-{
- DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
- FSScreenPtr fsDisplayInfo = FULLSCREEN_PRIV(pScreen);
- CGDirectDisplayID cgID = fsDisplayInfo->displayID;
-
- // Initialize shadow framebuffer support
- if (! shadowInit(pScreen, FSShadowUpdate, NULL)) {
- ErrorF("Failed to initalize shadow framebuffer for screen %i.\n",
- index);
- return FALSE;
- }
-
- if (dfb->colorType == PseudoColor) {
- // Initialize colormap handling
- size_t aquaBpp;
-
- // If Aqua is using 8 bits we need to keep track of its pallete.
- CFNumberGetValue(CFDictionaryGetValue(fsDisplayInfo->aquaDisplayMode,
- kCGDisplayBitsPerPixel), kCFNumberLongType, &aquaBpp);
- if (aquaBpp <= 8)
- fsDisplayInfo->aquaPalette = CGPaletteCreateWithDisplay(cgID);
-
- pScreen->CreateColormap = FSCreateColormap;
- pScreen->DestroyColormap = FSDestroyColormap;
- pScreen->InstallColormap = FSInstallColormap;
- pScreen->StoreColors = FSStoreColors;
-
- }
-
- quartzScreens[quartzNumScreens++] = fsDisplayInfo;
- return TRUE;
-}
-
-
-/*
- * Quartz display mode function list.
- */
-static QuartzModeProcsRec fsModeProcs = {
- FSDisplayInit,
- FSAddScreen,
- FSSetupScreen,
- NULL, // Not needed
- QuartzInitCursor,
- QuartzReallySetCursor,
- FSSuspendScreen,
- FSResumeScreen,
- FSCapture,
- FSRelease,
- NULL, // No dynamic screen change support
- NULL,
- NULL,
- NULL, // No rootless code in fullscreen
- NULL,
- NULL,
- NULL,
- NULL, // No support for DRI surfaces
- NULL
-};
-
-
-/*
- * QuartzModeBundleInit
- * Initialize the display mode bundle after loading.
- */
-Bool
-QuartzModeBundleInit(void)
-{
- quartzProcs = &fsModeProcs;
- quartzOpenGLBundle = NULL; // Only Mesa support for now
- return TRUE;
-}
diff --git a/hw/darwin/quartz/fullscreen/quartzCursor.c b/hw/darwin/quartz/fullscreen/quartzCursor.c
deleted file mode 100644
index e2333e2ea..000000000
--- a/hw/darwin/quartz/fullscreen/quartzCursor.c
+++ /dev/null
@@ -1,652 +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.
- */
-
-#include "quartzCommon.h"
-#include "quartzCursor.h"
-#include "darwin.h"
-
-#include <pthread.h>
-
-#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 int darwinCursorScreenIndex = -1;
-static unsigned long darwinCursorGeneration = 0;
-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)pScreen->devPrivates[darwinCursorScreenIndex].ptr)
-
-#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
- pCursor->devPriv[pScreen->myNum] = (pointer) 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 = (CCrsrHandle) pCursor->devPriv[pScreen->myNum];
-
- if (currentCursor != oldCursor) {
- // This should only fail when quitting, in which case we just leak.
- FreeQDCursor(oldCursor);
- }
- pCursor->devPriv[pScreen->myNum] = 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(pCursor->devPriv[pScreen->myNum]);
- 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;
- }
-
- // allocate private storage for this screen's QuickDraw cursor info
- if (darwinCursorGeneration != serverGeneration) {
- if ((darwinCursorScreenIndex = AllocateScreenPrivateIndex()) < 0)
- return FALSE;
- darwinCursorGeneration = serverGeneration;
- }
-
- 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)
- pScreen->devPrivates[miPointerScreenIndex].ptr;
-
- 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/hw/darwin/quartz/fullscreen/quartzCursor.h b/hw/darwin/quartz/fullscreen/quartzCursor.h
deleted file mode 100644
index 57fac68a5..000000000
--- a/hw/darwin/quartz/fullscreen/quartzCursor.h
+++ /dev/null
@@ -1,43 +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/hw/darwin/quartz/quartzCursor.c b/hw/darwin/quartz/quartzCursor.c
deleted file mode 100644
index e2333e2ea..000000000
--- a/hw/darwin/quartz/quartzCursor.c
+++ /dev/null
@@ -1,652 +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.
- */
-
-#include "quartzCommon.h"
-#include "quartzCursor.h"
-#include "darwin.h"
-
-#include <pthread.h>
-
-#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 int darwinCursorScreenIndex = -1;
-static unsigned long darwinCursorGeneration = 0;
-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)pScreen->devPrivates[darwinCursorScreenIndex].ptr)
-
-#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
- pCursor->devPriv[pScreen->myNum] = (pointer) 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 = (CCrsrHandle) pCursor->devPriv[pScreen->myNum];
-
- if (currentCursor != oldCursor) {
- // This should only fail when quitting, in which case we just leak.
- FreeQDCursor(oldCursor);
- }
- pCursor->devPriv[pScreen->myNum] = 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(pCursor->devPriv[pScreen->myNum]);
- 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;
- }
-
- // allocate private storage for this screen's QuickDraw cursor info
- if (darwinCursorGeneration != serverGeneration) {
- if ((darwinCursorScreenIndex = AllocateScreenPrivateIndex()) < 0)
- return FALSE;
- darwinCursorGeneration = serverGeneration;
- }
-
- 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)
- pScreen->devPrivates[miPointerScreenIndex].ptr;
-
- 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/hw/darwin/quartz/quartzCursor.h b/hw/darwin/quartz/quartzCursor.h
deleted file mode 100644
index 56cc94d49..000000000
--- a/hw/darwin/quartz/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 QuartzSuspendXCursor(ScreenPtr pScreen);
-void QuartzResumeXCursor(ScreenPtr pScreen, int x, int y);
-
-#endif
diff --git a/hw/darwin/quartz/quartzStartup.c b/hw/darwin/quartz/quartzStartup.c
deleted file mode 100644
index 277e5935f..000000000
--- a/hw/darwin/quartz/quartzStartup.c
+++ /dev/null
@@ -1,290 +0,0 @@
-/**************************************************************
- *
- * Startup code for the Quartz Darwin X Server
- *
- **************************************************************/
-/*
- * Copyright (c) 2001-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.
- */
-
-#include <fcntl.h>
-#include <unistd.h>
-#include <CoreFoundation/CoreFoundation.h>
-#include "quartzCommon.h"
-#include "darwin.h"
-#include "quartz.h"
-#include "opaque.h"
-#include "micmap.h"
-
-int NSApplicationMain(int argc, char *argv[]);
-
-char **envpGlobal; // argcGlobal and argvGlobal
- // are from dix/globals.c
-
-// GLX bundle function pointers
-typedef void (*GlxExtensionInitPtr)(void);
-static GlxExtensionInitPtr GlxExtensionInit = NULL;
-
-typedef void (*GlxWrapInitVisualsPtr)(miInitVisualsProcPtr *);
-static GlxWrapInitVisualsPtr GlxWrapInitVisuals = NULL;
-
-typedef Bool (*QuartzModeBundleInitPtr)(void);
-
-
-/*
- * 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;
- int main_exit, i;
- int fd[2];
-
- if (been_here) {
- QuartzReadPreferences();
- return;
- }
- been_here = TRUE;
-
- // Make a pipe to pass events
- assert( pipe(fd) == 0 );
- darwinEventReadFD = fd[0];
- darwinEventWriteFD = fd[1];
- fcntl(darwinEventReadFD, F_SETFL, O_NONBLOCK);
-
- // Store command line arguments to pass back to main()
- argcGlobal = argc;
- argvGlobal = argv;
- envpGlobal = envp;
-
- quartzStartClients = 1;
- 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" )) {
- DarwinPrintBanner();
- exit(0);
- }
-
- // Determine if we need to start X clients
- // and what display mode to use
- if (!strcmp(argv[i], "-nostartx")) {
- quartzStartClients = 0;
- } else if (!strcmp( argv[i], "-fullscreen")) {
- quartzRootless = 0;
- } else if (!strcmp( argv[i], "-rootless")) {
- quartzRootless = 1;
- }
- }
-
- main_exit = NSApplicationMain(argc, argv);
- exit(main_exit);
-}
-
-
-/*
- * QuartzLoadDisplayBundle
- * Try to load the appropriate bundle containing the back end display code.
- */
-Bool QuartzLoadDisplayBundle(
- const char *dpyBundleName)
-{
- CFBundleRef mainBundle;
- CFStringRef bundleName;
- CFURLRef bundleURL;
- CFBundleRef dpyBundle;
- QuartzModeBundleInitPtr bundleInit;
-
- // Get the main bundle for the application
- mainBundle = CFBundleGetMainBundle();
-
- // Make CFString from bundle name
- bundleName = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault,
- dpyBundleName,
- kCFStringEncodingASCII,
- kCFAllocatorNull);
-
- // Look for the appropriate bundle in the main bundle
- bundleURL = CFBundleCopyResourceURL(mainBundle, bundleName,
- NULL, NULL);
- if (!bundleURL) {
- ErrorF("Could not find display mode bundle %s.\n", dpyBundleName);
- return FALSE;
- }
-
- // Make a bundle instance using the URLRef
- dpyBundle = CFBundleCreate(kCFAllocatorDefault, bundleURL);
-
- if (!CFBundleLoadExecutable(dpyBundle)) {
- ErrorF("Could not load display mode bundle %s.\n", dpyBundleName);
- return FALSE;
- }
-
- // Lookup the bundle initialization function
- bundleInit = (void *)
- CFBundleGetFunctionPointerForName(dpyBundle,
- CFSTR("QuartzModeBundleInit"));
- if (!bundleInit) {
- ErrorF("Could not initialize display mode bundle %s.\n",
- dpyBundleName);
- return FALSE;
- }
- if (!bundleInit())
- return FALSE;
-
- // Release the CF objects
- CFRelease(bundleName);
- CFRelease(bundleURL);
-
- return TRUE;
-}
-
-
-/*
- * LoadGlxBundle
- * The Quartz mode X server needs to dynamically load the appropriate
- * bundle before initializing GLX.
- */
-static void LoadGlxBundle(void)
-{
- CFBundleRef mainBundle;
- CFStringRef bundleName;
- CFURLRef bundleURL;
- CFBundleRef glxBundle;
-
- // Get the main bundle for the application
- mainBundle = CFBundleGetMainBundle();
-
- // Choose the bundle to load
- ErrorF("Loading GLX bundle ");
- if (quartzUseAGL) {
- bundleName = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault,
- quartzOpenGLBundle,
- kCFStringEncodingASCII,
- kCFAllocatorNull);
- ErrorF("%s (using Apple's OpenGL)\n", quartzOpenGLBundle);
- } else {
- bundleName = CFSTR("glxMesa.bundle");
- CFRetain(bundleName); // so we can release later
- ErrorF("glxMesa.bundle (using Mesa)\n");
- }
-
- // Look for the appropriate GLX bundle in the main bundle by name
- bundleURL = CFBundleCopyResourceURL(mainBundle, bundleName,
- NULL, NULL);
- if (!bundleURL) {
- FatalError("Could not find GLX bundle.");
- }
-
- // Make a bundle instance using the URLRef
- glxBundle = CFBundleCreate(kCFAllocatorDefault, bundleURL);
-
- if (!CFBundleLoadExecutable(glxBundle)) {
- FatalError("Could not load GLX bundle.");
- }
-
- // Find the GLX init functions
- GlxExtensionInit = (void *) CFBundleGetFunctionPointerForName(
- glxBundle, CFSTR("GlxExtensionInit"));
-
- GlxWrapInitVisuals = (void *) CFBundleGetFunctionPointerForName(
- glxBundle, CFSTR("GlxWrapInitVisuals"));
-
- if (!GlxExtensionInit || !GlxWrapInitVisuals) {
- FatalError("Could not initialize GLX bundle.");
- }
-
- // Release the CF objects
- CFRelease(bundleName);
- CFRelease(bundleURL);
-}
-
-
-/*
- * DarwinGlxExtensionInit
- * Initialize the GLX extension.
- */
-void DarwinGlxExtensionInit(void)
-{
- if (!GlxExtensionInit)
- LoadGlxBundle();
-
- GlxExtensionInit();
-}
-
-
-/*
- * DarwinGlxWrapInitVisuals
- */
-void DarwinGlxWrapInitVisuals(
- miInitVisualsProcPtr *procPtr)
-{
- if (!GlxWrapInitVisuals)
- LoadGlxBundle();
-
- GlxWrapInitVisuals(procPtr);
-}
-
-
-int DarwinModeProcessArgument( int argc, char *argv[], int i )
-{
- // fullscreen: CoreGraphics full-screen mode
- // rootless: Cocoa rootless mode
- // quartz: Default, either fullscreen or rootless
-
- if ( !strcmp( argv[i], "-fullscreen" ) ) {
- ErrorF( "Running full screen in parallel with Mac OS X Quartz window server.\n" );
- return 1;
- }
-
- if ( !strcmp( argv[i], "-rootless" ) ) {
- ErrorF( "Running rootless inside Mac OS X window server.\n" );
- return 1;
- }
-
- if ( !strcmp( argv[i], "-quartz" ) ) {
- ErrorF( "Running in parallel with Mac OS X Quartz window server.\n" );
- return 1;
- }
-
- // The Mac OS X front end uses this argument, which we just ignore here.
- if ( !strcmp( argv[i], "-nostartx" ) ) {
- return 1;
- }
-
- // This command line arg is passed when launched from the Aqua GUI.
- if ( !strncmp( argv[i], "-psn_", 5 ) ) {
- return 1;
- }
-
- return 0;
-}
diff --git a/hw/darwin/quartz/xpr/Xplugin.h b/hw/darwin/quartz/xpr/Xplugin.h
deleted file mode 100644
index fb6842c87..000000000
--- a/hw/darwin/quartz/xpr/Xplugin.h
+++ /dev/null
@@ -1,590 +0,0 @@
-/* Xplugin.h -- windowing API for rootless X11 server
- $Id$
-
- Copyright (c) 2002 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.
-
- Note that these interfaces are provided solely for the use of the
- X11 server. Any other uses are unsupported and strongly discouraged. */
-
-#ifndef XPLUGIN_H
-#define XPLUGIN_H 1
-
-#include <stdint.h>
-
-/* By default we use the X server definition of BoxRec to define xp_box,
- so that the compiler can silently convert between the two. But if
- XP_NO_X_HEADERS is defined, we'll define it ourselves. */
-
-#ifndef XP_NO_X_HEADERS
-# include "miscstruct.h"
- typedef BoxRec xp_box;
-#else
- struct xp_box_struct {
- short x1, y1, x2, y2;
- };
- typedef struct xp_box_struct xp_box;
-#endif
-
-typedef unsigned int xp_resource_id;
-typedef xp_resource_id xp_window_id;
-typedef xp_resource_id xp_surface_id;
-typedef unsigned int xp_client_id;
-typedef unsigned int xp_request_type;
-typedef int xp_error;
-typedef int xp_bool;
-
-
-/* Error codes that the functions declared here may return. They all
- numerically match their X equivalents, i.e. the XP_ can be dropped
- if <X11/X.h> has been included. */
-
-enum xp_error_enum {
- XP_Success = 0,
- XP_BadRequest = 1,
- XP_BadValue = 2,
- XP_BadWindow = 3,
- XP_BadMatch = 8,
- XP_BadAccess = 10,
- XP_BadImplementation = 17,
-};
-
-
-/* Event types generated by the plugin. */
-
-enum xp_event_type_enum {
- /* The global display configuration changed somehow. */
- XP_EVENT_DISPLAY_CHANGED = 1 << 0,
-
- /* A window changed state. Argument is xp_window_state_event */
- XP_EVENT_WINDOW_STATE_CHANGED = 1 << 1,
-
- /* An async request encountered an error. Argument is of type
- xp_async_error_event */
- XP_EVENT_ASYNC_ERROR = 1 << 2,
-
- /* Sent when a surface is destroyed as a side effect of destroying
- a window. Arg is of type xp_surface_id. */
- XP_EVENT_SURFACE_DESTROYED = 1 << 3,
-
- /* Sent when any GL contexts pointing at the given surface need to
- call xp_update_gl_context () to refresh their state (because the
- window moved or was resized. Arg is of type xp_surface_id. */
- XP_EVENT_SURFACE_CHANGED = 1 << 4,
-
- /* Sent when a window has been moved. Arg is of type xp_window_id. */
- XP_EVENT_WINDOW_MOVED = 1 << 5,
-};
-
-/* Function type used to receive events. */
-
-typedef void (xp_event_fun) (unsigned int type, const void *arg,
- unsigned int arg_size, void *user_data);
-
-
-/* Operation types. Used when reporting errors asynchronously. */
-
-enum xp_request_type_enum {
- XP_REQUEST_NIL = 0,
- XP_REQUEST_DESTROY_WINDOW = 1,
- XP_REQUEST_CONFIGURE_WINDOW = 2,
- XP_REQUEST_FLUSH_WINDOW = 3,
- XP_REQUEST_COPY_WINDOW = 4,
- XP_REQUEST_UNLOCK_WINDOW = 5,
- XP_REQUEST_DISABLE_UPDATE = 6,
- XP_REQUEST_REENABLE_UPDATE = 7,
- XP_REQUEST_HIDE_CURSOR = 8,
- XP_REQUEST_SHOW_CURSOR = 9,
- XP_REQUEST_FRAME_DRAW = 10,
-};
-
-/* Structure used to report an error asynchronously. Passed as the "arg"
- of an XP_EVENT_ASYNC_ERROR event. */
-
-struct xp_async_error_event_struct {
- xp_request_type request_type;
- xp_resource_id id;
- xp_error error;
-};
-
-typedef struct xp_async_error_event_struct xp_async_error_event;
-
-
-/* Possible window states. */
-
-enum xp_window_state_enum {
- /* The window is not in the global list of possibly-visible windows. */
- XP_WINDOW_STATE_OFFSCREEN = 1 << 0,
-
- /* Parts of the window may be obscured by other windows. */
- XP_WINDOW_STATE_OBSCURED = 1 << 1,
-};
-
-/* Structure passed as argument of an XP_EVENT_WINDOW_STATE_CHANGED event. */
-
-struct xp_window_state_event_struct {
- xp_window_id id;
- unsigned int state;
-};
-
-typedef struct xp_window_state_event_struct xp_window_state_event;
-
-
-/* Function type used to supply a colormap for indexed drawables. */
-
-typedef xp_error (xp_colormap_fun) (void *data, int first_color,
- int n_colors, uint32_t *colors);
-
-
-/* Window attributes structure. Used when creating and configuring windows.
- Also used when configuring surfaces attached to windows. Functions that
- take one of these structures also take a bit mask defining which
- fields are set to meaningful values. */
-
-enum xp_window_changes_enum {
- XP_ORIGIN = 1 << 0,
- XP_SIZE = 1 << 1,
- XP_BOUNDS = XP_ORIGIN | XP_SIZE,
- XP_SHAPE = 1 << 2,
- XP_STACKING = 1 << 3,
- XP_DEPTH = 1 << 4,
- XP_COLORMAP = 1 << 5,
- XP_WINDOW_LEVEL = 1 << 6,
-};
-
-struct xp_window_changes_struct {
- /* XP_ORIGIN */
- int x, y;
-
- /* XP_SIZE */
- unsigned int width, height;
- int bit_gravity; /* how to resize the backing store */
-
- /* XP_SHAPE */
- int shape_nrects; /* -1 = remove shape */
- xp_box *shape_rects;
- int shape_tx, shape_ty; /* translation for shape */
-
- /* XP_STACKING */
- int stack_mode;
- xp_window_id sibling; /* may be zero; in ABOVE/BELOW modes
- it may specify a relative window */
- /* XP_DEPTH, window-only */
- unsigned int depth;
-
- /* XP_COLORMAP, window-only */
- xp_colormap_fun *colormap;
- void *colormap_data;
-
- /* XP_WINDOW_LEVEL, window-only */
- int window_level;
-};
-
-typedef struct xp_window_changes_struct xp_window_changes;
-
-/* Values for bit_gravity field */
-
-enum xp_bit_gravity_enum {
- XP_GRAVITY_NONE = 0, /* no gravity, fill everything */
- XP_GRAVITY_NORTH_WEST = 1, /* anchor to top-left corner */
- XP_GRAVITY_NORTH_EAST = 2, /* anchor to top-right corner */
- XP_GRAVITY_SOUTH_EAST = 3, /* anchor to bottom-right corner */
- XP_GRAVITY_SOUTH_WEST = 4, /* anchor to bottom-left corner */
-};
-
-/* Values for stack_mode field */
-
-enum xp_window_stack_mode_enum {
- XP_UNMAPPED = 0, /* remove the window */
- XP_MAPPED_ABOVE = 1, /* display the window on top */
- XP_MAPPED_BELOW = 2, /* display the window at bottom */
-};
-
-/* Data formats for depth field and composite functions */
-
-enum xp_depth_enum {
- XP_DEPTH_NIL = 0, /* null source when compositing */
- XP_DEPTH_ARGB8888,
- XP_DEPTH_RGB555,
- XP_DEPTH_A8, /* for masks when compositing */
- XP_DEPTH_INDEX8,
-};
-
-/* Options that may be passed to the xp_init () function. */
-
-enum xp_init_options_enum {
- /* Don't mark that this process can be in the foreground. */
- XP_IN_BACKGROUND = 1 << 0,
-
- /* Deliver background pointer events to this process. */
- XP_BACKGROUND_EVENTS = 1 << 1,
-};
-
-
-
-/* Miscellaneous functions */
-
-/* Initialize the plugin library. Only the copy/fill/composite functions
- may be called without having previously called xp_init () */
-
-extern xp_error xp_init (unsigned int options);
-
-/* Sets the current set of requested notifications to MASK. When any of
- these arrive, CALLBACK will be invoked with CALLBACK-DATA. Note that
- calling this function cancels any previously requested notifications
- that aren't set in MASK. */
-
-extern xp_error xp_select_events (unsigned int mask,
- xp_event_fun *callback,
- void *callback_data);
-
-/* Waits for all initiated operations to complete. */
-
-extern xp_error xp_synchronize (void);
-
-/* Causes any display update initiated through the plugin libary to be
- queued until update is reenabled. Note that calls to these functions
- nest. */
-
-extern xp_error xp_disable_update (void);
-extern xp_error xp_reenable_update (void);
-
-
-
-/* Cursor functions. */
-
-/* Installs the specified cursor. ARGB-DATA should point to 32-bit
- premultiplied big-endian ARGB data. The HOT-X,HOT-Y parameters
- specify the offset to the cursor's hot spot from its top-left
- corner. */
-
-extern xp_error xp_set_cursor (unsigned int width, unsigned int height,
- unsigned int hot_x, unsigned int hot_y,
- const uint32_t *argb_data,
- unsigned int rowbytes);
-
-/* Hide and show the cursor if it's owned by the current process. Calls
- to these functions nest. */
-
-extern xp_error xp_hide_cursor (void);
-extern xp_error xp_show_cursor (void);
-
-
-
-/* Window functions. */
-
-/* Create a new window as defined by MASK and VALUES. MASK must contain
- XP_BOUNDS or an error is raised. The id of the newly created window
- is stored in *RET-ID if this function returns XP_Success. */
-
-extern xp_error xp_create_window (unsigned int mask,
- const xp_window_changes *values,
- xp_window_id *ret_id);
-
-/* Destroys the window identified by ID. */
-
-extern xp_error xp_destroy_window (xp_window_id id);
-
-/* Reconfigures the given window according to MASK and VALUES. */
-
-extern xp_error xp_configure_window (xp_window_id id, unsigned int mask,
- const xp_window_changes *values);
-
-
-/* Returns true if NATIVE-ID is a window created by the plugin library.
- If so and RET-ID is non-null, stores the id of the window in *RET-ID. */
-
-extern xp_bool xp_lookup_native_window (unsigned int native_id,
- xp_window_id *ret_id);
-
-/* If ID names a window created by the plugin library, stores it's native
- window id in *RET-NATIVE-ID. */
-
-extern xp_error xp_get_native_window (xp_window_id id,
- unsigned int *ret_native_id);
-
-
-/* Locks the rectangle IN-RECT (or, if null, the entire window) of the
- given window's backing store. Any other non-null parameters are filled
- in as follows:
-
- DEPTH = format of returned data. Currently either XP_DEPTH_ARGB8888
- or XP_DEPTH_RGB565 (possibly with 8 bit planar alpha). Data is
- always stored in native byte order.
-
- BITS[0] = pointer to top-left pixel of locked color data
- BITS[1] = pointer to top-left of locked alpha data, or null if window
- has no alpha. If the alpha data is meshed, then BITS[1] = BITS[0].
-
- ROWBYTES[0,1] = size in bytes of each row of color,alpha data
-
- OUT-RECT = rectangle specifying the current position and size of the
- locked region relative to the window origin.
-
- Note that an error is raised when trying to lock an already locked
- window. While the window is locked, the only operations that may
- be performed on it are to modify, access or flush its marked region. */
-
-extern xp_error xp_lock_window (xp_window_id id,
- const xp_box *in_rect,
- unsigned int *depth,
- void *bits[2],
- unsigned int rowbytes[2],
- xp_box *out_rect);
-
-/* Mark that the region specified by SHAPE-NRECTS, SHAPE-RECTS,
- SHAPE-TX, and SHAPE-TY in the specified window has been updated, and
- will need to subsequently be redisplayed. */
-
-extern xp_error xp_mark_window (xp_window_id id, int shape_nrects,
- const xp_box *shape_rects,
- int shape_tx, int shape_ty);
-
-/* Unlocks the specified window. If FLUSH is true, then any marked
- regions are immediately redisplayed. Note that it's an error to
- unlock an already unlocked window. */
-
-extern xp_error xp_unlock_window (xp_window_id id, xp_bool flush);
-
-/* If anything is marked in the given window for redisplay, do it now. */
-
-extern xp_error xp_flush_window (xp_window_id id);
-
-/* Moves the contents of the region DX,DY pixels away from that specified
- by DST_RECTS and DST_NRECTS in the window with SRC-ID to the
- destination region in the window DST-ID. Note that currently source
- and destination windows must be the same. */
-
-extern xp_error xp_copy_window (xp_window_id src_id, xp_window_id dst_id,
- int dst_nrects, const xp_box *dst_rects,
- int dx, int dy);
-
-/* Returns true if the given window has any regions marked for
- redisplay. */
-
-extern xp_bool xp_is_window_marked (xp_window_id id);
-
-/* If successful returns a superset of the region marked for update in
- the given window. Use xp_free_region () to release the returned data. */
-
-extern xp_error xp_get_marked_shape (xp_window_id id,
- int *ret_nrects, xp_box **ret_rects);
-
-extern void xp_free_shape (int nrects, xp_box *rects);
-
-/* Searches for the first window below ABOVE-ID containing the point X,Y,
- and returns it's window id in *RET-ID. If no window is found, *RET-ID
- is set to zero. If ABOVE-ID is zero, finds the topmost window
- containing the given point. */
-
-extern xp_error xp_find_window (int x, int y, xp_window_id above_id,
- xp_window_id *ret_id);
-
-/* Returns the current origin and size of the window ID in *BOUNDS-RET if
- successful. */
-extern xp_error xp_get_window_bounds (xp_window_id id, xp_box *bounds_ret);
-
-
-
-/* Window surface functions. */
-
-/* Create a new VRAM surface on the specified window. If successful,
- returns the identifier of the new surface in *RET-SID. */
-
-extern xp_error xp_create_surface (xp_window_id id, xp_surface_id *ret_sid);
-
-/* Destroys the specified surface. */
-
-extern xp_error xp_destroy_surface (xp_surface_id sid);
-
-/* Reconfigures the specified surface as defined by MASK and VALUES.
- Note that specifying XP_DEPTH is an error. */
-
-extern xp_error xp_configure_surface (xp_surface_id sid, unsigned int mask,
- const xp_window_changes *values);
-
-/* If successful, places the client identifier of the current process
- in *RET-CLIENT. */
-
-extern xp_error xp_get_client_id (xp_client_id *ret_client);
-
-/* Given a valid window,surface combination created by the current
- process, attempts to allow the specified external client access
- to that surface. If successful, returns two integers in RET-KEY
- which the client can use to import the surface into their process. */
-
-extern xp_error xp_export_surface (xp_window_id wid, xp_surface_id sid,
- xp_client_id client,
- unsigned int ret_key[2]);
-
-/* Given a two integer key returned from xp_export_surface (), tries
- to import the surface into the current process. If successful the
- local surface identifier is stored in *SID-RET. */
-
-extern xp_error xp_import_surface (const unsigned int key[2],
- xp_surface_id *sid_ret);
-
-/* If successful, stores the number of surfaces attached to the
- specified window in *RET. */
-
-extern xp_error xp_get_window_surface_count (xp_window_id id,
- unsigned int *ret);
-
-/* Attaches the CGLContextObj CGL-CTX to the specified surface. */
-
-extern xp_error xp_attach_gl_context (void *cgl_ctx, xp_surface_id sid);
-
-/* Updates the CGLContextObj CGL-CTX to reflect any recent changes to
- the surface it's attached to. */
-
-extern xp_error xp_update_gl_context (void *cgl_ctx);
-
-
-
-/* Window frame functions. */
-
-/* Possible arguments to xp_frame_get_rect (). */
-
-enum xp_frame_rect_enum {
- XP_FRAME_RECT_TITLEBAR = 1,
- XP_FRAME_RECT_TRACKING = 2,
- XP_FRAME_RECT_GROWBOX = 3,
-};
-
-/* Classes of window frame. */
-
-enum xp_frame_class_enum {
- XP_FRAME_CLASS_DOCUMENT = 1 << 0,
- XP_FRAME_CLASS_DIALOG = 1 << 1,
- XP_FRAME_CLASS_MODAL_DIALOG = 1 << 2,
- XP_FRAME_CLASS_SYSTEM_MODAL_DIALOG = 1 << 3,
- XP_FRAME_CLASS_UTILITY = 1 << 4,
- XP_FRAME_CLASS_TOOLBAR = 1 << 5,
- XP_FRAME_CLASS_MENU = 1 << 6,
- XP_FRAME_CLASS_SPLASH = 1 << 7,
- XP_FRAME_CLASS_BORDERLESS = 1 << 8,
-};
-
-/* Attributes of window frames. */
-
-enum xp_frame_attr_enum {
- XP_FRAME_ACTIVE = 0x0001,
- XP_FRAME_URGENT = 0x0002,
- XP_FRAME_TITLE = 0x0004,
- XP_FRAME_PRELIGHT = 0x0008,
- XP_FRAME_SHADED = 0x0010,
- XP_FRAME_CLOSE_BOX = 0x0100,
- XP_FRAME_COLLAPSE = 0x0200,
- XP_FRAME_ZOOM = 0x0400,
- XP_FRAME_ANY_BUTTON = 0x0700,
- XP_FRAME_CLOSE_BOX_CLICKED = 0x0800,
- XP_FRAME_COLLAPSE_BOX_CLICKED = 0x1000,
- XP_FRAME_ZOOM_BOX_CLICKED = 0x2000,
- XP_FRAME_ANY_CLICKED = 0x3800,
- XP_FRAME_GROW_BOX = 0x4000,
-};
-
-#define XP_FRAME_ATTR_IS_SET(a,b) (((a) & (b)) == (b))
-#define XP_FRAME_ATTR_IS_CLICKED(a,m) ((a) & ((m) << 3))
-#define XP_FRAME_ATTR_SET_CLICKED(a,m) ((a) |= ((m) << 3))
-#define XP_FRAME_ATTR_UNSET_CLICKED(a,m) ((a) &= ~((m) << 3))
-
-#define XP_FRAME_POINTER_ATTRS (XP_FRAME_PRELIGHT \
- | XP_FRAME_ANY_BUTTON \
- | XP_FRAME_ANY_CLICKED)
-
-extern xp_error xp_frame_get_rect (int type, int class, const xp_box *outer,
- const xp_box *inner, xp_box *ret);
-extern xp_error xp_frame_hit_test (int class, int x, int y,
- const xp_box *outer,
- const xp_box *inner, int *ret);
-extern xp_error xp_frame_draw (xp_window_id wid, int class, unsigned int attr,
- const xp_box *outer, const xp_box *inner,
- unsigned int title_len,
- const unsigned char *title_bytes);
-
-
-
-/* Memory manipulation functions. */
-
-enum xp_composite_op_enum {
- XP_COMPOSITE_SRC = 0,
- XP_COMPOSITE_OVER,
-};
-
-#define XP_COMPOSITE_FUNCTION(op, src_depth, mask_depth, dest_depth) \
- (((op) << 24) | ((src_depth) << 16) \
- | ((mask_depth) << 8) | ((dest_depth) << 0))
-
-#define XP_COMPOSITE_FUNCTION_OP(f) (((f) >> 24) & 255)
-#define XP_COMPOSITE_FUNCTION_SRC_DEPTH(f) (((f) >> 16) & 255)
-#define XP_COMPOSITE_FUNCTION_MASK_DEPTH(f) (((f) >> 8) & 255)
-#define XP_COMPOSITE_FUNCTION_DEST_DEPTH(f) (((f) >> 0) & 255)
-
-/* Composite WIDTH by HEIGHT pixels from source and mask to destination
- using a specified function (if source and destination overlap,
- undefined behavior results).
-
- For SRC and DEST, the first element of the array is the color data. If
- the second element is non-null it implies that there is alpha data
- (which may be meshed or planar). Data without alpha is assumed to be
- opaque.
-
- Passing a null SRC-ROWBYTES pointer implies that the data SRC points
- to is a single element.
-
- Operations that are not supported will return XP_BadImplementation. */
-
-extern xp_error xp_composite_pixels (unsigned int width, unsigned int height,
- unsigned int function,
- void *src[2], unsigned int src_rowbytes[2],
- void *mask, unsigned int mask_rowbytes,
- void *dest[2], unsigned int dest_rowbytes[2]);
-
-/* Fill HEIGHT rows of data starting at DST. Each row will have WIDTH
- bytes filled with the 32-bit pattern VALUE. Each row is DST-ROWBYTES
- wide in total. */
-
-extern void xp_fill_bytes (unsigned int width,
- unsigned int height, uint32_t value,
- void *dst, unsigned int dst_rowbytes);
-
-/* Copy HEIGHT rows of bytes from SRC to DST. Each row will have WIDTH
- bytes copied. SRC and DST may overlap, and the right thing will happen. */
-
-extern void xp_copy_bytes (unsigned int width, unsigned int height,
- const void *src, unsigned int src_rowbytes,
- void *dst, unsigned int dst_rowbytes);
-
-/* Suggestions for the minimum number of bytes or pixels for which it
- makes sense to use some of the xp_ functions */
-
-extern unsigned int xp_fill_bytes_threshold, xp_copy_bytes_threshold,
- xp_composite_area_threshold, xp_scroll_area_threshold;
-
-
-#endif /* XPLUGIN_H */
diff --git a/hw/darwin/utils/README.txt b/hw/darwin/utils/README.txt
deleted file mode 100644
index fb6d4399e..000000000
--- a/hw/darwin/utils/README.txt
+++ /dev/null
@@ -1,111 +0,0 @@
-dumpkeymap - Diagnostic dump and detailed description of .keymapping files
-Version 4
-
-Copyright (C)1999,2000 by Eric Sunshine <sunshine@sunshineco.com>
-Eric Sunshine, 1 December 2000
-
-OVERVIEW
-========
-This package contains the diagnostic utility dumpkeymap, as well as highly
-detailed documentation describing the internal layout of the Apple/NeXT
-.keymapping file.
-
-The dumpkeymap utility displays detailed information about each .keymapping
-file mentioned on the command-line. On Apple and NeXT platforms, if no
-.keymapping files are mentioned on the command-line, then it will instead
-dissect the key mapping currently in use by the WindowServer and AppKit.
-
-Documentation includes a thorough and detailed description of the internal
-layout of the .keymapping file, as well as an explanation of how to interpret
-the output of dumpkeymap.
-
-The complete set of documentation is available for perusal via dumpkeymap's
-manual page (dumpkeymap.1), as well as via the command-line options described
-below.
-
- --help
- Usage summary.
- --help-keymapping
- Detailed discussion of the internal format of a .keymapping file.
- --help-output
- Explanation of dumpkeymap's output.
- --help-files
- List of key mapping-related files and directories.
- --help-diagnostics
- Explanation of diagnostic messages.
-
-Once the manual page is been installed, documentation can also be accessed
-with the Unix `man' command:
-
- % man dumpkeymap
-
-
-COMPILATION
-===========
-MacOS/X, Darwin
-
- cc -Wall -o dumpkeymap dumpkeymap.c -framework IOKit
-
-MacOS/X DP4 (Developer Preview 4)
-
- cc -Wall -o dumpkeymap dumpkeymap.c -FKernel -framework IOKit
-
-MacOS/X Server, OpenStep, NextStep
-
- cc -Wall -o dumpkeymap dumpkeymap.c
-
-By default, dumpkeymap is configured to interface with the HID driver (Apple)
-or event-status driver (NeXT), thus allowing it to dump the key mapping which
-is currently in use by the WindowServer and AppKit. However, these facilities
-are specific to Apple/NeXT. In order to build dumpkeymap for non-Apple/NeXT
-platforms, you must define the DUMPKEYMAP_FILE_ONLY flag when compiling the
-program. This flag inhibits use of the HID and event-status drivers and
-configures dumpkeymap to work strictly with raw key mapping files.
-
-For example, to compile for Linux:
-
- gcc -Wall -DDUMPKEYMAP_FILE_ONLY -o dumpkeymap dumpkeymap.c
-
-
-INSTALLATION
-============
-Install the dumpkeymap executable image in a location mentioned in the PATH
-environment variable. Typicall locations for executable files are:
-
- /usr/local/bin
- $(HOME)/bin
-
-Install the manual page, dumpkeymap.1, in the `man1' subdirectory one of the
-standard manual page locations or in any other location mentioned by the
-MANPATH environment variable.
-
-Typical locations for manual pages on most Unix platforms are:
-
- /usr/local/man/man1
-
-Typical locations for manual pages on MacOS/X, Darwin, and MacOS/X Server are:
-
- /usr/local/man/man1
- /Local/Documentation/ManPages/man1
- /Network/Documentation/ManPages/man1
-
-Typical locations for manual pages on OpenStep and NextStep are:
-
- /usr/local/man/man1
- /LocalLibrary/Documentation/ManPages/man1
- /LocalDeveloper/Documentation/ManPages/man1
-
-
-CONCLUSION
-==========
-This program and its accompanying documentation were written by Eric Sunshine
-and are copyright (C)1999,2000 by Eric Sunshine <sunshine@sunshineco.com>.
-
-The implementation of dumpkeymap is based upon information gathered on
-September 3, 1997 by Eric Sunshine <sunshine@sunshineco.com> and Paul S.
-McCarthy <zarnuk@zarnuk.com> during an effort to reverse engineer the format
-of the NeXT .keymapping file.
-
-
-
-$XFree86: xc/programs/Xserver/hw/darwin/utils/README.txt,v 1.1 2000/12/01 19:47:39 dawes Exp $
diff --git a/hw/darwin/utils/dumpkeymap.c b/hw/darwin/utils/dumpkeymap.c
deleted file mode 100644
index d2eeca5c2..000000000
--- a/hw/darwin/utils/dumpkeymap.c
+++ /dev/null
@@ -1,1453 +0,0 @@
-//=============================================================================
-//
-// Copyright (C) 1999,2000 by Eric Sunshine <sunshine@sunshineco.com>
-// 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.
-//
-//=============================================================================
-//-----------------------------------------------------------------------------
-// dumpkeymap.c
-//
-// Prints a textual representation of each Apple/NeXT .keymapping file
-// mentioned on the command-line. If no files are mentioned and if the
-// local machine is an Apple or NeXT installation, then the key mapping
-// currently in use by the WindowServer and the AppKit is printed
-// instead.
-//
-// Invoke dumpkeymap with one of the options listed below in order to
-// view detailed documentation about .keymapping files and the use of
-// this program.
-//
-// --help: Usage summary.
-// --help-keymapping: Detailed discussion of the internal format of a
-// .keymapping file.
-// --help-output: Explanation of dumpkeymap's output.
-// --help-files: List of key mapping-related files and directories.
-// --help-diagnostics: Explanation of diagnostic messages.
-//
-// COMPILATION INSTRUCTIONS
-//
-// MacOS/X, Darwin
-// cc -Wall -o dumpkeymap dumpkeymap.c -framework IOKit
-//
-// MacOS/X DP4 (Developer Preview 4)
-// cc -Wall -o dumpkeymap dumpkeymap.c -FKernel -framework IOKit
-//
-// MacOS/X Server, OpenStep, NextStep
-// cc -Wall -o dumpkeymap dumpkeymap.c
-//
-// By default, dumpkeymap is configured to interface with the HID driver
-// (Apple) or event-status driver (NeXT), thus allowing it to dump the
-// key mapping which is currently in use by the WindowServer and AppKit.
-// However, these facilities are specific to Apple/NeXT. In order to
-// build dumpkeymap for non-Apple/NeXT platforms, you must define the
-// DUMPKEYMAP_FILE_ONLY flag when compiling the program. This flag
-// inhibits use of the HID and event-status drivers and configures
-// dumpkeymap to work strictly with raw key mapping files.
-//
-// For example, to compile for Linux:
-// gcc -Wall -DDUMPKEYMAP_FILE_ONLY -o dumpkeymap dumpkeymap.c
-//
-// CONCLUSION
-//
-// This program and its accompanying documentation were written by Eric
-// Sunshine and are copyright (C)1999,2000 by Eric Sunshine
-// <sunshine@sunshineco.com>.
-//
-// The implementation of dumpkeymap is based upon information gathered
-// on September 3, 1997 by Eric Sunshine <sunshine@sunshineco.com> and
-// Paul S. McCarthy <zarnuk@zarnuk.com> during an effort to reverse
-// engineer the format of the NeXT .keymapping file.
-//
-// HISTORY
-//
-// v4 2000/12/01 Eric Sunshine <sunshine@sunshineco.com>
-// Updated manual page to work with `rman', the `man' to `HTML'
-// translator. Unfortunately, however, rman is missing important
-// roff features such as diversions, indentation, and tab stops,
-// and is also hideously buggy, so getting the manual to work with
-// rman required quite a few work-arounds.
-// The manual page has now been tested with nroff (plain text), troff
-// (PostScript, etc.), groff (PostScript), and rman (HTML, etc.)
-//
-// v3 2000/11/28 Eric Sunshine <sunshine@sunshineco.com>
-// Considerably expanded the documentation.
-// Augmented the existing description of .keymapping internals.
-// Added these new documentation topics:
-// - Output: Very important section describing how to interpret
-// the output of dumpkeymap.
-// - Files: Lists files and directories related to key mappings.
-// - Diagnostics: Explains diagnostic messages issued by
-// dumpkeymap.
-// Created a manual page (dumpkeymap.1) which contains the complete
-// set of documentation for key mapping files and dumpkeymap.
-// Added command-line options (--help, --help-keymapping,
-// --help-output, --help-files, --help-diagnostics) which allow
-// access to all key mapping documentation. Previously the
-// description of the internal layout of a .keymapping file was
-// only available as source code comments.
-// Added --version option.
-// Ported to non-Apple/NeXT platforms. Defining the pre-processor
-// flag DUMPKEYMAP_FILE_ONLY at compilation time inhibits use of
-// Apple/NeXT-specific API.
-// Added a README file.
-//
-// v2 2000/11/13 Eric Sunshine <sunshine@sunshineco.com>
-// Converted from C++ to plain-C.
-// Now parses and takes into account the "number-size" flag stored
-// with each key map. This flag indicates the size, in bytes, of
-// all remaining numeric values in the mapping. Updated all code
-// to respect this flag. (Previously, the purpose of this field
-// was unknown, and it was thus denoted as
-// `KeyMapping::fill[2]'.)
-// Updated all documentation; especially the "KEY MAPPING
-// DESCRIPTION" section. Added discussion of the "number-size"
-// flag and revamped all structure definitions to use the generic
-// data type `number' instead of `uchar' or 'byte'. Clarified
-// several sections of the documentation and added missing
-// discussions about type definitions and the relationship of
-// `interface' and `handler_id' to .keymapping and .keyboard
-// files.
-// Updated compilation instructions to include directions for all
-// platforms on which this program might be built.
-// Now published under the formal BSD license rather than a
-// home-grown license.
-//
-// v1 1999/09/08 Eric Sunshine <sunshine@sunshineco.com>
-// Created.
-//-----------------------------------------------------------------------------
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-#if !defined(DUMPKEYMAP_FILE_ONLY)
-#include <drivers/event_status_driver.h>
-#endif
-
-#define PROG_NAME "dumpkeymap"
-#define PROG_VERSION "4"
-#define AUTHOR_NAME "Eric Sunshine"
-#define AUTHOR_EMAIL "sunshine@sunshineco.com"
-#define AUTHOR_INFO AUTHOR_NAME " <" AUTHOR_EMAIL ">"
-#define COPYRIGHT "Copyright (C) 1999,2000 by " AUTHOR_INFO
-
-typedef unsigned char byte;
-typedef unsigned short word;
-typedef unsigned int natural;
-typedef unsigned long dword;
-typedef dword number;
-
-#define ASCII_SET 0x00
-#define BIND_FUNCTION 0xfe
-#define BIND_SPECIAL 0xff
-
-#define OPT_SWITCH(X) { char const* switched_str__=(X); if (0) {
-#define OPT_CASE(X,Y) } else if (strcmp(switched_str__,(#X)) == 0 || \
- strcmp(switched_str__,(#Y)) == 0) {
-#define OPT_DEFAULT } else {
-#define OPT_SWITCH_END }}
-
-//-----------------------------------------------------------------------------
-// Translation Tables
-//-----------------------------------------------------------------------------
-static char const* const SPECIAL_CODE[] =
- {
- "sound-up",
- "sound-down",
- "brightness-up",
- "brightness-down",
- "alpha-lock",
- "help",
- "power",
- "secondary-up-arrow",
- "secondary-down-arrow"
- };
-#define N_SPECIAL_CODE (sizeof(SPECIAL_CODE) / sizeof(SPECIAL_CODE[0]))
-
-static char const* const MODIFIER_CODE[] =
- {
- "alpha-lock",
- "shift",
- "control",
- "alternate",
- "command",
- "keypad",
- "help"
- };
-#define N_MODIFIER_CODE (sizeof(MODIFIER_CODE) / sizeof(MODIFIER_CODE[0]))
-
-static char const* const MODIFIER_MASK[] =
- {
- "-----", // R = carriage-return
- "----L", // A = alternate
- "---S-", // C = control
- "---SL", // S = shift
- "--C--", // L = alpha-lock
- "--C-L",
- "--CS-",
- "--CSL",
- "-A---",
- "-A--L",
- "-A-S-",
- "-A-SL",
- "-AC--",
- "-AC-L",
- "-ACS-",
- "-ACSL",
- "R----",
- "R---L",
- "R--S-",
- "R--SL",
- "R-C--",
- "R-C-L",
- "R-CS-",
- "R-CSL",
- "RA---",
- "RA--L",
- "RA-S-",
- "RA-SL",
- "RAC--",
- "RAC-L",
- "RACS-",
- "RACSL",
- };
-#define N_MODIFIER_MASK (sizeof(MODIFIER_MASK) / sizeof(MODIFIER_MASK[0]))
-
-#define FUNCTION_KEY_FIRST 0x20
-static char const* const FUNCTION_KEY[] =
- {
- "F1", // 0x20
- "F2", // 0x21
- "F3", // 0x22
- "F4", // 0x23
- "F5", // 0x24
- "F6", // 0x25
- "F7", // 0x26
- "F8", // 0x27
- "F9", // 0x28
- "F10", // 0x29
- "F11", // 0x2a
- "F12", // 0x2b
- "insert", // 0x2c
- "delete", // 0x2d
- "home", // 0x2e
- "end", // 0x2f
- "page up", // 0x30
- "page down", // 0x31
- "print screen", // 0x32
- "scroll lock", // 0x33
- "pause", // 0x34
- "sys-request", // 0x35
- "break", // 0x36
- "reset (HIL)", // 0x37
- "stop (HIL)", // 0x38
- "menu (HIL)", // 0x39
- "user (HIL)", // 0x3a
- "system (HIL)", // 0x3b
- "print (HIL)", // 0x3c
- "clear line (HIL)", // 0x3d
- "clear display (HIL)", // 0x3e
- "insert line (HIL)", // 0x3f
- "delete line (HIL)", // 0x40
- "insert char (HIL)", // 0x41
- "delete char (HIL)", // 0x42
- "prev (HIL)", // 0x43
- "next (HIL)", // 0x44
- "select (HIL)", // 0x45
- };
-#define N_FUNCTION_KEY (sizeof(FUNCTION_KEY) / sizeof(FUNCTION_KEY[0]))
-
-
-//-----------------------------------------------------------------------------
-// Data Stream Object
-// Can be configured to treat embedded "numbers" as being composed of
-// either 1, 2, or 4 bytes, apiece.
-//-----------------------------------------------------------------------------
-typedef struct _DataStream
- {
- byte const* data;
- byte const* data_end;
- natural number_size; // Size in bytes of a "number" in the stream.
- } DataStream;
-
-static DataStream* new_data_stream( byte const* data, int size )
- {
- DataStream* s = (DataStream*)malloc( sizeof(DataStream) );
- 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 )
- {
- free(s);
- }
-
-static int end_of_stream( DataStream* s )
- {
- return (s->data >= s->data_end);
- }
-
-static void expect_nbytes( DataStream* s, int nbytes )
- {
- if (s->data + nbytes > s->data_end)
- {
- fputs( "Insufficient data in keymapping data stream.\n", stderr );
- exit(-1);
- }
- }
-
-static byte get_byte( DataStream* s )
- {
- expect_nbytes( s, 1 );
- return *s->data++;
- }
-
-static word get_word( DataStream* s )
- {
- word hi, lo;
- expect_nbytes( s, 2 );
- hi = *s->data++;
- lo = *s->data++;
- return ((hi << 8) | lo);
- }
-
-static dword get_dword( DataStream* s )
- {
- dword b1, b2, b3, b4;
- expect_nbytes( s, 4 );
- b4 = *s->data++;
- b3 = *s->data++;
- b2 = *s->data++;
- b1 = *s->data++;
- return ((b4 << 24) | (b3 << 16) | (b2 << 8) | b1);
- }
-
-static number 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);
- }
- }
-
-
-//-----------------------------------------------------------------------------
-// Translation Utility Functions
-//-----------------------------------------------------------------------------
-static char const* special_code_desc( number n )
- {
- if (n < N_SPECIAL_CODE)
- return SPECIAL_CODE[n];
- else
- return "invalid";
- }
-
-static char const* modifier_code_desc( number n )
- {
- if (n < N_MODIFIER_CODE)
- return MODIFIER_CODE[n];
- else
- return "invalid";
- }
-
-static char const* modifier_mask_desc( number n )
- {
- if (n < N_MODIFIER_MASK)
- return MODIFIER_MASK[n];
- else
- return "?????";
- }
-
-static char const* function_key_desc( number n )
- {
- if (n >= FUNCTION_KEY_FIRST && n < N_FUNCTION_KEY + FUNCTION_KEY_FIRST)
- return FUNCTION_KEY[ n - FUNCTION_KEY_FIRST ];
- else
- return "unknown";
- }
-
-static number bits_set( number mask )
- {
- number n = 0;
- for ( ; mask != 0; mask >>= 1)
- if ((mask & 0x01) != 0)
- n++;
- return n;
- }
-
-
-//-----------------------------------------------------------------------------
-// Unparse a list of Modifier records.
-//-----------------------------------------------------------------------------
-static void unparse_modifiers( DataStream* s )
- {
- number nmod = get_number(s); // Modifier count
- printf( "MODIFIERS [%lu]\n", nmod );
- while (nmod-- > 0)
- {
- number nscan;
- number const code = get_number(s);
- printf( "%s:", modifier_code_desc(code) );
- nscan = get_number(s);
- while (nscan-- > 0)
- printf( " 0x%02x", (natural)get_number(s) );
- putchar( '\n' );
- }
- putchar( '\n' );
- }
-
-
-//-----------------------------------------------------------------------------
-// Unparse a list of Character records.
-//-----------------------------------------------------------------------------
-typedef void (*UnparseSpecialFunc)( number code );
-
-static void unparse_char_codes(
- DataStream* s, number ncodes, UnparseSpecialFunc unparse_special )
- {
- if (ncodes != 0)
- {
- while (ncodes-- > 0)
- {
- number const char_set = get_number(s);
- number const code = get_number(s);
- putchar(' ');
- switch (char_set)
- {
- case ASCII_SET:
- {
- int const c = (int)code;
- if (isprint(c))
- printf( "\"%c\"", c );
- else if (code < ' ')
- printf( "\"^%c\"", c + '@' );
- else
- printf( "%02x", c );
- break;
- }
- case BIND_FUNCTION:
- printf( "[%s]", function_key_desc(code) );
- break;
- case BIND_SPECIAL:
- unparse_special( code );
- break;
- default:
- printf( "%02x/%02x", (natural)char_set, (natural)code );
- break;
- }
- }
- }
- }
-
-
-//-----------------------------------------------------------------------------
-// Unparse a list of scan code bindings.
-//-----------------------------------------------------------------------------
-static void unparse_key_special( number code )
- {
- printf( "{seq#%lu}", code );
- }
-
-static void unparse_characters( DataStream* s )
- {
- number const NOT_BOUND = 0xff;
- number const nscans = get_number(s);
- number scan;
- printf( "CHARACTERS [%lu]\n", nscans );
- for (scan = 0; scan < nscans; scan++)
- {
- number const mask = get_number(s);
- printf( "scan 0x%02x: ", (natural)scan );
- if (mask == NOT_BOUND)
- fputs( "not-bound\n", stdout );
- else
- {
- number const bits = bits_set( mask );
- number const codes = 1 << bits;
- printf( "%s ", modifier_mask_desc(mask) );
- unparse_char_codes( s, codes, unparse_key_special );
- putchar( '\n' );
- }
- }
- putchar( '\n' );
- }
-
-
-//-----------------------------------------------------------------------------
-// Unparse a list of key sequences.
-//-----------------------------------------------------------------------------
-static void unparse_sequence_special( number code )
- {
- printf( "{%s}", (code == 0 ? "unmodify" : modifier_code_desc(code)) );
- }
-
-static void unparse_sequences( DataStream* s )
- {
- number const nseqs = get_number(s);
- number seq;
- printf( "SEQUENCES [%lu]\n", nseqs );
- for (seq = 0; seq < nseqs; seq++)
- {
- number const nchars = get_number(s);
- printf( "sequence %lu:", seq );
- unparse_char_codes( s, nchars, unparse_sequence_special );
- putchar( '\n' );
- }
- putchar( '\n' );
- }
-
-
-//-----------------------------------------------------------------------------
-// Unparse a list of special keys.
-//-----------------------------------------------------------------------------
-static void unparse_specials( DataStream* s )
- {
- number nspecials = get_number(s);
- printf( "SPECIALS [%lu]\n", nspecials );
- while (nspecials-- > 0)
- {
- number const special = get_number(s);
- number const scan = get_number(s);
- printf( "%s: 0x%02x\n", special_code_desc(special), (natural)scan );
- }
- putchar( '\n' );
- }
-
-
-//-----------------------------------------------------------------------------
-// Unparse the number-size flag.
-//-----------------------------------------------------------------------------
-static void unparse_numeric_size( DataStream* s )
- {
- word const numbers_are_shorts = get_word(s);
- s->number_size = numbers_are_shorts ? 2 : 1;
- }
-
-
-//-----------------------------------------------------------------------------
-// Unparse an entire key map.
-//-----------------------------------------------------------------------------
-static void unparse_keymap_data( DataStream* s )
- {
- unparse_numeric_size(s);
- unparse_modifiers(s);
- unparse_characters(s);
- unparse_sequences(s);
- unparse_specials(s);
- }
-
-
-//-----------------------------------------------------------------------------
-// Unparse the active key map.
-//-----------------------------------------------------------------------------
-#if !defined(DUMPKEYMAP_FILE_ONLY)
-static int unparse_active_keymap( void )
- {
- int rc = 1;
- NXEventHandle const h = NXOpenEventStatus();
- if (h == 0)
- fputs( "Unable to open event status driver.\n", stderr );
- else
- {
- NXKeyMapping km;
- km.size = NXKeyMappingLength(h);
- if (km.size <= 0)
- fprintf( stderr, "Bad key mapping length (%d).\n", km.size );
- else
- {
- km.mapping = (char*)malloc( km.size );
- if (NXGetKeyMapping( h, &km ) == 0)
- fputs( "Unable to get current key mapping.\n", stderr );
- else
- {
- DataStream* stream =
- new_data_stream( (byte const*)km.mapping, km.size );
- fputs( "=============\nACTIVE KEYMAP\n=============\n\n",
- stdout);
- unparse_keymap_data( stream );
- destroy_data_stream( stream );
- rc = 0;
- }
- free( km.mapping );
- }
- NXCloseEventStatus(h);
- }
- return rc;
- }
-#endif
-
-
-//-----------------------------------------------------------------------------
-// Unparse one key map from a keymapping file.
-//-----------------------------------------------------------------------------
-static void unparse_keymap( DataStream* s )
- {
- dword const interface = get_dword(s);
- dword const handler_id = get_dword(s);
- dword const map_size = get_dword(s);
- printf( "interface: 0x%02lx\nhandler_id: 0x%02lx\nmap_size: %lu bytes\n\n",
- interface, handler_id, map_size );
- unparse_keymap_data(s);
- }
-
-
-//-----------------------------------------------------------------------------
-// Check the magic number of a keymapping file.
-//-----------------------------------------------------------------------------
-static int check_magic_number( DataStream* s )
- {
- return (get_byte(s) == 'K' &&
- get_byte(s) == 'Y' &&
- get_byte(s) == 'M' &&
- get_byte(s) == '1');
- }
-
-
-//-----------------------------------------------------------------------------
-// Unparse all key maps within a keymapping file.
-//-----------------------------------------------------------------------------
-static int unparse_keymaps( DataStream* s )
- {
- int rc = 0;
- if (check_magic_number(s))
- {
- int n = 1;
- while (!end_of_stream(s))
- {
- printf( "---------\nKEYMAP #%d\n---------\n", n++ );
- unparse_keymap(s);
- }
- }
- else
- {
- fputs( "Bad magic number.\n", stderr );
- rc = 1;
- }
- return rc;
- }
-
-
-//-----------------------------------------------------------------------------
-// Unparse a keymapping file.
-//-----------------------------------------------------------------------------
-static int unparse_keymap_file( char const* const path )
- {
- int rc = 1;
- FILE* file;
- printf( "===========\nKEYMAP FILE\n===========\n%s\n\n", path );
- file = fopen( path, "rb" );
- if (file == 0)
- perror( "Unable to open key mapping file" );
- else
- {
- struct stat st;
- if (fstat( fileno(file), &st ) != 0)
- perror( "Unable to determine key mapping file size" );
- else
- {
- byte* buffer = (byte*)malloc( st.st_size );
- if (fread( buffer, st.st_size, 1, file ) != 1)
- perror( "Unable to read key mapping file" );
- else
- {
- DataStream* stream = new_data_stream(buffer, (int)st.st_size);
- fclose( file ); file = 0;
- rc = unparse_keymaps( stream );
- destroy_data_stream( stream );
- }
- free( buffer );
- }
- if (file != 0)
- fclose( file );
- }
- return rc;
- }
-
-
-//-----------------------------------------------------------------------------
-// Handle the case when no documents are mentioned on the command-line. For
-// Apple/NeXT platforms, dump the currently active key mapping; else display
-// an error message.
-//-----------------------------------------------------------------------------
-static int handle_empty_document_list( void )
- {
-#if !defined(DUMPKEYMAP_FILE_ONLY)
- return unparse_active_keymap();
-#else
- fputs( "ERROR: Must specify at least one .keymapping file.\n\n", stderr );
- return 1;
-#endif
- }
-
-
-//-----------------------------------------------------------------------------
-// Print a detailed description of the internal layout of a key mapping.
-//-----------------------------------------------------------------------------
-static void print_internal_layout_info( FILE* f )
- {
- fputs(
-"What follows is a detailed descriptions of the internal layout of an\n"
-"Apple/NeXT .keymapping file.\n"
-"\n"
-"Types and Data\n"
-"--------------\n"
-"The following type definitions are employed throughout this discussion:\n"
-"\n"
-" typedef unsigned char byte;\n"
-" typedef unsigned short word;\n"
-" typedef unsigned long dword;\n"
-"\n"
-"Additionally, the type definition `number' is used generically to indicate\n"
-"a numeric value. The actual size of the `number' type may be one or two\n"
-"bytes depending upon how the data is stored in the key map. Although most\n"
-"key maps use byte-sized numeric values, word-sized values are also allowed.\n"
-"\n"
-"Multi-byte values in a key mapping file are stored in big-endian byte\n"
-"order.\n"
-"\n"
-"Key Mapping File and Device Mapping\n"
-"-----------------------------------\n"
-"A key mapping file begins with a magic-number and continues with a variable\n"
-"number of device-specific key mappings.\n"
-"\n"
-" struct KeyMappingFile {\n"
-" char magic_number[4]; // `KYM1'\n"
-" DeviceMapping maps[...]; // Variable number of maps\n"
-" };\n"
-"\n"
-" struct DeviceMapping {\n"
-" dword interface; // Interface type\n"
-" dword handler_id; // Interface subtype\n"
-" dword map_size; // Byte count of `map' (below)\n"
-" KeyMapping map;\n"
-" };\n"
-"\n"
-"The value of `interface' represents a family of keyboard device types\n"
-"(such as Intel PC, ADB, NeXT, Sun Type5, etc.), and is generally\n"
-"specified as one of the constant values NX_EVS_DEVICE_INTERFACE_ADB,\n"
-"NX_EVS_DEVICE_INTERFACE_ACE, etc., which are are defined in IOHIDTypes.h on\n"
-"MacOS/X and Darwin, and in ev_types.h on MacOS/X Server, OpenStep, and\n"
-"NextStep.\n"
-"\n"
-"The value of `handler_id' represents a specific keyboard layout within the\n"
-"much broader `interface' family. For instance, for a 101-key Intel PC\n"
-"keyboard (of type NX_EVS_DEVICE_INTERFACE_ACE) the `handler_id' is '0',\n"
-"whereas for a 102-key keyboard it is `1'.\n"
-"\n"
-"Together, `interface' and `handler_id' identify the exact keyboard hardware\n"
-"to which this mapping applies. Programs which display a visual\n"
-"representation of a keyboard layout, match `interface' and `handler_id'\n"
-"from the .keymapping file against the `interface' and `handler_id' values\n"
-"found in each .keyboard file.\n"
-"\n"
-"Key Mapping\n"
-"-----------\n"
-"A key mapping completely defines the relationship of all scan codes with\n"
-"their associated functionality. A KeyMapping structure is embedded within\n"
-"the DeviceMapping structure in a KeyMappingFile. The key mapping currently\n"
-"in use by the WindowServer and AppKit is also represented by a KeyMapping\n"
-"structure, and can be referred to directly by calling NXGetKeyMapping() and\n"
-"accessing the `mapping' data member of the returned NXKeyMapping structure.\n"
-"\n"
-" struct KeyMapping {\n"
-" word number_size; // 0=1 byte, non-zero=2 bytes\n"
-" number num_modifier_groups; // Modifier groups\n"
-" ModifierGroup modifier_groups[...];\n"
-" number num_scan_codes; // Scan groups\n"
-" ScanGroup scan_table[...];\n"
-" number num_sequence_lists; // Sequence lists\n"
-" Sequence sequence_lists[...];\n"
-" number num_special_keys; // Special keys\n"
-" SpecialKey special_key[...];\n"
-" };\n"
-"\n"
-"The `number_size' flag determines the size, in bytes, of all remaining\n"
-"numeric values (denoted by the type definition `number') within the key\n"
-"mapping. If its value is zero, then numbers are represented by a single\n"
-"byte. If it is non-zero, then numbers are represented by a word (two\n"
-"bytes).\n"
-"\n"
-"Modifier Group\n"
-"--------------\n"
-"A modifier group defines all scan codes which map to a particular type of\n"
-"modifier, such as `shift', `control', etc.\n"
-"\n"
-" enum Modifier {\n"
-" ALPHALOCK = 0,\n"
-" SHIFT,\n"
-" CONTROL,\n"
-" ALTERNATE,\n"
-" COMMAND,\n"
-" KEYPAD,\n"
-" HELP\n"
-" };\n"
-"\n"
-" struct ModifierGroup {\n"
-" number modifier; // A Modifier constant\n"
-" number num_scan_codes;\n"
-" number scan_codes[...]; // Variable number of scan codes\n"
-" };\n"
-"\n"
-"The scan_codes[] array contains a list of all scan codes which map to the\n"
-"specified modifier. The `shift', `command', and `alternate' modifiers are\n"
-"frequently mapped to two different scan codes, apiece, since these\n"
-"modifiers often appear on both the left and right sides of the keyboard.\n"
-"\n"
-"Scan Group\n"
-"----------\n"
-"There is one ScanGroup for each scan code generated by the given keyboard.\n"
-"This number is given by KeyMapping::num_scan_codes. The first scan group\n"
-"represents hardware scan code 0, the second represents scan code 1, etc.\n"
-"\n"
-" enum ModifierMask {\n"
-" ALPHALOCK_MASK = 1 << 0,\n"
-" SHIFT_MASK = 1 << 1,\n"
-" CONTROL_MASK = 1 << 2,\n"
-" ALTERNATE_MASK = 1 << 3,\n"
-" CARRIAGE_RETURN_MASK = 1 << 4\n"
-" };\n"
-" #define NOT_BOUND 0xff\n"
-"\n"
-" struct ScanGroup {\n"
-" number mask;\n"
-" Character characters[...];\n"
-" };\n"
-"\n"
-"For each scan code, `mask' defines which modifier combinations generate\n"
-"characters. If `mask' is NOT_BOUND (0xff) then then this scan code does\n"
-"not generate any characters ever, and its characters[] array is zero\n"
-"length. Otherwise, the characters[] array contains one Character record\n"
-"for each modifier combination.\n"
-"\n"
-"The number of records in characters[] is determined by computing (1 <<\n"
-"bits_set_in_mask). In other words, if mask is zero, then zero bits are\n"
-"set, so characters[] contains only one record. If `mask' is (SHIFT_MASK |\n"
-"CONTROL_MASK), then two bits are set, so characters[] contains four\n"
-"records.\n"
-"\n"
-"The first record always represents the character which is generated by that\n"
-"key when no modifiers are active. The remaining records represent\n"
-"characters generated by the various modifier combinations. Using the\n"
-"example with the `shift' and `control' masks set, record two would\n"
-"represent the character with the `shift' modifier active; record three, the\n"
-"`control' modifier active; and record four, both the `shift' and `control'\n"
-"modifiers active.\n"
-"\n"
-"As a special case, ALPHALOCK_MASK implies SHIFT_MASK, though only\n"
-"ALPHALOCK_MASK appears in `mask'. In this case the same character is\n"
-"generated for both the `shift' and `alpha-lock' modifiers, but only needs\n"
-"to appear once in the characters[] array.\n"
-"\n"
-"CARRIAGE_RETURN_MASK does not actually refer to a modifier key. Instead,\n"
-"it is used to distinguish the scan code which is given the special\n"
-"pseudo-designation of `carriage return' key. Typically, this mask appears\n"
-"solo in a ScanGroup record and only the two Character records for control-M\n"
-"and control-C follow. This flag may be a throwback to an earlier time or\n"
-"may be specially interpreted by the low-level keyboard driver, but its\n"
-"purpose is otherwise enigmatic.\n"
-"Character\n"
-"---------\n"
-"Each Character record indicates the character generated when this key is\n"
-"pressed, as well as the character set which contains the character. Well\n"
-"known character sets are `ASCII' and `Symbol'. The character set can also\n"
-"be one of the meta values FUNCTION_KEY or KEY_SEQUENCE. If it is\n"
-"FUNCTION_KEY then `char_code' represents a generally well-known function\n"
-"key such as those enumerated by FunctionKey. If the character set is\n"
-"KEY_SEQUENCE then `char_code' represents a zero-base index into\n"
-"KeyMapping::sequence_lists[].\n"
-"\n"
-" enum CharacterSet {\n"
-" ASCII = 0x00,\n"
-" SYMBOL = 0x01,\n"
-" ...\n"
-" FUNCTION_KEY = 0xfe,\n"
-" KEY_SEQUENCE = 0xff\n"
-" };\n"
-"\n"
-" struct Character {\n"
-" number set; // CharacterSet of generated character\n"
-" number char_code; // Actual character generated\n"
-" };\n"
-"\n"
-" enum FunctionKey {\n"
-" F1 = 0x20, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12,\n"
-" INSERT, DELETE, HOME, END, PAGE_UP, PAGE_DOWN, PRINT_SCREEN,\n"
-" SCROLL_LOCK, PAUSE, SYS_REQUEST, BREAK, RESET, STOP, MENU, USER,\n"
-" SYSTEM, PRINT, CLEAR_LINE, CLEAR_DISPLAY, INSERT_LINE,\n"
-" DELETE_LINE, INSERT_CHAR, DELETE_CHAR, PREV, NEXT, SELECT\n"
-" };\n"
-"\n"
-"Sequence\n"
-"--------\n"
-"When Character::set contains the meta value KEY_SEQUENCE, the scan code is\n"
-"bound to a sequence of keys rather than a single character. A sequence is\n"
-"a series of modifiers and characters which are automatically generated when\n"
-"the associated key is depressed.\n"
-"\n"
-" #define MODIFIER_KEY 0xff\n"
-"\n"
-" struct Sequence {\n"
-" number num_chars;\n"
-" Character characters[...];\n"
-" };\n"
-"\n"
-"Each generated Character is represented as previously described, with the\n"
-"exception that MODIFIER_KEY may appear in place of KEY_SEQUENCE. When the\n"
-"value of Character::set is MODIFIER_KEY then Character::char_code\n"
-"represents a modifier key rather than an actual character. If the modifier\n"
-"represented by `char_code' is non-zero, then it indicates that the\n"
-"associated modifier key has been depressed. In this case, the value is one\n"
-"of the constants enumerated by Modifier (SHIFT, CONTROL, ALTERNATE, etc.).\n"
-"If the value is zero then it means that the modifier keys have been\n"
-"released.\n"
-"\n"
-"Special Key\n"
-"-----------\n"
-"A special key is one which is scanned directly by the Mach kernel rather\n"
-"than by the WindowServer. In general, events are not generated for special\n"
-"keys.\n"
-"\n"
-" enum SpecialKeyType {\n"
-" VOLUME_UP = 0,\n"
-" VOLUME_DOWN,\n"
-" BRIGHTNESS_UP,\n"
-" BRIGHTNESS_DOWN,\n"
-" ALPHA_LOCK,\n"
-" HELP,\n"
-" POWER,\n"
-" SECONDARY_ARROW_UP,\n"
-" SECONDARY_ARROW_DOWN\n"
-" };\n"
-"\n"
-" struct SpecialKey {\n"
-" number type; // A SpecialKeyType constant\n"
-" number scan_code; // Actual scan code\n"
-" };\n"
-"\n", f );
- }
-
-
-//-----------------------------------------------------------------------------
-// Print an explanation of the output generated by this program.
-//-----------------------------------------------------------------------------
-static void print_output_info( FILE* f )
- {
- fputs(
-"What follows is an explanation and description of the various pieces of\n"
-"information emitted by dumpkeymap.\n"
-"\n"
-"For a more thorough discussion of any particular piece of information\n"
-"described here, refer to the detailed description of the internal layout of\n"
-"a key mapping given by the --help-layout option.\n"
-"\n"
-"Conventions\n"
-"-----------\n"
-"Depending upon context, some numeric values are displayed in decimal\n"
-"notation, whereas others are displayed in hexadecimal notation.\n"
-"Hexadecimal numbers are denoted by a `0x' prefix (for instance, `0x7b'),\n"
-"except when explicitly noted otherwise.\n"
-"\n"
-"Key Mapping Source\n"
-"------------------\n"
-"The first piece of information presented about a particular key mapping is\n"
-"the source from which the data was gleaned. For a .keymapping file, the\n"
-"title `KEYMAP FILE' is emitted along with the path and name of the file in\n"
-"question. For the key mapping currently in use by the WindowServer and\n"
-"AppKit, the title `ACTIVE KEYMAP' is emitted instead.\n"
-"\n"
-"Device Information\n"
-"------------------\n"
-"Each .keymapping file may contain one or more raw key mappings. For\n"
-"example, a file which maps keys to a Dvorak-style layout might contain raw\n"
-"mappings for Intel PC, ADB, NeXT, and Sun Type5 keyboards.\n"
-"\n"
-"For each raw mapping, the following information is emitted:\n"
-"\n"
-" o The title `KEYMAP' along with the mapping's relative position in the\n"
-" .keymapping file.\n"
-" o The `interface' identifier.\n"
-" o The `handler_id' sub-identifier.\n"
-" o The size of the raw mapping resource counted in bytes.\n"
-"\n"
-"The `interface' and `handler_id' values, taken together, define a specific\n"
-"keyboard device. A .keyboard file, which describes the visual layout of a\n"
-"keyboard, also contains `interface' and `handler_id' identifiers. The\n"
-".keyboard file corresponding to a particular key mapping can be found by\n"
-"matching the `interface' and `handler_id' values from each resource.\n"
-"\n"
-"Modifiers\n"
-"---------\n"
-"Each mapping may contain zero or more modifier records which associate\n"
-"hardware scan codes with modifier descriptions such as `shift', `control',\n"
-"`alternate', etc. The title `MODIFIERS' is printed along with the count of\n"
-"modifier records which follow. For each modifier record, the modifier's\n"
-"name is printed along with a list of scan codes, in hexadecimal format,\n"
-"which generate that modifier value. For example:\n"
-"\n"
-" MODIFIERS [4]\n"
-" alternate: 0x1d 0x60\n"
-" control: 0x3a\n"
-" keypad: 0x52 0x53 ... 0x63 0x62\n"
-" shift: 0x2a 0x36\n"
-"\n"
-"Characters\n"
-"----------\n"
-"Each mapping may contain zero or more character records which associate\n"
-"hardware scan codes with the actual characters generated by those scan\n"
-"codes in the presence or absence of various modifier combinations. The\n"
-"title `CHARACTERS' is printed along with the count of character records\n"
-"which follow. Here is a highly abbreviated example:\n"
-"\n"
-" CHARACTERS [9]\n"
-" scan 0x00: -AC-L \"a\" \"A\" \"^A\" \"^A\" ca c7 \"^A\" \"^A\"\n"
-" scan 0x07: -AC-L \"x\" \"X\" \"^X\" \"^X\" 01/b4 01/ce \"^X\" \"^X\"\n"
-" scan 0x0a: ---S- \"<\" \">\"\n"
-" scan 0x13: -ACS- \"2\" \"@\" \"^@\" \"^@\" b2 b3 \"^@\" \"^@\"\n"
-" scan 0x24: R---- \"^M\" \"^C\"\n"
-" scan 0x3e: ----- [F4]\n"
-" scan 0x4a: ----- [page up]\n"
-" scan 0x60: ----- {seq#3}\n"
-" scan 0x68: not-bound\n"
-"\n"
-"For each record, the hexadecimal value of the hardware scan code is\n"
-"printed, followed by a list of modifier flag combinations and the actual\n"
-"characters generated by this scan code with and without modifiers applied.\n"
-"\n"
-"The modifier flags field is composed of a combination of single letter\n"
-"representations of the various modifier types. The letters stand for:\n"
-"\n"
-" L - alpha-lock\n"
-" S - shift\n"
-" C - control\n"
-" A - alternate\n"
-" R - carriage-return\n"
-"\n"
-"As a special case, the `alpha-lock' flag also implies the `shift' flag, so\n"
-"these two flags never appear together in the same record.\n"
-"\n"
-"The combination of modifier flags determines the meaning and number of\n"
-"fields which follow. The first field after the modifier flags always\n"
-"represents the character that will be generated if no modifier keys are\n"
-"depressed. The remaining fields represent characters generated by the\n"
-"various modifier combinations. The order of the fields follows this\n"
-"general pattern:\n"
-"\n"
-" o The character generated by this scan code when no modifiers are in\n"
-" effect is listed first.\n"
-"\n"
-" o If the `L' or `S' flag is active, then the shifted character\n"
-" generated by this scan code is listed next.\n"
-"\n"
-" o If the `C' flag is active, then the control-character generated by\n"
-" this scan code is listed next. Furthermore, if the `L' or `S' flag\n"
-" is also active, then the shifted control-character is listed after\n"
-" that.\n"
-"\n"
-" o If the `A' flag is active, then the alternate-character generated by\n"
-" this scan code is listed next. Furthermore, if the `L' or `S' flag\n"
-" is active, then the shifted alternate-character is listed after that.\n"
-" If the `C' flag is also active, then the alternate-control-character\n"
-" is listed next. Finally, if the `C' and `L' or `C' and `S' flags are\n"
-" also active, then the shifted alternate-control-character is listed.\n"
-"\n"
-"The `R' flag does not actually refer to a modifier key. Instead, it is\n"
-"used to distinguish the scan code which is given the special\n"
-"pseudo-designation of `carriage return' key. Typically, this mask appears\n"
-"solo and only the two fields for control-M and control-C follow. This flag\n"
-"may be a throwback to an earlier time or may be specially interpreted by\n"
-"the low-level keyboard driver, but its purpose is otherwise enigmatic.\n"
-"\n"
-"Recalling the example from above, the following fields can be identified:\n"
-"\n"
-" scan 0x00: -AC-L \"a\" \"A\" \"^A\" \"^A\" ca c7 \"^A\" \"^A\"\n"
-"\n"
-" o Lower-case `a' is generated when no modifiers are active.\n"
-" o Upper-case `A' is generated when `shift' or `alpha-lock' are active.\n"
-" o Control-A is generated when `control' is active.\n"
-" o Control-A is generated when `control' and `shift' are active.\n"
-" o The character represented by the hexadecimal code 0xca is generated\n"
-" when `alternate' is active.\n"
-" o The character represented by 0xc7 is generated when `alternate' and\n"
-" `shift' (or `alpha-lock') are active.\n"
-" o Control-A is generated when `alternate' and `control' are active.\n"
-" o Control-A is generated when `alternate', `control' and `shift' (or\n"
-" `alpha-lock') are active.\n"
-"\n"
-"The notation used to represent a particular generated character varies.\n"
-"\n"
-" o Printable ASCII characters are quoted, as in \"x\" or \"X\".\n"
-"\n"
-" o Control-characters are quoted and prefixed with `^', as in \"^X\".\n"
-"\n"
-" o Characters with values greater than 127 (0x7f) are displayed as\n"
-" hexadecimal values without the `0x' prefix.\n"
-"\n"
-" o Characters in a non-ASCII character set (such as `Symbol') are\n"
-" displayed as two hexadecimal numbers separated by a slash, as in\n"
-" `01/4a'. The first number is the character set's identification code\n"
-" (such as `01' for the `Symbol' set), and the second number is the\n"
-" value of the generated character.\n"
-"\n"
-" o Non-printing special function characters are displayed with the\n"
-" function's common name enclosed in brackets, as in `[page up]' or\n"
-" `[F4]'.\n"
-"\n"
-" o If the binding represents a key sequence rather than a single\n"
-" character, then the sequence's identification number is enclosed in\n"
-" braces, as in `{seq#3}'.\n"
-"\n"
-"Recalling a few examples from above, the following interpretations can be\n"
-"made:\n"
-"\n"
-" scan 0x07: -AC-L \"x\" \"X\" \"^X\" \"^X\" 01/b4 01/ce \"^X\" \"^X\"\n"
-" scan 0x3e: ----- [F4]\n"
-" scan 0x4a: ----- [page up]\n"
-" scan 0x60: ----- {seq#3}\n"
-"\n"
-" o \"x\" and \"X\" are printable ASCII characters.\n"
-" o \"^X\" is a control-character.\n"
-" o `01/b4' and `01/ce' represent the character codes 0xb4 and 0xce in\n"
-" the `Symbol' character set.\n"
-" o Scan code 0x3e generates function-key `F4', and scan code 0x4a\n"
-" generates function-key `page up'.\n"
-" o Scan code 0x60 is bound to key sequence #3.\n"
-"\n"
-"Finally, if a scan code is not bound to any characters, then it is\n"
-"annotated with the label `not-bound', as with example scan code 0x68 from\n"
-"above.\n"
-"\n"
-"Sequences\n"
-"---------\n"
-"A scan code (modified and unmodified) can be bound to a key sequence rather\n"
-"than generating a single character or acting as a modifier. When it is\n"
-"bound to a key sequence, a series of character invocations and modifier\n"
-"actions are automatically generated rather than a single keystroke.\n"
-"\n"
-"Each mapping may contain zero or more key sequence records. The title\n"
-"`SEQUENCES' is printed along with the count of sequence records which\n"
-"follow. For example:\n"
-"\n"
-" SEQUENCES [3]\n"
-" sequence 0: \"f\" \"o\" \"o\"\n"
-" sequence 1: {alternate} \"b\" \"a\" \"r\" {unmodify}\n"
-" sequence 2: [home] \"b\" \"a\" \"z\"\n"
-"\n"
-"The notation used to represent the sequence of generated characters is\n"
-"identical to the notation already described in the `Characters' section\n"
-"above, with the exception that modifier actions may be interposed between\n"
-"generated characters. Such modifier actions are represented by the\n"
-"modifier's name enclosed in braces. The special name `{unmodify}'\n"
-"indicates the release of the modifier keys.\n"
-"\n"
-"Thus, the sequences in the above example can be interpreted as follows:\n"
-"\n"
-" o Sequence #0 generates `foo'.\n"
-" o Sequence #1 invokes the `alternate' modifier, generates `bar', and\n"
-" then releases `alternate'.\n"
-" o Sequence #2 invokes the `home' key and then generates `baz'. In a\n"
-" text editor, this would probably result in `baz' being prepended to\n"
-" the line of text on which the cursor resides.\n"
-"\n"
-"Special Keys\n"
-"------------\n"
-"Certain keyboards feature keys which perform some type of special purpose\n"
-"function rather than generating a character or acting as a modifier. For\n"
-"instance, Apple keyboards often contain a `power' key, and NeXT keyboards\n"
-"have historically featured screen brightness and volume control keys.\n"
-"\n"
-"Each mapping may contain zero or more special-key records which associate\n"
-"hardware scan codes with such special purpose functions. The title\n"
-"`SPECIALS' is printed along with the count of records which follow. For\n"
-"each record, the special function's name is printed along with a list of\n"
-"scan codes, in hexadecimal format, which are bound to that function. For\n"
-"example:\n"
-"\n"
-" SPECIALS [6]\n"
-" alpha-lock: 0x39\n"
-" brightness-down: 0x79\n"
-" brightness-up: 0x74\n"
-" power: 0x7f\n"
-" sound-down: 0x77\n"
-" sound-up: 0x73\n"
-"\n", f );
- }
-
-
-//-----------------------------------------------------------------------------
-// Print a summary of the various files and directories which are related to
-// key mappings.
-//-----------------------------------------------------------------------------
-static void print_files_info( FILE* f )
- {
- fputs(
-"This is a summary of the various files and directories which are related to\n"
-"key mappings.\n"
-"\n"
-"*.keymapping\n"
-" A key mapping file which precisely defines the relationship of all\n"
-" hardware-specific keyboard scan-codes with their associated\n"
-" functionality.\n"
-"\n"
-"*.keyboard\n"
-" A file describing the physical layout of keys on a particular type of\n"
-" keyboard. Each `key' token in this file defines the position and shape\n"
-" of the key on the keyboard, as well as the associated scan code which\n"
-" that key generates. A .keymapping file, on the other hand, defines the\n"
-" characters which are generated by a particular scan code depending upon\n"
-" the state of the various modifier keys (such as shift, control, etc.).\n"
-" The `interface' and `handler_id' values from a .keymapping file are\n"
-" matched against those in each .keyboard file in order to associate a\n"
-" particular .keyboard file with a key mapping. Various GUI programs use\n"
-" the .keyboard file to display a visual representation of a keyboard for\n"
-" the user. Since these files are just plain text, they can be easily\n"
-" viewed and interpreted without the aid of a specialized program, thus\n"
-" dumpkeymap leaves these files alone.\n"
-"\n"
-"/System/Library/Keyboards\n"
-"/Network/Library/Keyboards\n"
-"/Local/Library/Keyboards\n"
-"/Library/Keyboards\n"
-" Repositories for .keymapping and .keyboard files for MacOS/X, Darwin,\n"
-" and MacOS/X Server.\n"
-"\n"
-"/NextLibrary/Keyboards\n"
-"/LocalLibrary/Keyboards\n"
-" Repositories for .keymapping and .keyboard files for OpenStep and\n"
-" NextStep.\n"
-"\n"
-"$(HOME)/Library/Keyboards\n"
-" Repository for personal .keymapping and .keyboard files.\n"
-"\n", f );
- }
-
-
-//-----------------------------------------------------------------------------
-// Print a list of the various diagnostic messages which may be emitted.
-//-----------------------------------------------------------------------------
-static void print_diagnostics_info( FILE* f )
- {
- fputs(
-"The following diagnostic messages may be issued to the standard error\n"
-"stream.\n"
-"\n"
-"Unrecognized option.\n"
-" An unrecognized option was specified on the command-line. Invoke\n"
-" dumpkeymap with the --help option to view a list of valid options.\n"
-"\n"
-"Insufficient data in keymapping data stream.\n"
-" The key mapping file or data stream is corrupt. Either the file has\n"
-" been incorrectly truncated or a field, such as those which indicates\n"
-" the number of variable records which follow, contains a corrupt value.\n"
-"\n"
-"The following diagnostic messages have significance only when trying to\n"
-"print .keymapping files mentioned on the command-line.\n"
-"\n"
-"Bad magic number.\n"
-" The mentioned file is not a .keymapping file. The file's content does\n"
-" not start with the string `KYM1'.\n"
-"\n"
-"Unable to open key mapping file.\n"
-" The call to fopen() failed; probably because the specified path is\n"
-" invalid or dumpkeymap does not have permission to read the file.\n"
-"\n"
-"Unable to determine key mapping file size.\n"
-" The call to fstat() failed, thus memory can not be allocated for\n"
-" loading the file.\n"
-"\n"
-"Unable to read key mapping file.\n"
-" The call to fread() failed.\n"
-"\n"
-"The following diagnostic messages have significance only when trying to\n"
-"print the currently active key mapping when no .keymapping files have been\n"
-"mentioned on the command-line.\n"
-"\n"
-"Unable to open event status driver.\n"
-" The call to NXOpenEventStatus() failed.\n"
-"\n"
-"Bad key mapping length.\n"
-" The call to NXKeyMappingLength() returned a bogus value.\n"
-"\n"
-"Unable to get current key mapping.\n"
-" The call to NXGetKeyMapping() failed.\n"
-"\n"
-"The following diagnostic messages have significance only when using\n"
-"dumpkeymap on a non-Apple/NeXT platform.\n"
-"\n"
-"Must specify at least one .keymapping file.\n"
-" No .keymapping files were mentioned on the command-line. On\n"
-" non-Apple/NeXT platforms, there is no concept of a currently active\n"
-" .keymapping file, so at least one file must be mentioned on the\n"
-" command-line.\n"
-"\n", f );
- }
-
-
-//-----------------------------------------------------------------------------
-// Print warranty.
-//-----------------------------------------------------------------------------
-static void print_warranty( FILE* f )
- {
- fputs(
-"This software is provided by the author `AS IS' and any express or implied\n"
-"WARRANTIES, including, but not limited to, the implied warranties of\n"
-"MERCHANTABILITY and FITNESS FOR A PARTICULAR PURPOSE are DISCLAIMED. In NO\n"
-"EVENT shall the author be LIABLE for any DIRECT, INDIRECT, INCIDENTAL,\n"
-"SPECIAL, EXEMPLARY, or CONSEQUENTIAL damages (including, but not limited\n"
-"to, procurement of substitute goods or services; loss of use, data, or\n"
-"profits; or business interruption) however caused and on any theory of\n"
-"liability, whether in contract, strict liability, or tort (including\n"
-"negligence or otherwise) arising in any way out of the use of this\n"
-"software, even if advised of the possibility of such damage.\n"
-"\n", f );
- }
-
-
-//-----------------------------------------------------------------------------
-// Print this program's version number.
-//-----------------------------------------------------------------------------
-static void print_version( FILE* f )
- {
- fputs( "Version " PROG_VERSION " (built " __DATE__ ")\n\n", f );
- }
-
-
-//-----------------------------------------------------------------------------
-// Print a usage summary.
-//-----------------------------------------------------------------------------
-static void print_usage( FILE* f )
- {
- fputs(
-"Usage: dumpkeymap [options] [-] [file ...]\n"
-"\n"
-"Prints a textual representation of each Apple/NeXT .keymapping file\n"
-"mentioned on the command-line. If no files are mentioned and if the local\n"
-"machine is an Apple or NeXT installation, then the key mapping currently in\n"
-"use by the WindowServer and the AppKit is printed instead.\n"
-"\n"
-"Options:\n"
-" -h --help\n"
-" Display general program instructions and option summary.\n"
-"\n"
-" -k --help-keymapping\n"
-" Display a detailed description of the internal layout of a\n"
-" .keymapping file.\n"
-"\n"
-" -o --help-output\n"
-" Display an explanation of the output generated by dumpkeymap when\n"
-" dissecting a .keymapping file.\n"
-"\n"
-" -f --help-files\n"
-" Display a summary of the various files and directories which are\n"
-" related to key mappings.\n"
-"\n"
-" -d --help-diagnostics\n"
-" Display a list of the various diagnostic messages which may be\n"
-" emitted by dumpkeymap.\n"
-"\n"
-" -v --version\n"
-" Display the dumpkeymap version number and warranty information.\n"
-"\n"
-" - --\n"
-" Inhibit processing of options at this point in the argument list.\n"
-" An occurrence of `-' or `--' in the argument list causes all\n"
-" following arguments to be treated as file names even if an argument\n"
-" begins with a `-' character.\n"
-"\n", f );
- }
-
-
-//-----------------------------------------------------------------------------
-// Print an informational banner.
-//-----------------------------------------------------------------------------
-static void print_banner( FILE* f )
- {
- fputs( "\n" PROG_NAME " v" PROG_VERSION " by " AUTHOR_INFO "\n"
- COPYRIGHT "\n\n", f );
- }
-
-
-//-----------------------------------------------------------------------------
-// Process command-line arguments. Examine options first; collecting files
-// along the way. If all is well, process collected file list.
-//-----------------------------------------------------------------------------
-int main( int const argc, char const* const argv[] )
- {
- int rc = 0, i, nfiles = 0, more_options = 1, process_files = 1;
- int* files = (int*)calloc( argc - 1, sizeof(int) );
- print_banner( stdout );
-
- for (i = 1; i < argc; i++)
- {
- char const* const s = argv[i];
- if (!more_options || *s != '-')
- files[ nfiles++ ] = i;
- else
- {
- OPT_SWITCH(s)
- OPT_CASE(-,--)
- more_options = 0;
- OPT_CASE(-h,--help)
- print_usage( stdout );
- process_files = 0;
- OPT_CASE(-k,--help-keymapping)
- print_internal_layout_info( stdout );
- process_files = 0;
- OPT_CASE(-o,--help-output)
- print_output_info( stdout );
- process_files = 0;
- OPT_CASE(-f,--help-files)
- print_files_info( stdout );
- process_files = 0;
- OPT_CASE(-d,--help-diagnostics)
- print_diagnostics_info( stdout );
- process_files = 0;
- OPT_CASE(-v,--version)
- print_version( stdout );
- print_warranty( stdout );
- process_files = 0;
- OPT_DEFAULT
- fprintf( stderr, "ERROR: Unrecognized option: %s\n\n", s );
- process_files = 0;
- rc = 1;
- OPT_SWITCH_END
- }
- }
-
- if (process_files)
- {
- if (nfiles == 0)
- rc = handle_empty_document_list();
- else
- for (i = 0; i < nfiles; i++)
- rc |= unparse_keymap_file( argv[files[i]] );
- }
-
- free( files );
- return rc;
- }
diff --git a/hw/darwin/utils/dumpkeymap.man b/hw/darwin/utils/dumpkeymap.man
deleted file mode 100644
index 90a2cd051..000000000
--- a/hw/darwin/utils/dumpkeymap.man
+++ /dev/null
@@ -1,1004 +0,0 @@
-.ig
-//=============================================================================
-//
-// Manual page for `dumpkeymap'.
-//
-// Copyright (C) 1999,2000 by Eric Sunshine <sunshine@sunshineco.com>
-// 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.
-//
-//=============================================================================
-//
-// $XFree86$
-//
-..
-.ig
-//-----------------------------------------------------------------------------
-// Local identification information.
-//-----------------------------------------------------------------------------
-..
-.nr VE 4 \" Version number
-.TH DUMPKEYMAP 1 "v\n(VE \-\- 1 December 2000" "Version \n(VE"
-.de UP
-1 December 2000
-..
-.ig
-//-----------------------------------------------------------------------------
-// Annotation Macros
-// -----------------
-// Facilitate creation of annotated, non-filled blocks of text. An
-// annotated block is initiated with the `AS' macro. Each annotated,
-// non-filled line within the block must be introduced with the `AN' macro
-// which takes three arguments. The first argument is the detail text to
-// be annotated. The second is a string of spaces used to align the
-// annotations by certain (broken) roff interpreters which fail to
-// implement the proper set of roff commands (such as diversions,
-// indentation, and tab stops). It is assumed that the spaces will be
-// used with fixed-point font. The third argument is the annotation
-// itself. The block should be terminated with the `AE' macro. For all
-// roff interpreters which properly implement diversions, indentation, and
-// tab stops, all annotations within the block are automatically aligned at
-// the same horizontal position. This position is guaranteed to be just
-// to the right of the widest `AN' detail line. For broken roff
-// interpreters, such as `rman', the string of spaces from the second
-// argument are used to align the annotations. Finally, the `AZ' macro,
-// which takes a single argument, can be used to to insert a non-annotated
-// line into the block which does not play a part in the calculation of
-// the horizontal annotation alignment.
-//
-// Implementation Notes
-// --------------------
-// *1* These macros utilize a diversion (named `AD'). Since the prevailing
-// indentation is stored along with the diverted text, we must muck with
-// the indentation level in order to prevent the indentation from being
-// applied to the text a second time when `AD' is finally emitted.
-//
-// *2* Unfortunately, `.if' strips leading whitespace from following text, so
-// `AN' uses \& to preserve the whitespace.
-//
-// *3* This manual page has been tested for proper formatting with troff,
-// groff, nroff and rman (the `man' to `HTML' converter). Unfortunately,
-// rman fails to implement many useful features such as diversions,
-// indentation, and tab stops, and is also hideously buggy. Furthermore
-// it identifies itself as nroff and fails to provide any further
-// identification, so there is no way to create macros which specifically
-// work around its limitations. Following is a list of several bugs in
-// rman which the implementation of these macros must avoid:
-// o Fails with multi-line conditionals within macros.
-// o Fails on macro definition within multi-line conditionals.
-// o Fails when macro arguments are not delimited by exactly 1 space.
-// o String definition `.ds' ignores the value; uses empty "" instead.
-// As a consequence of these problems, the following macros are written
-// using a series of ugly single-line `.if' conditionals rather than the
-// more natural multi-line `.if' and `.ie' conditionals. Also, rman fails
-// to understand the common idiom of `.\"' to introduce a comment, which
-// is why all comments in this file are wrapped in ignore `.ig' blocks.
-//-----------------------------------------------------------------------------
-..
-.de AS
-.if t .nr AW 0
-.if t .nr AI \\n(.i
-.if t .in -\\n(AI
-.nf
-..
-.de AN
-.if t .if \w'\\$1'>\\n(AW .nr AW \w'\\$1'
-.if t .da AD
-.if t \\&\\$1\\t\\$3
-.if t .da
-.if n \\&\\$1 \\$2\\$3
-..
-.de AZ
-.if t .da AD
-\\$1
-.if t .da
-..
-.de AE
-.if t .in +\\n(AIu
-.if t .if \\n(AW .ta \\n(AWu+\w'\\(em'u
-.if t .AD
-.if t .DT
-.if t .rm AD
-.if t .rm AW
-.fi
-..
-.ig
-//-----------------------------------------------------------------------------
-// Bulleted list macros -- `BG' begins a bulleted list; `BU' delimits
-// bulleted entries; `BE' ends a bulleted list.
-//-----------------------------------------------------------------------------
-..
-.de BG
-.PP
-.RS
-..
-.de BU
-.HP
-\\(bu\\ \\c
-..
-.de BE
-.RE
-.PP
-..
-.ig
-//-----------------------------------------------------------------------------
-// Indented paragraph with stylized hanging tag macro. `TG' takes a single
-// argument and treats it as the hanging tag of the indented paragraph.
-// The tag is italicized in troff but not in nroff.
-//-----------------------------------------------------------------------------
-..
-.de TG
-.TP
-.ie t .I "\\$1"
-.el \\$1
-..
-.ig
-//-----------------------------------------------------------------------------
-// Manual page for `dumpkeymap'.
-//-----------------------------------------------------------------------------
-..
-.SH NAME
-dumpkeymap \- Dianostic dump of a .keymapping file
-.SH SYNOPSIS
-.B dumpkeymap
-.RI [ options "] [-] [" file "...]"
-.SH DESCRIPTION
-.I dumpkeymap
-prints a textual representation of each Apple/\c
-.SM NeXT
-.I .keymapping
-file mentioned on the command-line. If no files are mentioned and if the
-local machine is an Apple or
-.SM NeXT
-installation, then the key mapping currently in use by the WindowServer and the
-AppKit is printed instead.
-.SH OPTIONS
-.TP
-.B "\-h \-\^\-help"
-Display general program instructions and option summary.
-.TP
-.B "\-k \-\^\-help\-keymapping"
-Display a detailed description of the internal layout of a
-.I .keymapping
-file. This is the same information as that presented in the
-.I "Key Mapping Description"
-section of this document.
-.TP
-.B "\-o \-\^\-help\-output"
-Display an explanation of the output generated by
-.I dumpkeymap
-when dissecting a
-.I .keymapping
-file. This is the same information as that presented in the
-.I "Output Description"
-section of this document.
-.TP
-.B "\-f \-\^\-help\-files"
-Display a summary of the various files and directories which are related to
-key mappings. This is the same information as that presented in the
-.I "Files"
-section of this document.
-.TP
-.B "\-d \-\^\-help\-diagnostics"
-Display a list of the various diagnostic messages which may be emitted by
-.I dumpkeymap.
-This is the same information as that presented in the
-.I "Diagnostics"
-section of this document.
-.TP
-.B "\-v \-\^\-version"
-Display the
-.I dumpkeymap
-version number and warranty information.
-.TP
-.B "\- \-\^\-"
-Inhibit processing of options at this point in the argument list. An
-occurrence of `\-' or `\-\^\-' in the argument list causes all following
-arguments to be treated as file names even if an argument begins with a `\-'
-character.
-.SH "KEY MAPPING DESCRIPTION"
-The following sections describe, in complete detail, the format of a raw key
-mapping resource, as well as the format of the
-.I .keymapping
-file which encapsulates one or more raw mappings.
-.SH "Types and Data"
-The following type definitions are employed throughout this discussion:
-.PP
-.RS
-.AS
-.AZ "typedef unsigned char byte;"
-.AZ "typedef unsigned short word;"
-.AZ "typedef unsigned long dword;"
-.AE
-.RE
-.PP
-Additionally, the type definition
-.RI ` number '
-is used generically to
-indicate a numeric value. The actual size of the
-.RI ` number '
-type may be one or two bytes depending upon how the data is stored in the key
-map. Although most key maps use byte-sized numeric values, word-sized values
-are also allowed.
-.PP
-Multi-byte values in a key mapping file are stored in big-endian byte order.
-.SH "Key Mapping File and Device Mapping"
-A key mapping file begins with a magic-number and continues with a
-variable number of device-specific key mappings.
-.PP
-.RS
-.AS
-.AZ "struct KeyMappingFile {"
-.AN " char magic_number[4];" " " "// `KYM1'"
-.AN " DeviceMapping maps[...];" "" "// Variable number of maps"
-.AZ };
-.AE
-.PP
-.AS
-.AZ "struct DeviceMapping {"
-.AN " dword interface;" " " "// Interface type"
-.AN " dword handler_id;" "" "// Interface subtype"
-.AN " dword map_size;" " " "// Byte count of `map' (below)"
-.AN " KeyMapping map;"
-.AZ };
-.AE
-.RE
-.PP
-The value of `interface' represents a family of keyboard device types
-(such as Intel
-.SM "PC, ADB, NeXT,"
-Sun Type5, etc.), and is generally specified as one of the constant values
-.SM "NX_EVS_DEVICE_INTERFACE_ADB, NX_EVS_DEVICE_INTERFACE_ACE,"
-etc., which are are defined in IOHIDTypes.h on MacOS/X and Darwin, and in
-ev_types.h on MacOS/X Server, OpenStep, and NextStep.
-.PP
-The value of `handler_id' represents a specific keyboard layout within the
-much broader `interface' family. For instance, for a 101-key Intel
-.SM PC
-keyboard (of type
-.SM NX_EVS_DEVICE_INTERFACE_ACE\c
-) the `handler_id' is '0', whereas for a 102-key keyboard it is `1'.
-.PP
-Together, `interface' and `handler_id' identify the exact keyboard hardware to
-which this mapping applies. Programs which display a visual representation of
-a keyboard layout, match `interface' and `handler_id' from the
-.I .keymapping
-file against the `interface' and `handler_id' values found in each
-.I .keyboard
-file.
-.SH "Key Mapping"
-A key mapping completely defines the relationship of all scan codes with their
-associated functionality. A
-.I KeyMapping
-structure is embedded within the
-.I DeviceMapping
-structure in a
-.IR KeyMappingFile .
-The key mapping currently in use by the WindowServer and AppKit is also
-represented by a
-.I KeyMapping
-structure, and can be referred to directly by calling NXGetKeyMapping() and
-accessing the `mapping' data member of the returned
-.I NXKeyMapping
-structure.
-.PP
-.RS
-.AS
-.AZ "struct KeyMapping {"
-.AN " word number_size;" " " "// 0=1 byte, non-zero=2 bytes"
-.AN " number num_modifier_groups;" "" "// Modifier groups"
-.AZ " ModifierGroup modifier_groups[...];"
-.AN " number num_scan_codes;" " " "// Scan groups"
-.AN " ScanGroup scan_table[...];"
-.AN " number num_sequence_lists;" " " "// Sequence lists"
-.AN " Sequence sequence_lists[...];"
-.AN " number num_special_keys;" " " "// Special keys"
-.AN " SpecialKey special_key[...];"
-.AZ };
-.AE
-.RE
-.PP
-The `number_size' flag determines the size, in bytes, of all remaining numeric
-values (denoted by the type definition
-.RI ` number ')
-within the
-key mapping. If its value is zero, then numbers are represented by a single
-byte. If it is non-zero, then numbers are represented by a word (two bytes).
-.SH "Modifier Group"
-A modifier group defines all scan codes which map to a particular type of
-modifier, such as
-.IR shift ,
-.IR control ,
-etc.
-.PP
-.RS
-.AS
-.AZ "enum Modifier {"
-.AZ " ALPHALOCK = 0,"
-.AZ " SHIFT,"
-.AZ " CONTROL,"
-.AZ " ALTERNATE,"
-.AZ " COMMAND,"
-.AZ " KEYPAD,"
-.AZ " HELP"
-.AZ };
-.AE
-.PP
-.AS
-.AZ "struct ModifierGroup {"
-.AN " number modifier;" " " "// A Modifier constant"
-.AN " number num_scan_codes;"
-.AN " number scan_codes[...];" "" "// Variable number of scan codes"
-.AZ };
-.AE
-.RE
-.PP
-The scan_codes[] array contains a list of all scan codes which map to the
-specified modifier. The
-.IR shift ", " command ", and " alternate
-modifiers are frequently mapped to two different scan codes, apiece,
-since these modifiers often appear on both the left and right sides of
-the keyboard.
-.SH "Scan Group"
-There is one
-.I ScanGroup
-for each scan code generated by the given keyboard. This number is given by
-KeyMapping::num_scan_codes. The first scan group represents hardware scan
-code 0, the second represents scan code 1, etc.
-.PP
-.RS
-.AS
-.AZ "enum ModifierMask {"
-.AN " ALPHALOCK_MASK" " " "= 1 << 0,"
-.AN " SHIFT_MASK" " " "= 1 << 1,"
-.AN " CONTROL_MASK" " " "= 1 << 2,"
-.AN " ALTERNATE_MASK" " " "= 1 << 3,"
-.AN " CARRIAGE_RETURN_MASK" "" "= 1 << 4"
-.AZ };
-.AZ "#define NOT_BOUND 0xff"
-.AE
-.PP
-.AS
-.AZ "struct ScanGroup {"
-.AN " number mask;"
-.AN " Character characters[...];"
-.AZ };
-.AE
-.RE
-.PP
-For each scan code, `mask' defines which modifier combinations generate
-characters. If `mask' is
-.SM NOT_BOUND
-(0xff) then then this scan code does not generate any characters ever, and its
-characters[] array is zero length. Otherwise, the characters[] array contains
-one
-.I Character
-record for each modifier combination.
-.PP
-The number of records in characters[] is determined by computing (1 <<
-bits_set_in_mask). In other words, if mask is zero, then zero bits are set,
-so characters[] contains only one record. If `mask' is
-.SM "(SHIFT_MASK | CONTROL_MASK),"
-then two bits are set, so characters[] contains four records.
-.PP
-The first record always represents the character which is generated by that
-key when no modifiers are active. The remaining records represent characters
-generated by the various modifier combinations. Using the example with the
-.I shift
-and
-.I control
-masks set, record two would represent the character with the
-.I shift
-modifier active; record three, the
-.I control
-modifier active; and record four, both the
-.I shift
-and
-.I control
-modifiers active.
-.PP
-As a special case,
-.SM ALPHALOCK_MASK
-implies
-.SM SHIFT_MASK,
-though only
-.SM ALPHALOCK_MASK
-appears in `mask'. In this case the same character is generated for both the
-.I shift
-and
-.I alpha-lock
-modifiers, but only needs to appear once in the characters[] array.
-.PP
-.SM CARRIAGE_RETURN_MASK
-does not actually refer to a modifier key. Instead, it is used to
-distinguish the scan code which is given the special pseudo-designation of
-.I "carriage return"
-key. Typically, this mask appears solo in a
-.I ScanGroup
-record and only the two
-.I Character
-records for control-M and control-C follow. This flag may be a throwback to
-an earlier time or may be specially interpreted by the low-level keyboard
-driver, but its purpose is otherwise enigmatic.
-.SH Character
-Each
-.I Character
-record indicates the character generated when this key is pressed, as well as
-the character set which contains the character. Well known character sets are
-.SM `ASCII'
-and `Symbol'. The character set can also be one of the meta values
-.SM FUNCTION_KEY
-or
-.SM KEY_SEQUENCE.
-If it is
-.SM FUNCTION_KEY
-then `char_code' represents a generally well-known function key such as those
-enumerated by
-.I FunctionKey.
-If the character set is
-.SM KEY_SEQUENCE
-then `char_code' represents is a zero-base index into
-KeyMapping::sequence_lists[].
-.PP
-.RS
-.AS
-.AZ "enum CharacterSet {"
-.AN " ASCII" " " "= 0x00,"
-.AN " SYMBOL" " " "= 0x01,"
-.AN " ..."
-.AN " FUNCTION_KEY" "" "= 0xfe,"
-.AN " KEY_SEQUENCE" "" "= 0xff"
-.AZ };
-.AE
-.PP
-.AS
-.AZ "struct Character {"
-.AN " number set;" " " "// CharacterSet of generated character"
-.AN " number char_code;" "" "// Actual character generated"
-.AZ };
-.AE
-.PP
-.AS
-.AZ "enum FunctionKey {"
-.AZ " F1 = 0x20, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12,"
-.AZ " INSERT, DELETE, HOME, END, PAGE_UP, PAGE_DOWN, PRINT_SCREEN,"
-.AZ " SCROLL_LOCK, PAUSE, SYS_REQUEST, BREAK, RESET, STOP, MENU,"
-.AZ " USER, SYSTEM, PRINT, CLEAR_LINE, CLEAR_DISPLAY, INSERT_LINE,"
-.AZ " DELETE_LINE, INSERT_CHAR, DELETE_CHAR, PREV, NEXT, SELECT"
-.AZ };
-.AE
-.RE
-.SH Sequence
-When Character::set contains the meta value
-.SM KEY_SEQUENCE,
-the scan code is bound to a sequence of keys rather than a single character.
-A sequence is a series of modifiers and characters which are automatically
-generated when the associated key is depressed.
-.PP
-.RS
-.AS
-.AZ "#define MODIFIER_KEY 0xff"
-.AE
-.PP
-.AS
-.AZ "struct Sequence {"
-.AN " number num_chars;"
-.AN " Character characters[...];"
-.AZ };
-.AE
-.RE
-.PP
-Each generated
-.I Character
-is represented as previously described, with the exception that
-.SM MODIFIER_KEY
-may appear in place of
-.SM KEY_SEQUENCE.
-When the value of Character::set is
-.SM MODIFIER_KEY
-then Character::char_code represents a modifier key rather than an actual
-character. If the modifier represented by `char_code' is non-zero, then it
-indicates that the associated modifier key has been depressed. In this case,
-the value is one of the constants enumerated by
-.I Modifier
-(\c
-.SM "SHIFT, CONTROL, ALTERNATE,"
-etc.). If the value is zero then it means that the modifier keys have been
-released.
-.SH "Special Key"
-A special key is one which is scanned directly by the Mach kernel rather than
-by the WindowServer. In general, events are not generated for special keys.
-.PP
-.RS
-.AS
-.AZ "enum SpecialKeyType {"
-.AZ " VOLUME_UP = 0,"
-.AZ " VOLUME_DOWN,"
-.AZ " BRIGHTNESS_UP,"
-.AZ " BRIGHTNESS_DOWN,"
-.AZ " ALPHA_LOCK,"
-.AZ " HELP,"
-.AZ " POWER,"
-.AZ " SECONDARY_ARROW_UP,"
-.AZ " SECONDARY_ARROW_DOWN"
-.AZ };
-.AE
-.PP
-.AS
-.AZ "struct SpecialKey {"
-.AN " number type;" " " "// A SpecialKeyType constant"
-.AN " number scan_code;" "" "// Actual scan code"
-.AZ };
-.AE
-.RE
-.SH OUTPUT
-What follows is an explanation and description of the various pieces of
-information emitted by
-.I dumpkeymap.
-.PP
-For a more thorough discussion of any particular piece of information described
-here, refer to the detailed description of the internal layout of a key mapping
-provided by the
-.I "Key Mapping Description"
-section above.
-.SH Conventions
-Depending upon context, some numeric values are displayed in decimal
-notation, whereas others are displayed in hexadecimal notation.
-Hexadecimal numbers are denoted by a `0x' prefix (for instance, `0x7b'),
-except when explicitly noted otherwise.
-.SH "Key Mapping Source"
-The first piece of information presented about a particular key mapping is the
-source from which the data was gleaned. For a
-.I .keymapping
-file, the title
-.SM "`KEYMAP FILE'"
-is emitted along with the path and name of the file in question. For the key
-mapping currently in use by the WindowServer and AppKit, the title
-.SM "`ACTIVE KEYMAP'"
-is emitted instead.
-.SH "Device Information"
-Each
-.I .keymapping
-file may contain one or more raw key mappings. For example, a file which maps
-keys to a Dvorak-style layout might contain raw mappings for Intel
-.SM "PC, ADB, NeXT,"
-and Sun Type5 keyboards.
-.PP
-For each raw mapping, the following information is emitted:
-.BG
-.BU
-The title
-.SM `KEYMAP'
-along with the mapping's relative position in the
-.I .keymapping
-file.
-.BU
-The `interface' identifier.
-.BU
-The `handler_id' sub-identifier.
-.BU
-The size of the raw mapping resource counted in bytes.
-.BE
-The `interface' and `handler_id' values, taken together, define a specific
-keyboard device. A
-.I .keyboard
-file, which describes the visual layout of a keyboard, also contains
-`interface' and `handler_id' identifiers. The
-.I .keyboard
-file corresponding to a particular key mapping can be found by matching the
-`interface' and `handler_id' values from each resource.
-.SH Modifiers
-Each mapping may contain zero or more modifier records which associate hardware
-scan codes with modifier descriptions such as
-.I "shift, control, alternate,"
-etc. The title
-.SM `MODIFIERS'
-is printed along with the count of modifier records which follow. For each
-modifier record, the modifier's name is printed along with a list of scan
-codes, in hexadecimal format, which generate that modifier value. For example:
-.PP
-.RS
-.nf
-MODIFIERS [4]
-alternate: 0x1d 0x60
-control: 0x3a
-keypad: 0x52 0x53 ... 0x63 0x62
-shift: 0x2a 0x36
-.fi
-.RE
-.SH Characters
-Each mapping may contain zero or more character records which associate
-hardware scan codes with the actual characters generated by those scan
-codes in the presence or absence of various modifier combinations. The
-title
-.SM `CHARACTERS'
-is printed along with the count of character records which follow. Here is a
-highly abbreviated example:
-.PP
-.RS
-.nf
-CHARACTERS [9]
-scan 0x00: -AC-L "a" "A" "^A" "^A" ca c7 "^A" "^A"
-scan 0x07: -AC-L "x" "X" "^X" "^X" 01/b4 01/ce "^X" "^X"
-scan 0x0a: ---S- "<" ">"
-scan 0x13: -ACS- "2" "@" "^@" "^@" b2 b3 "^@" "^@"
-scan 0x24: R---- "^M" "^C"
-scan 0x3e: ----- [F4]
-scan 0x4a: ----- [page up]
-scan 0x60: ----- {seq#3}
-scan 0x68: not-bound
-.fi
-.RE
-.PP
-For each record, the hexadecimal value of the hardware scan code is printed,
-followed by a list of modifier flag combinations and the actual characters
-generated by this scan code with and without modifiers applied.
-.PP
-The modifier flags field is composed of a combination of single letter
-representations of the various modifier types. The letters stand for:
-.PP
-.RS
-.nf
-L \- alpha-lock
-S \- shift
-C \- control
-A \- alternate
-R \- carriage-return
-.fi
-.RE
-.PP
-As a special case, the
-.I alpha-lock
-flag also implies the
-.I shift
-flag, so these two flags never appear together in the same record.
-.PP
-The combination of modifier flags determines the meaning and number of fields
-which follow. The first field after the modifier flags always represents the
-character that will be generated if no modifier keys are depressed. The
-remaining fields represent characters generated by the various modifier
-combinations. The order of the fields follows this general pattern:
-.BG
-.BU
-The character generated by this scan code when no modifiers are in effect is
-listed first.
-.BU
-If the `L' or `S' flag is active, then the shifted character generated by this
-scan code is listed next.
-.BU
-If the `C' flag is active, then the control-character generated by this scan
-code is listed next. Furthermore, if the `L' or `S' flag is also active, then
-the shifted control-character is listed after that.
-.BU
-If the `A' flag is active, then the alternate-character generated by this scan
-code is listed next. Furthermore, if the `L' or `S' flag is active, then the
-shifted alternate-character is listed after that. If the `C' flag is also
-active, then the alternate-control-character is listed next. Finally, if the
-`C' and `L' or `C' and `S' flags are also active, then the shifted
-alternate-control-character is listed.
-.BE
-The `R' flag does not actually refer to a modifier key. Instead, it is used to
-distinguish the scan code which is given the special pseudo-designation of
-.I "carriage return"
-key. Typically, this mask appears solo and only the two fields for control-M
-and control-C follow. This flag may be a throwback to an earlier time or may
-be specially interpreted by the low-level keyboard driver, but its purpose is
-otherwise enigmatic.
-.PP
-Recalling the example from above, the following fields can be identified:
-.PP
-.RS
-.nf
-scan 0x00: -AC-L "a" "A" "^A" "^A" ca c7 "^A" "^A"
-.fi
-.RE
-.BG
-.BU
-Lower-case `a' is generated when no modifiers are active.
-.BU
-Upper-case `A' is generated when
-.IR shift " or " alpha-lock
-are active.
-.BU
-Control-A is generated when
-.I control
-is active.
-.BU
-Control-A is generated when
-.IR control " and " shift
-are active.
-.BU
-The character represented by the hexadecimal code 0xca is generated when
-.I alternate
-is active.
-.BU
-The character represented by 0xc7 is generated when
-.IR alternate " and " shift " (or " alpha-lock ") are active."
-.BU
-Control-A is generated when
-.IR alternate " and " control
-are active.
-.BU
-Control-A is generated when
-.IR "alternate, control" " and " shift " (or " alpha-lock ") are active."
-.BE
-The notation used to represent a particular generated character varies.
-.BG
-.BU
-Printable
-.SM ASCII
-characters are quoted, as in "x" or "X".
-.BU
-Control-characters are quoted and prefixed with `^', as in "^X".
-.BU
-Characters with values greater than 127 (0x7f) are displayed as hexadecimal
-values without the `0x' prefix.
-.BU
-Characters in a non-\c
-.SM ASCII
-character set (such as `Symbol') are displayed as two hexadecimal numbers
-separated by a slash, as in `01/4a'. The first number is the character set's
-identification code (such as `01' for the `Symbol' set), and the second number
-is the value of the generated character.
-.BU
-Non-printing special function characters are displayed with the function's
-common name enclosed in brackets, as in `[page up]' or `[F4]'.
-.BU
-If the binding represents a key sequence rather than a single character, then
-the sequence's identification number is enclosed in braces, as in `{seq#3}'.
-.BE
-Recalling a few examples from above, the following interpretations can be made:
-.PP
-.RS
-.nf
-scan 0x07: -AC-L "x" "X" "^X" "^X" 01/b4 01/ce "^X" "^X"
-scan 0x3e: ----- [F4]
-scan 0x4a: ----- [page up]
-scan 0x60: ----- {seq#3}
-.fi
-.RE
-.BG
-.BU
-"x" and "X" are printable
-.SM ASCII
-characters.
-.BU
-"^X" is a control-character.
-.BU
-`01/b4' and `01/ce' represent the character codes 0xb4 and 0xce in the `Symbol'
-character set.
-.BU
-Scan code 0x3e generates function-key `F4', and scan code 0x4a generates
-function-key `page up'.
-.BU
-Scan code 0x60 is bound to key sequence #3.
-.BE
-Finally, if a scan code is not bound to any characters, then it is annotated
-with the label `not-bound', as with example scan code 0x68 from above.
-.SH Sequences
-A scan code (modified and unmodified) can be bound to a key sequence rather
-than generating a single character or acting as a modifier. When it is bound
-to a key sequence, a series of character invocations and modifier actions are
-automatically generated rather than a single keystroke.
-.PP
-Each mapping may contain zero or more key sequence records. The title
-.SM `SEQUENCES'
-is printed along with the count of sequence records which follow. For example:
-.PP
-.RS
-.nf
-SEQUENCES [3]
-sequence 0: "f" "o" "o"
-sequence 1: {alternate} "b" "a" "r" {unmodify}
-sequence 2: [home] "b" "a" "z"
-.fi
-.RE
-.PP
-The notation used to represent the sequence of generated characters is
-identical to the notation already described in the
-.I Characters
-section above, with the exception that modifier actions may be interposed
-between generated characters. Such modifier actions are represented by the
-modifier's name enclosed in braces. The special name `{unmodify}' indicates
-the release of the modifier keys.
-.PP
-Thus, the sequences in the above example can be interpreted as follows:
-.BG
-.BU
-Sequence\ #0 generates `foo'.
-.BU
-Sequence\ #1 invokes the
-.I alternate
-modifier, generates `bar', and then releases
-.I alternate.
-.BU
-Sequence\ #2 invokes the
-.I home
-key and then generates `baz'. In a text editor, this would probably result in
-`baz' being prepended to the line of text on which the cursor resides.
-.BE
-.SH Special Keys
-Certain keyboards feature keys which perform some type of special purpose
-function rather than generating a character or acting as a modifier. For
-instance, Apple keyboards often contain a
-.I power
-key, and
-.SM NeXT
-keyboards have historically featured screen brightness and volume control keys.
-.PP
-Each mapping may contain zero or more special-key records which associate
-hardware scan codes with such special purpose functions. The title
-.SM `SPECIALS'
-is printed along with the count of records which follow. For each record, the
-special function's name is printed along with a list of scan codes, in
-hexadecimal format, which are bound to that function. For example:
-.PP
-.RS
-.nf
-SPECIALS [6]
-alpha-lock: 0x39
-brightness-down: 0x79
-brightness-up: 0x74
-power: 0x7f
-sound-down: 0x77
-sound-up: 0x73
-.fi
-.RE
-.SH FILES
-.IP *.keymapping
-A key mapping file which precisely defines the relationship of all
-hardware-specific keyboard scan-codes with their associated functionality.
-.IP *.keyboard
-A file describing the physical layout of keys on a particular type of
-keyboard. Each `key' token in this file defines the position and shape of the
-key on the keyboard, as well as the associated scan code which that key
-generates. A
-.I .keymapping
-file, on the other hand, defines the characters which are generated by a
-particular scan code depending upon the state of the various modifier keys
-(such as
-.I shift,
-.I control,
-etc.). The `interface' and `handler_id' values from a
-.I .keymapping
-file are matched against those in each
-.I .keyboard
-file in order to associate a particular
-.I .keyboard
-file with a key mapping. Various
-.SM GUI
-programs use the
-.I .keyboard
-file to display a visual representation of a keyboard for the user. Since
-these files are just plain text, they can be easily viewed and interpreted
-without the aid of a specialized program, thus
-.I dumpkeymap
-leaves these files alone.
-.PP
-/System/Library/Keyboards
-.br
-/Network/Library/Keyboards
-.br
-/Local/Library/Keyboards
-.br
-/Library/Keyboards
-.RS
-Repositories for
-.I .keymapping
-and
-.I .keyboard
-files for MacOS/X, Darwin, and MacOS/X Server.
-.RE
-.PP
-/NextLibrary/Keyboards
-.br
-/LocalLibrary/Keyboards
-.RS
-Repositories for
-.I .keymapping
-and
-.I .keyboard
-files for OpenStep and NextStep.
-.RE
-.IP $(HOME)/Library/Keyboards
-Repository for personal
-.I .keymapping
-and
-.I .keyboard
-files.
-.SH DIGANOSTICS
-The following diagnostic messages may be issued to the standard error stream.
-.TG "Unrecognized option."
-An unrecognized option was specified on the command-line. Invoke
-.I dumpkeymap
-with the
-.B "\-\^\-help"
-option to view a list of valid options.
-.TG "Insufficient data in keymapping data stream."
-The key mapping file or data stream is corrupt. Either the file has been
-incorrectly truncated or a field, such as those which indicates the number of
-variable records which follow, contains a corrupt value.
-.PP
-The following diagnostic messages have significance only when trying to print
-.I .keymapping
-files mentioned on the command-line.
-.TG "Bad magic number."
-The mentioned file is not a
-.I .keymapping
-file. The file's content does not start with the string `KYM1'.
-.TG "Unable to open key mapping file."
-The call to fopen() failed; probably because the specified path is invalid or
-.I dumpkeymap
-does not have permission to read the file.
-.TG "Unable to determine key mapping file size."
-The call to fstat() failed, thus memory can not be allocated for loading the
-file.
-.TG "Unable to read key mapping file."
-The call to fread() failed.
-.PP
-The following diagnostic messages have significance only when trying to print
-the currently active key mapping when no
-.I .keymapping
-files have been mentioned on the command-line.
-.TG "Unable to open event status driver."
-The call to NXOpenEventStatus() failed.
-.TG "Bad key mapping length."
-The call to NXKeyMappingLength() returned a bogus value.
-.TG "Unable to get current key mapping."
-The call to NXGetKeyMapping() failed.
-.PP
-The following diagnostic messages have significance only when using
-.I dumpkeymap
-on a non-Apple/\c
-.SM NeXT
-platform.
-.TG "Must specify at least one .keymapping file."
-No
-.I .keymapping
-files were mentioned on the command-line. On non-Apple/\c
-.SM NeXT
-platforms, there is no concept of a currently active
-.I .keymapping
-file, so at least one file must be mentioned on the command-line.
-.SH AUTHOR
-Eric Sunshine <sunshine@sunshineco.com> wrote
-.I dumpkeymap
-and this document, the
-.I "dumpkeymap user's manual."
-Both
-.I dumpkeymap
-and this document are copyright \(co1999,2000 by Eric Sunshine
-<sunshine@sunshineco.com>. All rights reserved.
-.PP
-The implementation of
-.I dumpkeymap
-is based upon information gathered on September 3, 1997 by Eric Sunshine
-<sunshine@sunshineco.com> and Paul S. McCarthy <zarnuk@zarnuk.com> during an
-effort to reverse engineer the format of the
-.SM NeXT
-.I .keymapping
-file.
-.if n .PP
-.if n Version \n(VE \-\-
-.if n .UP
diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c
index a2d866118..e10076f13 100644
--- a/hw/vfb/InitOutput.c
+++ b/hw/vfb/InitOutput.c
@@ -220,7 +220,7 @@ AbortDDX()
ddxGiveUp();
}
-#ifdef __DARWIN__
+#ifdef __APPLE__
void
DarwinHandleGUI(int argc, char *argv[])
{
diff --git a/hw/xfree86/os-support/Makefile.am b/hw/xfree86/os-support/Makefile.am
index 6cd9bb190..3729f62f2 100644
--- a/hw/xfree86/os-support/Makefile.am
+++ b/hw/xfree86/os-support/Makefile.am
@@ -1,5 +1,5 @@
SUBDIRS = bus @XORG_OS_SUBDIR@ misc
-DIST_SUBDIRS = bsd bus misc linux lynxos solaris sysv sco usl hurd
+DIST_SUBDIRS = bsd bus misc linux lynxos sysv sco solaris usl hurd
sdk_HEADERS = xf86_OSproc.h xf86_OSlib.h xf86_ansic.h xf86_libc.h \
assyntax.h xf86OSKbd.h xf86OSmouse.h
diff --git a/hw/xfree86/scanpci/pciid2c.pl b/hw/xfree86/scanpci/pciid2c.pl
index b8947ed05..b8947ed05 100644..100755
--- a/hw/xfree86/scanpci/pciid2c.pl
+++ b/hw/xfree86/scanpci/pciid2c.pl
diff --git a/hw/xnest/Init.c b/hw/xnest/Init.c
index 8c397a7bb..d5992588a 100644
--- a/hw/xnest/Init.c
+++ b/hw/xnest/Init.c
@@ -117,7 +117,7 @@ void ddxGiveUp()
AbortDDX();
}
-#ifdef __DARWIN__
+#ifdef __APPLE__
void
DarwinHandleGUI(int argc, char *argv[])
{
diff --git a/hw/xprint/attributes.c b/hw/xprint/attributes.c
index a24c1076b..02132e827 100644
--- a/hw/xprint/attributes.c
+++ b/hw/xprint/attributes.c
@@ -1379,7 +1379,7 @@ ReplaceAllKeywords(
defined(ISC) || \
defined(Lynx) || \
defined(__QNX__) || \
- defined(__DARWIN__)
+ defined(__APPLE__)
#define iswspace(c) (isascii(c) && isspace(toascii(c)))
#endif
diff --git a/hw/xprint/ddxInit.c b/hw/xprint/ddxInit.c
index 6cd3cfd3c..67b73a64a 100644
--- a/hw/xprint/ddxInit.c
+++ b/hw/xprint/ddxInit.c
@@ -199,7 +199,7 @@ ProcessInputEvents(void)
{
}
-#ifdef __DARWIN__
+#ifdef __APPLE__
#include "micmap.h"
void GlxExtensionInit(void);
diff --git a/hw/xquartz/Makefile.am b/hw/xquartz/Makefile.am
new file mode 100644
index 000000000..5e7044649
--- /dev/null
+++ b/hw/xquartz/Makefile.am
@@ -0,0 +1,53 @@
+noinst_LTLIBRARIES = libXquartz.la
+AM_CFLAGS = $(XSERVER_CFLAGS) $(DIX_CFLAGS)
+AM_CPPFLAGS = \
+ -DBUILD_DATE=\"$(BUILD_DATE)\" \
+ -DXSERVER_VERSION=\"$(VERSION)\" \
+ -DINXQUARTZ \
+ -DUSE_NEW_CLUT \
+ -DXFree86Server \
+ -I$(top_srcdir)/miext/rootless
+
+if X11APP
+X11APP_SUBDIRS = bundle
+endif
+
+SUBDIRS = . xpr $(X11APP_SUBDIRS)
+DIST_SUBDIRS = xpr bundle
+
+libXquartz_la_SOURCES = \
+ $(top_srcdir)/fb/fbcmap_mi.c \
+ $(top_srcdir)/mi/miinitext.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
+
+EXTRA_DIST = \
+ X11Application.h \
+ X11Controller.h \
+ applewmExt.h \
+ darwinClut8.h \
+ darwin.h \
+ darwinEvents.h \
+ darwinKeyboard.h \
+ keysym2ucs.h \
+ pseudoramiX.h \
+ quartz.h \
+ quartzAudio.h \
+ quartzCommon.h \
+ quartzForeground.h \
+ quartzKeyboard.h \
+ quartzPasteboard.h
diff --git a/hw/xquartz/X11Application.h b/hw/xquartz/X11Application.h
new file mode 100644
index 000000000..ea9a6b758
--- /dev/null
+++ b/hw/xquartz/X11Application.h
@@ -0,0 +1,105 @@
+/* X11Application.h -- subclass of NSApplication to multiplex events
+
+ Copyright (c) 2002-2007 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
+ (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 X11APPLICATION_H
+#define X11APPLICATION_H 1
+
+#if __OBJC__
+
+#import <Cocoa/Cocoa.h>
+#import "X11Controller.h"
+
+@interface X11Application : NSApplication {
+ X11Controller *_controller;
+
+ unsigned int _x_active :1;
+}
+
+- (void) set_controller:controller;
+- (void) set_window_menu:(NSArray *)list;
+
+- (int) prefs_get_integer:(NSString *)key default:(int)def;
+- (const char *) prefs_get_string:(NSString *)key default:(const char *)def;
+- (float) prefs_get_float:(NSString *)key default:(float)def;
+- (int) prefs_get_boolean:(NSString *)key default:(int)def;
+- (NSArray *) prefs_get_array:(NSString *)key;
+- (void) prefs_set_integer:(NSString *)key value:(int)value;
+- (void) prefs_set_float:(NSString *)key value:(float)value;
+- (void) prefs_set_boolean:(NSString *)key value:(int)value;
+- (void) prefs_set_array:(NSString *)key value:(NSArray *)value;
+- (void) prefs_set_string:(NSString *)key value:(NSString *)value;
+- (void) prefs_synchronize;
+
+- (BOOL) x_active;
+
+@end
+
+extern X11Application *X11App;
+
+#endif /* __OBJC__ */
+
+void X11ApplicationSetWindowMenu (int nitems, const char **items,
+ const char *shortcuts);
+void X11ApplicationSetWindowMenuCheck (int idx);
+void X11ApplicationSetFrontProcess (void);
+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);
+
+extern int X11EnableKeyEquivalents;
+extern int quartzHasRoot, quartzEnableRootless;
+
+#define APP_PREFS "org.x.X11"
+
+#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_SYNC_KEYMAP "sync_keymap"
+#define PREFS_DEPTH "depth"
+#define PREFS_NO_AUTH "no_auth"
+#define PREFS_NO_TCP "nolisten_tcp"
+#define PREFS_DONE_XINIT_CHECK "done_xinit_check"
+#define PREFS_NO_QUIT_ALERT "no_quit_alert"
+#define PREFS_FAKE_BUTTON2 "fake_button2"
+#define PREFS_FAKE_BUTTON3 "fake_button3"
+#define PREFS_ROOTLESS "rootless"
+#define PREFS_FULLSCREEN_HOTKEYS "fullscreen_hotkeys"
+#define PREFS_SWAP_ALT_META "swap_alt_meta"
+#define PREFS_XP_OPTIONS "xp_options"
+#define PREFS_ENABLE_STEREO "enable_stereo"
+#define PREFS_LOGIN_SHELL "login_shell"
+#define PREFS_CLICK_THROUGH "wm_click_through"
+#define PREFS_FFM "wm_ffm"
+#define PREFS_FOCUS_ON_NEW_WINDOW "wm_focus_on_new_window"
+
+#endif /* X11APPLICATION_H */
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
new file mode 100644
index 000000000..11752991d
--- /dev/null
+++ b/hw/xquartz/X11Application.m
@@ -0,0 +1,1015 @@
+/* X11Application.m -- subclass of NSApplication to multiplex events
+
+ Copyright (c) 2002-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. */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "quartzCommon.h"
+#include "quartzForeground.h"
+
+#import "X11Application.h"
+#include <Carbon/Carbon.h>
+
+/* 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 <mach/mach.h>
+#include <unistd.h>
+#include <pthread.h>
+
+#define DEFAULTS_FILE "/usr/X11/lib/X11/xserver/Xquartz.plist"
+
+/* Fake button press/release for scroll wheel move. */
+#define SCROLLWHEELUPFAKE 4
+#define SCROLLWHEELDOWNFAKE 5
+#define SCROLLWHEELLEFTFAKE 6
+#define SCROLLWHEELRIGHTFAKE 7
+
+#ifndef XSERVER_VERSION
+#define XSERVER_VERSION "?"
+#endif
+
+int X11EnableKeyEquivalents = TRUE;
+int quartzHasRoot = FALSE, quartzEnableRootless = TRUE;
+
+extern int darwinFakeButtons, input_check_flag;
+extern Bool enable_stereo;
+
+extern xEvent *darwinEvents;
+
+X11Application *X11App;
+
+#define ALL_KEY_MASKS (NSShiftKeyMask | NSControlKeyMask | NSAlternateKeyMask | NSCommandKeyMask)
+
+@implementation X11Application
+
+typedef struct message_struct message;
+struct message_struct {
+ mach_msg_header_t hdr;
+ SEL selector;
+ NSObject *arg;
+};
+
+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);
+
+static void init_ports (void) {
+ kern_return_t r;
+ NSPort *p;
+
+ if (_port != MACH_PORT_NULL) return;
+
+ r = mach_port_allocate (mach_task_self (), MACH_PORT_RIGHT_RECEIVE, &_port);
+ if (r != KERN_SUCCESS) return;
+
+ p = [NSMachPort portWithMachPort:_port];
+ [p setDelegate:NSApp];
+ [p scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
+}
+
+static void message_kit_thread (SEL selector, NSObject *arg) {
+ message msg;
+ kern_return_t r;
+
+ msg.hdr.msgh_bits = MACH_MSGH_BITS (MACH_MSG_TYPE_MAKE_SEND, 0);
+ msg.hdr.msgh_size = sizeof (msg);
+ msg.hdr.msgh_remote_port = _port;
+ msg.hdr.msgh_local_port = MACH_PORT_NULL;
+ msg.hdr.msgh_reserved = 0;
+ msg.hdr.msgh_id = 0;
+
+ msg.selector = selector;
+ msg.arg = [arg retain];
+
+ r = mach_msg (&msg.hdr, MACH_SEND_MSG, msg.hdr.msgh_size,
+ 0, MACH_PORT_NULL, 0, MACH_PORT_NULL);
+ if (r != KERN_SUCCESS)
+ ErrorF("%s: mach_msg failed: %x\n", __FUNCTION__, r);
+}
+
+- (void) handleMachMessage:(void *)_msg {
+ message *msg = _msg;
+
+ [self performSelector:msg->selector withObject:msg->arg];
+ [msg->arg release];
+}
+
+- (void) set_controller:obj {
+ if (_controller == nil) _controller = [obj retain];
+}
+
+- (void) dealloc {
+ if (_controller != nil) [_controller release];
+
+ if (_port != MACH_PORT_NULL)
+ mach_port_deallocate (mach_task_self (), _port);
+
+ [super dealloc];
+}
+
+- (void) orderFrontStandardAboutPanel: (id) sender {
+ NSMutableDictionary *dict;
+ NSDictionary *infoDict;
+ NSString *tem;
+
+ dict = [NSMutableDictionary dictionaryWithCapacity:2];
+ infoDict = [[NSBundle mainBundle] infoDictionary];
+
+ [dict setObject: NSLocalizedString (@"The X Window System", @"About panel")
+ forKey:@"ApplicationName"];
+
+ tem = [infoDict objectForKey:@"CFBundleShortVersionString"];
+
+ [dict setObject:[NSString stringWithFormat:@"Xquartz %@ - (xorg-server %s)", tem, XSERVER_VERSION]
+ forKey:@"ApplicationVersion"];
+
+ [self orderFrontStandardAboutPanelWithOptions: dict];
+}
+
+- (void) activateX:(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) */
+ static TSMDocumentID x11_document;
+
+ if (state) {
+ QuartzMessageServerThread (kXquartzActivate, 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);
+ }
+ } else {
+ QuartzMessageServerThread (kXquartzDeactivate, 0);
+
+ if (_x_active && x11_document != 0)
+ DeactivateTSMDocument (x11_document);
+ }
+
+ _x_active = state;
+}
+
+- (void) became_key:(NSWindow *)win {
+ [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. */
+ 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 (kXquartzToggleFullscreen, 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;
+
+ case NSFlagsChanged:
+ /* For the l33t X users who remap modifier keys to normal keysyms. */
+ 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];
+ if ([e data2] & 0x10)
+ QuartzMessageServerThread (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 */
+ }
+
+ if (for_appkit) [super sendEvent:e];
+
+ if (for_x) send_nsevent (type, e);
+}
+
+- (void) set_window_menu:(NSArray *)list {
+ [_controller set_window_menu:list];
+}
+
+- (void) set_window_menu_check:(NSNumber *)n {
+ [_controller set_window_menu_check:n];
+}
+
+- (void) set_apps_menu:(NSArray *)list {
+ [_controller set_apps_menu:list];
+}
+
+- (void) set_front_process:unused {
+ [NSApp activateIgnoringOtherApps:YES];
+
+ if ([self modalWindow] == nil)
+ [self activateX:YES];
+}
+
+- (void) set_can_quit:(NSNumber *)state {
+ [_controller set_can_quit:[state boolValue]];
+}
+
+- (void) server_ready:unused {
+ [_controller server_ready];
+}
+
+- (void) show_hide_menubar:(NSNumber *)state {
+ if ([state boolValue]) ShowMenuBar ();
+ else HideMenuBar ();
+}
+
+
+/* user preferences */
+
+/* Note that these functions only work for arrays whose elements
+ can be toll-free-bridged between NS and CF worlds. */
+
+static const void *cfretain (CFAllocatorRef a, const void *b) {
+ return CFRetain (b);
+}
+
+static void cfrelease (CFAllocatorRef a, const void *b) {
+ CFRelease (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;
+}
+
+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;
+}
+
+- (CFPropertyListRef) prefs_get:(NSString *)key {
+ CFPropertyListRef value;
+
+ value = CFPreferencesCopyAppValue ((CFStringRef) key, CFSTR (APP_PREFS));
+
+ if (value == NULL) {
+ static CFDictionaryRef defaults;
+
+ if (defaults == NULL) {
+ CFStringRef error = NULL;
+ CFDataRef data;
+ CFURLRef url;
+ SInt32 error_code;
+
+ url = (CFURLCreateFromFileSystemRepresentation
+ (NULL, (unsigned char *)DEFAULTS_FILE, strlen (DEFAULTS_FILE), false));
+ if (CFURLCreateDataAndPropertiesFromResource (NULL, url, &data,
+ NULL, NULL, &error_code)) {
+ defaults = (CFPropertyListCreateFromXMLData
+ (NULL, data, kCFPropertyListMutableContainersAndLeaves, &error));
+ if (error != NULL) CFRelease (error);
+ CFRelease (data);
+ }
+ CFRelease (url);
+
+ if (defaults != NULL) {
+ NSMutableArray *apps, *elt;
+ int count, i;
+ NSString *name, *nname;
+
+ /* Localize the names in the default apps menu. */
+
+ apps = [(NSDictionary *)defaults objectForKey:@PREFS_APPSMENU];
+ if (apps != nil) {
+ count = [apps count];
+ for (i = 0; i < count; i++) {
+ elt = [apps objectAtIndex:i];
+ if (elt != nil && [elt isKindOfClass:[NSArray class]]) {
+ name = [elt objectAtIndex:0];
+ if (name != nil) {
+ nname = NSLocalizedString (name, nil);
+ if (nname != nil && nname != name)
+ [elt replaceObjectAtIndex:0 withObject:nname];
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (defaults != NULL) value = CFDictionaryGetValue (defaults, key);
+ if (value != NULL) CFRetain (value);
+ }
+
+ return value;
+}
+
+- (int) prefs_get_integer:(NSString *)key default:(int)def {
+ CFPropertyListRef value;
+ int ret;
+
+ value = [self prefs_get:key];
+
+ if (value != NULL && CFGetTypeID (value) == CFNumberGetTypeID ())
+ CFNumberGetValue (value, kCFNumberIntType, &ret);
+ else if (value != NULL && CFGetTypeID (value) == CFStringGetTypeID ())
+ ret = CFStringGetIntValue (value);
+ else
+ ret = def;
+
+ if (value != NULL) CFRelease (value);
+
+ return ret;
+}
+
+- (const char *) prefs_get_string:(NSString *)key default:(const char *)def {
+ CFPropertyListRef value;
+ const char *ret = NULL;
+
+ value = [self prefs_get:key];
+
+ if (value != NULL && CFGetTypeID (value) == CFStringGetTypeID ()) {
+ NSString *s = (NSString *) value;
+
+ ret = [s UTF8String];
+ }
+
+ if (value != NULL) CFRelease (value);
+
+ return ret != NULL ? ret : def;
+}
+
+- (float) prefs_get_float:(NSString *)key default:(float)def {
+ CFPropertyListRef value;
+ float ret = def;
+
+ value = [self prefs_get:key];
+
+ if (value != NULL
+ && CFGetTypeID (value) == CFNumberGetTypeID ()
+ && CFNumberIsFloatType (value))
+ CFNumberGetValue (value, kCFNumberFloatType, &ret);
+ else if (value != NULL && CFGetTypeID (value) == CFStringGetTypeID ())
+ ret = CFStringGetDoubleValue (value);
+
+ if (value != NULL) CFRelease (value);
+
+ return ret;
+}
+
+- (int) prefs_get_boolean:(NSString *)key default:(int)def {
+ CFPropertyListRef value;
+ int ret = def;
+
+ value = [self prefs_get:key];
+
+ if (value != NULL) {
+ if (CFGetTypeID (value) == CFNumberGetTypeID ())
+ CFNumberGetValue (value, kCFNumberIntType, &ret);
+ else if (CFGetTypeID (value) == CFBooleanGetTypeID ())
+ ret = CFBooleanGetValue (value);
+ else if (CFGetTypeID (value) == CFStringGetTypeID ()) {
+ const char *tem = [(NSString *) value UTF8String];
+ if (strcasecmp (tem, "true") == 0 || strcasecmp (tem, "yes") == 0)
+ ret = YES;
+ else
+ ret = NO;
+ }
+
+ CFRelease (value);
+ }
+ return ret;
+}
+
+- (NSArray *) prefs_get_array:(NSString *)key {
+ NSArray *ret = nil;
+ CFPropertyListRef value;
+
+ value = [self prefs_get:key];
+
+ if (value != NULL) {
+ if (CFGetTypeID (value) == CFArrayGetTypeID ())
+ ret = [cfarray_to_nsarray (value) autorelease];
+
+ CFRelease (value);
+ }
+
+ return ret;
+}
+
+- (void) prefs_set_integer:(NSString *)key value:(int)value {
+ CFNumberRef x;
+
+ x = CFNumberCreate (NULL, kCFNumberIntType, &value);
+
+ CFPreferencesSetValue ((CFStringRef) key, (CFTypeRef) x, CFSTR (APP_PREFS),
+ kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+
+ CFRelease (x);
+}
+
+- (void) prefs_set_float:(NSString *)key value:(float)value {
+ CFNumberRef x;
+
+ x = CFNumberCreate (NULL, kCFNumberFloatType, &value);
+
+ CFPreferencesSetValue ((CFStringRef) key, (CFTypeRef) x, CFSTR (APP_PREFS),
+ kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+
+ CFRelease (x);
+}
+
+- (void) prefs_set_boolean:(NSString *)key value:(int)value {
+ CFPreferencesSetValue ((CFStringRef) key,
+ (CFTypeRef) value ? kCFBooleanTrue
+ : kCFBooleanFalse, CFSTR (APP_PREFS),
+ kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+
+}
+
+- (void) prefs_set_array:(NSString *)key value:(NSArray *)value {
+ CFArrayRef cfarray;
+
+ cfarray = nsarray_to_cfarray (value);
+ CFPreferencesSetValue ((CFStringRef) key,
+ (CFTypeRef) cfarray,
+ CFSTR (APP_PREFS),
+ kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+ CFRelease (cfarray);
+}
+
+- (void) prefs_set_string:(NSString *)key value:(NSString *)value {
+ CFPreferencesSetValue ((CFStringRef) key, (CFTypeRef) value,
+ CFSTR (APP_PREFS), kCFPreferencesCurrentUser,
+ kCFPreferencesAnyHost);
+}
+
+- (void) prefs_synchronize {
+ CFPreferencesAppSynchronize (kCFPreferencesCurrentApplication);
+}
+
+- (void) read_defaults
+{
+ const char *tem;
+
+ quartzUseSysBeep = [self prefs_get_boolean:@PREFS_SYSBEEP
+ default:quartzUseSysBeep];
+
+ // TODO: Add fullscreen support
+ //quartzEnableRootless = [self prefs_get_boolean:@PREFS_ROOTLESS
+ // default:quartzEnableRootless];
+#ifdef DARWIN_DDX_MISSING
+ quartzFullscreenDisableHotkeys = ![self prefs_get_boolean:
+ @PREFS_FULLSCREEN_HOTKEYS default:
+ !quartzFullscreenDisableHotkeys];
+ quartzXpluginOptions = [self prefs_get_integer:@PREFS_XP_OPTIONS
+ default:quartzXpluginOptions];
+#endif
+ darwinFakeButtons = [self prefs_get_boolean:@PREFS_FAKEBUTTONS
+ 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);
+ }
+
+ X11EnableKeyEquivalents = [self prefs_get_boolean:@PREFS_KEYEQUIVS
+ 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;
+
+ darwinDesiredDepth = [self prefs_get_integer:@PREFS_DEPTH
+ default:darwinDesiredDepth];
+
+ // TODO: Add 256 color support
+ if(darwinDesiredDepth == 8)
+ darwinDesiredDepth = -1;
+
+ enable_stereo = [self prefs_get_boolean:@PREFS_ENABLE_STEREO
+ default:false];
+}
+
+/* This will end up at the end of the responder chain. */
+- (void) copy:sender {
+ QuartzMessageServerThread (kXquartzPasteboardNotify, 1,
+ AppleWMCopyToPasteboard);
+}
+
+- (BOOL) x_active {
+ return _x_active;
+}
+
+@end
+
+static NSArray *
+array_with_strings_and_numbers (int nitems, const char **items,
+ const char *numbers) {
+ NSMutableArray *array, *subarray;
+ NSString *string, *number;
+ int i;
+
+ /* (Can't autorelease on the X server thread) */
+
+ array = [[NSMutableArray alloc] initWithCapacity:nitems];
+
+ for (i = 0; i < nitems; i++) {
+ subarray = [[NSMutableArray alloc] initWithCapacity:2];
+
+ string = [[NSString alloc] initWithUTF8String:items[i]];
+ [subarray addObject:string];
+ [string release];
+
+ if (numbers[i] != 0) {
+ number = [[NSString alloc] initWithFormat:@"%d", numbers[i]];
+ [subarray addObject:number];
+ [number release];
+ } else
+ [subarray addObject:@""];
+
+ [array addObject:subarray];
+ [subarray release];
+ }
+
+ return array;
+}
+
+void X11ApplicationSetWindowMenu (int nitems, const char **items,
+ const char *shortcuts) {
+ NSArray *array;
+ array = array_with_strings_and_numbers (nitems, items, shortcuts);
+
+ /* Send the array of strings over to the appkit thread */
+
+ message_kit_thread (@selector (set_window_menu:), array);
+ [array release];
+}
+
+void X11ApplicationSetWindowMenuCheck (int idx) {
+ NSNumber *n;
+
+ n = [[NSNumber alloc] initWithInt:idx];
+
+ message_kit_thread (@selector (set_window_menu_check:), n);
+
+ [n release];
+}
+
+void X11ApplicationSetFrontProcess (void) {
+ message_kit_thread (@selector (set_front_process:), nil);
+}
+
+void X11ApplicationSetCanQuit (int state) {
+ NSNumber *n;
+
+ n = [[NSNumber alloc] initWithBool:state];
+
+ message_kit_thread (@selector (set_can_quit:), n);
+
+ [n release];
+}
+
+void X11ApplicationServerReady (void) {
+ message_kit_thread (@selector (server_ready:), nil);
+}
+
+void X11ApplicationShowHideMenubar (int state) {
+ NSNumber *n;
+
+ n = [[NSNumber alloc] initWithBool:state];
+
+ message_kit_thread (@selector (show_hide_menubar:), n);
+
+ [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;
+
+ if ([X11App prefs_get_boolean:@PREFS_DONE_XINIT_CHECK default:NO])
+ return;
+
+ tem = getenv ("HOME");
+ if (tem == NULL) goto done;
+
+ snprintf (buf, sizeof (buf), "%s/.xinitrc", tem);
+ 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);
+
+ for (i = 1; access (buf2, F_OK) == 0; i++)
+ snprintf (buf2, sizeof (buf2), "%s.old.%d", buf, i);
+
+ rename (buf, buf2);
+ }
+
+ done:
+ [X11App prefs_set_boolean:@PREFS_DONE_XINIT_CHECK value:YES];
+ [X11App prefs_synchronize];
+}
+
+void X11ApplicationMain (int argc, const char **argv, void (*server_thread) (void *), void *server_arg) {
+ NSAutoreleasePool *pool;
+
+#ifdef DEBUG
+ while (access ("/tmp/x11-block", F_OK) == 0) sleep (1);
+#endif
+
+ pool = [[NSAutoreleasePool alloc] init];
+ X11App = (X11Application *) [X11Application sharedApplication];
+ init_ports ();
+ [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.
+ * Initialize all the Quartz functions.
+ */
+ QuartzModeBundleInit();
+
+ /* 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();
+
+ [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;
+}
+
+static void send_nsevent (NSEventType type, NSEvent *e) {
+ static unsigned int button_state = 0;
+ NSRect screen;
+ NSPoint location;
+ NSWindow *window;
+ int pointer_x, pointer_y;
+ xEvent xe;
+
+ memset (&xe, 0, sizeof (xe));
+
+ /* This field should be filled in for every event */
+ xe.u.keyButtonPointer.time = GetTimeInMillis();
+
+ /* convert location to global top-left coordinates */
+ 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);
+ } else {
+ pointer_x = location.x;
+ pointer_y = (screen.origin.y + screen.size.height) - location.y;
+ }
+
+ xe.u.keyButtonPointer.rootX = pointer_x;
+ xe.u.keyButtonPointer.rootY = pointer_y;
+
+ switch (type) {
+ float countX, countY;
+ int signX, signY;
+
+ case NSLeftMouseDown:
+ xe.u.u.type = ButtonPress;
+ xe.u.u.detail = 1;
+ goto do_press_event;
+
+ case NSRightMouseDown:
+ xe.u.u.type = ButtonPress;
+ xe.u.u.detail = 3;
+ goto do_press_event;
+
+ case NSOtherMouseDown:
+ xe.u.u.type = ButtonPress;
+ xe.u.u.detail = 2; /* FIXME? */
+ goto do_press_event;
+
+ do_press_event:
+ if (!quartzProcs->IsX11Window([e window], [e windowNumber])) {
+ /* X server doesn't grok this window, drop the event.
+
+ Note: theoretically this isn't necessary, but if I click
+ on the menubar, we get sent a LeftMouseDown when the
+ release happens, but no LeftMouseUp is ever seen! */
+
+ break;
+ }
+ goto do_event;
+
+ case NSLeftMouseUp:
+ xe.u.u.type = ButtonRelease;
+ xe.u.u.detail = 1;
+ goto do_release_event;
+
+ case NSRightMouseUp:
+ xe.u.u.type = ButtonRelease;
+ xe.u.u.detail = 3;
+ goto do_release_event;
+
+ case NSOtherMouseUp:
+ xe.u.u.type = ButtonRelease;
+ xe.u.u.detail = 2; /* FIXME? */
+ goto do_release_event;
+
+ do_release_event:
+ if ((button_state & (1 << xe.u.u.detail)) == 0)
+ {
+ /* X didn't see the button press for this release, so skip it */
+ break;
+ }
+ goto do_event;
+
+ case NSMouseMoved:
+ case NSLeftMouseDragged:
+ case NSRightMouseDragged:
+ case NSOtherMouseDragged:
+ xe.u.u.type = MotionNotify;
+ goto do_event;
+
+ case NSKeyDown:
+ xe.u.u.type = KeyPress;
+ xe.u.u.detail = [e keyCode];
+ goto do_event;
+
+ case NSKeyUp:
+ xe.u.u.type = KeyRelease;
+ xe.u.u.detail = [e keyCode];
+ goto do_event;
+
+ case NSScrollWheel:
+// xe.u.keyButtonPointer.state = convert_flags ([e modifierFlags]);
+ countY = [e deltaY];
+ countX = [e deltaX];
+ signY = countY > 0.0f ?
+ SCROLLWHEELUPFAKE : SCROLLWHEELDOWNFAKE;
+ signX = countX > 0.0f ?
+ SCROLLWHEELLEFTFAKE : SCROLLWHEELRIGHTFAKE;
+
+ countX = fabs(countX);
+ countY = fabs(countY);
+
+ while ((countX > 0.0f) || (countY > 0.0f)) {
+ if (countX > 0.0f) {
+ xe.u.u.detail = signX;
+ xe.u.u.type = ButtonPress;
+ DarwinEQEnqueue(&xe);
+ xe.u.u.type = ButtonRelease;
+ DarwinEQEnqueue(&xe);
+ countX = countX - 1.0f;
+ }
+
+ if (countY > 0.0f) {
+ xe.u.u.detail = signY;
+ xe.u.u.type = ButtonPress;
+ DarwinEQEnqueue(&xe);
+ xe.u.u.type = ButtonRelease;
+ DarwinEQEnqueue(&xe);
+ countY = countY - 1.0f;
+ }
+ }
+ xe.u.u.type = 0;
+ break;
+
+ case NSFlagsChanged:
+ xe.u.u.type = kXquartzUpdateModifiers;
+ xe.u.clientMessage.u.l.longs0 = [e modifierFlags];
+ DarwinEQEnqueue (&xe);
+ break;
+
+ do_event:
+ // xe.u.keyButtonPointer.state = convert_flags ([e modifierFlags]);
+ DarwinEQEnqueue (&xe);
+ break;
+
+ default: break; /* for gcc */
+ }
+
+ if (xe.u.u.type == ButtonPress) button_state |= (1 << xe.u.u.detail);
+ else if (xe.u.u.type == ButtonRelease) button_state &= ~(1 << xe.u.u.detail);
+}
diff --git a/hw/xquartz/X11Controller.h b/hw/xquartz/X11Controller.h
new file mode 100644
index 000000000..8d6a38ff0
--- /dev/null
+++ b/hw/xquartz/X11Controller.h
@@ -0,0 +1,105 @@
+/* X11Controller.h -- connect the IB ui
+
+ Copyright (c) 2002 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 X11CONTROLLER_H
+#define X11CONTROLLER_H 1
+
+#if __OBJC__
+
+#import <Cocoa/Cocoa.h>
+#include "xpr/x-list.h"
+
+@interface X11Controller : NSObject
+{
+ IBOutlet NSPanel *prefs_panel;
+
+ IBOutlet NSButton *fake_buttons;
+ IBOutlet NSButton *enable_fullscreen;
+ 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 NSPopUpButton *depth;
+
+ IBOutlet NSMenuItem *x11_about_item;
+ IBOutlet NSMenuItem *window_separator;
+ IBOutlet NSMenuItem *dock_window_separator;
+ IBOutlet NSMenuItem *apps_separator;
+ IBOutlet NSMenuItem *toggle_fullscreen_item;
+ IBOutlet NSMenu *dock_apps_menu;
+ IBOutlet NSTableView *apps_table;
+
+ NSArray *apps;
+ NSMutableArray *table_apps;
+
+ IBOutlet NSMenu *dock_menu;
+
+ int checked_window_item;
+ x_list *pending_apps;
+
+ BOOL finished_launching;
+ 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) 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;
+- (IBAction) apps_table_delete:(id)sender;
+- (IBAction) bring_to_front:(id)sender;
+- (IBAction) close_window:(id)sender;
+- (IBAction) minimize_window:(id)sender;
+- (IBAction) zoom_window:(id)sender;
+- (IBAction) next_window:(id)sender;
+- (IBAction) previous_window:(id)sender;
+- (IBAction) enable_fullscreen_changed:(id)sender;
+- (IBAction) toggle_fullscreen:(id)sender;
+- (IBAction) prefs_changed:(id)sender;
+- (IBAction) prefs_show:(id)sender;
+- (IBAction) quit:(id)sender;
+- (IBAction) x11_help:(id)sender;
+
+@end
+
+#endif /* __OBJC__ */
+
+void X11ControllerMain(int argc, const char **argv, void (*server_thread) (void *), void *server_arg);
+
+#endif /* X11CONTROLLER_H */
diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m
new file mode 100644
index 000000000..fd7e33429
--- /dev/null
+++ b/hw/xquartz/X11Controller.m
@@ -0,0 +1,763 @@
+/* X11Controller.m -- connect the IB ui, also the NSApp delegate
+
+ Copyright (c) 2002-2007 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
+ (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 <dix-config.h>
+#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 <Carbon/Carbon.h>
+
+/* 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 <stdio.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+@implementation X11Controller
+
+- (void) awakeFromNib
+{
+ X11Application *xapp = NSApp;
+ NSArray *array;
+
+ /* Point X11Application at ourself. */
+ [xapp set_controller:self];
+
+ array = [xapp prefs_get_array:@PREFS_APPSMENU];
+ if (array != nil)
+ {
+ int count;
+
+ /* convert from [TITLE1 COMMAND1 TITLE2 COMMAND2 ...]
+ to [[TITLE1 COMMAND1] [TITLE2 COMMAND2] ...] format. */
+
+ count = [array count];
+ if (count > 0
+ && ![[array objectAtIndex:0] isKindOfClass:[NSArray class]])
+ {
+ int i;
+ NSMutableArray *copy, *sub;
+
+ copy = [NSMutableArray arrayWithCapacity:(count / 2)];
+
+ for (i = 0; i < count / 2; i++)
+ {
+ sub = [[NSMutableArray alloc] initWithCapacity:3];
+ [sub addObject:[array objectAtIndex:i*2]];
+ [sub addObject:[array objectAtIndex:i*2+1]];
+ [sub addObject:@""];
+ [copy addObject:sub];
+ [sub release];
+ }
+
+ array = copy;
+ }
+
+ [self set_apps_menu:array];
+ }
+}
+
+- (void) item_selected:sender
+{
+ [NSApp activateIgnoringOtherApps:YES];
+
+ QuartzMessageServerThread (kXquartzControllerNotify, 2,
+ AppleWMWindowMenuItem, [sender tag]);
+}
+
+- (void) remove_window_menu
+{
+ NSMenu *menu;
+ int first, count, i;
+
+ /* Work backwards so we don't mess up the indices */
+ menu = [window_separator menu];
+ first = [menu indexOfItem:window_separator] + 1;
+ count = [menu numberOfItems];
+ for (i = count - 1; i >= first; i--)
+ [menu removeItemAtIndex:i];
+
+ menu = [dock_window_separator menu];
+ count = [menu indexOfItem:dock_window_separator];
+ for (i = 0; i < count; i++)
+ [dock_menu removeItemAtIndex:0];
+}
+
+- (void) install_window_menu:(NSArray *)list
+{
+ NSMenu *menu;
+ NSMenuItem *item;
+ int first, count, i;
+
+ menu = [window_separator menu];
+ first = [menu indexOfItem:window_separator] + 1;
+ count = [list count];
+ for (i = 0; i < count; i++)
+ {
+ NSString *name, *shortcut;
+
+ name = [[list objectAtIndex:i] objectAtIndex:0];
+ shortcut = [[list objectAtIndex:i] objectAtIndex:1];
+
+ item = (NSMenuItem *) [menu addItemWithTitle:name action:@selector
+ (item_selected:) keyEquivalent:shortcut];
+ [item setTarget:self];
+ [item setTag:i];
+ [item setEnabled:YES];
+
+ item = (NSMenuItem *) [dock_menu insertItemWithTitle:name
+ action:@selector
+ (item_selected:) keyEquivalent:shortcut
+ atIndex:i];
+ [item setTarget:self];
+ [item setTag:i];
+ [item setEnabled:YES];
+ }
+
+ if (checked_window_item >= 0 && checked_window_item < count)
+ {
+ item = (NSMenuItem *) [menu itemAtIndex:first + checked_window_item];
+ [item setState:NSOnState];
+ item = (NSMenuItem *) [dock_menu itemAtIndex:checked_window_item];
+ [item setState:NSOnState];
+ }
+}
+
+- (void) remove_apps_menu
+{
+ NSMenu *menu;
+ NSMenuItem *item;
+ int i;
+
+ if (apps == nil || apps_separator == nil) return;
+
+ menu = [apps_separator menu];
+
+ if (menu != nil)
+ {
+ for (i = [menu numberOfItems] - 1; i >= 0; i--)
+ {
+ item = (NSMenuItem *) [menu itemAtIndex:i];
+ if ([item tag] != 0)
+ [menu removeItemAtIndex:i];
+ }
+ }
+
+ if (dock_apps_menu != nil)
+ {
+ for (i = [dock_apps_menu numberOfItems] - 1; i >= 0; i--)
+ {
+ item = (NSMenuItem *) [dock_apps_menu itemAtIndex:i];
+ if ([item tag] != 0)
+ [dock_apps_menu removeItemAtIndex:i];
+ }
+ }
+
+ [apps release];
+ apps = nil;
+}
+
+- (void) prepend_apps_item:(NSArray *)list index:(int)i menu:(NSMenu *)menu
+{
+ NSString *title, *shortcut = @"";
+ NSArray *group;
+ NSMenuItem *item;
+
+ group = [list objectAtIndex:i];
+ title = [group objectAtIndex:0];
+ if ([group count] >= 3)
+ shortcut = [group objectAtIndex:2];
+
+ if ([title length] != 0)
+ {
+ item = (NSMenuItem *) [menu insertItemWithTitle:title
+ action:@selector (app_selected:)
+ keyEquivalent:shortcut atIndex:0];
+ [item setTarget:self];
+ [item setEnabled:YES];
+ }
+ else
+ {
+ item = (NSMenuItem *) [NSMenuItem separatorItem];
+ [menu insertItem:item atIndex:0];
+ }
+
+ [item setTag:i+1]; /* can't be zero, so add one */
+}
+
+- (void) install_apps_menu:(NSArray *)list
+{
+ NSMenu *menu;
+ int i, count;
+
+ count = [list count];
+
+ if (count == 0 || apps_separator == nil) return;
+
+ menu = [apps_separator menu];
+
+ for (i = count - 1; i >= 0; i--)
+ {
+ if (menu != nil)
+ [self prepend_apps_item:list index:i menu:menu];
+ if (dock_apps_menu != nil)
+ [self prepend_apps_item:list index:i menu:dock_apps_menu];
+ }
+
+ apps = [list retain];
+}
+
+- (void) set_window_menu:(NSArray *)list
+{
+ [self remove_window_menu];
+ [self install_window_menu:list];
+
+ QuartzMessageServerThread (kXquartzControllerNotify, 1,
+ AppleWMWindowMenuNotify);
+}
+
+- (void) set_window_menu_check:(NSNumber *)nn
+{
+ NSMenu *menu;
+ NSMenuItem *item;
+ int first, count;
+ int n = [nn intValue];
+
+ menu = [window_separator menu];
+ first = [menu indexOfItem:window_separator] + 1;
+ count = [menu numberOfItems] - first;
+
+ if (checked_window_item >= 0 && checked_window_item < count)
+ {
+ item = (NSMenuItem *) [menu itemAtIndex:first + checked_window_item];
+ [item setState:NSOffState];
+ item = (NSMenuItem *) [dock_menu itemAtIndex:checked_window_item];
+ [item setState:NSOffState];
+ }
+ if (n >= 0 && n < count)
+ {
+ item = (NSMenuItem *) [menu itemAtIndex:first + n];
+ [item setState:NSOnState];
+ item = (NSMenuItem *) [dock_menu itemAtIndex:n];
+ [item setState:NSOnState];
+ }
+ checked_window_item = n;
+}
+
+- (void) set_apps_menu:(NSArray *)list
+{
+ [self remove_apps_menu];
+ [self install_apps_menu:list];
+}
+
+- (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 */
+
+ child1 = fork();
+
+ switch (child1) {
+ case -1: /* error */
+ break;
+
+ 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;
+
+ default: /* parent */
+ waitpid(child1, &status, 0);
+ }
+}
+
+- (void) app_selected:sender
+{
+ int tag;
+ NSString *item;
+
+ tag = [sender tag] - 1;
+ if (apps == nil || tag < 0 || tag >= [apps count])
+ return;
+
+ item = [[apps objectAtIndex:tag] objectAtIndex:1];
+
+ [self launch_client:item];
+}
+
+- (IBAction) apps_table_show:sender
+{
+ NSArray *columns;
+
+ if (table_apps == nil) {
+ table_apps = [[NSMutableArray alloc] initWithCapacity:1];
+
+ if (apps != nil)[table_apps addObjectsFromArray:apps];
+ }
+
+ columns = [apps_table tableColumns];
+ [[columns objectAtIndex:0] setIdentifier:@"0"];
+ [[columns objectAtIndex:1] setIdentifier:@"1"];
+ [[columns objectAtIndex:2] setIdentifier:@"2"];
+
+ [apps_table setDataSource:self];
+ [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;
+}
+
+- (IBAction) apps_table_done:sender
+{
+ [apps_table deselectAll:sender]; /* flush edits? */
+
+ [self remove_apps_menu];
+ [self install_apps_menu:table_apps];
+
+ [NSApp prefs_set_array:@PREFS_APPSMENU value:table_apps];
+ [NSApp prefs_synchronize];
+
+ [[apps_table window] orderOut:sender];
+
+ [table_apps release];
+ table_apps = nil;
+}
+
+- (IBAction) apps_table_new:sender
+{
+ NSMutableArray *item;
+
+ int row = [apps_table selectedRow], i;
+
+ if (row < 0) row = 0;
+ else row = row + 1;
+
+ i = row;
+ if (i > [table_apps count])
+ return; /* avoid exceptions */
+
+ [apps_table deselectAll:sender];
+
+ item = [[NSMutableArray alloc] initWithCapacity:3];
+ [item addObject:@""];
+ [item addObject:@""];
+ [item addObject:@""];
+
+ [table_apps insertObject:item atIndex:i];
+ [item release];
+
+ [apps_table reloadData];
+ [apps_table selectRow:row byExtendingSelection:NO];
+}
+
+- (IBAction) apps_table_duplicate:sender
+{
+ int row = [apps_table selectedRow], i;
+ NSObject *item;
+
+ if (row < 0) {
+ [self apps_table_new:sender];
+ return;
+ }
+
+ i = row;
+ if (i > [table_apps count] - 1) return; /* avoid exceptions */
+
+ [apps_table deselectAll:sender];
+
+ item = [[table_apps objectAtIndex:i] mutableCopy];
+ [table_apps insertObject:item atIndex:i];
+ [item release];
+
+ [apps_table reloadData];
+ [apps_table selectRow:row+1 byExtendingSelection:NO];
+}
+
+- (IBAction) apps_table_delete:sender
+{
+ int row = [apps_table selectedRow];
+
+ if (row >= 0)
+ {
+ int i = row;
+
+ if (i > [table_apps count] - 1) return; /* avoid exceptions */
+
+ [apps_table deselectAll:sender];
+
+ [table_apps removeObjectAtIndex:i];
+ }
+
+ [apps_table reloadData];
+
+ row = MIN (row, [table_apps count] - 1);
+ if (row >= 0)
+ [apps_table selectRow:row byExtendingSelection:NO];
+}
+
+- (int) numberOfRowsInTableView:(NSTableView *)tableView
+{
+ if (table_apps == nil) return 0;
+
+ return [table_apps count];
+}
+
+- (id) tableView:(NSTableView *)tableView
+objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row
+{
+ NSArray *item;
+ int col;
+
+ if (table_apps == nil) return nil;
+
+ col = [[tableColumn identifier] intValue];
+
+ item = [table_apps objectAtIndex:row];
+ if ([item count] > col)
+ return [item objectAtIndex:col];
+ else
+ return @"";
+}
+
+- (void) tableView:(NSTableView *)tableView setObjectValue:(id)object
+ forTableColumn:(NSTableColumn *)tableColumn row:(int)row
+{
+ NSMutableArray *item;
+ int col;
+
+ if (table_apps == nil) return;
+
+ col = [[tableColumn identifier] intValue];
+
+ item = [table_apps objectAtIndex:row];
+ [item replaceObjectAtIndex:col withObject:object];
+}
+
+- (void) hide_window:sender
+{
+ if ([X11App x_active])
+ QuartzMessageServerThread (kXquartzControllerNotify, 1, AppleWMHideWindow);
+ else
+ NSBeep (); /* FIXME: something here */
+}
+
+- (IBAction)bring_to_front:sender
+{
+ QuartzMessageServerThread(kXquartzControllerNotify, 1, AppleWMBringAllToFront);
+}
+
+- (IBAction)close_window:sender
+{
+ if ([X11App x_active])
+ QuartzMessageServerThread (kXquartzControllerNotify, 1, AppleWMCloseWindow);
+ else
+ [[NSApp keyWindow] performClose:sender];
+}
+
+- (IBAction)minimize_window:sender
+{
+ if ([X11App x_active])
+ QuartzMessageServerThread (kXquartzControllerNotify, 1, AppleWMMinimizeWindow);
+ else
+ [[NSApp keyWindow] performMiniaturize:sender];
+}
+
+- (IBAction)zoom_window:sender
+{
+ if ([X11App x_active])
+ QuartzMessageServerThread (kXquartzControllerNotify, 1, AppleWMZoomWindow);
+ else
+ [[NSApp keyWindow] performZoom:sender];
+}
+
+- (IBAction) next_window:sender
+{
+ QuartzMessageServerThread (kXquartzControllerNotify, 1, AppleWMNextWindow);
+}
+
+- (IBAction) previous_window:sender
+{
+ QuartzMessageServerThread (kXquartzControllerNotify, 1, AppleWMPreviousWindow);
+}
+
+- (IBAction) enable_fullscreen_changed:sender
+{
+ int value = ![enable_fullscreen intValue];
+
+#ifdef DARWIN_DDX_MISSING
+ QuartzMessageServerThread (kXquartzSetRootless, 1, value);
+#endif
+
+ [NSApp prefs_set_boolean:@PREFS_ROOTLESS value:value];
+ [NSApp prefs_synchronize];
+}
+
+- (IBAction) toggle_fullscreen:sender
+{
+#ifdef DARWIN_DDX_MISSING
+ QuartzMessageServerThread (kXquartzToggleFullscreen, 0);
+#endif
+}
+
+- (void) set_can_quit:(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_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]];
+
+ system("killall -HUP quartz-wm");
+
+ [NSApp prefs_synchronize];
+}
+
+- (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_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]]];
+ // TODO: Add 256 color support
+ if([depth indexOfItemWithTag:8] != -1)
+ [depth removeItemAtIndex:[depth indexOfItemWithTag:8]];
+
+ [enable_fullscreen setIntValue:!quartzEnableRootless];
+ // TODO: Add fullscreen support
+ [enable_fullscreen setEnabled:NO];
+
+ [prefs_panel makeKeyAndOrderFront:sender];
+}
+
+- (IBAction) quit:sender
+{
+ QuartzMessageServerThread (kXquartzQuit, 0);
+}
+
+- (IBAction) x11_help:sender
+{
+ AHLookupAnchor ((CFStringRef)NSLocalizedString(@"Mac Help", no comment), CFSTR ("mchlp2276"));
+}
+
+- (BOOL) validateMenuItem:(NSMenuItem *)item
+{
+ NSMenu *menu = [item menu];
+
+ if (item == toggle_fullscreen_item)
+ return !quartzEnableRootless;
+ else if (menu == [window_separator menu] || menu == dock_menu
+ || (menu == [x11_about_item menu] && [item tag] == 42))
+ return (AppleWMSelectedEvents () & AppleWMControllerNotifyMask) != 0;
+ else
+ return TRUE;
+}
+
+- (void) applicationDidHide:(NSNotification *)notify
+{
+ QuartzMessageServerThread (kXquartzControllerNotify, 1, AppleWMHideAll);
+}
+
+- (void) applicationDidUnhide:(NSNotification *)notify
+{
+ QuartzMessageServerThread (kXquartzControllerNotify, 1, AppleWMShowAll);
+}
+
+- (NSApplicationTerminateReply) applicationShouldTerminate:sender {
+ NSString *msg;
+ NSString *title;
+
+ if (can_quit || [X11App prefs_get_boolean:@PREFS_NO_QUIT_ALERT default:NO])
+ return NSTerminateNow;
+
+ /* Make sure we're frontmost. */
+ [NSApp activateIgnoringOtherApps:YES];
+
+ 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 (title, msg, NSLocalizedString (@"Quit", @""),
+ NSLocalizedString (@"Cancel", @""), nil)
+ == NSAlertDefaultReturn) ? NSTerminateNow : NSTerminateCancel;
+}
+
+- (void) applicationWillTerminate:(NSNotification *)aNotification
+{
+ [X11App prefs_synchronize];
+
+ /* shutdown the X server, it will exit () for us. */
+ QuartzMessageServerThread (kXquartzQuit, 0);
+
+ /* In case it doesn't, exit anyway after a while. */
+ while (sleep (10) != 0) ;
+ exit (1);
+}
+
+- (void) server_ready
+{
+ x_list *node;
+
+ finished_launching = YES;
+
+ for (node = pending_apps; node != NULL; node = node->next)
+ {
+ NSString *filename = node->data;
+ [self launch_client:filename];
+ [filename release];
+ }
+
+ x_list_free (pending_apps);
+ pending_apps = NULL;
+}
+
+- (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;
+}
+
+@end
+
+void X11ControllerMain(int argc, const char **argv, void (*server_thread) (void *), void *server_arg) {
+ X11ApplicationMain (argc, argv, server_thread, server_arg);
+}
diff --git a/hw/darwin/quartz/applewm.c b/hw/xquartz/applewm.c
index 6db036f1b..a853ef1bf 100644
--- a/hw/darwin/quartz/applewm.c
+++ b/hw/xquartz/applewm.c
@@ -1,6 +1,6 @@
/**************************************************************************
-Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved.
+Copyright (c) 2002-2007 Apple Inc. All Rights Reserved.
Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a
@@ -25,6 +25,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
#include "quartzCommon.h"
#define NEED_REPLIES
@@ -43,8 +47,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <X11/Xatom.h>
#include "darwin.h"
#define _APPLEWM_SERVER_
-#include "applewmstr.h"
+#include "X11/extensions/applewmstr.h"
#include "applewmExt.h"
+#include "X11Application.h"
#define DEFINE_ATOM_HELPER(func,atom_name) \
static Atom func (void) { \
@@ -443,9 +448,7 @@ ProcAppleWMSetWindowMenu(
break;
}
}
-
- QuartzSetWindowMenu (nitems, items, shortcuts);
-
+ X11ApplicationSetWindowMenu (nitems, items, shortcuts);
free(items);
free(shortcuts);
@@ -460,10 +463,7 @@ ProcAppleWMSetWindowMenuCheck(
REQUEST(xAppleWMSetWindowMenuCheckReq);
REQUEST_SIZE_MATCH(xAppleWMSetWindowMenuCheckReq);
-
- QuartzMessageMainThread(kQuartzSetWindowMenuCheck, &stuff->index,
- sizeof(stuff->index));
-
+ X11ApplicationSetWindowMenuCheck(stuff->index);
return (client->noClientException);
}
@@ -474,8 +474,7 @@ ProcAppleWMSetFrontProcess(
{
REQUEST_SIZE_MATCH(xAppleWMSetFrontProcessReq);
- QuartzMessageMainThread(kQuartzSetFrontProcess, NULL, 0);
-
+ X11ApplicationSetFrontProcess();
return (client->noClientException);
}
@@ -517,9 +516,7 @@ ProcAppleWMSetCanQuit(
REQUEST_SIZE_MATCH(xAppleWMSetCanQuitReq);
- QuartzMessageMainThread(kQuartzSetCanQuit, &stuff->state,
- sizeof(stuff->state));
-
+ X11ApplicationSetCanQuit(stuff->state);
return (client->noClientException);
}
diff --git a/hw/darwin/quartz/applewmExt.h b/hw/xquartz/applewmExt.h
index 60d49ef59..60d49ef59 100644
--- a/hw/darwin/quartz/applewmExt.h
+++ b/hw/xquartz/applewmExt.h
diff --git a/hw/xquartz/bundle/Dutch.lproj/InfoPlist.strings b/hw/xquartz/bundle/Dutch.lproj/InfoPlist.strings
new file mode 100644
index 000000000..8f978d63f
--- /dev/null
+++ b/hw/xquartz/bundle/Dutch.lproj/InfoPlist.strings
Binary files differ
diff --git a/hw/xquartz/bundle/Dutch.lproj/Localizable.strings b/hw/xquartz/bundle/Dutch.lproj/Localizable.strings
new file mode 100644
index 000000000..1ff39fe67
--- /dev/null
+++ b/hw/xquartz/bundle/Dutch.lproj/Localizable.strings
Binary files differ
diff --git a/hw/xquartz/bundle/Dutch.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/Dutch.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..95c26d7b3
--- /dev/null
+++ b/hw/xquartz/bundle/Dutch.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/hw/xquartz/bundle/English.lproj/InfoPlist.strings b/hw/xquartz/bundle/English.lproj/InfoPlist.strings
new file mode 100644
index 000000000..88e1f04ac
--- /dev/null
+++ b/hw/xquartz/bundle/English.lproj/InfoPlist.strings
Binary files differ
diff --git a/hw/xquartz/bundle/English.lproj/Localizable.strings b/hw/xquartz/bundle/English.lproj/Localizable.strings
new file mode 100644
index 000000000..c83b08536
--- /dev/null
+++ b/hw/xquartz/bundle/English.lproj/Localizable.strings
Binary files differ
diff --git a/hw/xquartz/bundle/English.lproj/main.nib/designable.nib b/hw/xquartz/bundle/English.lproj/main.nib/designable.nib
new file mode 100644
index 000000000..c159d6ee1
--- /dev/null
+++ b/hw/xquartz/bundle/English.lproj/main.nib/designable.nib
@@ -0,0 +1,3734 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.02">
+ <data>
+ <int key="IBDocument.SystemTarget">1050</int>
+ <string key="IBDocument.SystemVersion">9C7010</string>
+ <string key="IBDocument.InterfaceBuilderVersion">639</string>
+ <string key="IBDocument.AppKitVersion">949.26</string>
+ <string key="IBDocument.HIToolboxVersion">352.00</string>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="904585544">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSCustomObject" id="815810918">
+ <object class="NSMutableString" key="NSClassName">
+ <characters key="NS.bytes">NSApplication</characters>
+ </object>
+ </object>
+ <object class="NSCustomObject" id="941939442">
+ <string key="NSClassName">FirstResponder</string>
+ </object>
+ <object class="NSCustomObject" id="951368722">
+ <string key="NSClassName">NSApplication</string>
+ </object>
+ <object class="NSMenu" id="524015605">
+ <string key="NSTitle">MainMenu</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="365880285">
+ <reference key="NSMenu" ref="524015605"/>
+ <string key="NSTitle">X11</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <object class="NSCustomResource" key="NSOnImage" id="531645050">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">NSMenuCheckmark</string>
+ </object>
+ <object class="NSCustomResource" key="NSMixedImage" id="351811234">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">NSMenuMixedState</string>
+ </object>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="576521955">
+ <string key="NSTitle">X11</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="139290918">
+ <reference key="NSMenu" ref="576521955"/>
+ <string key="NSTitle">About X11</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="386173216">
+ <reference key="NSMenu" ref="576521955"/>
+ <string key="NSTitle">Preferences...</string>
+ <string key="NSKeyEquiv">,</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="272876017">
+ <reference key="NSMenu" ref="576521955"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="32285361">
+ <reference key="NSMenu" ref="576521955"/>
+ <string key="NSTitle">Services</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="821388474">
+ <object class="NSMutableString" key="NSTitle">
+ <characters key="NS.bytes">Services</characters>
+ </object>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <string key="NSName">_NSServicesMenu</string>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="431301145">
+ <reference key="NSMenu" ref="576521955"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="6876565">
+ <reference key="NSMenu" ref="576521955"/>
+ <string key="NSTitle">Toggle Full Screen</string>
+ <string key="NSKeyEquiv">a</string>
+ <int key="NSKeyEquivModMask">1572864</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="479677589">
+ <reference key="NSMenu" ref="576521955"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="301008465">
+ <reference key="NSMenu" ref="576521955"/>
+ <string key="NSTitle">Hide X11</string>
+ <string key="NSKeyEquiv">h</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ <int key="NSTag">42</int>
+ </object>
+ <object class="NSMenuItem" id="206802571">
+ <reference key="NSMenu" ref="576521955"/>
+ <string key="NSTitle">Hide Others</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="1023546148">
+ <reference key="NSMenu" ref="576521955"/>
+ <string key="NSTitle">Show All</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ <int key="NSTag">42</int>
+ </object>
+ <object class="NSMenuItem" id="848095279">
+ <reference key="NSMenu" ref="576521955"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="274138642">
+ <reference key="NSMenu" ref="576521955"/>
+ <string key="NSTitle">Quit X11</string>
+ <string key="NSKeyEquiv">q</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ </object>
+ <string key="NSName">_NSAppleMenu</string>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="868031522">
+ <reference key="NSMenu" ref="524015605"/>
+ <string key="NSTitle">Applications</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="981161348">
+ <string key="NSTitle">Applications</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="390088328">
+ <reference key="NSMenu" ref="981161348"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="1065386165">
+ <reference key="NSMenu" ref="981161348"/>
+ <string key="NSTitle">Customize...</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="200491363">
+ <reference key="NSMenu" ref="524015605"/>
+ <string key="NSTitle">Edit</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="526778998">
+ <string key="NSTitle">Edit</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="1010221707">
+ <reference key="NSMenu" ref="526778998"/>
+ <string key="NSTitle">Undo</string>
+ <string key="NSKeyEquiv">z</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="535038564">
+ <reference key="NSMenu" ref="526778998"/>
+ <string key="NSTitle">Redo</string>
+ <string key="NSKeyEquiv">Z</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="839739619">
+ <reference key="NSMenu" ref="526778998"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="581727829">
+ <reference key="NSMenu" ref="526778998"/>
+ <string key="NSTitle">Cut</string>
+ <string key="NSKeyEquiv">x</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="185296989">
+ <reference key="NSMenu" ref="526778998"/>
+ <string key="NSTitle">Copy</string>
+ <string key="NSKeyEquiv">c</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="924678073">
+ <reference key="NSMenu" ref="526778998"/>
+ <string key="NSTitle">Paste</string>
+ <string key="NSKeyEquiv">v</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="994817848">
+ <reference key="NSMenu" ref="526778998"/>
+ <string key="NSTitle">Delete</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="322866464">
+ <reference key="NSMenu" ref="526778998"/>
+ <string key="NSTitle">Select All</string>
+ <string key="NSKeyEquiv">a</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="931553638">
+ <reference key="NSMenu" ref="524015605"/>
+ <string key="NSTitle">Window</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="96874957">
+ <object class="NSMutableString" key="NSTitle">
+ <characters key="NS.bytes">Window</characters>
+ </object>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="677652931">
+ <reference key="NSMenu" ref="96874957"/>
+ <string key="NSTitle">Minimize</string>
+ <string key="NSKeyEquiv">m</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="1066447520">
+ <reference key="NSMenu" ref="96874957"/>
+ <string key="NSTitle">Zoom</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="1036389925">
+ <reference key="NSMenu" ref="96874957"/>
+ <string key="NSTitle">Cycle Through Windows</string>
+ <string key="NSKeyEquiv">`</string>
+ <int key="NSKeyEquivModMask">1048840</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="369641893">
+ <reference key="NSMenu" ref="96874957"/>
+ <string key="NSTitle">Reverse Cycle Through Windows</string>
+ <string key="NSKeyEquiv">~</string>
+ <int key="NSKeyEquivModMask">1179914</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="280172320">
+ <reference key="NSMenu" ref="96874957"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="984461797">
+ <reference key="NSMenu" ref="96874957"/>
+ <string key="NSTitle">Close</string>
+ <string key="NSKeyEquiv">w</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="155085383">
+ <reference key="NSMenu" ref="96874957"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="276216762">
+ <reference key="NSMenu" ref="96874957"/>
+ <string key="NSTitle">Bring All to Front</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="444952046">
+ <reference key="NSMenu" ref="96874957"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ </object>
+ <string key="NSName">_NSWindowsMenu</string>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="551174276">
+ <reference key="NSMenu" ref="524015605"/>
+ <string key="NSTitle">Help</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="511848303">
+ <string key="NSTitle">Help</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="504984881">
+ <reference key="NSMenu" ref="511848303"/>
+ <string key="NSTitle">X11 Help</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ </object>
+ <string key="NSName">_NSMainMenu</string>
+ </object>
+ <object class="NSCustomObject" id="485884620">
+ <string key="NSClassName">X11Controller</string>
+ </object>
+ <object class="NSWindowTemplate" id="124913468">
+ <int key="NSWindowStyleMask">3</int>
+ <int key="NSWindowBacking">2</int>
+ <string key="NSWindowRect">{{266, 392}, {484, 280}}</string>
+ <int key="NSWTFlags">1350041600</int>
+ <string key="NSWindowTitle">X11 Preferences</string>
+ <string key="NSWindowClass">NSPanel</string>
+ <object class="NSMutableString" key="NSViewClass">
+ <characters key="NS.bytes">View</characters>
+ </object>
+ <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
+ <string key="NSWindowContentMinSize">{213, 107}</string>
+ <object class="NSView" key="NSWindowView" id="941366957">
+ <nil key="NSNextResponder"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSTabView" id="448510093">
+ <reference key="NSNextResponder" ref="941366957"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{13, 10}, {458, 264}}</string>
+ <reference key="NSSuperview" ref="941366957"/>
+ <object class="NSMutableArray" key="NSTabViewItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSTabViewItem" id="287591690">
+ <object class="NSMutableString" key="NSIdentifier">
+ <characters key="NS.bytes">1</characters>
+ </object>
+ <object class="NSView" key="NSView" id="596750588">
+ <reference key="NSNextResponder" ref="448510093"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSButton" id="119157981">
+ <reference key="NSNextResponder" ref="596750588"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{18, 182}, {402, 18}}</string>
+ <reference key="NSSuperview" ref="596750588"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="990762273">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Emulate three button mouse</string>
+ <object class="NSFont" key="NSSupport" id="463863101">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">1.300000e+01</double>
+ <int key="NSfFlags">1044</int>
+ </object>
+ <reference key="NSControlView" ref="119157981"/>
+ <int key="NSButtonFlags">1211912703</int>
+ <int key="NSButtonFlags2">2</int>
+ <object class="NSButtonImageSource" key="NSAlternateImage" id="391434389">
+ <string key="NSImageName">NSSwitch</string>
+ </object>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSTextField" id="443008216">
+ <reference key="NSNextResponder" ref="596750588"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{36, 32}, {385, 31}}</string>
+ <reference key="NSSuperview" ref="596750588"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="391919450">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">4194304</int>
+ <string key="NSContents">When enabled, menu bar key equivalents may interfere with X11 applications that use the Meta modifier.</string>
+ <object class="NSFont" key="NSSupport" id="26">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">1.100000e+01</double>
+ <int key="NSfFlags">3100</int>
+ </object>
+ <reference key="NSControlView" ref="443008216"/>
+ <object class="NSColor" key="NSBackgroundColor" id="57160303">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">controlColor</string>
+ <object class="NSColor" key="NSColor" id="590688762">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC42NjY2NjY2OQA</bytes>
+ </object>
+ </object>
+ <object class="NSColor" key="NSTextColor" id="930815747">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">controlTextColor</string>
+ <object class="NSColor" key="NSColor" id="214098874">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MAA</bytes>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSTextField" id="282885445">
+ <reference key="NSNextResponder" ref="596750588"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{36, 147}, {385, 29}}</string>
+ <reference key="NSSuperview" ref="596750588"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="649334366">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">4194304</int>
+ <string type="base64-UTF8" key="NSContents">SG9sZCBPcHRpb24gYW5kIENvbW1hbmQgd2hpbGUgY2xpY2tpbmcgdG8gYWN0aXZhdGUgdGhlIG1pZGRs
+ZSBhbmQgcmlnaHQgbW91c2UgYnV0dG9ucy4KA</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="282885445"/>
+ <reference key="NSBackgroundColor" ref="57160303"/>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ </object>
+ <object class="NSButton" id="842100515">
+ <reference key="NSNextResponder" ref="596750588"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{18, 69}, {402, 18}}</string>
+ <reference key="NSSuperview" ref="596750588"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="940564599">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Enable key equivalents under X11</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="842100515"/>
+ <int key="NSButtonFlags">1211912703</int>
+ <int key="NSButtonFlags2">2</int>
+ <reference key="NSAlternateImage" ref="391434389"/>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSTextField" id="31160162">
+ <reference key="NSNextResponder" ref="596750588"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{36, 98}, {385, 14}}</string>
+ <reference key="NSSuperview" ref="596750588"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="666057093">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">4194304</int>
+ <string key="NSContents">Allows input menu changes to overwrite the current X11 keymap.</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="31160162"/>
+ <reference key="NSBackgroundColor" ref="57160303"/>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ </object>
+ <object class="NSButton" id="179949713">
+ <reference key="NSNextResponder" ref="596750588"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{18, 118}, {402, 18}}</string>
+ <reference key="NSSuperview" ref="596750588"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="967619578">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Follow system keyboard layout</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="179949713"/>
+ <int key="NSButtonFlags">1211912703</int>
+ <int key="NSButtonFlags2">2</int>
+ <reference key="NSAlternateImage" ref="391434389"/>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrame">{{10, 33}, {438, 218}}</string>
+ <reference key="NSSuperview" ref="448510093"/>
+ </object>
+ <string key="NSLabel">Input</string>
+ <reference key="NSColor" ref="57160303"/>
+ <reference key="NSTabView" ref="448510093"/>
+ </object>
+ <object class="NSTabViewItem" id="960678392">
+ <object class="NSMutableString" key="NSIdentifier">
+ <characters key="NS.bytes">2</characters>
+ </object>
+ <object class="NSView" key="NSView" id="515308735">
+ <nil key="NSNextResponder"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSButton" id="418227126">
+ <reference key="NSNextResponder" ref="515308735"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{18, 55}, {402, 18}}</string>
+ <reference key="NSSuperview" ref="515308735"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="1016069354">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Use system alert effect</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="418227126"/>
+ <int key="NSButtonFlags">1211912703</int>
+ <int key="NSButtonFlags2">2</int>
+ <reference key="NSAlternateImage" ref="391434389"/>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSTextField" id="1039016593">
+ <reference key="NSNextResponder" ref="515308735"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{36, 21}, {385, 28}}</string>
+ <reference key="NSSuperview" ref="515308735"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="624655599">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">4194304</int>
+ <string key="NSContents">X11 beeps will use the standard system alert, as defined in the Sound Effects system preferences panel.</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="1039016593"/>
+ <reference key="NSBackgroundColor" ref="57160303"/>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ </object>
+ <object class="NSPopUpButton" id="709074847">
+ <reference key="NSNextResponder" ref="515308735"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{74, 174}, {128, 26}}</string>
+ <reference key="NSSuperview" ref="515308735"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSPopUpButtonCell" key="NSCell" id="633115429">
+ <int key="NSCellFlags">-2076049856</int>
+ <int key="NSCellFlags2">1024</int>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="709074847"/>
+ <int key="NSButtonFlags">109199615</int>
+ <int key="NSButtonFlags2">1</int>
+ <object class="NSFont" key="NSAlternateImage">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">1.300000e+01</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <object class="NSMutableString" key="NSAlternateContents">
+ <characters key="NS.bytes"/>
+ </object>
+ <object class="NSMutableString" key="NSKeyEquivalent">
+ <characters key="NS.bytes"/>
+ </object>
+ <int key="NSPeriodicDelay">400</int>
+ <int key="NSPeriodicInterval">75</int>
+ <object class="NSMenuItem" key="NSMenuItem" id="616492372">
+ <reference key="NSMenu" ref="341113515"/>
+ <string key="NSTitle">From Display</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <int key="NSState">1</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ <string key="NSAction">_popUpItemAction:</string>
+ <int key="NSTag">-1</int>
+ <reference key="NSTarget" ref="633115429"/>
+ </object>
+ <bool key="NSMenuItemRespectAlignment">YES</bool>
+ <object class="NSMenu" key="NSMenu" id="341113515">
+ <object class="NSMutableString" key="NSTitle">
+ <characters key="NS.bytes">OtherViews</characters>
+ </object>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="616492372"/>
+ <object class="NSMenuItem" id="759499526">
+ <reference key="NSMenu" ref="341113515"/>
+ <string key="NSTitle">256 Colors</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ <string key="NSAction">_popUpItemAction:</string>
+ <int key="NSTag">8</int>
+ <reference key="NSTarget" ref="633115429"/>
+ </object>
+ <object class="NSMenuItem" id="543935434">
+ <reference key="NSMenu" ref="341113515"/>
+ <string key="NSTitle">Thousands</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ <string key="NSAction">_popUpItemAction:</string>
+ <int key="NSTag">15</int>
+ <reference key="NSTarget" ref="633115429"/>
+ </object>
+ <object class="NSMenuItem" id="836673018">
+ <reference key="NSMenu" ref="341113515"/>
+ <string key="NSTitle">Millions</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ <string key="NSAction">_popUpItemAction:</string>
+ <int key="NSTag">24</int>
+ <reference key="NSTarget" ref="633115429"/>
+ </object>
+ </object>
+ </object>
+ <int key="NSPreferredEdge">3</int>
+ <bool key="NSUsesItemFromMenu">YES</bool>
+ <bool key="NSAltersState">YES</bool>
+ <int key="NSArrowPosition">1</int>
+ </object>
+ </object>
+ <object class="NSTextField" id="201731424">
+ <reference key="NSNextResponder" ref="515308735"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{17, 177}, {55, 20}}</string>
+ <reference key="NSSuperview" ref="515308735"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="930265681">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">4194304</int>
+ <string type="base64-UTF8" key="NSContents">Q29sb3JzOgo</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="201731424"/>
+ <reference key="NSBackgroundColor" ref="57160303"/>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ </object>
+ <object class="NSTextField" id="86150604">
+ <reference key="NSNextResponder" ref="515308735"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{36, 155}, {392, 14}}</string>
+ <reference key="NSSuperview" ref="515308735"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="311969422">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">4194304</int>
+ <string key="NSContents">This option takes effect when X11 is launched again.</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="86150604"/>
+ <reference key="NSBackgroundColor" ref="57160303"/>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ </object>
+ <object class="NSButton" id="477203622">
+ <reference key="NSNextResponder" ref="515308735"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{18, 121}, {409, 23}}</string>
+ <reference key="NSSuperview" ref="515308735"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="631531164">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Full screen mode</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="477203622"/>
+ <int key="NSButtonFlags">1211912703</int>
+ <int key="NSButtonFlags2">2</int>
+ <reference key="NSAlternateImage" ref="391434389"/>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSTextField" id="298603383">
+ <reference key="NSNextResponder" ref="515308735"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{36, 84}, {385, 31}}</string>
+ <reference key="NSSuperview" ref="515308735"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="761107402">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">4194304</int>
+ <string key="NSContents">Enables the X11 root window. Use the Command-Option-A keystroke to enter and leave full screen mode.</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="298603383"/>
+ <reference key="NSBackgroundColor" ref="57160303"/>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrame">{{10, 33}, {438, 218}}</string>
+ </object>
+ <string key="NSLabel">Output</string>
+ <reference key="NSColor" ref="57160303"/>
+ <reference key="NSTabView" ref="448510093"/>
+ </object>
+ <object class="NSTabViewItem" id="10973343">
+ <object class="NSMutableString" key="NSIdentifier">
+ <characters key="NS.bytes">2</characters>
+ </object>
+ <object class="NSView" key="NSView" id="184765684">
+ <nil key="NSNextResponder"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSButton" id="657659108">
+ <reference key="NSNextResponder" ref="184765684"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{15, 184}, {402, 18}}</string>
+ <reference key="NSSuperview" ref="184765684"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="259618205">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Click-through Inactive Windows</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="657659108"/>
+ <int key="NSButtonFlags">1211912703</int>
+ <int key="NSButtonFlags2">2</int>
+ <reference key="NSAlternateImage" ref="391434389"/>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSTextField" id="290578835">
+ <reference key="NSNextResponder" ref="184765684"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{23, 147}, {385, 31}}</string>
+ <reference key="NSSuperview" ref="184765684"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="399127858">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">4194304</int>
+ <string key="NSContents">When enabled, clicking on an inactive window will cause that mouse click to pass through to that window in addition to activating it.</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="290578835"/>
+ <reference key="NSBackgroundColor" ref="57160303"/>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ </object>
+ <object class="NSButton" id="992839333">
+ <reference key="NSNextResponder" ref="184765684"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{15, 123}, {402, 18}}</string>
+ <reference key="NSSuperview" ref="184765684"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="959555182">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Focus Follows Mouse</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="992839333"/>
+ <int key="NSButtonFlags">1211912703</int>
+ <int key="NSButtonFlags2">2</int>
+ <reference key="NSAlternateImage" ref="391434389"/>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSTextField" id="138261120">
+ <reference key="NSNextResponder" ref="184765684"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{23, 100}, {385, 17}}</string>
+ <reference key="NSSuperview" ref="184765684"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="183409141">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">4194304</int>
+ <string key="NSContents">X11 window focus follows the cursor</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="138261120"/>
+ <reference key="NSBackgroundColor" ref="57160303"/>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ </object>
+ <object class="NSButton" id="128352289">
+ <reference key="NSNextResponder" ref="184765684"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{15, 79}, {402, 18}}</string>
+ <reference key="NSSuperview" ref="184765684"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="556463187">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Focus On New Windows</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="128352289"/>
+ <int key="NSButtonFlags">1211912703</int>
+ <int key="NSButtonFlags2">2</int>
+ <reference key="NSAlternateImage" ref="391434389"/>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSTextField" id="57161931">
+ <reference key="NSNextResponder" ref="184765684"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{23, 45}, {385, 28}}</string>
+ <reference key="NSSuperview" ref="184765684"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="989804990">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">4194304</int>
+ <string key="NSContents">When enabled, creation of a new X11 window will cause X11.app to move to the foreground (instead of Finder.app, Terminal.app, etc.)</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="57161931"/>
+ <reference key="NSBackgroundColor" ref="57160303"/>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrame">{{10, 33}, {438, 218}}</string>
+ </object>
+ <string key="NSLabel">Windows</string>
+ <reference key="NSColor" ref="57160303"/>
+ <reference key="NSTabView" ref="448510093"/>
+ </object>
+ <object class="NSTabViewItem" id="348328898">
+ <object class="NSView" key="NSView" id="300811574">
+ <nil key="NSNextResponder"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSButton" id="989050925">
+ <reference key="NSNextResponder" ref="300811574"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{18, 182}, {402, 18}}</string>
+ <reference key="NSSuperview" ref="300811574"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="189594322">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Authenticate connections</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="989050925"/>
+ <int key="NSButtonFlags">1211912703</int>
+ <int key="NSButtonFlags2">2</int>
+ <reference key="NSAlternateImage" ref="391434389"/>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSButton" id="700826966">
+ <reference key="NSNextResponder" ref="300811574"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{18, 105}, {402, 18}}</string>
+ <reference key="NSSuperview" ref="300811574"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="489340979">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Allow connections from network clients</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="700826966"/>
+ <int key="NSButtonFlags">1211912703</int>
+ <int key="NSButtonFlags2">2</int>
+ <reference key="NSAlternateImage" ref="391434389"/>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSTextField" id="168436707">
+ <reference key="NSNextResponder" ref="300811574"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{36, 134}, {385, 42}}</string>
+ <reference key="NSSuperview" ref="300811574"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="53243865">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">4194304</int>
+ <string type="base64-UTF8" key="NSContents">TGF1bmNoaW5nIFgxMSB3aWxsIGNyZWF0ZSBYYXV0aG9yaXR5IGFjY2Vzcy1jb250cm9sIGtleXMuIElm
+IHRoZSBzeXN0ZW0ncyBJUCBhZGRyZXNzIGNoYW5nZXMsIHRoZXNlIGtleXMgYmVjb21lIGludmFsaWQg
+d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="168436707"/>
+ <reference key="NSBackgroundColor" ref="57160303"/>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ </object>
+ <object class="NSTextField" id="363817195">
+ <reference key="NSNextResponder" ref="300811574"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{36, 57}, {385, 42}}</string>
+ <reference key="NSSuperview" ref="300811574"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="390084685">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">4194304</int>
+ <string key="NSContents">If enabled, Authenticate connections must also be enabled to ensure system security. When disabled, connections from remote applications are not allowed.</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="363817195"/>
+ <reference key="NSBackgroundColor" ref="57160303"/>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ </object>
+ <object class="NSTextField" id="223835729">
+ <reference key="NSNextResponder" ref="300811574"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{20, -44}, {404, 14}}</string>
+ <reference key="NSSuperview" ref="300811574"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="283628678">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">4194304</int>
+ <string key="NSContents">These options take effect when X11 is next launched.</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="223835729"/>
+ <reference key="NSBackgroundColor" ref="57160303"/>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrame">{{10, 33}, {438, 218}}</string>
+ </object>
+ <string key="NSLabel">Security</string>
+ <reference key="NSColor" ref="57160303"/>
+ <reference key="NSTabView" ref="448510093"/>
+ </object>
+ </object>
+ <reference key="NSSelectedTabViewItem" ref="287591690"/>
+ <reference key="NSFont" ref="463863101"/>
+ <int key="NSTvFlags">0</int>
+ <bool key="NSAllowTruncatedLabels">YES</bool>
+ <bool key="NSDrawsBackground">YES</bool>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="596750588"/>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrameSize">{484, 280}</string>
+ </object>
+ <string key="NSScreenRect">{{0, 0}, {1280, 938}}</string>
+ <string key="NSMinSize">{213, 129}</string>
+ <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
+ <string key="NSFrameAutosaveName">x11_prefs</string>
+ </object>
+ <object class="NSWindowTemplate" id="604417141">
+ <int key="NSWindowStyleMask">11</int>
+ <int key="NSWindowBacking">2</int>
+ <string key="NSWindowRect">{{302, 400}, {454, 311}}</string>
+ <int key="NSWTFlags">1350041600</int>
+ <string key="NSWindowTitle">X11 Application Menu</string>
+ <string key="NSWindowClass">NSPanel</string>
+ <object class="NSMutableString" key="NSViewClass">
+ <characters key="NS.bytes">View</characters>
+ </object>
+ <string key="NSWindowContentMaxSize">{10000, 10000}</string>
+ <string key="NSWindowContentMinSize">{320, 240}</string>
+ <object class="NSView" key="NSWindowView" id="85544634">
+ <nil key="NSNextResponder"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSButton" id="671954382">
+ <reference key="NSNextResponder" ref="85544634"/>
+ <int key="NSvFlags">265</int>
+ <string key="NSFrame">{{340, 231}, {100, 32}}</string>
+ <reference key="NSSuperview" ref="85544634"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="143554520">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">137887744</int>
+ <string key="NSContents">Duplicate</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="671954382"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">1</int>
+ <object class="NSFont" key="NSAlternateImage" id="549406736">
+ <string key="NSName">Helvetica</string>
+ <double key="NSSize">1.300000e+01</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <object class="NSMutableString" key="NSAlternateContents">
+ <characters key="NS.bytes"/>
+ </object>
+ <object class="NSMutableString" key="NSKeyEquivalent">
+ <characters key="NS.bytes"/>
+ </object>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSButton" id="492358940">
+ <reference key="NSNextResponder" ref="85544634"/>
+ <int key="NSvFlags">265</int>
+ <string key="NSFrame">{{340, 199}, {100, 32}}</string>
+ <reference key="NSSuperview" ref="85544634"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="8201128">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">137887744</int>
+ <string key="NSContents">Remove</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="492358940"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">1</int>
+ <reference key="NSAlternateImage" ref="549406736"/>
+ <object class="NSMutableString" key="NSAlternateContents">
+ <characters key="NS.bytes"/>
+ </object>
+ <object class="NSMutableString" key="NSKeyEquivalent">
+ <characters key="NS.bytes"/>
+ </object>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSScrollView" id="1063387772">
+ <reference key="NSNextResponder" ref="85544634"/>
+ <int key="NSvFlags">274</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSClipView" id="580565898">
+ <reference key="NSNextResponder" ref="1063387772"/>
+ <int key="NSvFlags">2304</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSTableView" id="905092943">
+ <reference key="NSNextResponder" ref="580565898"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrameSize">{301, 198}</string>
+ <reference key="NSSuperview" ref="580565898"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTableHeaderView" key="NSHeaderView" id="792419186">
+ <reference key="NSNextResponder" ref="672307654"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrameSize">{301, 17}</string>
+ <reference key="NSSuperview" ref="672307654"/>
+ <reference key="NSTableView" ref="905092943"/>
+ </object>
+ <object class="_NSCornerView" key="NSCornerView" id="898633680">
+ <reference key="NSNextResponder" ref="1063387772"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{302, 0}, {16, 17}}</string>
+ <reference key="NSSuperview" ref="1063387772"/>
+ </object>
+ <object class="NSMutableArray" key="NSTableColumns">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSTableColumn" id="84282687">
+ <double key="NSWidth">9.900000e+01</double>
+ <double key="NSMinWidth">4.000000e+01</double>
+ <double key="NSMaxWidth">1.000000e+03</double>
+ <object class="NSTableHeaderCell" key="NSHeaderCell">
+ <int key="NSCellFlags">75628032</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Name</string>
+ <reference key="NSSupport" ref="26"/>
+ <object class="NSColor" key="NSBackgroundColor" id="113872566">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC4zMzMzMzI5OQA</bytes>
+ </object>
+ <object class="NSColor" key="NSTextColor" id="249576247">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">headerTextColor</string>
+ <reference key="NSColor" ref="214098874"/>
+ </object>
+ </object>
+ <object class="NSTextFieldCell" key="NSDataCell" id="432610585">
+ <int key="NSCellFlags">338820672</int>
+ <int key="NSCellFlags2">1024</int>
+ <string key="NSContents">Text Cell</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="905092943"/>
+ <object class="NSColor" key="NSBackgroundColor" id="822946413">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ <int key="NSResizingMask">3</int>
+ <bool key="NSIsResizeable">YES</bool>
+ <bool key="NSIsEditable">YES</bool>
+ <reference key="NSTableView" ref="905092943"/>
+ </object>
+ <object class="NSTableColumn" id="938444323">
+ <double key="NSWidth">1.217310e+02</double>
+ <double key="NSMinWidth">6.273100e+01</double>
+ <double key="NSMaxWidth">1.000000e+03</double>
+ <object class="NSTableHeaderCell" key="NSHeaderCell">
+ <int key="NSCellFlags">75628032</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Command</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSBackgroundColor" ref="113872566"/>
+ <reference key="NSTextColor" ref="249576247"/>
+ </object>
+ <object class="NSTextFieldCell" key="NSDataCell" id="825378892">
+ <int key="NSCellFlags">338820672</int>
+ <int key="NSCellFlags2">1024</int>
+ <string key="NSContents">Text Cell</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="905092943"/>
+ <reference key="NSBackgroundColor" ref="822946413"/>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ <int key="NSResizingMask">3</int>
+ <bool key="NSIsResizeable">YES</bool>
+ <bool key="NSIsEditable">YES</bool>
+ <reference key="NSTableView" ref="905092943"/>
+ </object>
+ <object class="NSTableColumn" id="242608782">
+ <double key="NSWidth">7.100000e+01</double>
+ <double key="NSMinWidth">1.000000e+01</double>
+ <double key="NSMaxWidth">1.000000e+03</double>
+ <object class="NSTableHeaderCell" key="NSHeaderCell">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Shortcut</string>
+ <reference key="NSSupport" ref="26"/>
+ <object class="NSColor" key="NSBackgroundColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">headerColor</string>
+ <reference key="NSColor" ref="822946413"/>
+ </object>
+ <reference key="NSTextColor" ref="249576247"/>
+ </object>
+ <object class="NSTextFieldCell" key="NSDataCell" id="34714764">
+ <int key="NSCellFlags">338820672</int>
+ <int key="NSCellFlags2">1024</int>
+ <string key="NSContents">Text Cell</string>
+ <object class="NSFont" key="NSSupport">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">1.200000e+01</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <reference key="NSControlView" ref="905092943"/>
+ <bool key="NSDrawsBackground">YES</bool>
+ <object class="NSColor" key="NSBackgroundColor" id="812484075">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">controlBackgroundColor</string>
+ <reference key="NSColor" ref="590688762"/>
+ </object>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ <int key="NSResizingMask">3</int>
+ <bool key="NSIsResizeable">YES</bool>
+ <bool key="NSIsEditable">YES</bool>
+ <reference key="NSTableView" ref="905092943"/>
+ </object>
+ </object>
+ <double key="NSIntercellSpacingWidth">3.000000e+00</double>
+ <double key="NSIntercellSpacingHeight">2.000000e+00</double>
+ <reference key="NSBackgroundColor" ref="822946413"/>
+ <object class="NSColor" key="NSGridColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">gridColor</string>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC41AA</bytes>
+ </object>
+ </object>
+ <double key="NSRowHeight">1.700000e+01</double>
+ <int key="NSTvFlags">1379958784</int>
+ <int key="NSColumnAutoresizingStyle">1</int>
+ <int key="NSDraggingSourceMaskForLocal">-1</int>
+ <int key="NSDraggingSourceMaskForNonLocal">0</int>
+ <bool key="NSAllowsTypeSelect">YES</bool>
+ </object>
+ </object>
+ <string key="NSFrame">{{1, 17}, {301, 198}}</string>
+ <reference key="NSSuperview" ref="1063387772"/>
+ <reference key="NSNextKeyView" ref="905092943"/>
+ <reference key="NSDocView" ref="905092943"/>
+ <reference key="NSBGColor" ref="812484075"/>
+ <int key="NScvFlags">4</int>
+ </object>
+ <object class="NSScroller" id="842897584">
+ <reference key="NSNextResponder" ref="1063387772"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{302, 17}, {15, 198}}</string>
+ <reference key="NSSuperview" ref="1063387772"/>
+ <reference key="NSTarget" ref="1063387772"/>
+ <string key="NSAction">_doScroller:</string>
+ <double key="NSPercent">9.949238e-01</double>
+ </object>
+ <object class="NSScroller" id="17278747">
+ <reference key="NSNextResponder" ref="1063387772"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{1, 215}, {301, 15}}</string>
+ <reference key="NSSuperview" ref="1063387772"/>
+ <int key="NSsFlags">1</int>
+ <reference key="NSTarget" ref="1063387772"/>
+ <string key="NSAction">_doScroller:</string>
+ <double key="NSPercent">6.885246e-01</double>
+ </object>
+ <object class="NSClipView" id="672307654">
+ <reference key="NSNextResponder" ref="1063387772"/>
+ <int key="NSvFlags">2304</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="792419186"/>
+ </object>
+ <string key="NSFrame">{{1, 0}, {301, 17}}</string>
+ <reference key="NSSuperview" ref="1063387772"/>
+ <reference key="NSNextKeyView" ref="792419186"/>
+ <reference key="NSDocView" ref="792419186"/>
+ <reference key="NSBGColor" ref="812484075"/>
+ <int key="NScvFlags">4</int>
+ </object>
+ <reference ref="898633680"/>
+ </object>
+ <string key="NSFrame">{{20, 60}, {318, 231}}</string>
+ <reference key="NSSuperview" ref="85544634"/>
+ <reference key="NSNextKeyView" ref="580565898"/>
+ <int key="NSsFlags">50</int>
+ <reference key="NSVScroller" ref="842897584"/>
+ <reference key="NSHScroller" ref="17278747"/>
+ <reference key="NSContentView" ref="580565898"/>
+ <reference key="NSHeaderClipView" ref="672307654"/>
+ <reference key="NSCornerView" ref="898633680"/>
+ <bytes key="NSScrollAmts">QSAAAEEgAABBmAAAQZgAAA</bytes>
+ </object>
+ <object class="NSButton" id="758204686">
+ <reference key="NSNextResponder" ref="85544634"/>
+ <int key="NSvFlags">265</int>
+ <string key="NSFrame">{{340, 263}, {100, 32}}</string>
+ <reference key="NSSuperview" ref="85544634"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="1025474039">
+ <int key="NSCellFlags">-2080244224</int>
+ <int key="NSCellFlags2">137887744</int>
+ <string key="NSContents">Add Item</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="758204686"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">1</int>
+ <reference key="NSAlternateImage" ref="549406736"/>
+ <object class="NSMutableString" key="NSAlternateContents">
+ <characters key="NS.bytes"/>
+ </object>
+ <object class="NSMutableString" key="NSKeyEquivalent">
+ <characters key="NS.bytes"/>
+ </object>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSButton" id="125703429">
+ <reference key="NSNextResponder" ref="85544634"/>
+ <int key="NSvFlags">257</int>
+ <string key="NSFrame">{{356, 12}, {84, 32}}</string>
+ <reference key="NSSuperview" ref="85544634"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="892296813">
+ <int key="NSCellFlags">-2080244224</int>
+ <int key="NSCellFlags2">137887744</int>
+ <string key="NSContents">Cancel</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="125703429"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">1</int>
+ <reference key="NSAlternateImage" ref="549406736"/>
+ <object class="NSMutableString" key="NSAlternateContents">
+ <characters key="NS.bytes"/>
+ </object>
+ <object class="NSMutableString" key="NSKeyEquivalent">
+ <characters key="NS.bytes"/>
+ </object>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSButton" id="724002248">
+ <reference key="NSNextResponder" ref="85544634"/>
+ <int key="NSvFlags">257</int>
+ <string key="NSFrame">{{272, 12}, {84, 32}}</string>
+ <reference key="NSSuperview" ref="85544634"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="809610613">
+ <int key="NSCellFlags">-2080244224</int>
+ <int key="NSCellFlags2">137887744</int>
+ <string key="NSContents">Done</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="724002248"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">1</int>
+ <reference key="NSAlternateImage" ref="549406736"/>
+ <string key="NSAlternateContents"/>
+ <object class="NSMutableString" key="NSKeyEquivalent">
+ <characters key="NS.bytes"/>
+ </object>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrameSize">{454, 311}</string>
+ </object>
+ <string key="NSScreenRect">{{0, 0}, {1280, 938}}</string>
+ <string key="NSMinSize">{320, 262}</string>
+ <string key="NSFrameAutosaveName">x11_apps</string>
+ </object>
+ <object class="NSMenu" id="294137138">
+ <string key="NSTitle">Menu</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="318286212">
+ <reference key="NSMenu" ref="294137138"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="511651072">
+ <reference key="NSMenu" ref="294137138"/>
+ <string key="NSTitle">Applications</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="48278059">
+ <string key="NSTitle">Applications</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="563798000">
+ <reference key="NSMenu" ref="48278059"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="1032342329">
+ <reference key="NSMenu" ref="48278059"/>
+ <string type="base64-UTF8" key="NSTitle">Q3VzdG9taXpl4oCmA</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ </object>
+ <string key="NSName"/>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">cut:</string>
+ <reference key="source" ref="941939442"/>
+ <reference key="destination" ref="581727829"/>
+ </object>
+ <int key="connectionID">175</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">paste:</string>
+ <reference key="source" ref="941939442"/>
+ <reference key="destination" ref="924678073"/>
+ </object>
+ <int key="connectionID">176</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">redo:</string>
+ <reference key="source" ref="941939442"/>
+ <reference key="destination" ref="535038564"/>
+ </object>
+ <int key="connectionID">178</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">selectAll:</string>
+ <reference key="source" ref="941939442"/>
+ <reference key="destination" ref="322866464"/>
+ </object>
+ <int key="connectionID">179</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">undo:</string>
+ <reference key="source" ref="941939442"/>
+ <reference key="destination" ref="1010221707"/>
+ </object>
+ <int key="connectionID">180</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">copy:</string>
+ <reference key="source" ref="941939442"/>
+ <reference key="destination" ref="185296989"/>
+ </object>
+ <int key="connectionID">181</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">delete:</string>
+ <reference key="source" ref="941939442"/>
+ <reference key="destination" ref="994817848"/>
+ </object>
+ <int key="connectionID">195</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">minimize_window:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="677652931"/>
+ </object>
+ <int key="connectionID">202</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">close_window:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="984461797"/>
+ </object>
+ <int key="connectionID">205</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">zoom_window:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="1066447520"/>
+ </object>
+ <int key="connectionID">206</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">bring_to_front:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="276216762"/>
+ </object>
+ <int key="connectionID">207</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">hideOtherApplications:</string>
+ <reference key="source" ref="815810918"/>
+ <reference key="destination" ref="206802571"/>
+ </object>
+ <int key="connectionID">263</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">apps_separator</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="390088328"/>
+ </object>
+ <int key="connectionID">273</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">apps_table</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="905092943"/>
+ </object>
+ <int key="connectionID">301</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">apps_table_done:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="724002248"/>
+ </object>
+ <int key="connectionID">302</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">apps_table_delete:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="492358940"/>
+ </object>
+ <int key="connectionID">303</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">apps_table_duplicate:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="671954382"/>
+ </object>
+ <int key="connectionID">304</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">apps_table_show:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="1065386165"/>
+ </object>
+ <int key="connectionID">308</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">apps_table_cancel:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="125703429"/>
+ </object>
+ <int key="connectionID">309</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">apps_table_new:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="758204686"/>
+ </object>
+ <int key="connectionID">311</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">prefs_show:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="386173216"/>
+ </object>
+ <int key="connectionID">318</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">x11_about_item</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="139290918"/>
+ </object>
+ <int key="connectionID">321</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">enable_auth</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="989050925"/>
+ </object>
+ <int key="connectionID">387</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">enable_tcp</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="700826966"/>
+ </object>
+ <int key="connectionID">388</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">depth</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="709074847"/>
+ </object>
+ <int key="connectionID">389</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">use_sysbeep</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="418227126"/>
+ </object>
+ <int key="connectionID">390</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">fake_buttons</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="119157981"/>
+ </object>
+ <int key="connectionID">391</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">sync_keymap</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="179949713"/>
+ </object>
+ <int key="connectionID">392</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">enable_keyequivs</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="842100515"/>
+ </object>
+ <int key="connectionID">393</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">prefs_changed:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="119157981"/>
+ </object>
+ <int key="connectionID">394</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">prefs_changed:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="179949713"/>
+ </object>
+ <int key="connectionID">395</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">prefs_changed:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="842100515"/>
+ </object>
+ <int key="connectionID">396</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">prefs_changed:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="418227126"/>
+ </object>
+ <int key="connectionID">397</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">prefs_changed:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="709074847"/>
+ </object>
+ <int key="connectionID">398</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">prefs_changed:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="989050925"/>
+ </object>
+ <int key="connectionID">399</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">prefs_changed:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="700826966"/>
+ </object>
+ <int key="connectionID">401</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">prefs_panel</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="124913468"/>
+ </object>
+ <int key="connectionID">402</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">x11_help:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="504984881"/>
+ </object>
+ <int key="connectionID">422</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">dockMenu</string>
+ <reference key="source" ref="815810918"/>
+ <reference key="destination" ref="294137138"/>
+ </object>
+ <int key="connectionID">426</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">dock_menu</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="294137138"/>
+ </object>
+ <int key="connectionID">428</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="815810918"/>
+ <reference key="destination" ref="485884620"/>
+ </object>
+ <int key="connectionID">429</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">hide:</string>
+ <reference key="source" ref="815810918"/>
+ <reference key="destination" ref="301008465"/>
+ </object>
+ <int key="connectionID">430</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">unhideAllApplications:</string>
+ <reference key="source" ref="815810918"/>
+ <reference key="destination" ref="1023546148"/>
+ </object>
+ <int key="connectionID">431</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">orderFrontStandardAboutPanel:</string>
+ <reference key="source" ref="815810918"/>
+ <reference key="destination" ref="139290918"/>
+ </object>
+ <int key="connectionID">433</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">dock_apps_menu</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="48278059"/>
+ </object>
+ <int key="connectionID">530</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">dock_window_separator</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="318286212"/>
+ </object>
+ <int key="connectionID">531</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">apps_table_show:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="1032342329"/>
+ </object>
+ <int key="connectionID">534</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">next_window:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="1036389925"/>
+ </object>
+ <int key="connectionID">539</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">previous_window:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="369641893"/>
+ </object>
+ <int key="connectionID">540</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">enable_fullscreen</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="477203622"/>
+ </object>
+ <int key="connectionID">546</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">enable_fullscreen_changed:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="477203622"/>
+ </object>
+ <int key="connectionID">547</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">toggle_fullscreen:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="6876565"/>
+ </object>
+ <int key="connectionID">548</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">toggle_fullscreen_item</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="6876565"/>
+ </object>
+ <int key="connectionID">549</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">window_separator</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="444952046"/>
+ </object>
+ <int key="connectionID">300331</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">menu</string>
+ <reference key="source" ref="815810918"/>
+ <reference key="destination" ref="524015605"/>
+ </object>
+ <int key="connectionID">300334</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">terminate:</string>
+ <reference key="source" ref="815810918"/>
+ <reference key="destination" ref="274138642"/>
+ </object>
+ <int key="connectionID">300336</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">prefs_changed:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="657659108"/>
+ </object>
+ <int key="connectionID">300389</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">prefs_changed:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="992839333"/>
+ </object>
+ <int key="connectionID">300390</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">prefs_changed:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="128352289"/>
+ </object>
+ <int key="connectionID">300391</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">click_through</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="657659108"/>
+ </object>
+ <int key="connectionID">300392</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">focus_follows_mouse</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="992839333"/>
+ </object>
+ <int key="connectionID">300393</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">focus_on_new_window</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="128352289"/>
+ </object>
+ <int key="connectionID">300394</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <object class="NSArray" key="object" id="330408435">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <reference key="children" ref="904585544"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="815810918"/>
+ <reference key="parent" ref="330408435"/>
+ <string type="base64-UTF8" key="objectName">RmlsZSdzIE93bmVyA</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="941939442"/>
+ <reference key="parent" ref="330408435"/>
+ <string key="objectName">First Responder</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-3</int>
+ <reference key="object" ref="951368722"/>
+ <reference key="parent" ref="330408435"/>
+ <string key="objectName">Application</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">29</int>
+ <reference key="object" ref="524015605"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="931553638"/>
+ <reference ref="365880285"/>
+ <reference ref="200491363"/>
+ <reference ref="868031522"/>
+ <reference ref="551174276"/>
+ </object>
+ <reference key="parent" ref="330408435"/>
+ <string key="objectName">MainMenu</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">19</int>
+ <reference key="object" ref="931553638"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="96874957"/>
+ </object>
+ <reference key="parent" ref="524015605"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">24</int>
+ <reference key="object" ref="96874957"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="677652931"/>
+ <reference ref="276216762"/>
+ <reference ref="1066447520"/>
+ <reference ref="1036389925"/>
+ <reference ref="280172320"/>
+ <reference ref="369641893"/>
+ <reference ref="984461797"/>
+ <reference ref="155085383"/>
+ <reference ref="444952046"/>
+ </object>
+ <reference key="parent" ref="931553638"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">5</int>
+ <reference key="object" ref="276216762"/>
+ <reference key="parent" ref="96874957"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">23</int>
+ <reference key="object" ref="677652931"/>
+ <reference key="parent" ref="96874957"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">92</int>
+ <reference key="object" ref="280172320"/>
+ <reference key="parent" ref="96874957"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">203</int>
+ <reference key="object" ref="984461797"/>
+ <reference key="parent" ref="96874957"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">204</int>
+ <reference key="object" ref="1066447520"/>
+ <reference key="parent" ref="96874957"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">536</int>
+ <reference key="object" ref="155085383"/>
+ <reference key="parent" ref="96874957"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">537</int>
+ <reference key="object" ref="1036389925"/>
+ <reference key="parent" ref="96874957"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">538</int>
+ <reference key="object" ref="369641893"/>
+ <reference key="parent" ref="96874957"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">56</int>
+ <reference key="object" ref="365880285"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="576521955"/>
+ </object>
+ <reference key="parent" ref="524015605"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">57</int>
+ <reference key="object" ref="576521955"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="139290918"/>
+ <reference ref="386173216"/>
+ <reference ref="32285361"/>
+ <reference ref="301008465"/>
+ <reference ref="274138642"/>
+ <reference ref="272876017"/>
+ <reference ref="431301145"/>
+ <reference ref="206802571"/>
+ <reference ref="848095279"/>
+ <reference ref="1023546148"/>
+ <reference ref="6876565"/>
+ <reference ref="479677589"/>
+ </object>
+ <reference key="parent" ref="365880285"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">58</int>
+ <reference key="object" ref="139290918"/>
+ <reference key="parent" ref="576521955"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">129</int>
+ <reference key="object" ref="386173216"/>
+ <reference key="parent" ref="576521955"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">131</int>
+ <reference key="object" ref="32285361"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="821388474"/>
+ </object>
+ <reference key="parent" ref="576521955"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">130</int>
+ <reference key="object" ref="821388474"/>
+ <reference key="parent" ref="32285361"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">134</int>
+ <reference key="object" ref="301008465"/>
+ <reference key="parent" ref="576521955"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">136</int>
+ <reference key="object" ref="274138642"/>
+ <reference key="parent" ref="576521955"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">143</int>
+ <reference key="object" ref="272876017"/>
+ <reference key="parent" ref="576521955"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">144</int>
+ <reference key="object" ref="431301145"/>
+ <reference key="parent" ref="576521955"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">145</int>
+ <reference key="object" ref="206802571"/>
+ <reference key="parent" ref="576521955"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">149</int>
+ <reference key="object" ref="848095279"/>
+ <reference key="parent" ref="576521955"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">150</int>
+ <reference key="object" ref="1023546148"/>
+ <reference key="parent" ref="576521955"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">544</int>
+ <reference key="object" ref="6876565"/>
+ <reference key="parent" ref="576521955"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">545</int>
+ <reference key="object" ref="479677589"/>
+ <reference key="parent" ref="576521955"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">163</int>
+ <reference key="object" ref="200491363"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="526778998"/>
+ </object>
+ <reference key="parent" ref="524015605"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">169</int>
+ <reference key="object" ref="526778998"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="839739619"/>
+ <reference ref="185296989"/>
+ <reference ref="1010221707"/>
+ <reference ref="581727829"/>
+ <reference ref="994817848"/>
+ <reference ref="924678073"/>
+ <reference ref="322866464"/>
+ <reference ref="535038564"/>
+ </object>
+ <reference key="parent" ref="200491363"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">156</int>
+ <reference key="object" ref="839739619"/>
+ <reference key="parent" ref="526778998"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">157</int>
+ <reference key="object" ref="185296989"/>
+ <reference key="parent" ref="526778998"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">158</int>
+ <reference key="object" ref="1010221707"/>
+ <reference key="parent" ref="526778998"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">160</int>
+ <reference key="object" ref="581727829"/>
+ <reference key="parent" ref="526778998"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">164</int>
+ <reference key="object" ref="994817848"/>
+ <reference key="parent" ref="526778998"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">171</int>
+ <reference key="object" ref="924678073"/>
+ <reference key="parent" ref="526778998"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">172</int>
+ <reference key="object" ref="322866464"/>
+ <reference key="parent" ref="526778998"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">173</int>
+ <reference key="object" ref="535038564"/>
+ <reference key="parent" ref="526778998"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">269</int>
+ <reference key="object" ref="868031522"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="981161348"/>
+ </object>
+ <reference key="parent" ref="524015605"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">270</int>
+ <reference key="object" ref="981161348"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="390088328"/>
+ <reference ref="1065386165"/>
+ </object>
+ <reference key="parent" ref="868031522"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">272</int>
+ <reference key="object" ref="390088328"/>
+ <reference key="parent" ref="981161348"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">305</int>
+ <reference key="object" ref="1065386165"/>
+ <reference key="parent" ref="981161348"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">419</int>
+ <reference key="object" ref="551174276"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="511848303"/>
+ </object>
+ <reference key="parent" ref="524015605"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">420</int>
+ <reference key="object" ref="511848303"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="504984881"/>
+ </object>
+ <reference key="parent" ref="551174276"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">421</int>
+ <reference key="object" ref="504984881"/>
+ <reference key="parent" ref="511848303"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">196</int>
+ <reference key="object" ref="485884620"/>
+ <reference key="parent" ref="330408435"/>
+ <string key="objectName">X11Controller</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">244</int>
+ <reference key="object" ref="124913468"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="941366957"/>
+ </object>
+ <reference key="parent" ref="330408435"/>
+ <string key="objectName">PrefsPanel</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">245</int>
+ <reference key="object" ref="941366957"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="448510093"/>
+ </object>
+ <reference key="parent" ref="124913468"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">348</int>
+ <reference key="object" ref="448510093"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="287591690"/>
+ <reference ref="960678392"/>
+ <reference ref="348328898"/>
+ <reference ref="10973343"/>
+ </object>
+ <reference key="parent" ref="941366957"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">349</int>
+ <reference key="object" ref="287591690"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="596750588"/>
+ </object>
+ <reference key="parent" ref="448510093"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">351</int>
+ <reference key="object" ref="596750588"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="119157981"/>
+ <reference ref="443008216"/>
+ <reference ref="282885445"/>
+ <reference ref="842100515"/>
+ <reference ref="31160162"/>
+ <reference ref="179949713"/>
+ </object>
+ <reference key="parent" ref="287591690"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">363</int>
+ <reference key="object" ref="119157981"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="990762273"/>
+ </object>
+ <reference key="parent" ref="596750588"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">364</int>
+ <reference key="object" ref="443008216"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="391919450"/>
+ </object>
+ <reference key="parent" ref="596750588"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">365</int>
+ <reference key="object" ref="282885445"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="649334366"/>
+ </object>
+ <reference key="parent" ref="596750588"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">368</int>
+ <reference key="object" ref="842100515"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="940564599"/>
+ </object>
+ <reference key="parent" ref="596750588"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">369</int>
+ <reference key="object" ref="31160162"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="666057093"/>
+ </object>
+ <reference key="parent" ref="596750588"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">370</int>
+ <reference key="object" ref="179949713"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="967619578"/>
+ </object>
+ <reference key="parent" ref="596750588"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">352</int>
+ <reference key="object" ref="960678392"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="515308735"/>
+ </object>
+ <reference key="parent" ref="448510093"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">350</int>
+ <reference key="object" ref="515308735"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="418227126"/>
+ <reference ref="1039016593"/>
+ <reference ref="709074847"/>
+ <reference ref="201731424"/>
+ <reference ref="86150604"/>
+ <reference ref="477203622"/>
+ <reference ref="298603383"/>
+ </object>
+ <reference key="parent" ref="960678392"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">371</int>
+ <reference key="object" ref="418227126"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1016069354"/>
+ </object>
+ <reference key="parent" ref="515308735"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">372</int>
+ <reference key="object" ref="1039016593"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="624655599"/>
+ </object>
+ <reference key="parent" ref="515308735"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">382</int>
+ <reference key="object" ref="709074847"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="633115429"/>
+ </object>
+ <reference key="parent" ref="515308735"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">385</int>
+ <reference key="object" ref="201731424"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="930265681"/>
+ </object>
+ <reference key="parent" ref="515308735"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">386</int>
+ <reference key="object" ref="86150604"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="311969422"/>
+ </object>
+ <reference key="parent" ref="515308735"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">541</int>
+ <reference key="object" ref="477203622"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="631531164"/>
+ </object>
+ <reference key="parent" ref="515308735"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">543</int>
+ <reference key="object" ref="298603383"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="761107402"/>
+ </object>
+ <reference key="parent" ref="515308735"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">353</int>
+ <reference key="object" ref="348328898"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="300811574"/>
+ </object>
+ <reference key="parent" ref="448510093"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">354</int>
+ <reference key="object" ref="300811574"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="989050925"/>
+ <reference ref="700826966"/>
+ <reference ref="168436707"/>
+ <reference ref="363817195"/>
+ <reference ref="223835729"/>
+ </object>
+ <reference key="parent" ref="348328898"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">374</int>
+ <reference key="object" ref="989050925"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="189594322"/>
+ </object>
+ <reference key="parent" ref="300811574"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">375</int>
+ <reference key="object" ref="700826966"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="489340979"/>
+ </object>
+ <reference key="parent" ref="300811574"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">376</int>
+ <reference key="object" ref="168436707"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="53243865"/>
+ </object>
+ <reference key="parent" ref="300811574"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">377</int>
+ <reference key="object" ref="363817195"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="390084685"/>
+ </object>
+ <reference key="parent" ref="300811574"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">379</int>
+ <reference key="object" ref="223835729"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="283628678"/>
+ </object>
+ <reference key="parent" ref="300811574"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">285</int>
+ <reference key="object" ref="604417141"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="85544634"/>
+ </object>
+ <reference key="parent" ref="330408435"/>
+ <string key="objectName">EditPrograms</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">286</int>
+ <reference key="object" ref="85544634"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1063387772"/>
+ <reference ref="758204686"/>
+ <reference ref="671954382"/>
+ <reference ref="492358940"/>
+ <reference ref="125703429"/>
+ <reference ref="724002248"/>
+ </object>
+ <reference key="parent" ref="604417141"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">423</int>
+ <reference key="object" ref="294137138"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="318286212"/>
+ <reference ref="511651072"/>
+ </object>
+ <reference key="parent" ref="330408435"/>
+ <string key="objectName">DockMenu</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">524</int>
+ <reference key="object" ref="318286212"/>
+ <reference key="parent" ref="294137138"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">526</int>
+ <reference key="object" ref="511651072"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="48278059"/>
+ </object>
+ <reference key="parent" ref="294137138"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">527</int>
+ <reference key="object" ref="48278059"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1032342329"/>
+ <reference ref="563798000"/>
+ </object>
+ <reference key="parent" ref="511651072"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">532</int>
+ <reference key="object" ref="1032342329"/>
+ <reference key="parent" ref="48278059"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">533</int>
+ <reference key="object" ref="563798000"/>
+ <reference key="parent" ref="48278059"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100363</int>
+ <reference key="object" ref="990762273"/>
+ <reference key="parent" ref="119157981"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100364</int>
+ <reference key="object" ref="391919450"/>
+ <reference key="parent" ref="443008216"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100365</int>
+ <reference key="object" ref="649334366"/>
+ <reference key="parent" ref="282885445"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100368</int>
+ <reference key="object" ref="940564599"/>
+ <reference key="parent" ref="842100515"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100369</int>
+ <reference key="object" ref="666057093"/>
+ <reference key="parent" ref="31160162"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100370</int>
+ <reference key="object" ref="967619578"/>
+ <reference key="parent" ref="179949713"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100371</int>
+ <reference key="object" ref="1016069354"/>
+ <reference key="parent" ref="418227126"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100372</int>
+ <reference key="object" ref="624655599"/>
+ <reference key="parent" ref="1039016593"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100382</int>
+ <reference key="object" ref="633115429"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="341113515"/>
+ </object>
+ <reference key="parent" ref="709074847"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100385</int>
+ <reference key="object" ref="930265681"/>
+ <reference key="parent" ref="201731424"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100386</int>
+ <reference key="object" ref="311969422"/>
+ <reference key="parent" ref="86150604"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100541</int>
+ <reference key="object" ref="631531164"/>
+ <reference key="parent" ref="477203622"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100543</int>
+ <reference key="object" ref="761107402"/>
+ <reference key="parent" ref="298603383"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100374</int>
+ <reference key="object" ref="189594322"/>
+ <reference key="parent" ref="989050925"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100375</int>
+ <reference key="object" ref="489340979"/>
+ <reference key="parent" ref="700826966"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100376</int>
+ <reference key="object" ref="53243865"/>
+ <reference key="parent" ref="168436707"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100377</int>
+ <reference key="object" ref="390084685"/>
+ <reference key="parent" ref="363817195"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100379</int>
+ <reference key="object" ref="283628678"/>
+ <reference key="parent" ref="223835729"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">380</int>
+ <reference key="object" ref="341113515"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="759499526"/>
+ <reference ref="616492372"/>
+ <reference ref="543935434"/>
+ <reference ref="836673018"/>
+ </object>
+ <reference key="parent" ref="633115429"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">435</int>
+ <reference key="object" ref="759499526"/>
+ <reference key="parent" ref="341113515"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">384</int>
+ <reference key="object" ref="616492372"/>
+ <reference key="parent" ref="341113515"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">383</int>
+ <reference key="object" ref="543935434"/>
+ <reference key="parent" ref="341113515"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">381</int>
+ <reference key="object" ref="836673018"/>
+ <reference key="parent" ref="341113515"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">295</int>
+ <reference key="object" ref="1063387772"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="792419186"/>
+ <reference ref="17278747"/>
+ <reference ref="842897584"/>
+ <reference ref="905092943"/>
+ </object>
+ <reference key="parent" ref="85544634"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">300295</int>
+ <reference key="object" ref="792419186"/>
+ <reference key="parent" ref="1063387772"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">200295</int>
+ <reference key="object" ref="17278747"/>
+ <reference key="parent" ref="1063387772"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100295</int>
+ <reference key="object" ref="842897584"/>
+ <reference key="parent" ref="1063387772"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">296</int>
+ <reference key="object" ref="905092943"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="242608782"/>
+ <reference ref="938444323"/>
+ <reference ref="84282687"/>
+ </object>
+ <reference key="parent" ref="1063387772"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">535</int>
+ <reference key="object" ref="242608782"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="34714764"/>
+ </object>
+ <reference key="parent" ref="905092943"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">575</int>
+ <reference key="object" ref="34714764"/>
+ <reference key="parent" ref="242608782"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">298</int>
+ <reference key="object" ref="938444323"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="825378892"/>
+ </object>
+ <reference key="parent" ref="905092943"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">573</int>
+ <reference key="object" ref="825378892"/>
+ <reference key="parent" ref="938444323"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">297</int>
+ <reference key="object" ref="84282687"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="432610585"/>
+ </object>
+ <reference key="parent" ref="905092943"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">574</int>
+ <reference key="object" ref="432610585"/>
+ <reference key="parent" ref="84282687"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">310</int>
+ <reference key="object" ref="758204686"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1025474039"/>
+ </object>
+ <reference key="parent" ref="85544634"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100310</int>
+ <reference key="object" ref="1025474039"/>
+ <reference key="parent" ref="758204686"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">292</int>
+ <reference key="object" ref="671954382"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="143554520"/>
+ </object>
+ <reference key="parent" ref="85544634"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100292</int>
+ <reference key="object" ref="143554520"/>
+ <reference key="parent" ref="671954382"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">293</int>
+ <reference key="object" ref="492358940"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="8201128"/>
+ </object>
+ <reference key="parent" ref="85544634"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100293</int>
+ <reference key="object" ref="8201128"/>
+ <reference key="parent" ref="492358940"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">299</int>
+ <reference key="object" ref="125703429"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="892296813"/>
+ </object>
+ <reference key="parent" ref="85544634"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100299</int>
+ <reference key="object" ref="892296813"/>
+ <reference key="parent" ref="125703429"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">291</int>
+ <reference key="object" ref="724002248"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="809610613"/>
+ </object>
+ <reference key="parent" ref="85544634"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100291</int>
+ <reference key="object" ref="809610613"/>
+ <reference key="parent" ref="724002248"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">300330</int>
+ <reference key="object" ref="444952046"/>
+ <reference key="parent" ref="96874957"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">300337</int>
+ <reference key="object" ref="10973343"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="184765684"/>
+ </object>
+ <reference key="parent" ref="448510093"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">300338</int>
+ <reference key="object" ref="184765684"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="657659108"/>
+ <reference ref="290578835"/>
+ <reference ref="992839333"/>
+ <reference ref="138261120"/>
+ <reference ref="128352289"/>
+ <reference ref="57161931"/>
+ </object>
+ <reference key="parent" ref="10973343"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">300358</int>
+ <reference key="object" ref="290578835"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="399127858"/>
+ </object>
+ <reference key="parent" ref="184765684"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">300359</int>
+ <reference key="object" ref="657659108"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="259618205"/>
+ </object>
+ <reference key="parent" ref="184765684"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">300360</int>
+ <reference key="object" ref="259618205"/>
+ <reference key="parent" ref="657659108"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">300361</int>
+ <reference key="object" ref="399127858"/>
+ <reference key="parent" ref="290578835"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">300362</int>
+ <reference key="object" ref="992839333"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="959555182"/>
+ </object>
+ <reference key="parent" ref="184765684"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">300363</int>
+ <reference key="object" ref="959555182"/>
+ <reference key="parent" ref="992839333"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">300364</int>
+ <reference key="object" ref="138261120"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="183409141"/>
+ </object>
+ <reference key="parent" ref="184765684"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">300365</int>
+ <reference key="object" ref="183409141"/>
+ <reference key="parent" ref="138261120"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">300368</int>
+ <reference key="object" ref="128352289"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="556463187"/>
+ </object>
+ <reference key="parent" ref="184765684"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">300369</int>
+ <reference key="object" ref="556463187"/>
+ <reference key="parent" ref="128352289"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">300370</int>
+ <reference key="object" ref="57161931"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="989804990"/>
+ </object>
+ <reference key="parent" ref="184765684"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">300371</int>
+ <reference key="object" ref="989804990"/>
+ <reference key="parent" ref="57161931"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>-1.IBPluginDependency</string>
+ <string>-2.IBPluginDependency</string>
+ <string>-3.IBPluginDependency</string>
+ <string>-3.ImportedFromIB2</string>
+ <string>100295.IBShouldRemoveOnLegacySave</string>
+ <string>129.IBPluginDependency</string>
+ <string>129.ImportedFromIB2</string>
+ <string>130.IBPluginDependency</string>
+ <string>130.ImportedFromIB2</string>
+ <string>131.IBPluginDependency</string>
+ <string>131.ImportedFromIB2</string>
+ <string>134.IBPluginDependency</string>
+ <string>134.ImportedFromIB2</string>
+ <string>136.IBPluginDependency</string>
+ <string>136.ImportedFromIB2</string>
+ <string>143.IBPluginDependency</string>
+ <string>143.ImportedFromIB2</string>
+ <string>144.IBPluginDependency</string>
+ <string>144.ImportedFromIB2</string>
+ <string>145.IBPluginDependency</string>
+ <string>145.ImportedFromIB2</string>
+ <string>149.IBPluginDependency</string>
+ <string>149.ImportedFromIB2</string>
+ <string>150.IBPluginDependency</string>
+ <string>150.ImportedFromIB2</string>
+ <string>156.IBPluginDependency</string>
+ <string>156.ImportedFromIB2</string>
+ <string>157.IBPluginDependency</string>
+ <string>157.ImportedFromIB2</string>
+ <string>158.IBPluginDependency</string>
+ <string>158.ImportedFromIB2</string>
+ <string>160.IBPluginDependency</string>
+ <string>160.ImportedFromIB2</string>
+ <string>163.IBPluginDependency</string>
+ <string>163.ImportedFromIB2</string>
+ <string>164.IBPluginDependency</string>
+ <string>164.ImportedFromIB2</string>
+ <string>169.IBPluginDependency</string>
+ <string>169.ImportedFromIB2</string>
+ <string>169.editorWindowContentRectSynchronizationRect</string>
+ <string>171.IBPluginDependency</string>
+ <string>171.ImportedFromIB2</string>
+ <string>172.IBPluginDependency</string>
+ <string>172.ImportedFromIB2</string>
+ <string>173.IBPluginDependency</string>
+ <string>173.ImportedFromIB2</string>
+ <string>19.IBPluginDependency</string>
+ <string>19.ImportedFromIB2</string>
+ <string>196.IBPluginDependency</string>
+ <string>196.ImportedFromIB2</string>
+ <string>200295.IBShouldRemoveOnLegacySave</string>
+ <string>203.IBPluginDependency</string>
+ <string>203.ImportedFromIB2</string>
+ <string>204.IBPluginDependency</string>
+ <string>204.ImportedFromIB2</string>
+ <string>23.IBPluginDependency</string>
+ <string>23.ImportedFromIB2</string>
+ <string>24.IBPluginDependency</string>
+ <string>24.ImportedFromIB2</string>
+ <string>24.editorWindowContentRectSynchronizationRect</string>
+ <string>244.IBEditorWindowLastContentRect</string>
+ <string>244.IBPluginDependency</string>
+ <string>244.IBWindowTemplateEditedContentRect</string>
+ <string>244.ImportedFromIB2</string>
+ <string>244.editorWindowContentRectSynchronizationRect</string>
+ <string>244.lastResizeAction</string>
+ <string>244.windowTemplate.hasMaxSize</string>
+ <string>244.windowTemplate.hasMinSize</string>
+ <string>244.windowTemplate.maxSize</string>
+ <string>244.windowTemplate.minSize</string>
+ <string>245.IBPluginDependency</string>
+ <string>245.ImportedFromIB2</string>
+ <string>269.IBPluginDependency</string>
+ <string>269.ImportedFromIB2</string>
+ <string>270.IBPluginDependency</string>
+ <string>270.ImportedFromIB2</string>
+ <string>270.editorWindowContentRectSynchronizationRect</string>
+ <string>272.IBPluginDependency</string>
+ <string>272.ImportedFromIB2</string>
+ <string>285.IBEditorWindowLastContentRect</string>
+ <string>285.IBPluginDependency</string>
+ <string>285.IBViewEditorWindowController.showingBoundsRectangles</string>
+ <string>285.IBViewEditorWindowController.showingLayoutRectangles</string>
+ <string>285.IBWindowTemplateEditedContentRect</string>
+ <string>285.ImportedFromIB2</string>
+ <string>285.editorWindowContentRectSynchronizationRect</string>
+ <string>285.lastResizeAction</string>
+ <string>285.windowTemplate.hasMaxSize</string>
+ <string>285.windowTemplate.hasMinSize</string>
+ <string>285.windowTemplate.maxSize</string>
+ <string>285.windowTemplate.minSize</string>
+ <string>286.IBPluginDependency</string>
+ <string>286.ImportedFromIB2</string>
+ <string>29.IBEditorWindowLastContentRect</string>
+ <string>29.IBPluginDependency</string>
+ <string>29.ImportedFromIB2</string>
+ <string>29.editorWindowContentRectSynchronizationRect</string>
+ <string>291.IBPluginDependency</string>
+ <string>291.ImportedFromIB2</string>
+ <string>292.IBPluginDependency</string>
+ <string>292.ImportedFromIB2</string>
+ <string>293.IBPluginDependency</string>
+ <string>293.ImportedFromIB2</string>
+ <string>295.IBPluginDependency</string>
+ <string>295.ImportedFromIB2</string>
+ <string>296.IBPluginDependency</string>
+ <string>296.ImportedFromIB2</string>
+ <string>297.IBPluginDependency</string>
+ <string>297.ImportedFromIB2</string>
+ <string>298.IBPluginDependency</string>
+ <string>298.ImportedFromIB2</string>
+ <string>299.IBPluginDependency</string>
+ <string>299.ImportedFromIB2</string>
+ <string>300295.IBShouldRemoveOnLegacySave</string>
+ <string>300330.IBPluginDependency</string>
+ <string>300330.ImportedFromIB2</string>
+ <string>300337.IBPluginDependency</string>
+ <string>300337.ImportedFromIB2</string>
+ <string>300338.IBPluginDependency</string>
+ <string>300338.ImportedFromIB2</string>
+ <string>300358.IBPluginDependency</string>
+ <string>300358.ImportedFromIB2</string>
+ <string>300359.IBPluginDependency</string>
+ <string>300359.ImportedFromIB2</string>
+ <string>300362.IBPluginDependency</string>
+ <string>300362.ImportedFromIB2</string>
+ <string>300364.IBPluginDependency</string>
+ <string>300364.ImportedFromIB2</string>
+ <string>300368.IBPluginDependency</string>
+ <string>300368.ImportedFromIB2</string>
+ <string>300370.IBPluginDependency</string>
+ <string>300370.ImportedFromIB2</string>
+ <string>305.IBPluginDependency</string>
+ <string>305.ImportedFromIB2</string>
+ <string>310.IBPluginDependency</string>
+ <string>310.ImportedFromIB2</string>
+ <string>348.IBPluginDependency</string>
+ <string>348.ImportedFromIB2</string>
+ <string>349.IBPluginDependency</string>
+ <string>349.ImportedFromIB2</string>
+ <string>350.IBPluginDependency</string>
+ <string>350.ImportedFromIB2</string>
+ <string>351.IBPluginDependency</string>
+ <string>351.ImportedFromIB2</string>
+ <string>352.IBPluginDependency</string>
+ <string>352.ImportedFromIB2</string>
+ <string>353.IBPluginDependency</string>
+ <string>353.ImportedFromIB2</string>
+ <string>354.IBPluginDependency</string>
+ <string>354.ImportedFromIB2</string>
+ <string>363.IBPluginDependency</string>
+ <string>363.ImportedFromIB2</string>
+ <string>364.IBPluginDependency</string>
+ <string>364.ImportedFromIB2</string>
+ <string>365.IBPluginDependency</string>
+ <string>365.ImportedFromIB2</string>
+ <string>368.IBPluginDependency</string>
+ <string>368.ImportedFromIB2</string>
+ <string>369.IBPluginDependency</string>
+ <string>369.ImportedFromIB2</string>
+ <string>370.IBPluginDependency</string>
+ <string>370.ImportedFromIB2</string>
+ <string>371.IBPluginDependency</string>
+ <string>371.ImportedFromIB2</string>
+ <string>372.IBPluginDependency</string>
+ <string>372.ImportedFromIB2</string>
+ <string>374.IBPluginDependency</string>
+ <string>374.ImportedFromIB2</string>
+ <string>375.IBPluginDependency</string>
+ <string>375.ImportedFromIB2</string>
+ <string>376.IBPluginDependency</string>
+ <string>376.ImportedFromIB2</string>
+ <string>377.IBPluginDependency</string>
+ <string>377.ImportedFromIB2</string>
+ <string>379.IBPluginDependency</string>
+ <string>379.ImportedFromIB2</string>
+ <string>380.IBPluginDependency</string>
+ <string>380.ImportedFromIB2</string>
+ <string>381.IBPluginDependency</string>
+ <string>381.ImportedFromIB2</string>
+ <string>382.IBPluginDependency</string>
+ <string>382.ImportedFromIB2</string>
+ <string>383.IBPluginDependency</string>
+ <string>383.ImportedFromIB2</string>
+ <string>384.IBPluginDependency</string>
+ <string>384.ImportedFromIB2</string>
+ <string>385.IBPluginDependency</string>
+ <string>385.ImportedFromIB2</string>
+ <string>386.IBPluginDependency</string>
+ <string>386.ImportedFromIB2</string>
+ <string>419.IBPluginDependency</string>
+ <string>419.ImportedFromIB2</string>
+ <string>420.IBPluginDependency</string>
+ <string>420.ImportedFromIB2</string>
+ <string>421.IBPluginDependency</string>
+ <string>421.ImportedFromIB2</string>
+ <string>423.IBPluginDependency</string>
+ <string>423.ImportedFromIB2</string>
+ <string>435.IBPluginDependency</string>
+ <string>435.ImportedFromIB2</string>
+ <string>5.IBPluginDependency</string>
+ <string>5.ImportedFromIB2</string>
+ <string>524.IBPluginDependency</string>
+ <string>524.ImportedFromIB2</string>
+ <string>526.IBPluginDependency</string>
+ <string>526.ImportedFromIB2</string>
+ <string>527.IBPluginDependency</string>
+ <string>527.ImportedFromIB2</string>
+ <string>532.IBPluginDependency</string>
+ <string>532.ImportedFromIB2</string>
+ <string>533.IBPluginDependency</string>
+ <string>533.ImportedFromIB2</string>
+ <string>535.IBPluginDependency</string>
+ <string>535.ImportedFromIB2</string>
+ <string>536.IBPluginDependency</string>
+ <string>536.ImportedFromIB2</string>
+ <string>537.IBPluginDependency</string>
+ <string>537.ImportedFromIB2</string>
+ <string>538.IBPluginDependency</string>
+ <string>538.ImportedFromIB2</string>
+ <string>541.IBPluginDependency</string>
+ <string>541.ImportedFromIB2</string>
+ <string>543.IBPluginDependency</string>
+ <string>543.ImportedFromIB2</string>
+ <string>544.IBPluginDependency</string>
+ <string>544.ImportedFromIB2</string>
+ <string>545.IBPluginDependency</string>
+ <string>545.ImportedFromIB2</string>
+ <string>56.IBPluginDependency</string>
+ <string>56.ImportedFromIB2</string>
+ <string>57.IBEditorWindowLastContentRect</string>
+ <string>57.IBPluginDependency</string>
+ <string>57.ImportedFromIB2</string>
+ <string>57.editorWindowContentRectSynchronizationRect</string>
+ <string>573.IBPluginDependency</string>
+ <string>573.ImportedFromIB2</string>
+ <string>574.IBPluginDependency</string>
+ <string>574.ImportedFromIB2</string>
+ <string>575.IBPluginDependency</string>
+ <string>575.ImportedFromIB2</string>
+ <string>58.IBPluginDependency</string>
+ <string>58.ImportedFromIB2</string>
+ <string>92.IBPluginDependency</string>
+ <string>92.ImportedFromIB2</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1" id="9"/>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>{{202, 626}, {154, 153}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>{{271, 666}, {301, 153}}</string>
+ <string>{{313, 353}, {484, 280}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{313, 353}, {484, 280}}</string>
+ <reference ref="9"/>
+ <string>{{184, 290}, {481, 345}}</string>
+ <object class="NSDictionary">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>IBResizeActionFinalFrame</string>
+ <string>IBResizeActionInitialFrame</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>{{182, 481}, {484, 280}}</string>
+ <string>{{182, 103}, {536, 658}}</string>
+ </object>
+ </object>
+ <reference ref="9"/>
+ <reference ref="9"/>
+ <string>{3.40282e+38, 3.40282e+38}</string>
+ <string>{213, 107}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>{{100, 746}, {155, 33}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>{{407, 545}, {454, 311}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <reference ref="9"/>
+ <string>{{407, 545}, {454, 311}}</string>
+ <reference ref="9"/>
+ <string>{{433, 406}, {486, 327}}</string>
+ <object class="NSDictionary">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>IBResizeActionFinalFrame</string>
+ <string>IBResizeActionInitialFrame</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>{{537, 554}, {454, 311}}</string>
+ <string>{{537, 576}, {471, 289}}</string>
+ </object>
+ </object>
+ <integer value="0"/>
+ <reference ref="9"/>
+ <string>{3.40282e+38, 3.40282e+38}</string>
+ <string>{320, 240}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>{{0, 836}, {336, 20}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>{{67, 819}, {336, 20}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>{{12, 633}, {218, 203}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>{{79, 616}, {218, 203}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">300394</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">FirstResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBUserSource</string>
+ <string key="minorKey"/>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSFormatter</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBUserSource</string>
+ <string key="minorKey"/>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">X11Controller</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBUserSource</string>
+ <string key="minorKey"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.1+">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">X11Controller</string>
+ <string key="superclassName">NSObject</string>
+ <object class="NSMutableDictionary" key="actions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>apps_table_cancel:</string>
+ <string>apps_table_delete:</string>
+ <string>apps_table_done:</string>
+ <string>apps_table_duplicate:</string>
+ <string>apps_table_new:</string>
+ <string>apps_table_show:</string>
+ <string>bring_to_front:</string>
+ <string>close_window:</string>
+ <string>enable_fullscreen_changed:</string>
+ <string>minimize_window:</string>
+ <string>next_window:</string>
+ <string>prefs_changed:</string>
+ <string>prefs_show:</string>
+ <string>previous_window:</string>
+ <string>quit:</string>
+ <string>toggle_fullscreen:</string>
+ <string>x11_help:</string>
+ <string>zoom_window:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>apps_separator</string>
+ <string>apps_table</string>
+ <string>click_through</string>
+ <string>depth</string>
+ <string>dock_apps_menu</string>
+ <string>dock_menu</string>
+ <string>dock_window_separator</string>
+ <string>enable_auth</string>
+ <string>enable_fullscreen</string>
+ <string>enable_keyequivs</string>
+ <string>enable_tcp</string>
+ <string>fake_buttons</string>
+ <string>focus_follows_mouse</string>
+ <string>focus_on_new_window</string>
+ <string>prefs_panel</string>
+ <string>sync_keymap</string>
+ <string>toggle_fullscreen_item</string>
+ <string>use_sysbeep</string>
+ <string>window_separator</string>
+ <string>x11_about_item</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>NSMenuItem</string>
+ <string>NSTableView</string>
+ <string>NSButton</string>
+ <string>NSPopUpButton</string>
+ <string>NSMenu</string>
+ <string>NSMenu</string>
+ <string>NSMenuItem</string>
+ <string>NSButton</string>
+ <string>NSButton</string>
+ <string>NSButton</string>
+ <string>NSButton</string>
+ <string>NSButton</string>
+ <string>NSButton</string>
+ <string>NSButton</string>
+ <string>NSPanel</string>
+ <string>NSButton</string>
+ <string>NSMenuItem</string>
+ <string>NSButton</string>
+ <string>NSMenuItem</string>
+ <string>NSMenuItem</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBDocumentRelativeSource</string>
+ <string key="minorKey">../../X11Controller.h</string>
+ </object>
+ </object>
+ </object>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <nil key="IBDocument.LastKnownRelativeProjectPath"/>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ </data>
+</archive>
diff --git a/hw/xquartz/bundle/English.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/English.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..95420e4f7
--- /dev/null
+++ b/hw/xquartz/bundle/English.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/hw/xquartz/bundle/French.lproj/InfoPlist.strings b/hw/xquartz/bundle/French.lproj/InfoPlist.strings
new file mode 100644
index 000000000..88e1f04ac
--- /dev/null
+++ b/hw/xquartz/bundle/French.lproj/InfoPlist.strings
Binary files differ
diff --git a/hw/xquartz/bundle/French.lproj/Localizable.strings b/hw/xquartz/bundle/French.lproj/Localizable.strings
new file mode 100644
index 000000000..2770dfb8c
--- /dev/null
+++ b/hw/xquartz/bundle/French.lproj/Localizable.strings
Binary files differ
diff --git a/hw/xquartz/bundle/French.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/French.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..9f9a7da67
--- /dev/null
+++ b/hw/xquartz/bundle/French.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/hw/xquartz/bundle/German.lproj/InfoPlist.strings b/hw/xquartz/bundle/German.lproj/InfoPlist.strings
new file mode 100644
index 000000000..aa37e7555
--- /dev/null
+++ b/hw/xquartz/bundle/German.lproj/InfoPlist.strings
Binary files differ
diff --git a/hw/xquartz/bundle/German.lproj/Localizable.strings b/hw/xquartz/bundle/German.lproj/Localizable.strings
new file mode 100644
index 000000000..a5489ab5c
--- /dev/null
+++ b/hw/xquartz/bundle/German.lproj/Localizable.strings
Binary files differ
diff --git a/hw/xquartz/bundle/German.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/German.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..19532a9c2
--- /dev/null
+++ b/hw/xquartz/bundle/German.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/hw/xquartz/bundle/Info.plist b/hw/xquartz/bundle/Info.plist
new file mode 100644
index 000000000..4d1ae5405
--- /dev/null
+++ b/hw/xquartz/bundle/Info.plist
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>X11</string>
+ <key>CFBundleGetInfoString</key>
+ <string>X11</string>
+ <key>CFBundleIconFile</key>
+ <string>X11.icns</string>
+ <key>CFBundleIdentifier</key>
+ <string>org.x.X11</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>X11</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>2.2.1</string>
+ <key>CFBundleSignature</key>
+ <string>x11a</string>
+ <key>CSResourcesFileMapped</key>
+ <true/>
+ <key>NSHumanReadableCopyright</key>
+ <string>Copyright © 2003-2008, Apple Inc.
+Copyright © 2003, XFree86 Project, Inc.
+Copyright © 2003-2008, X.org Foundation, Inc.
+</string>
+ <key>NSMainNibFile</key>
+ <string>main</string>
+ <key>NSPrincipalClass</key>
+ <string>X11Application</string>
+ <key>LSBackgroundOnly</key>
+ <true/>
+</dict>
+</plist>
diff --git a/hw/xquartz/bundle/Italian.lproj/InfoPlist.strings b/hw/xquartz/bundle/Italian.lproj/InfoPlist.strings
new file mode 100644
index 000000000..412169880
--- /dev/null
+++ b/hw/xquartz/bundle/Italian.lproj/InfoPlist.strings
Binary files differ
diff --git a/hw/xquartz/bundle/Italian.lproj/Localizable.strings b/hw/xquartz/bundle/Italian.lproj/Localizable.strings
new file mode 100644
index 000000000..d05d73d44
--- /dev/null
+++ b/hw/xquartz/bundle/Italian.lproj/Localizable.strings
Binary files differ
diff --git a/hw/xquartz/bundle/Italian.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/Italian.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..b6e2e1bb1
--- /dev/null
+++ b/hw/xquartz/bundle/Italian.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/hw/xquartz/bundle/Japanese.lproj/InfoPlist.strings b/hw/xquartz/bundle/Japanese.lproj/InfoPlist.strings
new file mode 100644
index 000000000..2d6330fa7
--- /dev/null
+++ b/hw/xquartz/bundle/Japanese.lproj/InfoPlist.strings
Binary files differ
diff --git a/hw/xquartz/bundle/Japanese.lproj/Localizable.strings b/hw/xquartz/bundle/Japanese.lproj/Localizable.strings
new file mode 100644
index 000000000..99821ea1f
--- /dev/null
+++ b/hw/xquartz/bundle/Japanese.lproj/Localizable.strings
Binary files differ
diff --git a/hw/xquartz/bundle/Japanese.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/Japanese.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..523fd0856
--- /dev/null
+++ b/hw/xquartz/bundle/Japanese.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/hw/xquartz/bundle/Makefile.am b/hw/xquartz/bundle/Makefile.am
new file mode 100644
index 000000000..801fdc7d8
--- /dev/null
+++ b/hw/xquartz/bundle/Makefile.am
@@ -0,0 +1,77 @@
+bin_SCRIPTS = x11app
+
+.PHONY: x11app
+
+x11app:
+ xcodebuild CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ARCHS="$(X11APP_ARCHS)"
+
+install-data-hook:
+ xcodebuild install DSTROOT="/$(DESTDIR)" INSTALL_PATH="$(APPLE_APPLICATIONS_DIR)" DEPLOYMENT_LOCATION=YES SKIP_INSTALL=NO ARCHS="$(X11APP_ARCHS)"
+
+clean-local:
+ rm -rf build
+
+resourcedir=$(libdir)/X11/xserver
+resource_DATA = Xquartz.plist
+
+EXTRA_DIST = \
+ $(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
diff --git a/hw/xquartz/bundle/Spanish.lproj/InfoPlist.strings b/hw/xquartz/bundle/Spanish.lproj/InfoPlist.strings
new file mode 100644
index 000000000..0e4287d14
--- /dev/null
+++ b/hw/xquartz/bundle/Spanish.lproj/InfoPlist.strings
Binary files differ
diff --git a/hw/xquartz/bundle/Spanish.lproj/Localizable.strings b/hw/xquartz/bundle/Spanish.lproj/Localizable.strings
new file mode 100644
index 000000000..652f432a5
--- /dev/null
+++ b/hw/xquartz/bundle/Spanish.lproj/Localizable.strings
Binary files differ
diff --git a/hw/xquartz/bundle/Spanish.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/Spanish.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..029349dd0
--- /dev/null
+++ b/hw/xquartz/bundle/Spanish.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/hw/xquartz/bundle/X11.icns b/hw/xquartz/bundle/X11.icns
new file mode 100644
index 000000000..d770e617d
--- /dev/null
+++ b/hw/xquartz/bundle/X11.icns
Binary files differ
diff --git a/hw/xquartz/bundle/X11.xcodeproj/project.pbxproj b/hw/xquartz/bundle/X11.xcodeproj/project.pbxproj
new file mode 100644
index 000000000..ae8ec07e6
--- /dev/null
+++ b/hw/xquartz/bundle/X11.xcodeproj/project.pbxproj
@@ -0,0 +1,458 @@
+// !$*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 = "<group>"; };
+ 1870340FFE93FCAF11CA0CD7 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E460D1B6C05005958A5 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E470D1B6C05005958A5 /* Dutch */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Dutch; path = Dutch.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E480D1B6C05005958A5 /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E490D1B6C05005958A5 /* French */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = French; path = French.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E4A0D1B6C05005958A5 /* German */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = German; path = German.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E4B0D1B6C05005958A5 /* Italian */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Italian; path = Italian.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E4C0D1B6C05005958A5 /* Japanese */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Japanese; path = Japanese.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E4D0D1B6C05005958A5 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E4E0D1B6C05005958A5 /* no */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = no; path = no.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E4F0D1B6C05005958A5 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E500D1B6C05005958A5 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E510D1B6C05005958A5 /* pt_PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt_PT; path = pt_PT.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E520D1B6C05005958A5 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E530D1B6C05005958A5 /* Spanish */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Spanish; path = Spanish.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E540D1B6C05005958A5 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E550D1B6C05005958A5 /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh_CN; path = zh_CN.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E560D1B6C05005958A5 /* zh_TW */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh_TW; path = zh_TW.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E570D1B6C17005958A5 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E580D1B6C17005958A5 /* Dutch */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Dutch; path = Dutch.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E590D1B6C17005958A5 /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E5A0D1B6C17005958A5 /* French */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = French; path = French.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E5B0D1B6C17005958A5 /* German */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = German; path = German.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E5C0D1B6C17005958A5 /* Italian */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Italian; path = Italian.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E5D0D1B6C17005958A5 /* Japanese */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Japanese; path = Japanese.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E5E0D1B6C17005958A5 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E5F0D1B6C17005958A5 /* no */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = no; path = no.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E600D1B6C17005958A5 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E610D1B6C17005958A5 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E620D1B6C17005958A5 /* pt_PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt_PT; path = pt_PT.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E630D1B6C17005958A5 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E640D1B6C17005958A5 /* Spanish */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Spanish; path = Spanish.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E650D1B6C17005958A5 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E660D1B6C17005958A5 /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh_CN; path = zh_CN.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E670D1B6C17005958A5 /* zh_TW */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh_TW; path = zh_TW.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E680D1B6C34005958A5 /* da */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = da; path = da.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E690D1B6C34005958A5 /* Dutch */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Dutch; path = Dutch.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E6A0D1B6C34005958A5 /* fi */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = fi; path = fi.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E6B0D1B6C34005958A5 /* French */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = French; path = French.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E6C0D1B6C34005958A5 /* German */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = German; path = German.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E6D0D1B6C34005958A5 /* Italian */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Italian; path = Italian.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E6E0D1B6C34005958A5 /* Japanese */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Japanese; path = Japanese.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E6F0D1B6C34005958A5 /* ko */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = ko; path = ko.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E700D1B6C34005958A5 /* no */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = no; path = no.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E710D1B6C34005958A5 /* pl */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pl; path = pl.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E720D1B6C34005958A5 /* pt */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt; path = pt.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E730D1B6C34005958A5 /* pt_PT */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt_PT; path = pt_PT.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E740D1B6C34005958A5 /* ru */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = ru; path = ru.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E750D1B6C34005958A5 /* Spanish */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Spanish; path = Spanish.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E760D1B6C34005958A5 /* sv */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = sv; path = sv.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E770D1B6C34005958A5 /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = zh_CN; path = zh_CN.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E780D1B6C34005958A5 /* zh_TW */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = zh_TW; path = zh_TW.lproj/main.nib; sourceTree = "<group>"; };
+ 50459C5F038587C60ECA21EC /* X11.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = X11.icns; sourceTree = "<group>"; };
+ 50EE2AB703849F0B0ECA21EC /* bundle-main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = "bundle-main.c"; sourceTree = "<group>"; };
+ 50F4F0A7039D6ACA0E82C0CB /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
+ 527F24260B5D938C007840A7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Info.plist; sourceTree = "<group>"; };
+ 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 = "<group>"; };
+ 570C5748047186C400ACF82F /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = /System/Library/Frameworks/SystemConfiguration.framework; sourceTree = "<absolute>"; };
+/* 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 = "<group>";
+ };
+ 20286C29FDCF999611CA2CEA /* X11 */ = {
+ isa = PBXGroup;
+ children = (
+ 20286C2AFDCF999611CA2CEA /* Sources */,
+ 20286C2CFDCF999611CA2CEA /* Resources */,
+ 20286C32FDCF999611CA2CEA /* External Frameworks and Libraries */,
+ 195DF8CFFE9D517E11CA2CBB /* Products */,
+ 527F24260B5D938C007840A7 /* Info.plist */,
+ );
+ name = X11;
+ sourceTree = "<group>";
+ };
+ 20286C2AFDCF999611CA2CEA /* Sources */ = {
+ isa = PBXGroup;
+ children = (
+ 50EE2AB703849F0B0ECA21EC /* bundle-main.c */,
+ );
+ name = Sources;
+ sourceTree = "<group>";
+ };
+ 20286C2CFDCF999611CA2CEA /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 52D9C0EB0BCDDF6B00CD2AFC /* Localizable.strings */,
+ 50459C5F038587C60ECA21EC /* X11.icns */,
+ 0867D6AAFE840B52C02AAC07 /* InfoPlist.strings */,
+ 02345980000FD03B11CA0E72 /* main.nib */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+ 20286C32FDCF999611CA2CEA /* External Frameworks and Libraries */ = {
+ isa = PBXGroup;
+ children = (
+ 50F4F0A7039D6ACA0E82C0CB /* CoreFoundation.framework */,
+ 570C5748047186C400ACF82F /* SystemConfiguration.framework */,
+ );
+ name = "External Frameworks and Libraries";
+ sourceTree = "<group>";
+ };
+/* 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 = "<group>";
+ };
+ 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 = "<group>";
+ };
+ 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 = "<group>";
+ };
+/* 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/hw/xquartz/bundle/Xquartz.plist b/hw/xquartz/bundle/Xquartz.plist
new file mode 100644
index 000000000..e15704516
--- /dev/null
+++ b/hw/xquartz/bundle/Xquartz.plist
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+
+<!-- This file contains system-wide defaults for the Apple X11 server -->
+
+<plist version="1.0">
+<dict>
+ <key>apps_menu</key>
+ <array>
+ <array>
+ <string>Terminal</string>
+ <string>xterm</string>
+ <string>n</string>
+ </array>
+ <array>
+ <string>xman</string>
+ <string>xman</string>
+ <string></string>
+ </array>
+ <array>
+ <string>xlogo</string>
+ <string>xlogo</string>
+ <string></string>
+ </array>
+ </array>
+</dict>
+</plist>
diff --git a/hw/xquartz/bundle/bundle-main.c b/hw/xquartz/bundle/bundle-main.c
new file mode 100644
index 000000000..e97770a55
--- /dev/null
+++ b/hw/xquartz/bundle/bundle-main.c
@@ -0,0 +1,136 @@
+/* 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 <X11/Xlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <CoreFoundation/CoreFoundation.h>
+
+#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/hw/xquartz/bundle/da.lproj/InfoPlist.strings b/hw/xquartz/bundle/da.lproj/InfoPlist.strings
new file mode 100644
index 000000000..88e1f04ac
--- /dev/null
+++ b/hw/xquartz/bundle/da.lproj/InfoPlist.strings
Binary files differ
diff --git a/hw/xquartz/bundle/da.lproj/Localizable.strings b/hw/xquartz/bundle/da.lproj/Localizable.strings
new file mode 100644
index 000000000..9608a2e6b
--- /dev/null
+++ b/hw/xquartz/bundle/da.lproj/Localizable.strings
Binary files differ
diff --git a/hw/xquartz/bundle/da.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/da.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..4a2bd4bde
--- /dev/null
+++ b/hw/xquartz/bundle/da.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/hw/xquartz/bundle/fi.lproj/InfoPlist.strings b/hw/xquartz/bundle/fi.lproj/InfoPlist.strings
new file mode 100644
index 000000000..8e4f6474f
--- /dev/null
+++ b/hw/xquartz/bundle/fi.lproj/InfoPlist.strings
Binary files differ
diff --git a/hw/xquartz/bundle/fi.lproj/Localizable.strings b/hw/xquartz/bundle/fi.lproj/Localizable.strings
new file mode 100644
index 000000000..e8420fbaa
--- /dev/null
+++ b/hw/xquartz/bundle/fi.lproj/Localizable.strings
Binary files differ
diff --git a/hw/xquartz/bundle/fi.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/fi.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..b5039fd44
--- /dev/null
+++ b/hw/xquartz/bundle/fi.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/hw/xquartz/bundle/ko.lproj/InfoPlist.strings b/hw/xquartz/bundle/ko.lproj/InfoPlist.strings
new file mode 100644
index 000000000..4c738f8b2
--- /dev/null
+++ b/hw/xquartz/bundle/ko.lproj/InfoPlist.strings
Binary files differ
diff --git a/hw/xquartz/bundle/ko.lproj/Localizable.strings b/hw/xquartz/bundle/ko.lproj/Localizable.strings
new file mode 100644
index 000000000..56a335859
--- /dev/null
+++ b/hw/xquartz/bundle/ko.lproj/Localizable.strings
Binary files differ
diff --git a/hw/xquartz/bundle/ko.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/ko.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..925945c4d
--- /dev/null
+++ b/hw/xquartz/bundle/ko.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/hw/xquartz/bundle/no.lproj/InfoPlist.strings b/hw/xquartz/bundle/no.lproj/InfoPlist.strings
new file mode 100644
index 000000000..eb1cfb002
--- /dev/null
+++ b/hw/xquartz/bundle/no.lproj/InfoPlist.strings
Binary files differ
diff --git a/hw/xquartz/bundle/no.lproj/Localizable.strings b/hw/xquartz/bundle/no.lproj/Localizable.strings
new file mode 100644
index 000000000..5157a67de
--- /dev/null
+++ b/hw/xquartz/bundle/no.lproj/Localizable.strings
Binary files differ
diff --git a/hw/xquartz/bundle/no.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/no.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..ca25327f5
--- /dev/null
+++ b/hw/xquartz/bundle/no.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/hw/xquartz/bundle/pl.lproj/InfoPlist.strings b/hw/xquartz/bundle/pl.lproj/InfoPlist.strings
new file mode 100644
index 000000000..b9c950214
--- /dev/null
+++ b/hw/xquartz/bundle/pl.lproj/InfoPlist.strings
Binary files differ
diff --git a/hw/xquartz/bundle/pl.lproj/Localizable.strings b/hw/xquartz/bundle/pl.lproj/Localizable.strings
new file mode 100644
index 000000000..4ae12d77f
--- /dev/null
+++ b/hw/xquartz/bundle/pl.lproj/Localizable.strings
Binary files differ
diff --git a/hw/xquartz/bundle/pl.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/pl.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..e9ca5404b
--- /dev/null
+++ b/hw/xquartz/bundle/pl.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/hw/xquartz/bundle/pt.lproj/InfoPlist.strings b/hw/xquartz/bundle/pt.lproj/InfoPlist.strings
new file mode 100644
index 000000000..33c637448
--- /dev/null
+++ b/hw/xquartz/bundle/pt.lproj/InfoPlist.strings
Binary files differ
diff --git a/hw/xquartz/bundle/pt.lproj/Localizable.strings b/hw/xquartz/bundle/pt.lproj/Localizable.strings
new file mode 100644
index 000000000..23ea96847
--- /dev/null
+++ b/hw/xquartz/bundle/pt.lproj/Localizable.strings
Binary files differ
diff --git a/hw/xquartz/bundle/pt.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/pt.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..e88cccdba
--- /dev/null
+++ b/hw/xquartz/bundle/pt.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/hw/xquartz/bundle/pt_PT.lproj/InfoPlist.strings b/hw/xquartz/bundle/pt_PT.lproj/InfoPlist.strings
new file mode 100644
index 000000000..33c637448
--- /dev/null
+++ b/hw/xquartz/bundle/pt_PT.lproj/InfoPlist.strings
Binary files differ
diff --git a/hw/xquartz/bundle/pt_PT.lproj/Localizable.strings b/hw/xquartz/bundle/pt_PT.lproj/Localizable.strings
new file mode 100644
index 000000000..71c33ad14
--- /dev/null
+++ b/hw/xquartz/bundle/pt_PT.lproj/Localizable.strings
Binary files differ
diff --git a/hw/xquartz/bundle/pt_PT.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/pt_PT.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..a61933475
--- /dev/null
+++ b/hw/xquartz/bundle/pt_PT.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/hw/xquartz/bundle/ru.lproj/InfoPlist.strings b/hw/xquartz/bundle/ru.lproj/InfoPlist.strings
new file mode 100644
index 000000000..7f722e4b6
--- /dev/null
+++ b/hw/xquartz/bundle/ru.lproj/InfoPlist.strings
Binary files differ
diff --git a/hw/xquartz/bundle/ru.lproj/Localizable.strings b/hw/xquartz/bundle/ru.lproj/Localizable.strings
new file mode 100644
index 000000000..3b3811234
--- /dev/null
+++ b/hw/xquartz/bundle/ru.lproj/Localizable.strings
Binary files differ
diff --git a/hw/xquartz/bundle/ru.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/ru.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..9354e0264
--- /dev/null
+++ b/hw/xquartz/bundle/ru.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/hw/xquartz/bundle/sv.lproj/InfoPlist.strings b/hw/xquartz/bundle/sv.lproj/InfoPlist.strings
new file mode 100644
index 000000000..655d5ff63
--- /dev/null
+++ b/hw/xquartz/bundle/sv.lproj/InfoPlist.strings
Binary files differ
diff --git a/hw/xquartz/bundle/sv.lproj/Localizable.strings b/hw/xquartz/bundle/sv.lproj/Localizable.strings
new file mode 100644
index 000000000..796f06c21
--- /dev/null
+++ b/hw/xquartz/bundle/sv.lproj/Localizable.strings
Binary files differ
diff --git a/hw/xquartz/bundle/sv.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/sv.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..bd01c2dac
--- /dev/null
+++ b/hw/xquartz/bundle/sv.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/hw/xquartz/bundle/zh_CN.lproj/InfoPlist.strings b/hw/xquartz/bundle/zh_CN.lproj/InfoPlist.strings
new file mode 100644
index 000000000..b5df36885
--- /dev/null
+++ b/hw/xquartz/bundle/zh_CN.lproj/InfoPlist.strings
Binary files differ
diff --git a/hw/xquartz/bundle/zh_CN.lproj/Localizable.strings b/hw/xquartz/bundle/zh_CN.lproj/Localizable.strings
new file mode 100644
index 000000000..f88a6da4b
--- /dev/null
+++ b/hw/xquartz/bundle/zh_CN.lproj/Localizable.strings
Binary files differ
diff --git a/hw/xquartz/bundle/zh_CN.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/zh_CN.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..e36c15fb6
--- /dev/null
+++ b/hw/xquartz/bundle/zh_CN.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/hw/xquartz/bundle/zh_TW.lproj/InfoPlist.strings b/hw/xquartz/bundle/zh_TW.lproj/InfoPlist.strings
new file mode 100644
index 000000000..92d5473b0
--- /dev/null
+++ b/hw/xquartz/bundle/zh_TW.lproj/InfoPlist.strings
Binary files differ
diff --git a/hw/xquartz/bundle/zh_TW.lproj/Localizable.strings b/hw/xquartz/bundle/zh_TW.lproj/Localizable.strings
new file mode 100644
index 000000000..f009302c2
--- /dev/null
+++ b/hw/xquartz/bundle/zh_TW.lproj/Localizable.strings
Binary files differ
diff --git a/hw/xquartz/bundle/zh_TW.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/zh_TW.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..36602c53e
--- /dev/null
+++ b/hw/xquartz/bundle/zh_TW.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/hw/darwin/darwin.c b/hw/xquartz/darwin.c
index bd9998976..e4d440826 100644
--- a/hw/darwin/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -3,9 +3,8 @@
* Shared code for the Darwin X Server
* running with Quartz or IOKit display mode
*
- **************************************************************/
-/*
* 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"),
@@ -30,6 +29,10 @@
* use or other dealings in this Software without prior written authorization.
*/
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
#include <X11/X.h>
#include <X11/Xproto.h>
#include "os.h"
@@ -42,8 +45,6 @@
#include "fb.h" // fb framebuffer code
#include "site.h"
#include "globals.h"
-#include "xorgVersion.h"
-#include "xf86Date.h"
#include "dix.h"
#ifdef XINPUT
@@ -68,8 +69,20 @@
#include <IOKit/hidsystem/IOHIDLib.h>
#include <IOKit/hidsystem/ev_keymap.h>
+#ifdef MITSHM
+#define _XSHM_SERVER_
+#include <X11/extensions/XShm.h>
+#endif
+
#include "darwin.h"
-#include "darwinClut8.h"
+#include "darwinEvents.h"
+#include "darwinKeyboard.h"
+#include "quartz.h"
+//#include "darwinClut8.h"
+
+#ifdef ENABLE_DEBUG_LOG
+FILE *debug_log_fp = NULL;
+#endif
/*
* X server shared global variables
@@ -79,7 +92,7 @@ int darwinScreenIndex = 0;
io_connect_t darwinParamConnect = 0;
int darwinEventReadFD = -1;
int darwinEventWriteFD = -1;
-int darwinMouseAccelChange = 1;
+// int darwinMouseAccelChange = 1;
int darwinFakeButtons = 0;
// location of X11's (0,0) point in global screen coordinates
@@ -92,11 +105,10 @@ int darwinDesiredDepth = -1;
int darwinDesiredRefresh = -1;
char *darwinKeymapFile = "USA.keymapping";
int darwinSyncKeymap = FALSE;
-int darwinSwapAltMeta = FALSE;
// modifier masks for faking mouse buttons
-int darwinFakeMouse2Mask = NX_COMMANDMASK;
-int darwinFakeMouse3Mask = NX_ALTERNATEMASK;
+int darwinFakeMouse2Mask = NX_ALTERNATEMASK;
+int darwinFakeMouse3Mask = NX_COMMANDMASK;
// devices
DeviceIntPtr darwinPointer = NULL;
@@ -123,80 +135,26 @@ const int NUMFORMATS = sizeof(formats)/sizeof(formats[0]);
#ifndef PRE_RELEASE
#define PRE_RELEASE XORG_VERSION_SNAP
#endif
-
-void
-DarwinPrintBanner()
-{
-#if PRE_RELEASE
- ErrorF("\n"
- "This is a pre-release version of the " XVENDORNAME " X11.\n"
- "Portions of this release are based on XFree86 4.4RC2 and selected\n"
- "files from XFree86 4.4RC3. It is not supported in any way.\n"
- "Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.\n"
- "Select the \"xorg\" product for bugs you find in this release.\n"
- "Before reporting bugs in pre-release versions please check the\n"
- "latest version in the " XVENDORNAME " \"monolithic tree\" CVS\n"
- "repository hosted at http://www.freedesktop.org/Software/xorg/");
+#ifndef BUILD_DATE
+#define BUILD_DATE ""
#endif
-#if XORG_VERSION_SNAP > 0
- ErrorF(".%d", XORG_VERSION_SNAP);
+#ifndef XSERVER_VERSION
+#define XSERVER_VERSION "?"
#endif
-#if XORG_VERSION_SNAP >= 900
- ErrorF(" (%d.%d.0 RC %d)", XORG_VERSION_MAJOR, XORG_VERSION_MINOR + 1,
- XORG_VERSION_SNAP - 900);
-#endif
+const char *__crashreporter_info__ = "X.Org X Server " XSERVER_VERSION "Build Date: " BUILD_DATE;
-#ifdef XORG_CUSTOM_VERSION
- ErrorF(" (%s)", XF86_CUSTOM_VERSION);
-#endif
- ErrorF("\nRelease Date: %s\n", XF86_DATE);
- ErrorF("X Protocol Version %d, Revision %d, %s\n",
- X_PROTOCOL, X_PROTOCOL_REVISION, XORG_RELEASE );
- ErrorF("Build Operating System: %s %s\n", OSNAME, OSVENDOR);
-#ifdef HAS_UTSNAME
- {
- struct utsname name;
-
- if (uname(&name) == 0) {
- ErrorF("Current Operating System: %s %s %s %s %s\n",
- name.sysname, name.nodename, name.release, name.version, name.machine);
- }
- }
-#endif
-#if defined(BUILD_DATE) && (BUILD_DATE > 19000000)
- {
- struct tm t;
- char buf[100];
-
- bzero(&t, sizeof(t));
- bzero(buf, sizeof(buf));
- t.tm_mday = BUILD_DATE % 100;
- t.tm_mon = (BUILD_DATE / 100) % 100 - 1;
- t.tm_year = BUILD_DATE / 10000 - 1900;
- if (strftime(buf, sizeof(buf), "%d %B %Y", &t))
- ErrorF("Build Date: %s\n", buf);
- }
-#endif
-#if defined(CLOG_DATE) && (CLOG_DATE > 19000000)
- {
- struct tm t;
- char buf[100];
-
- bzero(&t, sizeof(t));
- bzero(buf, sizeof(buf));
- t.tm_mday = CLOG_DATE % 100;
- t.tm_mon = (CLOG_DATE / 100) % 100 - 1;
- t.tm_year = CLOG_DATE / 10000 - 1900;
- if (strftime(buf, sizeof(buf), "%d %B %Y", &t))
- ErrorF("Changelog Date: %s\n", buf);
- }
-#endif
-#if defined(BUILDERSTRING)
- ErrorF("%s \n",BUILDERSTRING);
-#endif
- ErrorF("\tBefore reporting problems, check "__VENDORDWEBSUPPORT__"\n"
- "\tto make sure that you have the latest version.\n");
+void DDXRingBell(int volume, int pitch, int duration) {
+ // FIXME -- make some noise, yo
+}
+
+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("X.Org X Server %s\nBuild Date: %s\n", XSERVER_VERSION, BUILD_DATE );
}
@@ -220,17 +178,10 @@ static Bool DarwinSaveScreen(ScreenPtr pScreen, int on)
* This is a callback from dix during AddScreen() from InitOutput().
* Initialize the screen and communicate information about it back to dix.
*/
-static Bool DarwinAddScreen(
- int index,
- ScreenPtr pScreen,
- int argc,
- char **argv )
-{
- int bitsPerRGB, i, dpi;
+static Bool DarwinAddScreen(int index, ScreenPtr pScreen, int argc, char **argv) {
+ int dpi;
static int foundIndex = 0;
Bool ret;
- VisualPtr visual;
- ColormapPtr pmap;
DarwinFramebufferPtr dfb;
// reset index of found screens for each server generation
@@ -238,36 +189,23 @@ static Bool DarwinAddScreen(
// allocate space for private per screen storage
dfb = xalloc(sizeof(DarwinFramebufferRec));
- SCREEN_PRIV(pScreen) = dfb;
+
+ // SCREEN_PRIV(pScreen) = dfb;
+ pScreen->devPrivates[darwinScreenIndex].ptr = dfb;
// setup hardware/mode specific details
- ret = DarwinModeAddScreen(foundIndex, pScreen);
+ ret = QuartzAddScreen(foundIndex, pScreen);
foundIndex++;
if (! ret)
return FALSE;
- bitsPerRGB = dfb->bitsPerComponent;
-
// reset the visual list
miClearVisualTypes();
// setup a single visual appropriate for our pixel type
- if (dfb->colorType == TrueColor) {
- if (!miSetVisualTypes( dfb->colorBitsPerPixel, TrueColorMask,
- bitsPerRGB, TrueColor )) {
- return FALSE;
- }
- } else if (dfb->colorType == PseudoColor) {
- if (!miSetVisualTypes( dfb->colorBitsPerPixel, PseudoColorMask,
- bitsPerRGB, PseudoColor )) {
- return FALSE;
- }
- } else if (dfb->colorType == StaticColor) {
- if (!miSetVisualTypes( dfb->colorBitsPerPixel, StaticColorMask,
- bitsPerRGB, StaticColor )) {
- return FALSE;
- }
- } else {
+ if(!miSetVisualTypesAndMasks(dfb->depth, dfb->visuals, dfb->bitsPerRGB,
+ dfb->preferredCVC, dfb->redMask,
+ dfb->greenMask, dfb->blueMask)) {
return FALSE;
}
@@ -291,20 +229,28 @@ static Bool DarwinAddScreen(
return FALSE;
}
+// ErrorF("Screen type: %d, %d=%d, %d=%d, %d=%d, %x=%x=%x, %x=%x=%x, %x=%x=%x\n", pScreen->visuals->class,
+// pScreen->visuals->offsetRed, dfb->bitsPerRGB * 2,
+// pScreen->visuals->offsetGreen, dfb->bitsPerRGB,
+// pScreen->visuals->offsetBlue, 0,
+// pScreen->visuals->redMask, dfb->redMask, ((1<<dfb->bitsPerRGB)-1) << pScreen->visuals->offsetRed,
+// pScreen->visuals->greenMask, dfb->greenMask, ((1<<dfb->bitsPerRGB)-1) << pScreen->visuals->offsetGreen,
+// pScreen->visuals->blueMask, dfb->blueMask, ((1<<dfb->bitsPerRGB)-1) << pScreen->visuals->offsetBlue);
+
// set the RGB order correctly for TrueColor
- if (dfb->bitsPerPixel > 8) {
- for (i = 0, visual = pScreen->visuals; // someday we may have more than 1
- i < pScreen->numVisuals; i++, visual++) {
- if (visual->class == TrueColor) {
- visual->offsetRed = bitsPerRGB * 2;
- visual->offsetGreen = bitsPerRGB;
- visual->offsetBlue = 0;
- visual->redMask = ((1<<bitsPerRGB)-1) << visual->offsetRed;
- visual->greenMask = ((1<<bitsPerRGB)-1) << visual->offsetGreen;
- visual->blueMask = ((1<<bitsPerRGB)-1) << visual->offsetBlue;
- }
- }
- }
+// if (dfb->bitsPerPixel > 8) {
+// for (i = 0, visual = pScreen->visuals; // someday we may have more than 1
+// i < pScreen->numVisuals; i++, visual++) {
+// if (visual->class == TrueColor) {
+// visual->offsetRed = bitsPerRGB * 2;
+// visual->offsetGreen = bitsPerRGB;
+// visual->offsetBlue = 0;
+// visual->redMask = ((1<<bitsPerRGB)-1) << visual->offsetRed;
+// visual->greenMask = ((1<<bitsPerRGB)-1) << visual->offsetGreen;
+// visual->blueMask = ((1<<bitsPerRGB)-1) << visual->offsetBlue;
+// }
+// }
+// }
#ifdef RENDER
if (! fbPictureInit(pScreen, 0, 0)) {
@@ -320,7 +266,7 @@ static Bool DarwinAddScreen(
pScreen->SaveScreen = DarwinSaveScreen;
// finish mode dependent screen setup including cursor support
- if (!DarwinModeSetupScreen(index, pScreen)) {
+ if (!QuartzSetupScreen(index, pScreen)) {
return FALSE;
}
@@ -334,23 +280,22 @@ static Bool DarwinAddScreen(
* mode and we're using a fixed color map. Essentially this translates
* to Darwin/x86 in 8-bit mode.
*/
- if( (dfb->colorBitsPerPixel == 8) &&
- (dfb->colorType == StaticColor) )
- {
- pmap = miInstalledMaps[pScreen->myNum];
- visual = pmap->pVisual;
- for( i = 0; i < visual->ColormapEntries; i++ ) {
- pmap->red[i].co.local.red = darwinClut8[i].red;
- pmap->red[i].co.local.green = darwinClut8[i].green;
- pmap->red[i].co.local.blue = darwinClut8[i].blue;
- }
- }
+// if(dfb->depth == 8) {
+// ColormapPtr map = RootlessGetColormap (pScreen);
+// for( i = 0; i < map->pVisual->ColormapEntries; i++ ) {
+// Entry *ent = map->red + i;
+// ErrorF("Setting lo %d -> r: %04x g: %04x b: %04x\n", i, darwinClut8[i].red, darwinClut8[i].green, darwinClut8[i].blue);
+// ent->co.local.red = darwinClut8[i].red;
+// ent->co.local.green = darwinClut8[i].green;
+// ent->co.local.blue = darwinClut8[i].blue;
+// }
+// }
dixScreenOrigins[index].x = dfb->x;
dixScreenOrigins[index].y = dfb->y;
- ErrorF("Screen %d added: %dx%d @ (%d,%d)\n",
- index, dfb->width, dfb->height, dfb->x, dfb->y);
+ /* ErrorF("Screen %d added: %dx%d @ (%d,%d)\n",
+ index, dfb->width, dfb->height, dfb->x, dfb->y); */
return TRUE;
}
@@ -363,6 +308,7 @@ static Bool DarwinAddScreen(
=============================================================================
*/
+#if 0
/*
* DarwinChangePointerControl
* Set mouse acceleration and thresholding
@@ -383,7 +329,7 @@ static void DarwinChangePointerControl(
if (kr != KERN_SUCCESS)
ErrorF( "Could not set mouse acceleration with kernel return = 0x%x.\n", kr );
}
-
+#endif
/*
* DarwinMouseProc
@@ -393,7 +339,7 @@ static int DarwinMouseProc(
DeviceIntPtr pPointer,
int what )
{
- char map[6];
+ CARD8 map[6];
switch (what) {
@@ -410,7 +356,7 @@ static int DarwinMouseProc(
map,
5, // numbuttons (4 & 5 are scroll wheel)
miPointerGetMotionEvents,
- DarwinChangePointerControl,
+ (PtrCtrlProcPtr)NoopDDA,
0 );
#ifdef XINPUT
InitValuatorAxisStruct( pPointer,
@@ -421,7 +367,7 @@ static int DarwinMouseProc(
1, // min resolution
1 ); // max resolution
InitValuatorAxisStruct( pPointer,
- 1, // X axis
+ 1, // Y axis
0, // min value
16000, // max value (fixme screen size?)
1, // resolution (fixme ?)
@@ -585,7 +531,7 @@ void InitInput( int argc, char **argv )
DarwinEQInit( (DevicePtr)darwinKeyboard, (DevicePtr)darwinPointer );
- DarwinModeInitInput(argc, argv);
+ QuartzInitInput(argc, argv);
}
@@ -614,8 +560,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;
@@ -624,17 +569,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);
}
}
}
@@ -675,7 +623,7 @@ void InitOutput( ScreenInfo *pScreenInfo, int argc, char **argv )
}
// Discover screens and do mode specific initialization
- DarwinModeInitOutput(argc, argv);
+ QuartzInitOutput(argc, argv);
// Add screens
for (i = 0; i < darwinScreensFound; i++) {
@@ -703,7 +651,22 @@ void OsVendorInit(void)
{
if (serverGeneration == 1) {
DarwinPrintBanner();
+#ifdef ENABLE_DEBUG_LOG
+ {
+ char *home_dir=NULL, *log_file_path=NULL;
+ home_dir = getenv("HOME");
+ if (home_dir) asprintf(&log_file_path, "%s/%s", home_dir, DEBUG_LOG_NAME);
+ if (log_file_path) {
+ if (!access(log_file_path, F_OK)) {
+ debug_log_fp = fopen(log_file_path, "a");
+ if (debug_log_fp) ErrorF("Debug logging enabled to %s\n", log_file_path);
+ }
+ free(log_file_path);
+ }
+ }
+#endif
}
+ // DEBUG_LOG("Xquartz started at %s\n", ctime(time(NULL)));
// Find the full path to the keymapping file.
if ( darwinKeymapFile ) {
@@ -715,10 +678,6 @@ void OsVendorInit(void)
}
darwinKeymapFile = tempStr;
}
-
- if ( !darwinKeymapFile ) {
- ErrorF("Reading keymap from the system.\n");
- }
}
@@ -739,10 +698,25 @@ void ddxInitGlobals(void)
*/
int ddxProcessArgument( int argc, char *argv[], int i )
{
- int numDone;
+ if( !strcmp( argv[i], "-launchd" ) ) {
+ ErrorF( "Launchd command line argument noticed.\n" );
+ return 1;
+ }
- if ((numDone = DarwinModeProcessArgument( argc, argv, i )))
- return numDone;
+ if ( !strcmp( argv[i], "-fullscreen" ) ) {
+ ErrorF( "Running full screen in parallel with Mac OS X Quartz window server.\n" );
+ return 1;
+ }
+
+ if ( !strcmp( argv[i], "-rootless" ) ) {
+ ErrorF( "Running rootless inside Mac OS X window server.\n" );
+ return 1;
+ }
+
+ // This command line arg is passed when launched from the Aqua GUI.
+ if ( !strncmp( argv[i], "-psn_", 5 ) ) {
+ return 1;
+ }
if ( !strcmp( argv[i], "-fakebuttons" ) ) {
darwinFakeButtons = TRUE;
@@ -782,11 +756,6 @@ int ddxProcessArgument( int argc, char *argv[], int i )
return 2;
}
- if ( !strcmp( argv[i], "-swapAltMeta" ) ) {
- darwinSwapAltMeta = 1;
- return 1;
- }
-
if ( !strcmp( argv[i], "-keymap" ) ) {
if ( i == argc-1 ) {
FatalError( "-keymap must be followed by a filename\n" );
@@ -826,24 +795,21 @@ int ddxProcessArgument( int argc, char *argv[], int i )
}
if ( !strcmp( argv[i], "-depth" ) ) {
- int bitDepth;
-
if ( i == argc-1 ) {
FatalError( "-depth must be followed by a number\n" );
}
#ifdef OLD_POWERBOOK_G3
ErrorF( "Ignoring unsupported -depth option on old PowerBook G3\n");
#else
- bitDepth = atoi( argv[i+1] );
- if (bitDepth == 8)
- darwinDesiredDepth = 0;
- else if (bitDepth == 15)
- darwinDesiredDepth = 1;
- else if (bitDepth == 24)
- darwinDesiredDepth = 2;
- else
+ darwinDesiredDepth = atoi( argv[i+1] );
+ if(darwinDesiredDepth != -1 &&
+ darwinDesiredDepth != 8 &&
+ darwinDesiredDepth != 15 &&
+ darwinDesiredDepth != 24) {
FatalError( "Unsupported pixel depth. Use 8, 15, or 24 bits\n" );
- ErrorF( "Attempting to use pixel depth of %i\n", bitDepth );
+ }
+
+ ErrorF( "Attempting to use pixel depth of %i\n", darwinDesiredDepth );
#endif
return 2;
}
@@ -866,7 +832,7 @@ int ddxProcessArgument( int argc, char *argv[], int i )
exit(0);
}
- // XDarwinStartup uses this argument to indicate the IOKit X server
+ // XquartzStartup uses this argument to indicate the IOKit X server
// should be started. Ignore it here.
if ( !strcmp( argv[i], "-iokit" ) ) {
return 1;
@@ -895,14 +861,11 @@ void ddxUseMsg( void )
ErrorF("-keymap <file> : read the keymapping from a file instead of the kernel.\n");
ErrorF("-version : show the server version.\n");
ErrorF("\n");
-#ifdef DARWIN_WITH_QUARTZ
- ErrorF("Quartz modes:\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("-quartz : use default Mac OS X window server mode\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");
-#endif
ErrorF("-size <height> <width> : use a screen resolution of <height> x <width>.\n");
ErrorF("-depth <8,15,24> : use this bit depth.\n");
ErrorF("-refresh <rate> : use a monitor refresh rate of <rate> Hz.\n");
@@ -916,9 +879,10 @@ void ddxUseMsg( void )
*/
void ddxGiveUp( void )
{
- ErrorF( "Quitting XDarwin...\n" );
+ ErrorF( "Quitting Xquartz...\n" );
- DarwinModeGiveUp();
+ //if (!quartzRootless)
+ // quartzProcs->ReleaseScreens();
}
@@ -939,7 +903,6 @@ void AbortDDX( void )
}
-#ifdef DPMSExtension
/*
* DPMS extension stubs
*/
@@ -956,8 +919,6 @@ int DPMSGet(int *level)
{
return -1;
}
-#endif
-
#include "mivalidate.h" // for union _Validate used by windowstr.h
#include "windowstr.h" // for struct _Window
diff --git a/hw/darwin/darwin.h b/hw/xquartz/darwin.h
index cd572258c..105d68eea 100644
--- a/hw/darwin/darwin.h
+++ b/hw/xquartz/darwin.h
@@ -31,6 +31,7 @@
#include "inputstr.h"
#include "scrnintstr.h"
#include <X11/extensions/XKB.h>
+#include <assert.h>
typedef struct {
void *framebuffer;
@@ -39,57 +40,25 @@ typedef struct {
int width;
int height;
int pitch;
- int colorType;
+ int depth;
+ int visuals;
+ int bitsPerRGB;
int bitsPerPixel;
- int colorBitsPerPixel;
- int bitsPerComponent;
+ int preferredCVC;
+ Pixel redMask;
+ Pixel greenMask;
+ Pixel blueMask;
} DarwinFramebufferRec, *DarwinFramebufferPtr;
-
// From darwin.c
-void DarwinPrintBanner();
+void DarwinPrintBanner(void);
int DarwinParseModifierList(const char *constmodifiers);
void DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo);
void xf86SetRootClip (ScreenPtr pScreen, BOOL enable);
-// From darwinEvents.c
-Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr);
-void DarwinEQEnqueue(const xEvent *e);
-void DarwinEQPointerPost(xEvent *e);
-void DarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX);
-
-// From darwinKeyboard.c
-int DarwinModifierNXKeyToNXKeycode(int key, int side);
-void DarwinKeyboardInit(DeviceIntPtr pDev);
-int DarwinModifierNXKeycodeToNXKey(unsigned char keycode, int *outSide);
-int DarwinModifierNXKeyToNXMask(int key);
-int DarwinModifierNXMaskToNXKey(int mask);
-int DarwinModifierStringToNXKey(const char *string);
-
-// Mode specific functions
-Bool DarwinModeAddScreen(int index, ScreenPtr pScreen);
-Bool DarwinModeSetupScreen(int index, ScreenPtr pScreen);
-void DarwinModeInitOutput(int argc,char **argv);
-void DarwinModeInitInput(int argc, char **argv);
-int DarwinModeProcessArgument(int argc, char *argv[], int i);
-void DarwinModeProcessEvent(xEvent *xe);
-void DarwinModeGiveUp(void);
-void DarwinModeBell(int volume, DeviceIntPtr pDevice, pointer ctrl, int class);
-
-
-#undef assert
-#define assert(x) { if ((x) == 0) \
- FatalError("assert failed on line %d of %s!\n", __LINE__, __FILE__); }
-#define kern_assert(x) { if ((x) != KERN_SUCCESS) \
- FatalError("assert failed on line %d of %s with kernel return 0x%x!\n", \
- __LINE__, __FILE__, x); }
#define SCREEN_PRIV(pScreen) \
((DarwinFramebufferPtr)pScreen->devPrivates[darwinScreenIndex].ptr)
-
-#define MIN_KEYCODE XkbMinLegalKeyCode // unfortunately, this isn't 0...
-
-
/*
* Global variables from darwin.c
*/
@@ -106,7 +75,6 @@ extern int darwinMouseAccelChange;
extern int darwinFakeButtons;
extern int darwinFakeMouse2Mask;
extern int darwinFakeMouse3Mask;
-extern int darwinSwapAltMeta;
extern char *darwinKeymapFile;
extern int darwinSyncKeymap;
extern unsigned int darwinDesiredWidth, darwinDesiredHeight;
@@ -122,31 +90,45 @@ extern int darwinMainScreenY;
* Special ddx events understood by the X server
*/
enum {
- kXDarwinUpdateModifiers // update all modifier keys
+ kXquartzUpdateModifiers // 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
-
+ kXquartzUpdateButtons, // update state of mouse buttons 2 and up
/*
* 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
+ 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
/*
* AppleWM events
*/
- kXDarwinControllerNotify, // send an AppleWMControllerNotify event
- kXDarwinPasteboardNotify, // notify the WM to copy or paste
+ kXquartzControllerNotify, // send an AppleWMControllerNotify event
+ kXquartzPasteboardNotify, // 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
+ kXquartzDisplayChanged, // display configuration has changed
+ kXquartzWindowState, // window visibility state has changed
+ kXquartzWindowMoved, // 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);
+#else
+#define DEBUG_LOG(msg, args...)
+#endif
+
+#define TRACE() DEBUG_LOG("\n")
+
#endif /* _DARWIN_H */
diff --git a/hw/darwin/darwinClut8.h b/hw/xquartz/darwinClut8.h
index 8e914f3fd..8e914f3fd 100644
--- a/hw/darwin/darwinClut8.h
+++ b/hw/xquartz/darwinClut8.h
diff --git a/hw/darwin/darwinEvents.c b/hw/xquartz/darwinEvents.c
index 6b902df05..fe31e2170 100644
--- a/hw/darwin/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -30,6 +30,10 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
#define NEED_EVENTS
#include <X11/X.h>
#include <X11/Xmd.h>
@@ -41,8 +45,8 @@ in this Software without prior written authorization from The Open Group.
#include "mi.h"
#include "scrnintstr.h"
#include "mipointer.h"
-
#include "darwin.h"
+#include "quartz.h"
#include "darwinKeyboard.h"
#include <sys/types.h>
@@ -50,10 +54,6 @@ in this Software without prior written authorization from The Open Group.
#include <unistd.h>
#include <IOKit/hidsystem/IOLLEvent.h>
-/* Fake button press/release for scroll wheel move. */
-#define SCROLLWHEELUPFAKE 4
-#define SCROLLWHEELDOWNFAKE 5
-
#define QUEUE_SIZE 256
typedef struct _Event {
@@ -72,27 +72,7 @@ typedef struct _EventQueue {
} EventQueueRec, *EventQueuePtr;
static EventQueueRec darwinEventQueue;
-
-
-/*
- * DarwinPressModifierMask
- * Press or release the given modifier key, specified by its mask.
- */
-static void DarwinPressModifierMask(
- xEvent *xe, // must already have type, time and mouse location
- int mask) // one of NX_*MASK constants
-{
- int key = DarwinModifierNXMaskToNXKey(mask);
-
- if (key != -1) {
- int keycode = DarwinModifierNXKeyToNXKeycode(key, 0);
- if (keycode != 0) {
- xe->u.u.detail = keycode + MIN_KEYCODE;
- (*darwinEventQueue.pKbd->processInputProc)(xe,
- (DeviceIntPtr)darwinEventQueue.pKbd, 1);
- }
- }
-}
+#define KeyPressed(k) (((DeviceIntPtr)darwinEventQueue.pKbd)->key->down[k >> 3] & (1 << (k & 7)))
#ifdef NX_DEVICELCTLKEYMASK
#define CONTROL_MASK(flags) (flags & (NX_DEVICELCTLKEYMASK|NX_DEVICERCTLKEYMASK))
@@ -118,6 +98,104 @@ static void DarwinPressModifierMask(
#define ALTERNATE_MASK(flags) (NX_ALTERNATEMASK)
#endif /* NX_DEVICELALTKEYMASK */
+#define KEYBOARD_MASK (NX_COMMANDMASK | NX_CONTROLMASK | NX_ALTERNATEMASK | NX_SHIFTMASK | \
+ NX_SECONDARYFNMASK | NX_ALPHASHIFTMASK | NX_NUMERICPADMASK | \
+ NX_HELPMASK | NX_DEVICELCTLKEYMASK | NX_DEVICELSHIFTKEYMASK | \
+ NX_DEVICERSHIFTKEYMASK | NX_DEVICELCMDKEYMASK | NX_DEVICERCMDKEYMASK | \
+ NX_DEVICELALTKEYMASK | NX_DEVICERALTKEYMASK | NX_DEVICERCTLKEYMASK)
+
+char * decode_event_flags(unsigned int modifiers) {
+ char buf[1024];
+ buf[0]='\0';
+ if (modifiers & NX_DEVICELCTLKEYMASK) strcat(buf, "NX_DEVICELCTLKEYMASK | ");
+ if (modifiers & NX_DEVICELSHIFTKEYMASK) strcat(buf, "NX_DEVICELSHIFTKEYMASK | ");
+ if (modifiers & NX_DEVICERSHIFTKEYMASK) strcat(buf, "NX_DEVICERSHIFTKEYMASK | ");
+ if (modifiers & NX_DEVICELCMDKEYMASK) strcat(buf, "NX_DEVICELCMDKEYMASK | ");
+ if (modifiers & NX_DEVICERCMDKEYMASK) strcat(buf, "NX_DEVICERCMDKEYMASK | ");
+ if (modifiers & NX_DEVICELALTKEYMASK) strcat(buf, "NX_DEVICELALTKEYMASK | ");
+ if (modifiers & NX_DEVICERALTKEYMASK) strcat(buf, "NX_DEVICERALTKEYMASK | ");
+ if (modifiers & NX_DEVICERCTLKEYMASK) strcat(buf, "NX_DEVICERCTLKEYMASK | ");
+
+ if (modifiers & NX_ALPHASHIFTMASK) strcat(buf, "NX_ALPHASHIFTMASK | ");
+ if (modifiers & NX_SHIFTMASK) strcat(buf, "NX_SHIFTMASK | ");
+ if (modifiers & NX_CONTROLMASK) strcat(buf, "NX_CONTROLMASK | ");
+ if (modifiers & NX_ALTERNATEMASK) strcat(buf, "NX_ALTERNATEMASK | ");
+ if (modifiers & NX_COMMANDMASK) strcat(buf, "NX_COMMANDMASK | ");
+ if (modifiers & NX_NUMERICPADMASK) strcat(buf, "NX_NUMERICPADMASK | ");
+ if (modifiers & NX_HELPMASK) strcat(buf, "NX_HELPMASK | ");
+ if (modifiers & NX_SECONDARYFNMASK) strcat(buf, "NX_SECONDARYFNMASK | ");
+
+ if (modifiers & NX_STYLUSPROXIMITYMASK) strcat(buf, "NX_STYLUSPROXIMITYMASK | ");
+ if (modifiers & NX_NONCOALSESCEDMASK) strcat(buf, "NX_NONCOALSESCEDMASK | ");
+ if (modifiers & NX_NULLEVENTMASK) strcat(buf, "NX_NULLEVENTMASK | ");
+ // if (modifiers & NX_LMOUSEDOWNMASK) strcat(buf, "NX_LMOUSEDOWNMASK | ");
+ // if (modifiers & NX_LMOUSEUPMASK) strcat(buf, "NX_LMOUSEUPMASK | ");
+ // if (modifiers & NX_RMOUSEDOWNMASK) strcat(buf, "NX_RMOUSEDOWNMASK | ");
+ // if (modifiers & NX_RMOUSEUPMASK) strcat(buf, "NX_RMOUSEUPMASK | ");
+ // if (modifiers & NX_OMOUSEDOWNMASK) strcat(buf, "NX_OMOUSEDOWNMASK | ");
+ // if (modifiers & NX_OMOUSEUPMASK) strcat(buf, "NX_OMOUSEUPMASK | ");
+ // if (modifiers & NX_MOUSEMOVEDMASK) strcat(buf, "NX_MOUSEMOVEDMASK | ");
+ // if (modifiers & NX_LMOUSEDRAGGEDMASK) strcat(buf, "NX_LMOUSEDRAGGEDMASK | ");
+ //if (modifiers & NX_RMOUSEDRAGGEDMASK) strcat(buf, "NX_RMOUSEDRAGGEDMASK | ");
+ //if (modifiers & NX_OMOUSEDRAGGEDMASK) strcat(buf, "NX_OMOUSEDRAGGEDMASK | ");
+ //if (modifiers & NX_MOUSEENTEREDMASK) strcat(buf, "NX_MOUSEENTEREDMASK | ");
+ //if (modifiers & NX_MOUSEEXITEDMASK) strcat(buf, "NX_MOUSEEXITEDMASK | ");
+ if (modifiers & NX_KEYDOWNMASK) strcat(buf, "NX_KEYDOWNMASK | ");
+ if (modifiers & NX_KEYUPMASK) strcat(buf, "NX_KEYUPMASK | ");
+ if (modifiers & NX_FLAGSCHANGEDMASK) strcat(buf, "NX_FLAGSCHANGEDMASK | ");
+ if (modifiers & NX_KITDEFINEDMASK) strcat(buf, "NX_KITDEFINEDMASK | ");
+ if (modifiers & NX_SYSDEFINEDMASK) strcat(buf, "NX_SYSDEFINEDMASK | ");
+ if (modifiers & NX_APPDEFINEDMASK) strcat(buf, "NX_APPDEFINEDMASK | ");
+
+ if (strlen(buf) < 5) strcpy(buf, "(empty)");
+ else buf[strlen(buf)-3]='\0';
+ return strdup(buf);
+}
+
+char * get_keysym_name(int ks) {
+ switch(ks) {
+ case XK_Alt_L: return "XK_Alt_L";
+ case XK_Alt_R: return "XK_Alt_R";
+ case XK_Meta_L: return "XK_Meta_L";
+ case XK_Meta_R: return "XK_Meta_R";
+ case XK_Control_L: return "XK_Control_L";
+ case XK_Control_R: return "XK_Control_R";
+ case XK_Shift_L: return "XK_Shift_L";
+ case XK_Shift_R: return "XK_Shift_R";
+ case XK_Mode_switch: return "XK_Mode_switch";
+ case XK_Caps_Lock: return "XK_Caps_Lock";
+ }
+ return "???";
+}
+
+/*
+ * DarwinPressModifierMask
+ * Press or release the given modifier key, specified by its mask.
+ */
+static void DarwinPressModifierMask(
+ xEvent *xe, // must already have type, time and mouse location
+ int mask) // one of NX_*MASK constants
+{
+ int key, keycode;
+ key = DarwinModifierNXMaskToNXKey(mask);
+ if (key == -1) {
+ ErrorF("DarwinPressModifierMask: can't find key for mask %x\n", mask);
+ return;
+ }
+ keycode = DarwinModifierNXKeyToNXKeycode(key, 0);
+ if (keycode == 0) {
+ ErrorF("DarwinPressModifierMask: can't find keycode for mask %x\n", mask);
+ return;
+ }
+
+ DEBUG_LOG("%x: %s %s\n", mask, xe->u.u.type==KeyPress?"pressing":"releasing",
+ decode_event_flags(mask));
+
+ xe->u.u.detail = keycode + MIN_KEYCODE;
+ (*darwinEventQueue.pKbd->processInputProc)(xe,
+ (DeviceIntPtr)darwinEventQueue.pKbd, 1);
+}
+
/*
* DarwinUpdateModifiers
* Send events to update the modifier state.
@@ -125,29 +203,69 @@ static void DarwinPressModifierMask(
static void DarwinUpdateModifiers(
xEvent *xe, // event template with time and mouse position set
int pressed, // KeyPress or KeyRelease
- int flags ) // modifier flags that have changed
+ unsigned int flags ) // modifier flags that have changed
{
- xe->u.u.type = pressed;
- if (flags & NX_ALPHASHIFTMASK) {
- DarwinPressModifierMask(xe, NX_ALPHASHIFTMASK);
- }
- if (flags & NX_COMMANDMASK) {
- DarwinPressModifierMask(xe, COMMAND_MASK(flags));
- }
- if (flags & NX_CONTROLMASK) {
- DarwinPressModifierMask(xe, CONTROL_MASK(flags));
- }
- if (flags & NX_ALTERNATEMASK) {
- DarwinPressModifierMask(xe, ALTERNATE_MASK(flags));
- }
- if (flags & NX_SHIFTMASK) {
- DarwinPressModifierMask(xe, SHIFT_MASK(flags));
- }
- if (flags & NX_SECONDARYFNMASK) {
- DarwinPressModifierMask(xe, NX_SECONDARYFNMASK);
- }
+ int i;
+ DEBUG_LOG("DarwinUpdateModifiers(%p, %d, %x, %s)\n", xe, pressed, flags, decode_event_flags(flags));
+ xe->u.u.type = pressed;
+ /* If we have "device specific" flags -- meaning, left or right -- then strip out the generic flag */
+ if (flags & (NX_DEVICELCTLKEYMASK | NX_DEVICERCTLKEYMASK)) flags &= ~NX_CONTROLMASK;
+ if (flags & (NX_DEVICELALTKEYMASK | NX_DEVICERALTKEYMASK)) flags &= ~NX_ALTERNATEMASK;
+ if (flags & (NX_DEVICELCMDKEYMASK | NX_DEVICERCMDKEYMASK)) flags &= ~NX_COMMANDMASK;
+ if (flags & (NX_DEVICELSHIFTKEYMASK | NX_DEVICERSHIFTKEYMASK)) flags &= ~NX_SHIFTMASK;
+ if (flags == NX_ALPHASHIFTMASK) {
+ // Alpha shift only sees KeyDown when enabled and KeyUp when disabled,
+ // but X11 wants to see a up/down pair to enable, and again to disable
+ xe->u.u.type = KeyPress;
+ DarwinPressModifierMask(xe, NX_ALPHASHIFTMASK);
+ xe->u.u.type = KeyRelease;
+ DarwinPressModifierMask(xe, NX_ALPHASHIFTMASK);
+ flags &= ~NX_ALPHASHIFTMASK;
+ }
+ for(i=0; i < (sizeof(flags)*8); i++)
+ if (flags & (1 << i)) DarwinPressModifierMask(xe, flags & (1 << i));
}
+/*
+ * DarwinReleaseModifiers
+ * This hacky function releases all modifier keys. It should be called when X11.app
+ * is deactivated (kXquartzDeactivate) to prevent modifiers from getting stuck if they
+ * are held down during a "context" switch -- otherwise, we would miss the KeyUp.
+ */
+void DarwinReleaseModifiers(void) {
+ KeySym *map = NULL;
+ xEvent ke;
+ int i = 0;
+
+ DEBUG_LOG("DarwinReleaseModifiers(%p)\n", &keyInfo.keyMap);
+
+ for (i = MIN_KEYCODE, map =keyInfo.keyMap;
+ i < MAX_KEYCODE;
+ i++, map += GLYPHS_PER_KEY) {
+ if (KeyPressed(i)) {
+ switch (*map) {
+ /* Don't release the lock keys */
+ case XK_Caps_Lock:
+ case XK_Shift_Lock:
+ case XK_Num_Lock:
+ case XK_Scroll_Lock:
+ case XK_Kana_Lock:
+ break;
+ default:
+ DEBUG_LOG("DarwinReleaseModifiers: releasing key %d (%s)\n", i, get_keysym_name(*map));
+ ke.u.keyButtonPointer.time = GetTimeInMillis();
+ ke.u.keyButtonPointer.rootX = 0;
+ ke.u.keyButtonPointer.rootY = 0;
+ ke.u.u.type = KeyRelease;
+ ke.u.u.detail = i;
+ (*darwinEventQueue.pKbd->processInputProc)(&ke,
+ (DeviceIntPtr)darwinEventQueue.pKbd, 1);
+ break;
+ }
+ }
+ }
+ ProcessInputEvents();
+}
/*
* DarwinSimulateMouseClick
@@ -166,7 +284,11 @@ static void DarwinSimulateMouseClick(
int whichButton, // mouse button to be pressed
int modifierMask) // modifiers used for the fake click
{
+ DEBUG_LOG("DarwinSimulateMouseClick(%p, %d, %x)\n", xe, whichButton, modifierMask);
// 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(xe, KeyRelease, modifierMask);
// push the mouse button
@@ -330,7 +452,7 @@ void ProcessInputEvents(void)
static unsigned int last_seed;
unsigned int this_seed;
- this_seed = DarwinModeSystemKeymapSeed();
+ this_seed = QuartzSystemKeymapSeed();
if (this_seed != last_seed)
{
last_seed = this_seed;
@@ -405,20 +527,22 @@ void ProcessInputEvents(void)
xe.u.keyButtonPointer.time);
break;
- case kXDarwinUpdateModifiers:
+ case kXquartzUpdateModifiers:
{
// Update modifier state.
// Any amount of modifiers may have changed.
- int flags = xe.u.clientMessage.u.l.longs0;
- DarwinUpdateModifiers(&xe, KeyRelease,
- old_flags & ~flags);
- DarwinUpdateModifiers(&xe, KeyPress,
- ~old_flags & flags);
+ unsigned int flags = xe.u.clientMessage.u.l.longs0 & ~NX_NONCOALSESCEDMASK; // ignore that one
+ DEBUG_LOG("kXquartzUpdateModifiers(%x, %x, %s)\n", old_flags, flags, decode_event_flags(flags));
+ flags &= KEYBOARD_MASK;
+ if (old_flags & ~flags) DarwinUpdateModifiers(&xe, KeyRelease,
+ old_flags & ~flags);
+ if (~old_flags & flags) DarwinUpdateModifiers(&xe, KeyPress,
+ ~old_flags & flags);
old_flags = flags;
break;
}
- case kXDarwinUpdateButtons:
+ case kXquartzUpdateButtons:
{
long hwDelta = xe.u.clientMessage.u.l.longs0;
long hwButtons = xe.u.clientMessage.u.l.longs1;
@@ -447,31 +571,14 @@ void ProcessInputEvents(void)
break;
}
- case kXDarwinScrollWheel:
- {
- short count = xe.u.clientMessage.u.s.shorts0;
-
- if (count > 0) {
- xe.u.u.detail = SCROLLWHEELUPFAKE;
- } else {
- xe.u.u.detail = SCROLLWHEELDOWNFAKE;
- count = -count;
- }
-
- for (; count; --count) {
- xe.u.u.type = ButtonPress;
- (*darwinEventQueue.pPtr->processInputProc)
- (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
- xe.u.u.type = ButtonRelease;
- (*darwinEventQueue.pPtr->processInputProc)
- (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
- }
- break;
- }
-
+ case kXquartzDeactivate:
+ DEBUG_LOG("kXquartzDeactivate\n");
+ DarwinReleaseModifiers();
+ old_flags=0;
+ // fall through
default:
// Check for mode specific event
- DarwinModeProcessEvent(&xe);
+ QuartzProcessEvent(&xe);
}
}
}
diff --git a/hw/darwin/quartz/cr/XView.h b/hw/xquartz/darwinEvents.h
index 26f789da2..6294379ba 100644
--- a/hw/darwin/quartz/cr/XView.h
+++ b/hw/xquartz/darwinEvents.h
@@ -1,7 +1,5 @@
/*
- * NSView subclass for Mac OS X rootless X server
- *
- * Copyright (c) 2001 Greg Parker. All Rights Reserved.
+ * Copyright (c) 2001-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"),
@@ -26,16 +24,12 @@
* use or other dealings in this Software without prior written authorization.
*/
-#import <Cocoa/Cocoa.h>
-
-@interface XView : NSQuickDrawView
-
-- (BOOL)isFlipped;
-- (BOOL)isOpaque;
-- (BOOL)acceptsFirstResponder;
-- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent;
-- (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent *)theEvent;
+#ifndef _DARWIN_EVENTS_H
+#define _DARWIN_EVENTS_H
-- (void)mouseDown:(NSEvent *)anEvent;
+Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr);
+void DarwinEQEnqueue(const xEvent *e);
+void DarwinEQPointerPost(xEvent *e);
+void DarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX);
-@end
+#endif /* _DARWIN_EVENTS_H */
diff --git a/hw/darwin/darwinKeyboard.c b/hw/xquartz/darwinKeyboard.c
index c148d96ce..483d0be23 100644
--- a/hw/darwin/darwinKeyboard.c
+++ b/hw/xquartz/darwinKeyboard.c
@@ -56,12 +56,13 @@
===========================================================================
*/
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
// Define this to get a diagnostic output to stderr which is helpful
// in determining how the X server is interpreting the Darwin keymap.
-#undef DUMP_DARWIN_KEYMAP
-
-/* Define this to use Alt for Mode_switch. */
-#define ALT_IS_MODE_SWITCH 1
+// #define DUMP_DARWIN_KEYMAP
#include <stdio.h>
#include <stdlib.h>
@@ -72,14 +73,21 @@
#include <architecture/byte_order.h> // For the NXSwap*
#include "darwin.h"
#include "darwinKeyboard.h"
+#include "quartzKeyboard.h"
+#include "quartzAudio.h"
+
+#ifdef NDEBUG
+#undef NDEBUG
+#include <assert.h>
+#define NDEBUG 1
+#else
+#include <assert.h>
+#endif
#define AltMask Mod1Mask
#define MetaMask Mod2Mask
#define FunctionMask Mod3Mask
-// FIXME: It would be nice to support some of the extra keys in XF86keysym.h,
-// at least the volume controls that now ship on every Apple keyboard.
-
#define UK(a) NoSymbol // unknown symbol
static KeySym const next_to_x[256] = {
@@ -173,7 +181,7 @@ static KeySym const next_to_x[256] = {
static KeySym const symbol_to_x[] = {
XK_Left, XK_Up, XK_Right, XK_Down
};
-int const NUM_SYMBOL = sizeof(symbol_to_x) / sizeof(symbol_to_x[0]);
+static int const NUM_SYMBOL = sizeof(symbol_to_x) / sizeof(symbol_to_x[0]);
#define MIN_FUNCKEY 0x20
static KeySym const funckey_to_x[] = {
@@ -184,7 +192,7 @@ static KeySym const funckey_to_x[] = {
XK_Page_Up, XK_Page_Down, XK_F13, XK_F14,
XK_F15
};
-int const NUM_FUNCKEY = sizeof(funckey_to_x) / sizeof(funckey_to_x[0]);
+static int const NUM_FUNCKEY = sizeof(funckey_to_x) / sizeof(funckey_to_x[0]);
typedef struct {
KeySym normalSym;
@@ -210,14 +218,14 @@ static darwinKeyPad_t const normal_to_keypad[] = {
{ XK_period, XK_KP_Decimal },
{ XK_slash, XK_KP_Divide }
};
-int const NUM_KEYPAD = sizeof(normal_to_keypad) / sizeof(normal_to_keypad[0]);
+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
}
-static darwinKeyboardInfo keyInfo;
+darwinKeyboardInfo keyInfo;
static FILE *fref = NULL;
static char *inBuffer = NULL;
@@ -226,35 +234,32 @@ static char *inBuffer = NULL;
// Can be configured to treat embedded "numbers" as being composed of
// either 1, 2, or 4 bytes, apiece.
//-----------------------------------------------------------------------------
-typedef struct _DataStream
-{
+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 )
-{
+static DataStream* new_data_stream(unsigned char const* data, int size) {
DataStream* s = (DataStream*)xalloc( sizeof(DataStream) );
- s->data = data;
- s->data_end = data + size;
- s->number_size = 1; // Default to byte-sized numbers.
+ 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 )
-{
+static void destroy_data_stream(DataStream* s) {
xfree(s);
}
-static unsigned char get_byte( DataStream* s )
-{
+static unsigned char get_byte(DataStream* s) {
assert(s->data + 1 <= s->data_end);
return *s->data++;
}
-static short get_word( DataStream* s )
-{
+static short get_word(DataStream* s) {
short hi, lo;
assert(s->data + 2 <= s->data_end);
hi = *s->data++;
@@ -262,8 +267,7 @@ static short get_word( DataStream* s )
return ((hi << 8) | lo);
}
-static int get_dword( DataStream* s )
-{
+static int get_dword(DataStream* s) {
int b1, b2, b3, b4;
assert(s->data + 4 <= s->data_end);
b4 = *s->data++;
@@ -273,8 +277,7 @@ static int get_dword( DataStream* s )
return ((b4 << 24) | (b3 << 16) | (b2 << 8) | b1);
}
-static int get_number( DataStream* s )
-{
+static int get_number(DataStream* s) {
switch (s->number_size) {
case 4: return get_dword(s);
case 2: return get_word(s);
@@ -290,8 +293,7 @@ static int get_number( DataStream* s )
* bits_set
* Calculate number of bits set in the modifier mask.
*/
-static short bits_set( short mask )
-{
+static short bits_set(short mask) {
short n = 0;
for ( ; mask != 0; mask >>= 1)
@@ -305,10 +307,7 @@ static short bits_set( short mask )
* 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 )
-{
+static void parse_next_char_code(DataStream *s, KeySym *k) {
const short charSet = get_number(s);
const short charCode = get_number(s);
@@ -331,9 +330,7 @@ static void parse_next_char_code(
* DarwinReadKeymapFile
* Read the appropriate keymapping from a keymapping file.
*/
-Bool DarwinReadKeymapFile(
- NXKeyMapping *keyMap)
-{
+Bool DarwinReadKeymapFile(NXKeyMapping *keyMap) {
struct stat st;
NXEventSystemDevice info[20];
int interface = 0, handler_id = 0;
@@ -375,10 +372,10 @@ Bool DarwinReadKeymapFile(
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);
+ ErrorF("Keymapping file '%s' is intended for use with the original NeXT keyboards and cannot be used by Xquartz.\n", darwinKeymapFile);
return FALSE;
} else {
- ErrorF("Keymapping file '%s' has a bad magic number and cannot be used by XDarwin.\n", darwinKeymapFile);
+ ErrorF("Keymapping file '%s' has a bad magic number and cannot be used by Xquartz.\n", darwinKeymapFile);
return FALSE;
}
@@ -442,9 +439,7 @@ Bool DarwinReadKeymapFile(
/*
* DarwinParseNXKeyMapping
*/
-Bool DarwinParseNXKeyMapping(
- darwinKeyboardInfo *info)
-{
+Bool DarwinParseNXKeyMapping(darwinKeyboardInfo *info) {
KeySym *k;
int i;
short numMods, numKeys, numPadKeys = 0;
@@ -512,8 +507,9 @@ Bool DarwinParseNXKeyMapping(
(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_Mode_switch : XK_Alt_R);
+ (left ? XK_Alt_L : XK_Alt_R);
break;
case NX_MODIFIERKEY_COMMAND:
info->keyMap[keyCode * GLYPHS_PER_KEY] =
@@ -638,27 +634,22 @@ Bool DarwinParseNXKeyMapping(
return TRUE;
}
-
/*
* DarwinBuildModifierMaps
* Use the keyMap field of keyboard info structure to populate
* the modMap and modifierKeycodes fields.
*/
-static void
-DarwinBuildModifierMaps(
- darwinKeyboardInfo *info)
-{
+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++)
- {
+ for (i = 0; i < NUM_KEYCODES; i++) {
k = info->keyMap + i * GLYPHS_PER_KEY;
- switch (k[0]) {
+ switch (*k) {
case XK_Shift_L:
info->modifierKeycodes[NX_MODIFIERKEY_SHIFT][0] = i;
info->modMap[MIN_KEYCODE + i] = ShiftMask;
@@ -695,6 +686,7 @@ DarwinBuildModifierMaps(
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:
@@ -703,6 +695,7 @@ DarwinBuildModifierMaps(
#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;
@@ -728,46 +721,24 @@ DarwinBuildModifierMaps(
info->modMap[MIN_KEYCODE + i] = Mod3Mask;
break;
}
-
- if (darwinSwapAltMeta)
- {
- switch (k[0])
- {
- case XK_Alt_L:
- k[0] = XK_Meta_L;
- break;
- case XK_Alt_R:
- k[0] = XK_Meta_R;
- break;
- case XK_Meta_L:
- k[0] = XK_Alt_L;
- break;
- case XK_Meta_R:
- k[0] = XK_Alt_R;
- break;
- }
- }
-
-#if ALT_IS_MODE_SWITCH
- if (k[0] == XK_Alt_L)
- k[0] = XK_Mode_switch;
-#endif
}
}
-
/*
* 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)
-{
+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)) {
- if (!DarwinModeReadSystemKeymap(&keyInfo)) {
+ DEBUG_LOG("DarwinParseNXKeyMapping returned 0... running QuartzReadSystemKeymap().\n");
+ if (!QuartzReadSystemKeymap(&keyInfo)) {
FatalError("Could not build a valid keymap.");
}
}
@@ -775,20 +746,20 @@ DarwinLoadKeyboardMapping(KeySymsRec *keySyms)
DarwinBuildModifierMaps(&keyInfo);
#ifdef DUMP_DARWIN_KEYMAP
- ErrorF("Darwin -> X converted keyboard map\n");
- for (i = 0, k = info->keyMap; i < NX_NUMKEYCODES;
+ 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;
- ErrorF("0x%02x:", i);
for (j = 0; j < GLYPHS_PER_KEY; j++) {
if (k[j] == NoSymbol) {
- ErrorF("\tNoSym");
+ DEBUG_LOG("0x%02x:\tNoSym\n", i);
} else {
- ErrorF("\t0x%x", k[j]);
+ DEBUG_LOG("0x%02x:\t0x%lx\n", i, k[j]);
}
}
- ErrorF("\n");
}
#endif
@@ -805,9 +776,7 @@ DarwinLoadKeyboardMapping(KeySymsRec *keySyms)
* X keyboard map and modifier map. Set the new keyboard
* device structure.
*/
-void DarwinKeyboardInit(
- DeviceIntPtr pDev )
-{
+void DarwinKeyboardInit(DeviceIntPtr pDev) {
KeySymsRec keySyms;
// Open a shared connection to the HID System.
@@ -816,25 +785,24 @@ void DarwinKeyboardInit(
assert( darwinParamConnect = NXOpenEventStatus() );
DarwinLoadKeyboardMapping(&keySyms);
-
+ // DarwinKeyboardReload(pDev);
/* Initialize the seed, so we don't reload the keymap unnecessarily
(and possibly overwrite xinitrc changes) */
- DarwinModeSystemKeymapSeed();
+ QuartzSystemKeymapSeed();
assert( InitKeyboardDeviceStruct( (DevicePtr)pDev, &keySyms,
- keyInfo.modMap, DarwinModeBell,
+ keyInfo.modMap, QuartzBell,
DarwinChangeKeyboardControl ));
}
/* Borrowed from dix/devices.c */
-static Bool
-InitModMap(register KeyClassPtr keyc)
-{
+static Bool InitModMap(register KeyClassPtr keyc) {
int i, j;
CARD8 keysPerModifier[8];
CARD8 mask;
+ // darwinKeyc = keyc;
if (keyc->modifierKeyMap != NULL)
xfree (keyc->modifierKeyMap);
@@ -874,9 +842,7 @@ InitModMap(register KeyClassPtr keyc)
}
-void
-DarwinKeyboardReload(DeviceIntPtr pDev)
-{
+void DarwinKeyboardReload(DeviceIntPtr pDev) {
KeySymsRec keySyms;
DarwinLoadKeyboardMapping(&keySyms);
@@ -886,7 +852,7 @@ DarwinKeyboardReload(DeviceIntPtr pDev)
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);
@@ -909,8 +875,7 @@ DarwinKeyboardReload(DeviceIntPtr pDev)
* 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 DarwinModifierNXKeyToNXKeycode(int key, int side) {
return keyInfo.modifierKeycodes[key][side];
}
@@ -919,8 +884,7 @@ int DarwinModifierNXKeyToNXKeycode(int key, int side)
* 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 DarwinModifierNXKeycodeToNXKey(unsigned char keycode, int *outSide) {
int key, side;
keycode += MIN_KEYCODE;
@@ -939,8 +903,7 @@ int DarwinModifierNXKeycodeToNXKey(unsigned char keycode, int *outSide)
* DarwinModifierNXMaskToNXKey
* Returns -1 if mask is not a known modifier mask.
*/
-int DarwinModifierNXMaskToNXKey(int mask)
-{
+int DarwinModifierNXMaskToNXKey(int mask) {
switch (mask) {
case NX_ALPHASHIFTMASK: return NX_MODIFIERKEY_ALPHALOCK;
case NX_SHIFTMASK: return NX_MODIFIERKEY_SHIFT;
@@ -970,12 +933,33 @@ int DarwinModifierNXMaskToNXKey(int mask)
return -1;
}
+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)
-{
+int DarwinModifierNXKeyToNXMask(int key) {
switch (key) {
case NX_MODIFIERKEY_ALPHALOCK: return NX_ALPHASHIFTMASK;
case NX_MODIFIERKEY_SHIFT: return NX_SHIFTMASK;
@@ -1005,8 +989,7 @@ int DarwinModifierNXKeyToNXMask(int key)
* DarwinModifierStringToNXKey
* Returns -1 if string is not a known modifier.
*/
-int DarwinModifierStringToNXKey(const char *str)
-{
+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;
diff --git a/miext/rootless/safeAlpha/safeAlpha.h b/hw/xquartz/darwinKeyboard.h
index bd1ce3203..5cf64c7d1 100644
--- a/miext/rootless/safeAlpha/safeAlpha.h
+++ b/hw/xquartz/darwinKeyboard.h
@@ -1,8 +1,5 @@
/*
- * Replacement functions to protect the alpha channel
- */
-/*
- * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
+ * 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"),
@@ -27,18 +24,22 @@
* use or other dealings in this Software without prior written authorization.
*/
-#ifndef _SAFEALPHA_H
-#define _SAFEALPHA_H
+#ifndef DARWIN_KEYBOARD_H
+#define DARWIN_KEYBOARD_H 1
-#include "picturestr.h"
+#include "quartzKeyboard.h"
-void SafeAlphaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what);
+/* 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);
-#ifdef RENDER
-void
-SafeAlphaComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
- INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask,
- INT16 xDst, INT16 yDst, CARD16 width, CARD16 height);
-#endif /* RENDER */
+/* Provided for darwin.c */
+void DarwinKeyboardInit(DeviceIntPtr pDev);
-#endif /* _SAFEALPHA_H */
+#endif /* DARWIN_KEYBOARD_H */
diff --git a/hw/darwin/darwinXinput.c b/hw/xquartz/darwinXinput.c
index 260d72af7..ee456a43a 100644
--- a/hw/darwin/darwinXinput.c
+++ b/hw/xquartz/darwinXinput.c
@@ -52,6 +52,10 @@ SOFTWARE.
********************************************************/
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
#define NEED_EVENTS
#include <X11/X.h>
#include <X11/Xproto.h>
diff --git a/hw/darwin/quartz/keysym2ucs.c b/hw/xquartz/keysym2ucs.c
index 98b8b6fee..8626ebc4e 100644
--- a/hw/darwin/quartz/keysym2ucs.c
+++ b/hw/xquartz/keysym2ucs.c
@@ -1,4 +1,4 @@
-/* $XFree86: $
+/*
*
* This module converts keysym values into the corresponding ISO 10646
* (UCS, Unicode) values.
diff --git a/hw/darwin/quartz/keysym2ucs.h b/hw/xquartz/keysym2ucs.h
index c7ff6f3b3..f5b7a18f2 100644
--- a/hw/darwin/quartz/keysym2ucs.h
+++ b/hw/xquartz/keysym2ucs.h
@@ -1,5 +1,4 @@
-/* $XFree86: $
- *
+/*
* This module converts keysym values into the corresponding ISO 10646
* (UCS, Unicode) values.
*
diff --git a/hw/darwin/quartz/pseudoramiX.c b/hw/xquartz/pseudoramiX.c
index ab57827d3..f0bdb5170 100644
--- a/hw/darwin/quartz/pseudoramiX.c
+++ b/hw/xquartz/pseudoramiX.c
@@ -33,14 +33,21 @@ dealings in this Software without prior written authorization from Digital
Equipment Corporation.
******************************************************************/
-#include "pseudoramiX.h"
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+#include "darwin.h"
+#include "pseudoramiX.h"
#include "extnsionst.h"
#include "dixstruct.h"
#include "window.h"
#include <X11/extensions/panoramiXproto.h>
#include "globals.h"
+Bool noPseudoramiXExtension = FALSE;
+extern int noPanoramiXExtension;
+
extern int ProcPanoramiXQueryVersion (ClientPtr client);
static void PseudoramiXResetProc(ExtensionEntry *extEntry);
@@ -93,6 +100,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;
@@ -110,6 +119,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
@@ -147,12 +158,16 @@ void PseudoramiXExtensionInit(int argc, char *argv[])
void PseudoramiXResetScreens(void)
{
+ TRACE();
+
pseudoramiXNumScreens = 0;
}
static void PseudoramiXResetProc(ExtensionEntry *extEntry)
{
+ TRACE();
+
PseudoramiXResetScreens();
}
@@ -160,6 +175,8 @@ static void PseudoramiXResetProc(ExtensionEntry *extEntry)
// was PanoramiX
static int ProcPseudoramiXQueryVersion(ClientPtr client)
{
+ TRACE();
+
return ProcPanoramiXQueryVersion(client);
}
@@ -172,6 +189,8 @@ static int ProcPseudoramiXGetState(ClientPtr client)
xPanoramiXGetStateReply rep;
register int n;
+ TRACE();
+
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
pWin = LookupWindow (stuff->window, client);
if (!pWin)
@@ -198,6 +217,8 @@ static int ProcPseudoramiXGetScreenCount(ClientPtr client)
xPanoramiXGetScreenCountReply rep;
register int n;
+ TRACE();
+
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
pWin = LookupWindow (stuff->window, client);
if (!pWin)
@@ -224,6 +245,8 @@ static int ProcPseudoramiXGetScreenSize(ClientPtr client)
xPanoramiXGetScreenSizeReply rep;
register int n;
+ TRACE();
+
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
pWin = LookupWindow (stuff->window, client);
if (!pWin)
@@ -253,6 +276,8 @@ static int ProcPseudoramiXIsActive(ClientPtr client)
/* REQUEST(xXineramaIsActiveReq); */
xXineramaIsActiveReply rep;
+ TRACE();
+
REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
rep.type = X_Reply;
@@ -276,6 +301,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;
@@ -318,6 +345,7 @@ static int ProcPseudoramiXQueryScreens(ClientPtr client)
// was PanoramiX
static int ProcPseudoramiXDispatch (ClientPtr client)
{ REQUEST(xReq);
+ TRACE();
switch (stuff->data)
{
case X_PanoramiXQueryVersion:
@@ -344,6 +372,8 @@ SProcPseudoramiXQueryVersion (ClientPtr client)
REQUEST(xPanoramiXQueryVersionReq);
register int n;
+ TRACE();
+
swaps(&stuff->length,n);
REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
return ProcPseudoramiXQueryVersion(client);
@@ -355,6 +385,8 @@ SProcPseudoramiXGetState(ClientPtr client)
REQUEST(xPanoramiXGetStateReq);
register int n;
+ TRACE();
+
swaps (&stuff->length, n);
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
return ProcPseudoramiXGetState(client);
@@ -366,6 +398,8 @@ SProcPseudoramiXGetScreenCount(ClientPtr client)
REQUEST(xPanoramiXGetScreenCountReq);
register int n;
+ TRACE();
+
swaps (&stuff->length, n);
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
return ProcPseudoramiXGetScreenCount(client);
@@ -377,6 +411,8 @@ SProcPseudoramiXGetScreenSize(ClientPtr client)
REQUEST(xPanoramiXGetScreenSizeReq);
register int n;
+ TRACE();
+
swaps (&stuff->length, n);
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
return ProcPseudoramiXGetScreenSize(client);
@@ -389,6 +425,8 @@ SProcPseudoramiXIsActive(ClientPtr client)
REQUEST(xXineramaIsActiveReq);
register int n;
+ TRACE();
+
swaps (&stuff->length, n);
REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
return ProcPseudoramiXIsActive(client);
@@ -401,6 +439,8 @@ SProcPseudoramiXQueryScreens(ClientPtr client)
REQUEST(xXineramaQueryScreensReq);
register int n;
+ TRACE();
+
swaps (&stuff->length, n);
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
return ProcPseudoramiXQueryScreens(client);
@@ -410,6 +450,9 @@ SProcPseudoramiXQueryScreens(ClientPtr client)
static int
SProcPseudoramiXDispatch (ClientPtr client)
{ REQUEST(xReq);
+
+ TRACE();
+
switch (stuff->data)
{
case X_PanoramiXQueryVersion:
diff --git a/hw/darwin/quartz/pseudoramiX.h b/hw/xquartz/pseudoramiX.h
index df5010d1d..df5010d1d 100644
--- a/hw/darwin/quartz/pseudoramiX.h
+++ b/hw/xquartz/pseudoramiX.h
diff --git a/hw/darwin/quartz/quartz.c b/hw/xquartz/quartz.c
index 36a8bea08..988e6e06b 100644
--- a/hw/darwin/quartz/quartz.c
+++ b/hw/xquartz/quartz.c
@@ -1,9 +1,7 @@
-/**************************************************************
+/*
*
* Quartz-specific support for the Darwin X Server
*
- **************************************************************/
-/*
* Copyright (c) 2001-2004 Greg Parker and Torrey T. Lyons.
* All Rights Reserved.
*
@@ -30,15 +28,24 @@
* use or other dealings in this Software without prior written authorization.
*/
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
#include "quartzCommon.h"
#include "quartz.h"
#include "darwin.h"
+#include "darwinEvents.h"
#include "quartzAudio.h"
#include "pseudoramiX.h"
#define _APPLEWM_SERVER_
-#include "applewm.h"
#include "applewmExt.h"
+#include "X11Application.h"
+
+#include <X11/extensions/applewm.h>
+#include <X11/extensions/randr.h>
+
// X headers
#include "scrnintstr.h"
#include "windowstr.h"
@@ -51,9 +58,15 @@
#include <fcntl.h>
#include <IOKit/pwr_mgt/IOPMLib.h>
+#define FAKE_RANDR 1
+
+/* FIXME: Abstract this away into xpr */
+#include <Xplugin.h>
+#include "rootlessWindow.h"
+WindowPtr xprGetXWindow(xp_window_id wid);
+
// Shared global variables for Quartz modes
int quartzEventWriteFD = -1;
-int quartzStartClients = 1;
int quartzRootless = -1;
int quartzUseSysBeep = 0;
int quartzUseAGL = 1;
@@ -62,10 +75,33 @@ int quartzServerVisible = TRUE;
int quartzServerQuitting = FALSE;
int quartzScreenIndex = 0;
int aquaMenuBarHeight = 0;
-int noPseudoramiXExtension = TRUE;
QuartzModeProcsPtr quartzProcs = NULL;
const char *quartzOpenGLBundle = NULL;
+#if defined(RANDR) && !defined(FAKE_RANDR)
+Bool QuartzRandRGetInfo (ScreenPtr pScreen, Rotation *rotations) {
+ return FALSE;
+}
+
+Bool QuartzRandRSetConfig (ScreenPtr pScreen,
+ Rotation randr,
+ int rate,
+ RRScreenSizePtr pSize) {
+ return FALSE;
+}
+
+Bool QuartzRandRInit (ScreenPtr pScreen) {
+ rrScrPrivPtr pScrPriv;
+
+ if (!RRScreenInit (pScreen)) return FALSE;
+
+ pScrPriv = rrGetScrPriv(pScreen);
+ pScrPriv->rrGetInfo = QuartzRandRGetInfo;
+ pScrPriv->rrSetConfig = QuartzRandRSetConfig;
+ return TRUE;
+}
+#endif
+
/*
===========================================================================
@@ -75,16 +111,18 @@ const char *quartzOpenGLBundle = NULL;
*/
/*
- * DarwinModeAddScreen
+ * QuartzAddScreen
* Do mode dependent initialization of each screen for Quartz.
*/
-Bool DarwinModeAddScreen(
+Bool QuartzAddScreen(
int index,
ScreenPtr pScreen)
{
// allocate space for private per screen Quartz specific storage
QuartzScreenPtr displayInfo = xcalloc(sizeof(QuartzScreenRec), 1);
- QUARTZ_PRIV(pScreen) = displayInfo;
+
+ // QUARTZ_PRIV(pScreen) = displayInfo;
+ pScreen->devPrivates[quartzScreenIndex].ptr = displayInfo;
// do Quartz mode specific initialization
return quartzProcs->AddScreen(index, pScreen);
@@ -92,10 +130,10 @@ Bool DarwinModeAddScreen(
/*
- * DarwinModeSetupScreen
+ * QuartzSetupScreen
* Finalize mode specific setup of each screen.
*/
-Bool DarwinModeSetupScreen(
+Bool QuartzSetupScreen(
int index,
ScreenPtr pScreen)
{
@@ -112,10 +150,10 @@ Bool DarwinModeSetupScreen(
/*
- * DarwinModeInitOutput
+ * QuartzInitOutput
* Quartz display initialization.
*/
-void DarwinModeInitOutput(
+void QuartzInitOutput(
int argc,
char **argv )
{
@@ -127,7 +165,7 @@ void DarwinModeInitOutput(
generation = serverGeneration;
}
- if (serverGeneration == 0) {
+ if (serverGeneration == 1) {
QuartzAudioInit();
}
@@ -140,32 +178,70 @@ void DarwinModeInitOutput(
// Do display mode specific initialization
quartzProcs->DisplayInit();
-
- // Init PseudoramiX implementation of Xinerama.
- // This should be in InitExtensions, but that causes link errors
- // for servers that don't link in pseudoramiX.c.
- if (!noPseudoramiXExtension) {
- PseudoramiXExtensionInit(argc, argv);
- }
}
/*
- * DarwinModeInitInput
+ * QuartzInitInput
* Inform the main thread the X server is ready to handle events.
*/
-void DarwinModeInitInput(
+void QuartzInitInput(
int argc,
char **argv )
{
- QuartzMessageMainThread(kQuartzServerStarted, NULL, 0);
-
+ X11ApplicationSetCanQuit(1);
+ X11ApplicationServerReady();
// Do final display mode specific initialization before handling events
if (quartzProcs->InitInput)
quartzProcs->InitInput(argc, argv);
}
+#ifdef FAKE_RANDR
+extern char *ConnectionInfo;
+
+static int padlength[4] = {0, 3, 2, 1};
+
+static void
+RREditConnectionInfo (ScreenPtr pScreen)
+{
+ xConnSetup *connSetup;
+ char *vendor;
+ xPixmapFormat *formats;
+ xWindowRoot *root;
+ xDepth *depth;
+ xVisualType *visual;
+ int screen = 0;
+ int d;
+
+ connSetup = (xConnSetup *) ConnectionInfo;
+ vendor = (char *) connSetup + sizeof (xConnSetup);
+ formats = (xPixmapFormat *) ((char *) vendor +
+ connSetup->nbytesVendor +
+ padlength[connSetup->nbytesVendor & 3]);
+ root = (xWindowRoot *) ((char *) formats +
+ sizeof (xPixmapFormat) * screenInfo.numPixmapFormats);
+ while (screen != pScreen->myNum)
+ {
+ depth = (xDepth *) ((char *) root +
+ sizeof (xWindowRoot));
+ for (d = 0; d < root->nDepths; d++)
+ {
+ visual = (xVisualType *) ((char *) depth +
+ sizeof (xDepth));
+ depth = (xDepth *) ((char *) visual +
+ depth->nVisuals * sizeof (xVisualType));
+ }
+ root = (xWindowRoot *) ((char *) depth);
+ screen++;
+ }
+ root->pixWidth = pScreen->width;
+ root->pixHeight = pScreen->height;
+ root->mmWidth = pScreen->mmWidth;
+ root->mmHeight = pScreen->mmHeight;
+}
+#endif
+
/*
* QuartzUpdateScreens
* Adjust for screen arrangement changes.
@@ -177,6 +253,7 @@ static void QuartzUpdateScreens(void)
int x, y, width, height, sx, sy;
xEvent e;
+ DEBUG_LOG("QuartzUpdateScreens(): noPseudoramiXExtension=%d, screenInfo.numScreens=%d\n", noPseudoramiXExtension, screenInfo.numScreens);
if (noPseudoramiXExtension || screenInfo.numScreens != 1)
{
/* FIXME: if not using Xinerama, we have multiple screens, and
@@ -198,8 +275,11 @@ static void QuartzUpdateScreens(void)
pScreen->mmHeight = pScreen->mmHeight * ((double) height / pScreen->height);
pScreen->width = width;
pScreen->height = height;
-
- /* FIXME: should probably do something with RandR here. */
+
+#ifndef FAKE_RANDR
+ if(!QuartzRandRInit(pScreen))
+ FatalError("Failed to init RandR extension.\n");
+#endif
DarwinAdjustScreenOrigins(&screenInfo);
quartzProcs->UpdateScreen(pScreen);
@@ -227,7 +307,9 @@ static void QuartzUpdateScreens(void)
e.u.configureNotify.override = pRoot->overrideRedirect;
DeliverEvents(pRoot, &e, 1, NullWindow);
- /* FIXME: Should we use RREditConnectionInfo(pScreen)? */
+#ifdef FAKE_RANDR
+ RREditConnectionInfo(pScreen);
+#endif
}
@@ -272,7 +354,6 @@ static void QuartzHide(void)
}
}
quartzServerVisible = FALSE;
- QuartzMessageMainThread(kQuartzServerHidden, NULL, 0);
}
@@ -295,6 +376,14 @@ static void QuartzSetRootClip(
}
}
+/*
+ * QuartzSpaceChanged
+ * Unmap offscreen windows, map onscreen windows
+ */
+static 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);
+}
/*
* QuartzMessageServerThread
@@ -329,15 +418,29 @@ QuartzMessageServerThread(
/*
- * DarwinModeProcessEvent
+ * QuartzProcessEvent
* Process Quartz specific events.
*/
-void DarwinModeProcessEvent(
- xEvent *xe)
-{
+void QuartzProcessEvent(xEvent *xe) {
switch (xe->u.u.type) {
+ case kXquartzControllerNotify:
+ DEBUG_LOG("kXquartzControllerNotify\n");
+ AppleWMSendEvent(AppleWMControllerNotify,
+ AppleWMControllerNotifyMask,
+ xe->u.clientMessage.u.l.longs0,
+ xe->u.clientMessage.u.l.longs1);
+ break;
+
+ case kXquartzPasteboardNotify:
+ DEBUG_LOG("kXquartzPasteboardNotify\n");
+ AppleWMSendEvent(AppleWMPasteboardNotify,
+ AppleWMPasteboardNotifyMask,
+ xe->u.clientMessage.u.l.longs0,
+ xe->u.clientMessage.u.l.longs1);
+ break;
- case kXDarwinActivate:
+ case kXquartzActivate:
+ DEBUG_LOG("kXquartzActivate\n");
QuartzShow(xe->u.keyButtonPointer.rootX,
xe->u.keyButtonPointer.rootY);
AppleWMSendEvent(AppleWMActivationNotify,
@@ -345,80 +448,77 @@ void DarwinModeProcessEvent(
AppleWMIsActive, 0);
break;
- case kXDarwinDeactivate:
+ case kXquartzDeactivate:
+ DEBUG_LOG("kXquartzDeactivate\n");
AppleWMSendEvent(AppleWMActivationNotify,
AppleWMActivationNotifyMask,
AppleWMIsInactive, 0);
QuartzHide();
break;
- case kXDarwinSetRootClip:
- QuartzSetRootClip((BOOL)xe->u.clientMessage.u.l.longs0);
+ case kXquartzDisplayChanged:
+ DEBUG_LOG("kXquartzDisplayChanged\n");
+ QuartzUpdateScreens();
break;
- case kXDarwinQuit:
- GiveUp(0);
+ case kXquartzWindowState:
+ DEBUG_LOG("kXquartzWindowState\n");
+ RootlessNativeWindowStateChanged(xprGetXWindow(xe->u.clientMessage.u.l.longs0),
+ xe->u.clientMessage.u.l.longs1);
+ break;
+
+ case kXquartzWindowMoved:
+ DEBUG_LOG("kXquartzWindowMoved\n");
+ RootlessNativeWindowMoved ((WindowPtr)xe->u.clientMessage.u.l.longs0);
+ break;
+
+ case kXquartzToggleFullscreen:
+ DEBUG_LOG("kXquartzToggleFullscreen\n");
+#ifdef DARWIN_DDX_MISSING
+ if (quartzEnableRootless) QuartzSetFullscreen(!quartzHasRoot);
+ else if (quartzHasRoot) QuartzHide();
+ else QuartzShow();
+#else
+ // ErrorF("kXquartzToggleFullscreen not implemented\n");
+#endif
break;
- case kXDarwinReadPasteboard:
- QuartzReadPasteboard();
+ case kXquartzSetRootless:
+ DEBUG_LOG("kXquartzSetRootless\n");
+#ifdef DARWIN_DDX_MISSING
+ QuartzSetRootless(xe->u.clientMessage.u.l.longs0);
+ if (!quartzEnableRootless && !quartzHasRoot) QuartzHide();
+#else
+ // ErrorF("kXquartzSetRootless not implemented\n");
+#endif
break;
- case kXDarwinWritePasteboard:
- QuartzWritePasteboard();
+ case kXquartzSetRootClip:
+ QuartzSetRootClip((BOOL)xe->u.clientMessage.u.l.longs0);
break;
- /*
- * AppleWM events
- */
- case kXDarwinControllerNotify:
- AppleWMSendEvent(AppleWMControllerNotify,
- AppleWMControllerNotifyMask,
- xe->u.clientMessage.u.l.longs0,
- xe->u.clientMessage.u.l.longs1);
+ case kXquartzQuit:
+ GiveUp(0);
break;
- case kXDarwinPasteboardNotify:
- AppleWMSendEvent(AppleWMPasteboardNotify,
- AppleWMPasteboardNotifyMask,
- xe->u.clientMessage.u.l.longs0,
- xe->u.clientMessage.u.l.longs1);
+ case kXquartzReadPasteboard:
+ QuartzReadPasteboard();
break;
- case kXDarwinDisplayChanged:
- QuartzUpdateScreens();
+ case kXquartzWritePasteboard:
+ QuartzWritePasteboard();
break;
- case kXDarwinWindowState:
- case kXDarwinWindowMoved:
- // FIXME: Not implemented yet
+ case kXquartzBringAllToFront:
+ DEBUG_LOG("kXquartzBringAllToFront\n");
+ RootlessOrderAllWindows();
break;
+ case kXquartzSpaceChanged:
+ DEBUG_LOG("kXquartzSpaceChanged\n");
+ QuartzSpaceChanged(xe->u.clientMessage.u.l.longs0);
+ break;
default:
- ErrorF("Unknown application defined event type %d.\n",
- xe->u.u.type);
- }
-}
-
-
-/*
- * DarwinModeGiveUp
- * Cleanup before X server shutdown
- * Release the screen and restore the Aqua cursor.
- */
-void DarwinModeGiveUp(void)
-{
-#if 0
-// Trying to switch cursors when quitting causes deadlock
- int i;
-
- for (i = 0; i < screenInfo.numScreens; i++) {
- if (screenInfo.screens[i]) {
- QuartzSuspendXCursor(screenInfo.screens[i]);
- }
+ ErrorF("Unknown application defined event type %d.\n", xe->u.u.type);
}
-#endif
-
- if (!quartzRootless)
- quartzProcs->ReleaseScreens();
}
diff --git a/hw/darwin/quartz/quartz.h b/hw/xquartz/quartz.h
index f1b36b6b1..fbe308a92 100644
--- a/hw/darwin/quartz/quartz.h
+++ b/hw/xquartz/quartz.h
@@ -3,8 +3,7 @@
*
* External interface of the Quartz display modes seen by the generic, mode
* independent parts of the Darwin X server.
- */
-/*
+ *
* Copyright (c) 2001-2003 Greg Parker and Torrey T. Lyons.
* All Rights Reserved.
*
@@ -123,7 +122,13 @@ typedef struct _QuartzModeProcs {
} QuartzModeProcsRec, *QuartzModeProcsPtr;
extern QuartzModeProcsPtr quartzProcs;
-
-Bool QuartzLoadDisplayBundle(const char *dpyBundleName);
+extern int quartzHasRoot, quartzEnableRootless;
+
+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 QuartzGiveUp(void);
+void QuartzProcessEvent(xEvent *xe);
#endif
diff --git a/hw/darwin/quartz/quartzAudio.c b/hw/xquartz/quartzAudio.c
index b477b037b..86bb20015 100644
--- a/hw/darwin/quartz/quartzAudio.c
+++ b/hw/xquartz/quartzAudio.c
@@ -36,6 +36,10 @@
* use or other dealings in this Software without prior written authorization.
*/
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
#include "quartzCommon.h"
#include "quartzAudio.h"
@@ -44,6 +48,7 @@
#include "inputstr.h"
#include <X11/extensions/XI.h>
+#include <assert.h>
void NSBeep();
@@ -241,10 +246,10 @@ static void QuartzCoreAudioBell(
/*
- * DarwinModeBell
+ * QuartzBell
* Ring the bell
*/
-void DarwinModeBell(
+void QuartzBell(
int volume, // volume in percent of max
DeviceIntPtr pDevice,
pointer ctrl,
diff --git a/hw/darwin/quartz/quartzAudio.h b/hw/xquartz/quartzAudio.h
index c406bbc2a..c406bbc2a 100644
--- a/hw/darwin/quartz/quartzAudio.h
+++ b/hw/xquartz/quartzAudio.h
diff --git a/hw/darwin/quartz/quartzCocoa.m b/hw/xquartz/quartzCocoa.m
index 3cb191f22..71fa392b1 100644
--- a/hw/darwin/quartz/quartzCocoa.m
+++ b/hw/xquartz/quartzCocoa.m
@@ -1,4 +1,3 @@
-/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/quartzCocoa.m,v 1.2 2004/04/23 19:15:17 eich Exp $ */
/**************************************************************
*
* Quartz-specific support for the Darwin X Server
@@ -7,8 +6,6 @@
* This file is separate from the parts of Quartz support
* that use X include files to avoid symbol collisions.
*
- **************************************************************/
-/*
* Copyright (c) 2001-2004 Torrey T. Lyons and Greg Parker.
* All Rights Reserved.
*
@@ -34,7 +31,10 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCocoa.m,v 1.5 2004/06/08 22:58:10 torrey Exp $ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
#include "quartzCommon.h"
@@ -44,61 +44,10 @@
#include <Cocoa/Cocoa.h>
-#import "Preferences.h"
-#include "pseudoramiX.h"
-
extern void FatalError(const char *, ...);
extern char *display;
extern int noPanoramiXExtension;
-
-/*
- * QuartzReadPreferences
- * Read the user preferences from the Cocoa front end.
- */
-void QuartzReadPreferences(void)
-{
- char *fileString;
-
- darwinFakeButtons = [Preferences fakeButtons];
- darwinFakeMouse2Mask = [Preferences button2Mask];
- darwinFakeMouse3Mask = [Preferences button3Mask];
- darwinMouseAccelChange = [Preferences mouseAccelChange];
- quartzUseSysBeep = [Preferences systemBeep];
- quartzEnableKeyEquivalents = [Preferences enableKeyEquivalents];
-
- // quartzRootless has already been set
- if (quartzRootless) {
- // Use PseudoramiX instead of Xinerama
- noPanoramiXExtension = TRUE;
- noPseudoramiXExtension = ![Preferences xinerama];
-
- quartzUseAGL = [Preferences useAGL];
- } else {
- noPanoramiXExtension = ![Preferences xinerama];
- noPseudoramiXExtension = TRUE;
-
- // Full screen can't use AGL for GLX
- quartzUseAGL = FALSE;
- }
-
- if ([Preferences useKeymapFile]) {
- fileString = (char *) [[Preferences keymapFile] lossyCString];
- darwinKeymapFile = (char *) malloc(strlen(fileString)+1);
- if (! darwinKeymapFile)
- FatalError("malloc failed in QuartzReadPreferences()!\n");
- strcpy(darwinKeymapFile, fileString);
- }
-
- display = (char *) malloc(8);
- if (! display)
- FatalError("malloc failed in QuartzReadPreferences()!\n");
- snprintf(display, 8, "%i", [Preferences display]);
-
- darwinDesiredDepth = [Preferences depth] - 1;
-}
-
-
/*
* QuartzWriteCocoaPasteboard
* Write text to the Mac OS X pasteboard.
@@ -145,7 +94,7 @@ char *QuartzReadCocoaPasteboard(void)
char *buffer;
if (! string) return NULL;
- buffer = (char *) [string lossyCString];
+ buffer = (char *) [string UTF8String];
text = (char *) malloc(strlen(buffer)+1);
if (text)
strcpy(text, buffer);
@@ -162,17 +111,6 @@ char *QuartzReadCocoaPasteboard(void)
int QuartzFSUseQDCursor(
int depth) // screen depth
{
- switch ([Preferences useQDCursor]) {
- case qdCursor_Always:
- return TRUE;
- case qdCursor_Never:
- return FALSE;
- case qdCursor_Not8Bit:
- if (depth > 8)
- return TRUE;
- else
- return FALSE;
- }
return TRUE;
}
@@ -182,9 +120,9 @@ int QuartzFSUseQDCursor(
* Clean out any autoreleased objects.
*/
void QuartzBlockHandler(
- void *blockData,
- void *pTimeout,
- void *pReadmask)
+ pointer blockData,
+ OSTimePtr pTimeout,
+ pointer pReadmask)
{
static NSAutoreleasePool *aPool = nil;
@@ -197,9 +135,9 @@ void QuartzBlockHandler(
* QuartzWakeupHandler
*/
void QuartzWakeupHandler(
- void *blockData,
+ pointer blockData,
int result,
- void *pReadmask)
+ pointer pReadmask)
{
// nothing here
}
diff --git a/hw/darwin/quartz/quartzCommon.h b/hw/xquartz/quartzCommon.h
index f5dff662c..40c72b3c7 100644
--- a/hw/darwin/quartz/quartzCommon.h
+++ b/hw/xquartz/quartzCommon.h
@@ -46,6 +46,7 @@
#undef Cursor
#undef WindowPtr
#undef Picture
+#include <X11/Xdefs.h>
// Quartz specific per screen storage structure
typedef struct {
@@ -62,11 +63,11 @@ typedef struct {
// Data stored at startup for Cocoa front end
extern int quartzEventWriteFD;
-extern int quartzStartClients;
// User preferences used by Quartz modes
extern int quartzRootless;
extern int quartzUseSysBeep;
+extern int focusOnNewWindow;
extern int quartzUseAGL;
extern int quartzEnableKeyEquivalents;
@@ -87,20 +88,7 @@ void QuartzSetWindowMenu(int nitems, const char **items,
void QuartzFSCapture(void);
void QuartzFSRelease(void);
int QuartzFSUseQDCursor(int depth);
-void QuartzBlockHandler(void *blockData, void *pTimeout, void *pReadmask);
-void QuartzWakeupHandler(void *blockData, int result, void *pReadmask);
-
-// Messages that can be sent to the main thread.
-enum {
- kQuartzServerHidden,
- kQuartzServerStarted,
- kQuartzServerDied,
- kQuartzCursorUpdate,
- kQuartzPostEvent,
- kQuartzSetWindowMenu,
- kQuartzSetWindowMenuCheck,
- kQuartzSetFrontProcess,
- kQuartzSetCanQuit
-};
+void QuartzBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadmask);
+void QuartzWakeupHandler(pointer blockData, int result, pointer pReadmask);
#endif /* _QUARTZCOMMON_H */
diff --git a/hw/xquartz/quartzForeground.c b/hw/xquartz/quartzForeground.c
new file mode 100644
index 000000000..f7cd967dc
--- /dev/null
+++ b/hw/xquartz/quartzForeground.c
@@ -0,0 +1,45 @@
+/* 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 <ApplicationServices/ApplicationServices.h>
+#include <stdio.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/hw/xquartz/quartzForeground.h b/hw/xquartz/quartzForeground.h
new file mode 100644
index 000000000..4fc21c72f
--- /dev/null
+++ b/hw/xquartz/quartzForeground.h
@@ -0,0 +1,37 @@
+/* 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();
+
+#endif /* _QUARTZ_FOREGROUND_H_ */
diff --git a/hw/darwin/quartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index fc12522be..9b899ca67 100644
--- a/hw/darwin/quartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -1,11 +1,9 @@
/*
quartzKeyboard.c
- $Id$
- Code to build a keymap using the Carbon Keyboard Layout API,
- which is supported on Mac OS X 10.2 and newer.
+ Code to build a keymap using the Carbon Keyboard Layout API.
- Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
+ 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
@@ -33,17 +31,19 @@
prior written authorization.
*/
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
#include "quartzCommon.h"
#include <CoreServices/CoreServices.h>
#include <Carbon/Carbon.h>
-#include "darwinKeyboard.h"
-#include "keysym.h"
+#include "quartzKeyboard.h"
+#include "X11/keysym.h"
#include "keysym2ucs.h"
-#ifdef HAS_KL_API
-
#define HACK_MISSING 1
#define HACK_KEYPAD 1
@@ -146,27 +146,19 @@ const static struct {
{UKEYSYM (0x31b), XK_dead_horn}, /* COMBINING HORN */
};
-unsigned int
-DarwinModeSystemKeymapSeed (void)
-{
+unsigned int QuartzSystemKeymapSeed(void) {
static unsigned int seed;
-
static KeyboardLayoutRef last_key_layout;
KeyboardLayoutRef key_layout;
KLGetCurrentKeyboardLayout (&key_layout);
-
- if (key_layout != last_key_layout)
- seed++;
-
+ if (key_layout != last_key_layout) seed++;
last_key_layout = key_layout;
return seed;
}
-static inline UniChar
-macroman2ucs (unsigned char c)
-{
+static inline UniChar macroman2ucs(unsigned char c) {
/* Precalculated table mapping MacRoman-128 to Unicode. Generated
by creating single element CFStringRefs then extracting the
first character. */
@@ -190,112 +182,89 @@ macroman2ucs (unsigned char c)
0xaf, 0x2d8, 0x2d9, 0x2da, 0xb8, 0x2dd, 0x2db, 0x2c7,
};
- if (c < 128)
- return c;
- else
- return table[c - 128];
+ if (c < 128) return c;
+ else return table[c - 128];
}
-static KeySym
-make_dead_key (KeySym in)
-{
+static KeySym make_dead_key(KeySym in) {
int i;
for (i = 0; i < sizeof (dead_keys) / sizeof (dead_keys[0]); i++)
- {
- if (dead_keys[i].normal == in)
- return dead_keys[i].dead;
- }
+ if (dead_keys[i].normal == in) return dead_keys[i].dead;
return in;
}
-Bool
-DarwinModeReadSystemKeymap (darwinKeyboardInfo *info)
-{
+Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info) {
KeyboardLayoutRef key_layout;
- const void *chr_data;
+ const void *chr_data = NULL;
int num_keycodes = NUM_KEYCODES;
UInt32 keyboard_type = 0;
- int is_uchr, i, j;
+ int is_uchr = 1, i, j;
OSStatus err;
KeySym *k;
- KLGetCurrentKeyboardLayout (&key_layout);
- KLGetKeyboardLayoutProperty (key_layout, kKLuchrData, &chr_data);
-
- if (chr_data != NULL)
- {
- is_uchr = 1;
- keyboard_type = LMGetKbdType ();
+ TISInputSourceRef currentKeyLayoutRef = TISCopyCurrentKeyboardLayoutInputSource();
+ keyboard_type = LMGetKbdType ();
+ if (currentKeyLayoutRef) {
+ CFDataRef currentKeyLayoutDataRef = (CFDataRef )TISGetInputSourceProperty(currentKeyLayoutRef, kTISPropertyUnicodeKeyLayoutData);
+ if (currentKeyLayoutDataRef) chr_data = CFDataGetBytePtr(currentKeyLayoutDataRef);
+ }
+
+ if (chr_data == NULL) {
+ KLGetCurrentKeyboardLayout (&key_layout);
+ KLGetKeyboardLayoutProperty (key_layout, kKLuchrData, &chr_data);
+ }
+
+ if (chr_data == NULL) {
+ KLGetKeyboardLayoutProperty (key_layout, kKLKCHRData, &chr_data);
+ is_uchr = 0;
+ num_keycodes = 128;
+ }
+
+ if (chr_data == NULL) {
+ ErrorF ( "Couldn't get uchr or kchr resource\n");
+ return FALSE;
}
- else
- {
- KLGetKeyboardLayoutProperty (key_layout, kKLKCHRData, &chr_data);
-
- if (chr_data == NULL)
- {
- ErrorF ( "Couldn't get uchr or kchr resource\n");
- return FALSE;
- }
-
- is_uchr = 0;
- num_keycodes = 128;
- }
-
/* 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.) */
- for (i = 0; i < num_keycodes; i++)
- {
+ for (i = 0; i < num_keycodes; i++) {
static const int mods[4] = {0, MOD_SHIFT, MOD_OPTION,
MOD_OPTION | MOD_SHIFT};
k = info->keyMap + i * GLYPHS_PER_KEY;
- for (j = 0; j < 4; j++)
- {
- if (is_uchr)
- {
+ for (j = 0; j < 4; j++) {
+ if (is_uchr) {
UniChar s[8];
UniCharCount len;
- UInt32 dead_key_state, extra_dead;
+ UInt32 dead_key_state = 0, extra_dead = 0;
- dead_key_state = 0;
err = UCKeyTranslate (chr_data, i, kUCKeyActionDown,
mods[j] >> 8, keyboard_type, 0,
&dead_key_state, 8, &len, s);
- if (err != noErr)
- continue;
+ if (err != noErr) continue;
- if (len == 0 && dead_key_state != 0)
- {
+ if (len == 0 && dead_key_state != 0) {
/* Found a dead key. Work out which one it is, but
remembering that it's dead. */
-
- extra_dead = 0;
err = UCKeyTranslate (chr_data, i, kUCKeyActionDown,
mods[j] >> 8, keyboard_type,
kUCKeyTranslateNoDeadKeysMask,
&extra_dead, 8, &len, s);
- if (err != noErr)
- continue;
+ if (err != noErr) continue;
}
- if (len > 0 && s[0] != 0x0010)
- {
+ if (len > 0 && s[0] != 0x0010) {
k[j] = ucs2keysym (s[0]);
-
- if (dead_key_state != 0)
- k[j] = make_dead_key (k[j]);
+ if (dead_key_state != 0) k[j] = make_dead_key (k[j]);
}
- }
- else
- {
- UInt32 c, state = 0;
+ } else { // kchr
+ UInt32 c, state = 0, state2 = 0;
UInt16 code;
code = i | mods[j];
@@ -307,81 +276,49 @@ DarwinModeReadSystemKeymap (darwinKeyboardInfo *info)
us the actual dead character. */
if (state != 0)
- {
- UInt32 state2 = 0;
c = KeyTranslate (chr_data, code | 128, &state2);
- }
/* Characters seem to be in MacRoman encoding. */
- if (c != 0 && c != 0x0010)
- {
+ if (c != 0 && c != 0x0010) {
k[j] = ucs2keysym (macroman2ucs (c & 255));
- if (state != 0)
- k[j] = make_dead_key (k[j]);
+ if (state != 0) k[j] = make_dead_key (k[j]);
}
}
}
-
- 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;
+
+ 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;
}
/* Fix up some things that are normally missing.. */
- if (HACK_MISSING)
- {
- for (i = 0; i < sizeof (known_keys) / sizeof (known_keys[0]); i++)
- {
+ if (HACK_MISSING) {
+ for (i = 0; i < sizeof (known_keys) / sizeof (known_keys[0]); i++) {
k = info->keyMap + known_keys[i].keycode * GLYPHS_PER_KEY;
- if (k[0] == NoSymbol && k[1] == NoSymbol
+ if (k[0] == NoSymbol && k[1] == NoSymbol
&& k[2] == NoSymbol && k[3] == NoSymbol)
- {
- k[0] = known_keys[i].keysym;
- }
+ k[0] = known_keys[i].keysym;
}
}
/* And some more things. We find the right symbols for the numeric
keypad, but not the KP_ keysyms. So try to convert known keycodes. */
- if (HACK_KEYPAD)
- {
+ if (HACK_KEYPAD) {
for (i = 0; i < sizeof (known_numeric_keys)
- / sizeof (known_numeric_keys[0]); i++)
- {
+ / sizeof (known_numeric_keys[0]); i++) {
k = info->keyMap + known_numeric_keys[i].keycode * GLYPHS_PER_KEY;
if (k[0] == known_numeric_keys[i].normal)
- {
k[0] = known_numeric_keys[i].keypad;
- }
}
}
-
+ if(currentKeyLayoutRef) CFRelease(currentKeyLayoutRef);
+
return TRUE;
}
-
-#else /* !HAS_KL_API */
-
-unsigned int
-DarwinModeSystemKeymapSeed (void)
-{
- return 0;
-}
-
-Bool
-DarwinModeReadSystemKeymap (darwinKeyboardInfo *info)
-{
- return FALSE;
-}
-
-#endif /* HAS_KL_API */
diff --git a/hw/darwin/darwinKeyboard.h b/hw/xquartz/quartzKeyboard.h
index f4a861186..73adeda70 100644
--- a/hw/darwin/darwinKeyboard.h
+++ b/hw/xquartz/quartzKeyboard.h
@@ -24,18 +24,19 @@
* use or other dealings in this Software without prior written authorization.
*/
-#ifndef DARWIN_KEYBOARD_H
-#define DARWIN_KEYBOARD_H 1
+#ifndef QUARTZ_KEYBOARD_H
+#define QUARTZ_KEYBOARD_H 1
#define XK_TECHNICAL // needed to get XK_Escape
#define XK_PUBLISHING
-#include "keysym.h"
+#include "X11/keysym.h"
#include "inputstr.h"
// Each key can generate 4 glyphs. They are, in order:
// unshifted, shifted, modeswitch unshifted, modeswitch shifted
#define GLYPHS_PER_KEY 4
#define NUM_KEYCODES 248 // NX_NUMKEYCODES might be better
+#define MIN_KEYCODE XkbMinLegalKeyCode // unfortunately, this isn't 0...
#define MAX_KEYCODE NUM_KEYCODES + MIN_KEYCODE - 1
typedef struct darwinKeyboardInfo_struct {
@@ -45,7 +46,7 @@ typedef struct darwinKeyboardInfo_struct {
} darwinKeyboardInfo;
void DarwinKeyboardReload(DeviceIntPtr pDev);
-unsigned int DarwinModeSystemKeymapSeed(void);
-Bool DarwinModeReadSystemKeymap(darwinKeyboardInfo *info);
+Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info);
+unsigned int QuartzSystemKeymapSeed(void);
-#endif /* DARWIN_KEYBOARD_H */
+#endif /* QUARTZ_KEYBOARD_H */
diff --git a/hw/darwin/quartz/quartzPasteboard.c b/hw/xquartz/quartzPasteboard.c
index e92fe5c79..0cecff54a 100644
--- a/hw/darwin/quartz/quartzPasteboard.c
+++ b/hw/xquartz/quartzPasteboard.c
@@ -30,6 +30,10 @@
* use or other dealings in this Software without prior written authorization.
*/
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
#include "quartzPasteboard.h"
#include <X11/Xatom.h>
diff --git a/hw/darwin/quartz/quartzPasteboard.h b/hw/xquartz/quartzPasteboard.h
index afcb6e587..afcb6e587 100644
--- a/hw/darwin/quartz/quartzPasteboard.h
+++ b/hw/xquartz/quartzPasteboard.h
diff --git a/hw/xquartz/quartzStartup.c b/hw/xquartz/quartzStartup.c
new file mode 100644
index 000000000..ab4373435
--- /dev/null
+++ b/hw/xquartz/quartzStartup.c
@@ -0,0 +1,117 @@
+/**************************************************************
+ *
+ * Startup code for the Quartz Darwin X Server
+ *
+ * Copyright (c) 2001-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.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <fcntl.h>
+#include <unistd.h>
+#include <CoreFoundation/CoreFoundation.h>
+#include "quartzCommon.h"
+#include "X11Controller.h"
+#include "darwin.h"
+#include "quartz.h"
+#include "opaque.h"
+#include "micmap.h"
+
+#ifdef NDEBUG
+#undef NDEBUG
+#include <assert.h>
+#define NDEBUG 1
+#else
+#include <assert.h>
+#endif
+
+char **envpGlobal; // argcGlobal and argvGlobal
+ // are from dix/globals.c
+
+static void server_thread (void *arg) {
+ extern int main(int argc, char **argv, char **envp);
+ exit (main (argcGlobal, argvGlobal, envpGlobal));
+}
+
+/*
+ * 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;
+ int i;
+ int fd[2];
+
+ /* 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");
+
+ if (been_here) {
+ return;
+ }
+ been_here = TRUE;
+
+ // Make a pipe to pass events
+ assert( pipe(fd) == 0 );
+ darwinEventReadFD = fd[0];
+ 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" )) {
+ DarwinPrintBanner();
+ exit(0);
+ }
+ }
+
+ /* 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. */
+
+ extern void _InitHLTB(void);
+
+ _InitHLTB();
+ X11ControllerMain(argc, (const char **)argv, server_thread, NULL);
+ exit(0);
+}
diff --git a/hw/xquartz/xpr/Makefile.am b/hw/xquartz/xpr/Makefile.am
new file mode 100644
index 000000000..578e71f92
--- /dev/null
+++ b/hw/xquartz/xpr/Makefile.am
@@ -0,0 +1,57 @@
+bin_PROGRAMS = Xquartz
+
+AM_CFLAGS = $(XSERVER_CFLAGS) $(DIX_CFLAGS)
+AM_CPPFLAGS = \
+ -I$(srcdir) -I$(srcdir)/.. \
+ -I$(top_srcdir)/miext \
+ -I$(top_srcdir)/miext/rootless
+
+Xquartz_SOURCES = \
+ appledri.c \
+ dri.c \
+ xprAppleWM.c \
+ xprCursor.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)/miext/rootless/librootless.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 = \
+ Xquartz.man.pre \
+ dri.h \
+ dristruct.h \
+ appledri.h \
+ appledristr.h \
+ x-hash.h \
+ x-hook.h \
+ x-list.h \
+ xpr.h
diff --git a/hw/xquartz/xpr/Xquartz.man.pre b/hw/xquartz/xpr/Xquartz.man.pre
new file mode 100644
index 000000000..315db1ca4
--- /dev/null
+++ b/hw/xquartz/xpr/Xquartz.man.pre
@@ -0,0 +1,156 @@
+.TH XQUARTZ 1 __vendorversion__
+.SH NAME
+Xquartz \- X window system server for Quartz operating system
+.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 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
+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 \-nofakebuttons
+Do not emulate a 3 button mouse. This is the default.
+.TP 8
+.B "\-fakemouse2 \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: Shift, Option, Control, Command, Fn. For example,
+.B \-fakemouse2 """Option,Shift""
+will set holding Option, Shift and clicking on button one as equivalent to
+clicking the second mouse button.
+.TP 8
+.B "\-fakemouse3 \fImodifiers\fP"
+Change the modifier keys used to emulate the third mouse button. By default,
+Option is used to emulate the third button. Any combination of the following
+modifier names may be used: Shift, Option, Control, Command, Fn. For example,
+.B \-fakemouse3 """Control,Shift""
+will set holding Control, Shift and clicking on button one as equivalent to
+clicking the third mouse button.
+.TP 8
+.B "\-swapAltMeta"
+Swaps the meaning of the Alt and Meta modifier keys.
+.TP 8
+.B "\-keymap \fIfile\fP"
+On startup \fIXquartz\fP translates a Darwin keymapping into an X keymap.
+The default is to read this keymapping from USA.keymapping. With this option
+the keymapping will be read from \fIfile\fP instead. If the file's path is
+not specified, it will be searched for in Library/Keyboards/ underneath the
+following directories (in order): ~, /, /Network, /System.
+.TP 8
+.B \-nokeymap
+On startup \fIXquartz\fP translates a Darwin keymapping into an X keymap.
+With this option \fIXquartz\fP queries the kernel for the current keymapping
+instead of reading it from a file. This will often fail on newer kernels.
+.TP 8
+.B "\-depth \fIdepth\fP"
+Specifies the color bit depth to use. Currently only 15, and 24 color
+bits per pixel are supported. If not specified, defaults to the depth
+of the main display.
+.SH CUSTOMIZATION
+\fIXquartz\fP can also be customized using the defaults(1) command. The available options are:
+.TP 8
+.B defaults write org.x.X11 enable_fake_buttons -boolean true
+Equivalent to the \fB-fakebuttons\fP command line option.
+.TP 8
+.B defaults write org.x.X11 fake_button2 \fImodifiers\fP
+Equivalent to the \fB-fakemouse2\fP option.
+.TP 8
+.B defaults write org.x.X11 fake_button3 \fImodifiers\fP
+Equivalent to the \fB-fakemouse3\fP option.
+.TP 8
+.B defaults write org.x.X11 swap_alt_meta -boolean true
+Equivalent to the \fB-swapAltMeta\fP option.
+.TP 8
+.B defaults write org.x.X11 keymap_file \fIfilename\fP
+Equivalent to the \fB-keymap\fP option.
+.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 true
+Prevents the X server accepting remote connections.
+.TP 8
+.B defaults write org.x.X11 xinit_kills_server -boolean false
+Stops the X server exiting when the xinitrc script terminates.
+.TP 8
+.B defaults write org.x.X11 fullscreen_hotkeys -boolean false
+Allows system hotkeys to be handled while in X11 fullscreen mode.
+.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
+Equivalent to the \fB-depth\fP option.
+.SH "SEE ALSO"
+.PP
+X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1)
+.PP
+.SH AUTHORS
+XFree86 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
diff --git a/hw/darwin/quartz/xpr/appledri.c b/hw/xquartz/xpr/appledri.c
index 6d9bae10f..817826193 100644
--- a/hw/darwin/quartz/xpr/appledri.c
+++ b/hw/xquartz/xpr/appledri.c
@@ -35,6 +35,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
#define NEED_REPLIES
#define NEED_EVENTS
#include <X11/X.h>
@@ -172,7 +176,7 @@ ProcAppleDRIAuthConnection(
rep.authenticated = 1;
if (!DRIAuthConnection( screenInfo.screens[stuff->screen], stuff->magic)) {
- ErrorF("Failed to authenticate %u\n", stuff->magic);
+ ErrorF("Failed to authenticate %u\n", (unsigned int)stuff->magic);
rep.authenticated = 0;
}
WriteToClient(client, sizeof(xAppleDRIAuthConnectionReply), (char *)&rep);
diff --git a/hw/xquartz/xpr/appledri.h b/hw/xquartz/xpr/appledri.h
new file mode 100644
index 000000000..c4e43be12
--- /dev/null
+++ b/hw/xquartz/xpr/appledri.h
@@ -0,0 +1,106 @@
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+Copyright 2000 VA Linux Systems, Inc.
+Copyright (c) 2002 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, sub license, 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 (including the
+next paragraph) 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 NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Kevin E. Martin <martin@valinux.com>
+ * Jens Owen <jens@valinux.com>
+ * Rickard E. (Rik) Faith <faith@valinux.com>
+ *
+ */
+
+#ifndef _APPLEDRI_H_
+#define _APPLEDRI_H_
+
+#include <X11/Xfuncproto.h>
+
+#define X_AppleDRIQueryVersion 0
+#define X_AppleDRIQueryDirectRenderingCapable 1
+#define X_AppleDRICreateSurface 2
+#define X_AppleDRIDestroySurface 3
+#define X_AppleDRIAuthConnection 4
+/* Requests up to and including 18 were used in a previous version */
+
+/* Events */
+#define AppleDRIObsoleteEvent1 0
+#define AppleDRIObsoleteEvent2 1
+#define AppleDRIObsoleteEvent3 2
+#define AppleDRISurfaceNotify 3
+#define AppleDRINumberEvents 4
+
+/* Errors */
+#define AppleDRIClientNotLocal 0
+#define AppleDRIOperationNotSupported 1
+#define AppleDRINumberErrors (AppleDRIOperationNotSupported + 1)
+
+/* Kinds of SurfaceNotify events: */
+#define AppleDRISurfaceNotifyChanged 0
+#define AppleDRISurfaceNotifyDestroyed 1
+
+#ifndef _APPLEDRI_SERVER_
+
+typedef struct {
+ int type; /* of event */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came frome a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window; /* window of event */
+ Time time; /* server timestamp when event happened */
+ int kind; /* subtype of event */
+ int arg;
+} XAppleDRINotifyEvent;
+
+_XFUNCPROTOBEGIN
+
+Bool XAppleDRIQueryExtension (Display *dpy, int *event_base, int *error_base);
+
+Bool XAppleDRIQueryVersion (Display *dpy, int *majorVersion,
+ int *minorVersion, int *patchVersion);
+
+Bool XAppleDRIQueryDirectRenderingCapable (Display *dpy, int screen,
+ Bool *isCapable);
+
+void *XAppleDRISetSurfaceNotifyHandler (void (*fun) (Display *dpy,
+ unsigned uid, int kind));
+
+Bool XAppleDRIAuthConnection (Display *dpy, int screen, unsigned int magic);
+
+Bool XAppleDRICreateSurface (Display *dpy, int screen, Drawable drawable,
+ unsigned int client_id, unsigned int key[2],
+ unsigned int* uid);
+
+Bool XAppleDRIDestroySurface (Display *dpy, int screen, Drawable drawable);
+
+Bool XAppleDRISynchronizeSurfaces (Display *dpy);
+
+_XFUNCPROTOEND
+
+#endif /* _APPLEDRI_SERVER_ */
+#endif /* _APPLEDRI_H_ */
+
diff --git a/hw/xquartz/xpr/appledristr.h b/hw/xquartz/xpr/appledristr.h
new file mode 100644
index 000000000..8649fd329
--- /dev/null
+++ b/hw/xquartz/xpr/appledristr.h
@@ -0,0 +1,175 @@
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+Copyright 2000 VA Linux Systems, Inc.
+Copyright (c) 2002 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, sub license, 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 (including the
+next paragraph) 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 NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Kevin E. Martin <martin@valinux.com>
+ * Jens Owen <jens@valinux.com>
+ * Rickard E. (Rik) Fiath <faith@valinux.com>
+ *
+ */
+
+#ifndef _APPLEDRISTR_H_
+#define _APPLEDRISTR_H_
+
+#include "appledri.h"
+
+#define APPLEDRINAME "Apple-DRI"
+
+#define APPLE_DRI_MAJOR_VERSION 1 /* current version numbers */
+#define APPLE_DRI_MINOR_VERSION 0
+#define APPLE_DRI_PATCH_VERSION 0
+
+typedef struct _AppleDRIQueryVersion {
+ CARD8 reqType; /* always DRIReqCode */
+ CARD8 driReqType; /* always X_DRIQueryVersion */
+ CARD16 length B16;
+} xAppleDRIQueryVersionReq;
+#define sz_xAppleDRIQueryVersionReq 4
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 majorVersion B16; /* major version of DRI protocol */
+ CARD16 minorVersion B16; /* minor version of DRI protocol */
+ CARD32 patchVersion B32; /* patch version of DRI protocol */
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xAppleDRIQueryVersionReply;
+#define sz_xAppleDRIQueryVersionReply 32
+
+typedef struct _AppleDRIQueryDirectRenderingCapable {
+ CARD8 reqType; /* always DRIReqCode */
+ CARD8 driReqType; /* X_DRIQueryDirectRenderingCapable */
+ CARD16 length B16;
+ CARD32 screen B32;
+} xAppleDRIQueryDirectRenderingCapableReq;
+#define sz_xAppleDRIQueryDirectRenderingCapableReq 8
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ BOOL isCapable;
+ BOOL pad2;
+ BOOL pad3;
+ BOOL pad4;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ CARD32 pad8 B32;
+ CARD32 pad9 B32;
+} xAppleDRIQueryDirectRenderingCapableReply;
+#define sz_xAppleDRIQueryDirectRenderingCapableReply 32
+
+typedef struct _AppleDRIAuthConnection {
+ CARD8 reqType; /* always DRIReqCode */
+ CARD8 driReqType; /* always X_DRICloseConnection */
+ CARD16 length B16;
+ CARD32 screen B32;
+ CARD32 magic B32;
+} xAppleDRIAuthConnectionReq;
+#define sz_xAppleDRIAuthConnectionReq 12
+
+typedef struct {
+ BYTE type;
+ BOOL pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 authenticated B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xAppleDRIAuthConnectionReply;
+#define zx_xAppleDRIAuthConnectionReply 32
+
+typedef struct _AppleDRICreateSurface {
+ CARD8 reqType; /* always DRIReqCode */
+ CARD8 driReqType; /* always X_DRICreateSurface */
+ CARD16 length B16;
+ CARD32 screen B32;
+ CARD32 drawable B32;
+ CARD32 client_id B32;
+} xAppleDRICreateSurfaceReq;
+#define sz_xAppleDRICreateSurfaceReq 16
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 key_0 B32;
+ CARD32 key_1 B32;
+ CARD32 uid B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xAppleDRICreateSurfaceReply;
+#define sz_xAppleDRICreateSurfaceReply 32
+
+typedef struct _AppleDRIDestroySurface {
+ CARD8 reqType; /* always DRIReqCode */
+ CARD8 driReqType; /* always X_DRIDestroySurface */
+ CARD16 length B16;
+ CARD32 screen B32;
+ CARD32 drawable B32;
+} xAppleDRIDestroySurfaceReq;
+#define sz_xAppleDRIDestroySurfaceReq 12
+
+typedef struct _AppleDRINotify {
+ BYTE type; /* always eventBase + event type */
+ BYTE kind;
+ CARD16 sequenceNumber B16;
+ Time time B32; /* time of change */
+ CARD16 pad1 B16;
+ CARD32 arg B32;
+ CARD32 pad3 B32;
+} xAppleDRINotifyEvent;
+#define sz_xAppleDRINotifyEvent 20
+
+#ifdef _APPLEDRI_SERVER_
+
+void AppleDRISendEvent (
+#if NeedFunctionPrototypes
+ int /* type */,
+ unsigned int /* mask */,
+ int /* which */,
+ int /* arg */
+#endif
+);
+
+#endif /* _APPLEDRI_SERVER_ */
+#endif /* _APPLEDRISTR_H_ */
diff --git a/hw/darwin/quartz/xpr/dri.c b/hw/xquartz/xpr/dri.c
index 9aeaaa588..e5591abcb 100644
--- a/hw/darwin/quartz/xpr/dri.c
+++ b/hw/xquartz/xpr/dri.c
@@ -34,8 +34,17 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifdef XFree86LOADER
+#include "xf86.h"
+#include "xf86_ansic.h"
+#else
#include <sys/time.h>
#include <unistd.h>
+#endif
#define NEED_REPLIES
#define NEED_EVENTS
@@ -234,7 +243,7 @@ DRIFinishScreenInit(ScreenPtr pScreen)
pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify;
pScreen->ClipNotify = DRIClipNotify;
- ErrorF("[DRI] screen %d installation complete\n", pScreen->myNum);
+ // ErrorF("[DRI] screen %d installation complete\n", pScreen->myNum);
return TRUE;
}
diff --git a/hw/darwin/quartz/xpr/dri.h b/hw/xquartz/xpr/dri.h
index cf2638a9f..8bb2e9e80 100644
--- a/hw/darwin/quartz/xpr/dri.h
+++ b/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 <Xplugin.h>
typedef void (*ClipNotifyPtr)( WindowPtr, int, int );
diff --git a/hw/darwin/quartz/xpr/dristruct.h b/hw/xquartz/xpr/dristruct.h
index 9a3d01c9b..9a3d01c9b 100644
--- a/hw/darwin/quartz/xpr/dristruct.h
+++ b/hw/xquartz/xpr/dristruct.h
diff --git a/hw/darwin/quartz/xpr/x-hash.c b/hw/xquartz/xpr/x-hash.c
index a7024b2da..55d28bacd 100644
--- a/hw/darwin/quartz/xpr/x-hash.c
+++ b/hw/xquartz/xpr/x-hash.c
@@ -1,5 +1,4 @@
/* x-hash.c - basic hash tables
- $Id$
Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
@@ -28,6 +27,10 @@
promote the sale, use or other dealings in this Software without
prior written authorization. */
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
#include "x-hash.h"
#include "x-list.h"
#include <stdlib.h>
diff --git a/hw/darwin/quartz/xpr/x-hash.h b/hw/xquartz/xpr/x-hash.h
index 5d4f7f93a..3456dbedf 100644
--- a/hw/darwin/quartz/xpr/x-hash.h
+++ b/hw/xquartz/xpr/x-hash.h
@@ -1,5 +1,4 @@
/* x-hash.h -- basic hash table class
- $Id$
Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
diff --git a/hw/darwin/quartz/xpr/x-hook.c b/hw/xquartz/xpr/x-hook.c
index dcd34fdc5..bb873bbfb 100644
--- a/hw/darwin/quartz/xpr/x-hook.c
+++ b/hw/xquartz/xpr/x-hook.c
@@ -1,5 +1,4 @@
/* x-hook.c
- $Id$
Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
@@ -27,7 +26,10 @@
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. */
-/* $XFree86: $ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
#include "x-hook.h"
#include <stdlib.h>
@@ -65,6 +67,7 @@ X_PFX (hook_remove) (x_list *lst, x_hook_function *fun, void *data)
}
X_PFX (list_free) (to_delete);
+ return lst;
}
X_EXTERN void
diff --git a/hw/darwin/quartz/xpr/x-hook.h b/hw/xquartz/xpr/x-hook.h
index 0b5e038fe..392352d50 100644
--- a/hw/darwin/quartz/xpr/x-hook.h
+++ b/hw/xquartz/xpr/x-hook.h
@@ -1,5 +1,4 @@
/* x-hook.h -- lists of function,data pairs to call.
- $Id$
Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
@@ -27,7 +26,6 @@
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. */
-/* $XFree86: $ */
#ifndef X_HOOK_H
#define X_HOOK_H 1
diff --git a/hw/darwin/quartz/xpr/x-list.c b/hw/xquartz/xpr/x-list.c
index b9f23928b..3596dd355 100644
--- a/hw/darwin/quartz/xpr/x-list.c
+++ b/hw/xquartz/xpr/x-list.c
@@ -1,5 +1,4 @@
/* x-list.c
- $Id$
Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
@@ -28,6 +27,10 @@
promote the sale, use or other dealings in this Software without
prior written authorization. */
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
#include "x-list.h"
#include <stdlib.h>
#include <assert.h>
diff --git a/hw/darwin/quartz/xpr/x-list.h b/hw/xquartz/xpr/x-list.h
index bd55a53d0..04af024a2 100644
--- a/hw/darwin/quartz/xpr/x-list.h
+++ b/hw/xquartz/xpr/x-list.h
@@ -1,5 +1,4 @@
/* x-list.h -- simple list type
- $Id$
Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
diff --git a/hw/darwin/quartz/xpr/xpr.h b/hw/xquartz/xpr/xpr.h
index 73a88c03d..b8c69df0d 100644
--- a/hw/darwin/quartz/xpr/xpr.h
+++ b/hw/xquartz/xpr/xpr.h
@@ -1,7 +1,6 @@
/*
* Xplugin rootless implementation
- */
-/*
+ *
* Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -32,12 +31,13 @@
#include "screenint.h"
-extern Bool QuartzModeBundleInit(void);
+Bool QuartzModeBundleInit(void);
void AppleDRIExtensionInit(void);
void xprAppleWMInit(void);
Bool xprInit(ScreenPtr pScreen);
Bool xprIsX11Window(void *nsWindow, int windowNumber);
+
void xprHideWindows(Bool hide);
Bool QuartzInitCursor(ScreenPtr pScreen);
diff --git a/hw/darwin/quartz/xpr/xprAppleWM.c b/hw/xquartz/xpr/xprAppleWM.c
index 21746f6e9..aa5f29159 100644
--- a/hw/darwin/quartz/xpr/xprAppleWM.c
+++ b/hw/xquartz/xpr/xprAppleWM.c
@@ -1,7 +1,6 @@
/*
* Xplugin rootless implementation functions for AppleWM extension
- */
-/*
+ *
* Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
* Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
*
@@ -28,13 +27,16 @@
* use or other dealings in this Software without prior written authorization.
*/
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
#include "xpr.h"
#include "applewmExt.h"
#include "rootless.h"
-#include "Xplugin.h"
+#include <Xplugin.h>
#include <X11/X.h>
-
static int xprSetWindowLevel(
WindowPtr pWin,
int level)
diff --git a/hw/darwin/quartz/xpr/xprCursor.c b/hw/xquartz/xpr/xprCursor.c
index cb949dadc..d41fdd5c4 100644
--- a/hw/darwin/quartz/xpr/xprCursor.c
+++ b/hw/xquartz/xpr/xprCursor.c
@@ -2,8 +2,6 @@
*
* Xplugin cursor support
*
- **************************************************************/
-/*
* Copyright (c) 2001 Torrey T. Lyons and Greg Parker.
* Copyright (c) 2002 Apple Computer, Inc.
* All Rights Reserved.
@@ -31,10 +29,15 @@
* use or other dealings in this Software without prior written authorization.
*/
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
#include "quartzCommon.h"
#include "xpr.h"
#include "darwin.h"
-#include "Xplugin.h"
+#include "darwinEvents.h"
+#include <Xplugin.h>
#include "mi.h"
#include "scrnintstr.h"
@@ -82,8 +85,17 @@ load_cursor(CursorPtr src, int screen)
#ifdef ARGB_CURSOR
if (src->bits->argb != NULL)
{
- rowbytes = src->bits->width * sizeof(CARD32);
+#if BITMAP_BIT_ORDER == MSBFirst
+ rowbytes = src->bits->width * sizeof (CARD32);
data = (uint32_t *) src->bits->argb;
+#else
+ const uint32_t *be_data=(uint32_t *) src->bits->argb;
+ unsigned i;
+ rowbytes = src->bits->width * sizeof (CARD32);
+ data=alloca (rowbytes * src->bits->height);
+ for(i=0;i<(src->bits->width*src->bits->height);i++)
+ data[i]=ntohl(be_data[i]);
+#endif
}
else
#endif
@@ -371,7 +383,8 @@ QuartzInitCursor(ScreenPtr pScreen)
if (ScreenPriv == NULL)
return FALSE;
- CURSOR_PRIV(pScreen) = ScreenPriv;
+ /* CURSOR_PRIV(pScreen) = ScreenPriv; */
+ pScreen->devPrivates[darwinCursorScreenIndex].ptr = ScreenPriv;
/* override some screen procedures */
ScreenPriv->QueryBestSize = pScreen->QueryBestSize;
diff --git a/hw/darwin/quartz/xpr/xprFrame.c b/hw/xquartz/xpr/xprFrame.c
index ed02d4b62..266bbfd49 100644
--- a/hw/darwin/quartz/xpr/xprFrame.c
+++ b/hw/xquartz/xpr/xprFrame.c
@@ -1,7 +1,6 @@
/*
* Xplugin rootless implementation frame functions
- */
-/*
+ *
* Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
* Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
*
@@ -28,9 +27,14 @@
* use or other dealings in this Software without prior written authorization.
*/
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <unistd.h>
#include "xpr.h"
#include "rootlessCommon.h"
-#include "Xplugin.h"
+#include <Xplugin.h>
#include "x-hash.h"
#include "x-list.h"
#include "applewmExt.h"
@@ -66,6 +70,7 @@ 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
@@ -183,7 +188,7 @@ xprMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY)
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);
}
@@ -394,10 +399,19 @@ xprInit(ScreenPtr pScreen)
{
RootlessInit(pScreen, &xprRootlessProcs);
- 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;
+ if(!access("/tmp/disable_fb.txt", F_OK)) {
+ // always use the xp functions, dammit
+ fprintf(stderr,"setting rootless thresholds to zero to disable fb usage\n");
+ rootless_CopyBytes_threshold = 0;
+ rootless_FillBytes_threshold = 0;
+ rootless_CompositePixels_threshold = 0;
+ rootless_CopyWindow_threshold = 0;
+ } else {
+ 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;
@@ -409,7 +423,7 @@ xprInit(ScreenPtr pScreen)
* Given the id of a physical window, try to find the top-level (or root)
* X window that it represents.
*/
-static WindowPtr
+WindowPtr
xprGetXWindow(xp_window_id wid)
{
RootlessWindowRec *winRec;
@@ -422,6 +436,37 @@ xprGetXWindow(xp_window_id wid)
return winRec != NULL ? winRec->win : NULL;
}
+/*
+ * Given the id of a physical window, try to find the top-level (or root)
+ * X window that it represents.
+ */
+WindowPtr
+xprGetXWindowFromAppKit(int windowNumber)
+{
+ RootlessWindowRec *winRec;
+ Bool ret;
+ xp_window_id wid;
+
+ if (window_hash == NULL)
+ return FALSE;
+
+ /* need to lock, since this function can be called by any thread */
+
+ pthread_mutex_lock(&window_hash_mutex);
+
+ if (xp_lookup_native_window(windowNumber, &wid))
+ ret = xprGetXWindow(wid) != NULL;
+ else
+ ret = FALSE;
+
+ pthread_mutex_unlock(&window_hash_mutex);
+
+ if (!ret) return NULL;
+ winRec = x_hash_table_lookup(window_hash, (void *) wid, NULL);
+
+ return winRec != NULL ? winRec->win : NULL;
+}
+
/*
* The windowNumber is an AppKit window number. Returns TRUE if xpr is
diff --git a/hw/darwin/quartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c
index 1755ca6f7..4e5374dd1 100644
--- a/hw/darwin/quartz/xpr/xprScreen.c
+++ b/hw/xquartz/xpr/xprScreen.c
@@ -1,7 +1,6 @@
/*
* Xplugin rootless implementation screen functions
- */
-/*
+ *
* Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved.
* Copyright (c) 2004 Torrey T. Lyons. All Rights Reserved.
*
@@ -28,79 +27,99 @@
* use or other dealings in this Software without prior written authorization.
*/
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
#include "quartzCommon.h"
#include "quartz.h"
#include "xpr.h"
#include "pseudoramiX.h"
#include "darwin.h"
#include "rootless.h"
-#include "safeAlpha.h"
#include "dri.h"
#include "globals.h"
-#include "Xplugin.h"
+#include <Xplugin.h>
#include "applewmExt.h"
+#include "micmap.h"
+
+// From xprFrame.c
+WindowPtr xprGetXWindow(xp_window_id wid);
#ifdef DAMAGE
# include "damage.h"
#endif
+/* 10.4's deferred update makes X slower.. have to live with the tearing
+ for now.. */
+#define XP_NO_DEFERRED_UPDATES 8
+
// Name of GLX bundle for native OpenGL
static const char *xprOpenGLBundle = "glxCGL.bundle";
-
/*
* eventHandler
* Callback handler for Xplugin events.
*/
-static void
-eventHandler(unsigned int type, const void *arg,
- unsigned int arg_size, void *data)
-{
- switch (type)
- {
- case XP_EVENT_DISPLAY_CHANGED:
- QuartzMessageServerThread(kXDarwinDisplayChanged, 0);
- break;
-
- case XP_EVENT_WINDOW_STATE_CHANGED:
- if (arg_size >= sizeof(xp_window_state_event))
- {
- const xp_window_state_event *ws_arg = arg;
-
- QuartzMessageServerThread(kXDarwinWindowState, 2,
- ws_arg->id, ws_arg->state);
- }
- break;
-
- case XP_EVENT_WINDOW_MOVED:
- if (arg_size == sizeof(xp_window_id))
- {
- xp_window_id id = * (xp_window_id *) arg;
-
- QuartzMessageServerThread(kXDarwinWindowMoved, 1, id);
- }
- break;
-
- case XP_EVENT_SURFACE_DESTROYED:
- case XP_EVENT_SURFACE_CHANGED:
- if (arg_size == sizeof(xp_surface_id))
- {
- int kind;
-
- if (type == XP_EVENT_SURFACE_DESTROYED)
- kind = AppleDRISurfaceNotifyDestroyed;
- else
- kind = AppleDRISurfaceNotifyChanged;
-
- DRISurfaceNotify(*(xp_surface_id *) arg, kind);
- }
- break;
+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(kXquartzDisplayChanged, 0);
+ break;
+
+ case XP_EVENT_WINDOW_STATE_CHANGED:
+ if (arg_size >= sizeof(xp_window_state_event)) {
+ 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(kXquartzWindowState, 2,
+ ws_arg->id, ws_arg->state);
+ } else {
+ DEBUG_LOG("XP_EVENT_WINDOW_STATE_CHANGED: ignored\n");
+ }
+ break;
+
+ case XP_EVENT_WINDOW_MOVED:
+ 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(kXquartzWindowMoved, 1, pWin);
+ }
+ break;
+
+ case XP_EVENT_SURFACE_DESTROYED:
+ DEBUG_LOG("XP_EVENT_SURFACE_DESTROYED\n");
+ case XP_EVENT_SURFACE_CHANGED:
+ DEBUG_LOG("XP_EVENT_SURFACE_CHANGED\n");
+ if (arg_size == sizeof(xp_surface_id)) {
+ int kind;
+
+ if (type == XP_EVENT_SURFACE_DESTROYED)
+ kind = AppleDRISurfaceNotifyDestroyed;
+ else
+ kind = AppleDRISurfaceNotifyChanged;
+
+ DRISurfaceNotify(*(xp_surface_id *) arg, kind);
+ }
+ break;
+ 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;
+ QuartzMessageServerThread(kXquartzSpaceChanged, 1, space_id);
+ }
+ break;
+ default:
+ ErrorF("Unknown XP_EVENT type (%d) in xprScreen:eventHandler\n", type);
}
}
-
/*
- * displayScreenBounds
+ * displayAtIndex
* Return the display ID for a particular display index.
*/
static CGDirectDisplayID
@@ -117,30 +136,35 @@ displayAtIndex(int index)
return kCGNullDirectDisplay;
}
-
/*
* displayScreenBounds
* Return the bounds of a particular display.
*/
static CGRect
-displayScreenBounds(CGDirectDisplayID id)
+displayScreenBounds(CGDirectDisplayID id, Bool remove_menubar)
{
CGRect frame;
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 (remove_menubar && !quartzHasRoot &&
+ 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;
}
-
/*
* xprAddPseudoramiXScreens
* Add a single virtual screen encompassing all the physical screens
@@ -161,8 +185,13 @@ xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height)
/* Get the union of all screens */
for (i = 0; i < displayCount; i++)
{
+
+ /* we can't remove the menubar from the screen - doing so
+ * would constrain the pointer to the screen, not allowing it
+ * to reach the menubar..
+ */
CGDirectDisplayID dpy = displayList[i];
- frame = displayScreenBounds(dpy);
+ frame = displayScreenBounds(dpy, FALSE);
unionRect = CGRectUnion(unionRect, frame);
}
@@ -172,22 +201,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 = displayScreenBounds(dpy, TRUE);
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);
@@ -196,7 +223,6 @@ xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height)
xfree(displayList);
}
-
/*
* xprDisplayInit
* Find number of CoreGraphics displays and initialize Xplugin.
@@ -206,7 +232,7 @@ xprDisplayInit(void)
{
CGDisplayCount displayCount;
- ErrorF("Display mode: Rootless Quartz -- Xplugin implementation\n");
+ DEBUG_LOG("");
CGGetActiveDisplayList(0, NULL, &displayCount);
@@ -218,23 +244,21 @@ xprDisplayInit(void)
else
darwinScreensFound = 1;
- if (xp_init(XP_IN_BACKGROUND) != Success)
- {
+ if (xp_init(XP_BACKGROUND_EVENTS | XP_NO_DEFERRED_UPDATES) != Success)
FatalError("Could not initialize the Xplugin library.");
- }
xp_select_events(XP_EVENT_DISPLAY_CHANGED
| XP_EVENT_WINDOW_STATE_CHANGED
| XP_EVENT_WINDOW_MOVED
| XP_EVENT_SURFACE_CHANGED
- | XP_EVENT_SURFACE_DESTROYED,
+ | XP_EVENT_SURFACE_DESTROYED
+ | XP_EVENT_SPACE_CHANGED,
eventHandler, NULL);
AppleDRIExtensionInit();
xprAppleWMInit();
}
-
/*
* xprAddScreen
* Init the framebuffer and record pixmap parameters for the screen.
@@ -243,45 +267,73 @@ static Bool
xprAddScreen(int index, ScreenPtr pScreen)
{
DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
-
- /* If no specific depth chosen, look for the depth of the main display.
- Else if 16bpp specified, use that. Else use 32bpp. */
-
- dfb->colorType = TrueColor;
- dfb->bitsPerComponent = 8;
- dfb->bitsPerPixel = 32;
- dfb->colorBitsPerPixel = 24;
-
- if (darwinDesiredDepth == -1)
- {
- dfb->bitsPerComponent = CGDisplayBitsPerSample(kCGDirectMainDisplay);
- dfb->bitsPerPixel = CGDisplayBitsPerPixel(kCGDirectMainDisplay);
- dfb->colorBitsPerPixel =
- CGDisplaySamplesPerPixel(kCGDirectMainDisplay) *
- dfb->bitsPerComponent;
+ int depth = darwinDesiredDepth;
+
+ DEBUG_LOG("index=%d depth=%d\n", index, depth);
+
+ if(depth == -1) {
+ depth = CGDisplaySamplesPerPixel(kCGDirectMainDisplay) * CGDisplayBitsPerSample(kCGDirectMainDisplay);
+ //dfb->depth = CGDisplaySamplesPerPixel(kCGDirectMainDisplay) * CGDisplayBitsPerSample(kCGDirectMainDisplay);
+ //dfb->bitsPerRGB = CGDisplayBitsPerSample(kCGDirectMainDisplay);
+ //dfb->bitsPerPixel = CGDisplayBitsPerPixel(kCGDirectMainDisplay);
}
- else if (darwinDesiredDepth == 15)
- {
- dfb->bitsPerComponent = 5;
- dfb->bitsPerPixel = 16;
- dfb->colorBitsPerPixel = 15;
- }
- else if (darwinDesiredDepth == 8)
- {
- dfb->colorType = PseudoColor;
- dfb->bitsPerComponent = 8;
- dfb->bitsPerPixel = 8;
- dfb->colorBitsPerPixel = 8;
+
+ 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
+ dfb->visuals = PseudoColorMask;
+ dfb->preferredCVC = PseudoColor;
+ dfb->depth = 8;
+ dfb->bitsPerRGB = 8;
+ dfb->bitsPerPixel = 8;
+ dfb->redMask = 0;
+ dfb->greenMask = 0;
+ dfb->blueMask = 0;
+ break;
+ case 15:
+ dfb->visuals = LARGE_VISUALS;
+ dfb->preferredCVC = TrueColor;
+ dfb->depth = 15;
+ dfb->bitsPerRGB = 5;
+ dfb->bitsPerPixel = 16;
+ dfb->redMask = 0x7c00;
+ dfb->greenMask = 0x03e0;
+ dfb->blueMask = 0x001f;
+ break;
+ case 24:
+ dfb->visuals = LARGE_VISUALS;
+ dfb->preferredCVC = TrueColor;
+ dfb->depth = 24;
+ dfb->bitsPerRGB = 8;
+ dfb->bitsPerPixel = 32;
+ dfb->redMask = 0x00ff0000;
+ 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;
dpy = displayAtIndex(index);
- frame = displayScreenBounds(dpy);
+ frame = displayScreenBounds(dpy, TRUE);
dfb->x = frame.origin.x;
dfb->y = frame.origin.y;
@@ -304,7 +356,6 @@ xprAddScreen(int index, ScreenPtr pScreen)
return TRUE;
}
-
/*
* xprSetupScreen
* Setup the screen for rootless access.
@@ -312,20 +363,11 @@ xprAddScreen(int index, ScreenPtr pScreen)
static Bool
xprSetupScreen(int index, ScreenPtr pScreen)
{
- // Add alpha protecting replacements for fb screen functions
- pScreen->PaintWindowBackground = SafeAlphaPaintWindow;
- pScreen->PaintWindowBorder = SafeAlphaPaintWindow;
-
-#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
@@ -341,7 +383,6 @@ xprSetupScreen(int index, ScreenPtr pScreen)
return DRIFinishScreenInit(pScreen);
}
-
/*
* xprUpdateScreen
* Update screen after configuation change.
@@ -358,7 +399,6 @@ xprUpdateScreen(ScreenPtr pScreen)
RootlessUpdateScreenPixmap(pScreen);
}
-
/*
* xprInitInput
* Finalize xpr specific setup.
@@ -375,7 +415,6 @@ xprInitInput(int argc, char **argv)
AppleWMSetScreenOrigin(WindowTable[i]);
}
-
/*
* Quartz display mode function list.
*/
@@ -401,7 +440,6 @@ static QuartzModeProcsRec xprModeProcs = {
DRIDestroySurface
};
-
/*
* QuartzModeBundleInit
* Initialize the display mode bundle after loading.
diff --git a/include/cursor.h b/include/cursor.h
index bdf4fd301..dc0810cd1 100644
--- a/include/cursor.h
+++ b/include/cursor.h
@@ -70,7 +70,7 @@ extern int FreeCursor(
/* Quartz support on Mac OS X pulls in the QuickDraw
framework whose AllocCursor function conflicts here. */
-#ifdef __DARWIN__
+#ifdef __APPLE__
#define AllocCursor Darwin_X_AllocCursor
#endif
extern CursorPtr AllocCursor(
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 5efd356b1..29b917e03 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -127,6 +127,12 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
+/* Define to 1 if launchd is available. */
+#undef HAVE_LAUNCHD
+
+/* Have Quartz */
+#undef XQUARTZ
+
/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
diff --git a/include/dixfont.h b/include/dixfont.h
index 709da6272..d6d13b40a 100644
--- a/include/dixfont.h
+++ b/include/dixfont.h
@@ -118,7 +118,7 @@ extern void DeleteClientFontStuff(ClientPtr /*client*/);
/* Quartz support on Mac OS X pulls in the QuickDraw
framework whose InitFonts function conflicts here. */
-#ifdef __DARWIN__
+#ifdef __APPLE__
#define InitFonts Darwin_X_InitFonts
#endif
extern void InitFonts(void);
diff --git a/include/resource.h b/include/resource.h
index fd0caaeb5..ca372481f 100644
--- a/include/resource.h
+++ b/include/resource.h
@@ -153,7 +153,7 @@ extern XID FakeClientID(
/* Quartz support on Mac OS X uses the CarbonCore
framework whose AddResource function conflicts here. */
-#ifdef __DARWIN__
+#ifdef __APPLE__
#define AddResource Darwin_X_AddResource
#endif
extern Bool AddResource(
diff --git a/include/window.h b/include/window.h
index bddeb252b..6e62b87df 100644
--- a/include/window.h
+++ b/include/window.h
@@ -134,7 +134,7 @@ extern void DestroySubwindows(
/* Quartz support on Mac OS X uses the HIToolbox
framework whose ChangeWindowAttributes function conflicts here. */
-#ifdef __DARWIN__
+#ifdef __APPLE__
#define ChangeWindowAttributes Darwin_X_ChangeWindowAttributes
#endif
extern int ChangeWindowAttributes(
@@ -145,7 +145,7 @@ extern int ChangeWindowAttributes(
/* Quartz support on Mac OS X uses the HIToolbox
framework whose GetWindowAttributes function conflicts here. */
-#ifdef __DARWIN__
+#ifdef __APPLE__
#define GetWindowAttributes(w,c,x) Darwin_X_GetWindowAttributes(w,c,x)
extern void Darwin_X_GetWindowAttributes(
#else
diff --git a/include/windowstr.h b/include/windowstr.h
index a37dc6b75..27261ec17 100644
--- a/include/windowstr.h
+++ b/include/windowstr.h
@@ -138,6 +138,9 @@ typedef struct _Window {
#ifdef COMPOSITE
unsigned redirectDraw:1; /* rendering is redirected from here */
#endif
+#ifdef ROOTLESS
+ unsigned rootlessUnhittable:1; /* doesn't hit-test */
+#endif
DevUnion *devPrivates;
} WindowRec;
diff --git a/mi/miinitext.c b/mi/miinitext.c
index 8fd8c9ce1..7bf974e07 100644
--- a/mi/miinitext.c
+++ b/mi/miinitext.c
@@ -206,6 +206,9 @@ extern Bool noXkbExtension;
#ifdef PANORAMIX
extern Bool noPanoramiXExtension;
#endif
+#ifdef INXQUARTZ
+extern Bool noPseudoramiXExtension;
+#endif
#ifdef XINPUT
extern Bool noXInputExtension;
#endif
@@ -271,6 +274,9 @@ extern void MultibufferExtensionInit(INITARGS);
#ifdef PANORAMIX
extern void PanoramiXExtensionInit(INITARGS);
#endif
+#ifdef INXQUARTZ
+extern void PseudoramiXExtensionInit(INITARGS);
+#endif
#ifdef XINPUT
extern void XInputExtensionInit(INITARGS);
#endif
@@ -340,13 +346,8 @@ extern void XFree86DGAExtensionInit(INITARGS);
typedef struct __GLXprovider __GLXprovider;
extern __GLXprovider __glXMesaProvider;
extern void GlxPushProvider(__GLXprovider *impl);
-#ifndef __DARWIN__
extern void GlxExtensionInit(INITARGS);
extern void GlxWrapInitVisuals(miInitVisualsProcPtr *);
-#else
-extern void DarwinGlxExtensionInit(INITARGS);
-extern void DarwinGlxWrapInitVisuals(miInitVisualsProcPtr *);
-#endif
#endif
#ifdef XF86DRI
extern void XFree86DRIExtensionInit(INITARGS);
@@ -537,6 +538,9 @@ InitExtensions(argc, argv)
if (!noPanoramiXExtension) PanoramiXExtensionInit();
# endif
#endif
+#ifdef INXQUARTZ
+ if(!noPseudoramiXExtension) PseudoramiXExtensionInit();
+#endif
#ifdef SHAPE
if (!noShapeExtension) ShapeExtensionInit();
#endif
@@ -630,13 +634,8 @@ InitExtensions(argc, argv)
#endif
#endif
#ifdef GLXEXT
-
GlxPushProvider(&__glXMesaProvider);
-#ifndef __DARWIN__
if (!noGlxExtension) GlxExtensionInit();
-#else
- if (!noGlxExtension) DarwinGlxExtensionInit();
-#endif
#endif
#ifdef XFIXES
/* must be before Render to layer DisplayCursor correctly */
@@ -670,11 +669,7 @@ InitVisualWrap()
{
miResetInitVisuals();
#ifdef GLXEXT
-#ifndef __DARWIN__
GlxWrapInitVisuals(&miInitVisualsProc);
-#else
- DarwinGlxWrapInitVisuals(&miInitVisualsProc);
-#endif
#endif
}
diff --git a/miext/Makefile.am b/miext/Makefile.am
index 4fa584b35..f138963b4 100644
--- a/miext/Makefile.am
+++ b/miext/Makefile.am
@@ -2,4 +2,7 @@ SUBDIRS = damage shadow
if COMPOSITE
SUBDIRS += cw
endif
+if XQUARTZ
+SUBDIRS += rootless
+endif
DIST_SUBDIRS = damage shadow cw rootless
diff --git a/miext/damage/damage.c b/miext/damage/damage.c
index cd66b5473..2acff11e8 100755
--- a/miext/damage/damage.c
+++ b/miext/damage/damage.c
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Copyright © 2003 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -72,6 +70,12 @@
#define pixmapDamage(pPixmap) damagePixPriv(pPixmap)
+static int damageScrPrivateIndex;
+static int damagePixPrivateIndex;
+static int damageGCPrivateIndex;
+static int damageWinPrivateIndex;
+static int damageGeneration;
+
static DamagePtr *
getDrawableDamageRef (DrawablePtr pDrawable)
{
@@ -368,12 +372,12 @@ static void damageChangeClip(GCPtr, int, pointer, int);
static void damageDestroyClip(GCPtr);
static void damageCopyClip(GCPtr, GCPtr);
-GCFuncs damageGCFuncs = {
+static GCFuncs damageGCFuncs = {
damageValidateGC, damageChangeGC, damageCopyGC, damageDestroyGC,
damageChangeClip, damageDestroyClip, damageCopyClip
};
-extern GCOps damageGCOps;
+static GCOps damageGCOps;
static Bool
damageCreateGC(GCPtr pGC)
@@ -1686,7 +1690,7 @@ damageCopyWindow(WindowPtr pWindow,
wrap (pScrPriv, pScreen, CopyWindow, damageCopyWindow);
}
-GCOps damageGCOps = {
+static GCOps damageGCOps = {
damageFillSpans, damageSetSpans,
damagePutImage, damageCopyArea,
damageCopyPlane, damagePolyPoint,
@@ -1787,12 +1791,6 @@ damageCloseScreen (int i, ScreenPtr pScreen)
return (*pScreen->CloseScreen) (i, pScreen);
}
-int damageScrPrivateIndex;
-int damagePixPrivateIndex;
-int damageGCPrivateIndex;
-int damageWinPrivateIndex;
-int damageGeneration;
-
Bool
DamageSetup (ScreenPtr pScreen)
{
@@ -1831,16 +1829,6 @@ DamageSetup (ScreenPtr pScreen)
if (!pScrPriv)
return FALSE;
-#ifdef COMPOSITE
- /* This is a kludge to ensure wrapping order with the composite wrapper.
- * If it's done from compinit.c, then DamageSetup may be called before the
- * extension init phase, so that cw will be higher in the wrapping chain and
- * rewrite drawables before damage gets to it, causing confusion.
- */
- if (!noCompositeExtension)
- miInitializeCompositeWrapper (pScreen);
-#endif
-
pScrPriv->internalLevel = 0;
pScrPriv->pScreenDamage = 0;
diff --git a/miext/damage/damage.h b/miext/damage/damage.h
index 36a06545f..4cfc8127d 100755
--- a/miext/damage/damage.h
+++ b/miext/damage/damage.h
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Copyright © 2003 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
diff --git a/miext/damage/damagestr.h b/miext/damage/damagestr.h
index 93e213fd1..58ee2bb38 100755
--- a/miext/damage/damagestr.h
+++ b/miext/damage/damagestr.h
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Copyright © 2003 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -82,11 +80,7 @@ typedef struct _damageGCPriv {
GCFuncs *funcs;
} DamageGCPrivRec, *DamageGCPrivPtr;
-extern int damageScrPrivateIndex;
-extern int damagePixPrivateIndex;
-extern int damageGCPrivateIndex;
-extern int damageWinPrivateIndex;
-
+/* XXX should move these into damage.c, damageScrPrivateIndex is static */
#define damageGetScrPriv(pScr) \
((DamageScrPrivPtr) (pScr)->devPrivates[damageScrPrivateIndex].ptr)
diff --git a/miext/rootless/Makefile.am b/miext/rootless/Makefile.am
index ecf762a64..dc851702f 100644
--- a/miext/rootless/Makefile.am
+++ b/miext/rootless/Makefile.am
@@ -1,23 +1,19 @@
-EXTRA_DIST = \
- accel/rlAccel.c \
- accel/rlAccel.h \
- accel/rlBlt.c \
- accel/rlCopy.c \
- accel/rlFill.c \
- accel/rlFillRect.c \
- accel/rlFillSpans.c \
- accel/rlGlyph.c \
- accel/rlSolid.c \
- README.txt \
+AM_CFLAGS = $(DIX_CFLAGS) $(XSERVER_CFLAGS)
+AM_CPPFLAGS = -I$(top_srcdir)/hw/xfree86/os-support
+
+SUBDIRS = accel
+
+noinst_LTLIBRARIES = librootless.la
+librootless_la_SOURCES = \
rootlessCommon.c \
- rootlessCommon.h \
- rootlessConfig.h \
rootlessGC.c \
- rootless.h \
rootlessScreen.c \
rootlessValTree.c \
- rootlessWindow.c \
- rootlessWindow.h \
- safeAlpha/safeAlpha.h \
- safeAlpha/safeAlphaPicture.c \
- safeAlpha/safeAlphaWindow.c
+ rootlessWindow.c
+
+EXTRA_DIST = \
+ README.txt \
+ rootless.h \
+ rootlessCommon.h \
+ rootlessConfig.h \
+ rootlessWindow.h
diff --git a/miext/rootless/README.txt b/miext/rootless/README.txt
index ffd17902f..2c3fbb05a 100644
--- a/miext/rootless/README.txt
+++ b/miext/rootless/README.txt
@@ -76,10 +76,6 @@ rootlessConfig.h to specify compile time options for its platform.
The following compile-time options are defined in
rootlessConfig.h:
- o ROOTLESS_ACCEL: If true, use the optional rootless acceleration
- functions where possible to a accelerate X11 drawing primitives.
- If false, all drawing will be done with fb.
-
o ROOTLESS_GLOBAL_COORDS: This option controls the way that frame
coordinates are passed to the rootless implementation. If false,
the coordinates are passed per screen relative to the origin of
diff --git a/miext/rootless/accel/Makefile.am b/miext/rootless/accel/Makefile.am
new file mode 100644
index 000000000..ca41653b7
--- /dev/null
+++ b/miext/rootless/accel/Makefile.am
@@ -0,0 +1,15 @@
+AM_CFLAGS = $(DIX_CFLAGS) $(XSERVER_CFLAGS)
+AM_CPPFLAGS = -I$(srcdir)/.. -I$(top_srcdir)/hw/xfree86/os-support
+
+noinst_LTLIBRARIES = librlAccel.la
+librlAccel_la_SOURCES = \
+ rlAccel.c \
+ rlBlt.c \
+ rlCopy.c \
+ rlFill.c \
+ rlFillRect.c \
+ rlFillSpans.c \
+ rlGlyph.c \
+ rlSolid.c
+
+EXTRA_DIST = rlAccel.h
diff --git a/miext/rootless/accel/rlBlt.c b/miext/rootless/accel/rlBlt.c
index d1e765836..b5fe74085 100644
--- a/miext/rootless/accel/rlBlt.c
+++ b/miext/rootless/accel/rlBlt.c
@@ -31,10 +31,23 @@
#include <dix-config.h>
#endif
+#include <stddef.h> /* For NULL */
+#include <string.h>
#include "fb.h"
#include "rootlessCommon.h"
#include "rlAccel.h"
+#define InitializeShifts(sx,dx,ls,rs) { \
+ if (sx != dx) { \
+ if (sx > dx) { \
+ ls = sx - dx; \
+ rs = FB_UNIT - ls; \
+ } else { \
+ rs = dx - sx; \
+ ls = FB_UNIT - rs; \
+ } \
+ } \
+}
void
rlBlt (FbBits *srcLine,
@@ -73,6 +86,29 @@ rlBlt (FbBits *srcLine,
return;
}
#endif
+
+ if (alu == GXcopy && pm == FB_ALLONES && !reverse &&
+ !(srcX & 7) && !(dstX & 7) && !(width & 7)) {
+ int i;
+ CARD8 *src = (CARD8 *) srcLine;
+ CARD8 *dst = (CARD8 *) dstLine;
+
+ srcStride *= sizeof(FbBits);
+ dstStride *= sizeof(FbBits);
+ width >>= 3;
+ src += (srcX >> 3);
+ dst += (dstX >> 3);
+
+ if (!upsidedown)
+ for (i = 0; i < height; i++)
+ memcpy(dst + i * dstStride, src + i * srcStride, width);
+ else
+ for (i = height - 1; i >= 0; i--)
+ memcpy(dst + i * dstStride, src + i * srcStride, width);
+
+ return;
+ }
+
FbInitializeMergeRop(alu, pm);
destInvarient = FbDestInvarientMergeRop();
if (upsidedown)
@@ -324,9 +360,12 @@ rlBlt (FbBits *srcLine,
bits1 = *src++;
if (startmask)
{
- bits = FbScrLeft(bits1, leftShift);
- bits1 = *src++;
- bits |= FbScrRight(bits1, rightShift);
+ bits = FbScrLeft(bits1, leftShift);
+ if (FbScrLeft(startmask, rightShift))
+ {
+ bits1 = *src++;
+ bits |= FbScrRight(bits1, rightShift);
+ }
FbDoLeftMaskByteMergeRop (dst, bits, startbyte, startmask);
dst++;
}
diff --git a/miext/rootless/accel/rlFill.c b/miext/rootless/accel/rlFill.c
index 0d0d01251..a80c7769f 100644
--- a/miext/rootless/accel/rlFill.c
+++ b/miext/rootless/accel/rlFill.c
@@ -89,7 +89,7 @@ rlFill (DrawablePtr pDrawable,
dstBpp,
(pGC->patOrg.x + pDrawable->x + dstXoff),
- pGC->patOrg.y + pDrawable->y + dstYoff - y);
+ pGC->patOrg.y + pDrawable->y - y);
}
else
{
@@ -126,7 +126,7 @@ rlFill (DrawablePtr pDrawable,
fgand, fgxor,
bgand, bgxor,
pGC->patOrg.x + pDrawable->x + dstXoff,
- pGC->patOrg.y + pDrawable->y + dstYoff - y);
+ pGC->patOrg.y + pDrawable->y - y);
}
break;
}
@@ -154,7 +154,7 @@ rlFill (DrawablePtr pDrawable,
pPriv->pm,
dstBpp,
(pGC->patOrg.x + pDrawable->x + dstXoff) * dstBpp,
- pGC->patOrg.y + pDrawable->y + dstYoff - y);
+ pGC->patOrg.y + pDrawable->y - y);
break;
}
}
diff --git a/miext/rootless/rootless.h b/miext/rootless/rootless.h
index f83defeb6..5224dca2b 100644
--- a/miext/rootless/rootless.h
+++ b/miext/rootless/rootless.h
@@ -66,7 +66,6 @@ typedef struct _RootlessWindowRec {
int bytesPerRow;
PixmapPtr pixmap;
- PixmapPtr oldPixmap;
#ifdef ROOTLESS_TRACK_DAMAGE
RegionRec damage;
@@ -74,6 +73,8 @@ typedef struct _RootlessWindowRec {
unsigned int is_drawing :1; // Currently drawing?
unsigned int is_reorder_pending :1;
+ unsigned int is_offscreen :1;
+ unsigned int is_obscured :1;
} RootlessWindowRec, *RootlessWindowPtr;
@@ -432,4 +433,8 @@ void RootlessUpdateScreenPixmap(ScreenPtr pScreen);
*/
void RootlessRepositionWindows(ScreenPtr pScreen);
+/*
+ * Bring all windows to the front of the Aqua stack
+ */
+void RootlessOrderAllWindows (void);
#endif /* _ROOTLESS_H */
diff --git a/miext/rootless/rootlessCommon.c b/miext/rootless/rootlessCommon.c
index 8fd922d4a..562f65577 100644
--- a/miext/rootless/rootlessCommon.c
+++ b/miext/rootless/rootlessCommon.c
@@ -33,7 +33,11 @@
#include <dix-config.h>
#endif
+#include <stddef.h> /* For NULL */
+#include <limits.h> /* For CHAR_BIT */
+
#include "rootlessCommon.h"
+#include "colormapst.h"
unsigned int rootless_CopyBytes_threshold = 0;
unsigned int rootless_FillBytes_threshold = 0;
@@ -95,6 +99,41 @@ IsFramedWindow(WindowPtr pWin)
return (top && WINREC(top));
}
+Bool
+RootlessResolveColormap (ScreenPtr pScreen, int first_color,
+ int n_colors, uint32_t *colors)
+{
+ int last, i;
+ ColormapPtr map;
+
+ map = RootlessGetColormap (pScreen);
+ if (map == NULL || map->class != PseudoColor) return FALSE;
+
+ last = MIN (map->pVisual->ColormapEntries, first_color + n_colors);
+ for (i = MAX (0, first_color); i < last; i++) {
+ Entry *ent = map->red + i;
+ uint16_t red, green, blue;
+
+ if (!ent->refcnt) continue;
+ if (ent->fShared) {
+ red = ent->co.shco.red->color;
+ green = ent->co.shco.green->color;
+ blue = ent->co.shco.blue->color;
+ } else {
+ red = ent->co.local.red;
+ green = ent->co.local.green;
+ blue = ent->co.local.blue;
+ }
+
+ colors[i - first_color] = (0xFF000000UL
+ | ((uint32_t) red & 0xff00) << 8
+ | (green & 0xff00)
+ | (blue >> 8));
+ }
+
+ return TRUE;
+}
+
/*
* RootlessStartDrawing
@@ -133,8 +172,24 @@ void RootlessStartDrawing(WindowPtr pWindow)
winRec->is_drawing = TRUE;
}
- winRec->oldPixmap = pScreen->GetWindowPixmap(pWindow);
- pScreen->SetWindowPixmap(pWindow, winRec->pixmap);
+ PixmapPtr curPixmap = pScreen->GetWindowPixmap(pWindow);
+ if (curPixmap == winRec->pixmap)
+ {
+ RL_DEBUG_MSG("Window %p already has winRec->pixmap %p; not pushing\n", pWindow, winRec->pixmap);
+ }
+ else
+ {
+ PixmapPtr oldPixmap = pWindow->devPrivates[rootlessWindowOldPixmapPrivateIndex].ptr;
+ if (oldPixmap != NULL)
+ {
+ if (oldPixmap == curPixmap)
+ RL_DEBUG_MSG("Window %p's curPixmap %p is the same as its oldPixmap; strange\n", pWindow, curPixmap);
+ else
+ RL_DEBUG_MSG("Window %p's existing oldPixmap %p being lost!\n", pWindow, oldPixmap);
+ }
+ pWindow->devPrivates[rootlessWindowOldPixmapPrivateIndex].ptr = curPixmap;
+ pScreen->SetWindowPixmap(pWindow, winRec->pixmap);
+ }
}
@@ -143,6 +198,29 @@ void RootlessStartDrawing(WindowPtr pWindow)
* Stop drawing to a window's backing buffer. If flush is true,
* damaged regions are flushed to the screen.
*/
+static int RestorePreDrawingPixmapVisitor(WindowPtr pWindow, pointer data)
+{
+ RootlessWindowRec *winRec = (RootlessWindowRec*)data;
+ ScreenPtr pScreen = pWindow->drawable.pScreen;
+ PixmapPtr exPixmap = pScreen->GetWindowPixmap(pWindow);
+ PixmapPtr oldPixmap = pWindow->devPrivates[rootlessWindowOldPixmapPrivateIndex].ptr;
+ if (oldPixmap == NULL)
+ {
+ if (exPixmap == winRec->pixmap)
+ RL_DEBUG_MSG("Window %p appears to be in drawing mode (ex-pixmap %p equals winRec->pixmap, which is being freed) but has no oldPixmap!\n", pWindow, exPixmap);
+ }
+ else
+ {
+ if (exPixmap != winRec->pixmap)
+ RL_DEBUG_MSG("Window %p appears to be in drawing mode (oldPixmap %p) but ex-pixmap %p not winRec->pixmap %p!\n", pWindow, oldPixmap, exPixmap, winRec->pixmap);
+ if (oldPixmap == winRec->pixmap)
+ RL_DEBUG_MSG("Window %p's oldPixmap %p is winRec->pixmap, which has just been freed!\n", pWindow, oldPixmap);
+ pScreen->SetWindowPixmap(pWindow, oldPixmap);
+ pWindow->devPrivates[rootlessWindowOldPixmapPrivateIndex].ptr = NULL;
+ }
+ return WT_WALKCHILDREN;
+}
+
void RootlessStopDrawing(WindowPtr pWindow, Bool flush)
{
ScreenPtr pScreen = pWindow->drawable.pScreen;
@@ -159,7 +237,7 @@ void RootlessStopDrawing(WindowPtr pWindow, Bool flush)
SCREENREC(pScreen)->imp->StopDrawing(winRec->wid, flush);
FreeScratchPixmapHeader(winRec->pixmap);
- pScreen->SetWindowPixmap(pWindow, winRec->oldPixmap);
+ TraverseTree(top, RestorePreDrawingPixmapVisitor, (pointer)winRec);
winRec->pixmap = NULL;
winRec->is_drawing = FALSE;
diff --git a/miext/rootless/rootlessCommon.h b/miext/rootless/rootlessCommon.h
index 3bf6af02f..62524b96a 100644
--- a/miext/rootless/rootlessCommon.h
+++ b/miext/rootless/rootlessCommon.h
@@ -32,12 +32,17 @@
#include <dix-config.h>
#endif
+#include <stdint.h>
#ifndef _ROOTLESSCOMMON_H
#define _ROOTLESSCOMMON_H
#include "rootless.h"
#include "fb.h"
+#ifdef SHAPE
+#include "scrnintstr.h"
+#endif /* SHAPE */
+
#ifdef RENDER
#include "picturestr.h"
#endif
@@ -55,6 +60,7 @@
extern int rootlessGCPrivateIndex;
extern int rootlessScreenPrivateIndex;
extern int rootlessWindowPrivateIndex;
+extern int rootlessWindowOldPixmapPrivateIndex;
// RootlessGCRec: private per-gc data
@@ -104,13 +110,20 @@ typedef struct _RootlessScreenRec {
GlyphsProcPtr Glyphs;
#endif
+ InstallColormapProcPtr InstallColormap;
+ UninstallColormapProcPtr UninstallColormap;
+ StoreColorsProcPtr StoreColors;
+
void *pixmap_data;
unsigned int pixmap_data_size;
+ ColormapPtr colormap;
+
void *redisplay_timer;
unsigned int redisplay_timer_set :1;
unsigned int redisplay_queued :1;
unsigned int redisplay_expired :1;
+ unsigned int colormap_changed :1;
} RootlessScreenRec, *RootlessScreenPtr;
@@ -251,6 +264,16 @@ void RootlessRedisplayScreen(ScreenPtr pScreen);
void RootlessQueueRedisplay(ScreenPtr pScreen);
+/* Return the colormap currently installed on the given screen. */
+ColormapPtr RootlessGetColormap (ScreenPtr pScreen);
+
+/* Convert colormap to ARGB. */
+Bool RootlessResolveColormap (ScreenPtr pScreen, int first_color,
+ int n_colors, uint32_t *colors);
+
+void RootlessFlushWindowColormap (WindowPtr pWin);
+void RootlessFlushScreenColormaps (ScreenPtr pScreen);
+
// Move a window to its proper location on the screen.
void RootlessRepositionWindow(WindowPtr pWin);
diff --git a/miext/rootless/rootlessConfig.h b/miext/rootless/rootlessConfig.h
index 3e326bf06..50bac3f51 100644
--- a/miext/rootless/rootlessConfig.h
+++ b/miext/rootless/rootlessConfig.h
@@ -34,25 +34,24 @@
#ifndef _ROOTLESSCONFIG_H
#define _ROOTLESSCONFIG_H
-#ifdef __DARWIN__
+#ifdef __APPLE__
-# define ROOTLESS_ACCEL TRUE
# define ROOTLESS_GLOBAL_COORDS TRUE
# define ROOTLESS_PROTECT_ALPHA TRUE
# define ROOTLESS_REDISPLAY_DELAY 10
# define ROOTLESS_RESIZE_GRAVITY TRUE
# undef ROOTLESS_TRACK_DAMAGE
+/*# define ROOTLESSDEBUG*/
/* Bit mask for alpha channel with a particular number of bits per
pixel. Note that we only care for 32bpp data. Mac OS X uses planar
alpha for 16bpp. */
# define RootlessAlphaMask(bpp) ((bpp) == 32 ? 0xFF000000 : 0)
-#endif /* __DARWIN__ */
+#endif /* __APPLE__ */
#if defined(__CYGWIN__) || defined(WIN32)
-# define ROOTLESS_ACCEL YES
# define ROOTLESS_GLOBAL_COORDS TRUE
# define ROOTLESS_PROTECT_ALPHA NO
# define ROOTLESS_REDISPLAY_DELAY 10
diff --git a/miext/rootless/rootlessGC.c b/miext/rootless/rootlessGC.c
index 5341267fb..d4a543604 100644
--- a/miext/rootless/rootlessGC.c
+++ b/miext/rootless/rootlessGC.c
@@ -33,6 +33,7 @@
#include <dix-config.h>
#endif
+#include <stddef.h> /* For NULL */
#include "mi.h"
#include "scrnintstr.h"
#include "gcstruct.h"
@@ -117,7 +118,7 @@ static GCOps rootlessGCOps = {
/*
There are two issues we must contend with when drawing. These are
- controlled with ROOTLESS_PROTECT_ALPHA and ROOTLESS_ACCEL.
+ controlled with ROOTLESS_PROTECT_ALPHA and RootlessAccelInit().
If ROOTLESS_PROTECT_ALPHA is set, we have to make sure that the alpha
channel of the on screen windows is always opaque. fb makes this harder
@@ -140,9 +141,9 @@ static GCOps rootlessGCOps = {
from another window since its alpha channel must also be opaque.
The other issue to consider is that the rootless implementation may
- provide accelerated drawing functions if ROOTLESS_ACCEL is set. For some
- drawing primitives we swap in rootless acceleration functions, which use
- the accelerated drawing functions where possible.
+ provide accelerated drawing functions if RootlessAccelInit() is called.For
+ some drawing primitives we swap in rootless acceleration functions, which
+ use the accelerated drawing functions where possible.
Where both alpha protection and acceleration is used, it is even a bigger
win to relax the planemask to all ones because most accelerated drawing
@@ -412,10 +413,12 @@ static void RootlessCopyClip(GCPtr pgcDst, GCPtr pgcSrc)
#define GC_IS_ROOT(pDst) ((pDst)->type == DRAWABLE_WINDOW \
&& IsRoot ((WindowPtr) (pDst)))
-#define GC_SKIP_ROOT(pDst) \
+#define GC_SKIP_ROOT(pDst, pGC) \
do { \
- if (GC_IS_ROOT (pDst)) \
+ if (GC_IS_ROOT (pDst)) { \
+ GCOP_WRAP(pGC); \
return; \
+ } \
} while (0)
@@ -425,7 +428,7 @@ RootlessFillSpans(DrawablePtr dst, GCPtr pGC, int nInit,
{
GC_SAVE(pGC);
GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
+ GC_SKIP_ROOT(dst, pGC);
RL_DEBUG_MSG("fill spans start ");
if (nInit <= 0) {
@@ -481,7 +484,7 @@ RootlessSetSpans(DrawablePtr dst, GCPtr pGC, char *pSrc,
int nspans, int sorted)
{
GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
+ GC_SKIP_ROOT(dst, pGC);
RL_DEBUG_MSG("set spans start ");
if (nspans <= 0) {
@@ -532,7 +535,7 @@ RootlessPutImage(DrawablePtr dst, GCPtr pGC,
BoxRec box;
GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
+ GC_SKIP_ROOT(dst, pGC);
RL_DEBUG_MSG("put image start ");
RootlessStartDrawing((WindowPtr) dst);
@@ -564,7 +567,10 @@ RootlessCopyArea(DrawablePtr pSrc, DrawablePtr dst, GCPtr pGC,
GCOP_UNWRAP(pGC);
if (GC_IS_ROOT(dst) || GC_IS_ROOT(pSrc))
+ {
+ GCOP_WRAP(pGC);
return NULL; /* nothing exposed */
+ }
RL_DEBUG_MSG("copy area start (src 0x%x, dst 0x%x)", pSrc, dst);
@@ -614,7 +620,10 @@ static RegionPtr RootlessCopyPlane(DrawablePtr pSrc, DrawablePtr dst,
GCOP_UNWRAP(pGC);
if (GC_IS_ROOT(dst) || GC_IS_ROOT(pSrc))
+ {
+ GCOP_WRAP(pGC);
return NULL; /* nothing exposed */
+ }
RL_DEBUG_MSG("copy plane start ");
@@ -651,7 +660,7 @@ static void RootlessPolyPoint(DrawablePtr dst, GCPtr pGC,
int mode, int npt, DDXPointPtr pptInit)
{
GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
+ GC_SKIP_ROOT(dst, pGC);
RL_DEBUG_MSG("polypoint start ");
RootlessStartDrawing((WindowPtr) dst);
@@ -745,7 +754,7 @@ static void RootlessPolylines(DrawablePtr dst, GCPtr pGC,
int mode, int npt, DDXPointPtr pptInit)
{
GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
+ GC_SKIP_ROOT(dst, pGC);
RL_DEBUG_MSG("poly lines start ");
RootlessStartDrawing((WindowPtr) dst);
@@ -820,7 +829,7 @@ static void RootlessPolySegment(DrawablePtr dst, GCPtr pGC,
int nseg, xSegment *pSeg)
{
GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
+ GC_SKIP_ROOT(dst, pGC);
RL_DEBUG_MSG("poly segment start (win 0x%x)", dst);
RootlessStartDrawing((WindowPtr) dst);
@@ -891,7 +900,7 @@ static void RootlessPolyRectangle(DrawablePtr dst, GCPtr pGC,
int nRects, xRectangle *pRects)
{
GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
+ GC_SKIP_ROOT(dst, pGC);
RL_DEBUG_MSG("poly rectangle start ");
RootlessStartDrawing((WindowPtr) dst);
@@ -952,7 +961,7 @@ static void RootlessPolyRectangle(DrawablePtr dst, GCPtr pGC,
static void RootlessPolyArc(DrawablePtr dst, GCPtr pGC, int narcs, xArc *parcs)
{
GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
+ GC_SKIP_ROOT(dst, pGC);
RL_DEBUG_MSG("poly arc start ");
RootlessStartDrawing((WindowPtr) dst);
@@ -1008,7 +1017,7 @@ static void RootlessFillPolygon(DrawablePtr dst, GCPtr pGC,
{
GC_SAVE(pGC);
GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
+ GC_SKIP_ROOT(dst, pGC);
RL_DEBUG_MSG("fill poly start (win 0x%x, fillStyle 0x%x)", dst,
pGC->fillStyle);
@@ -1082,7 +1091,7 @@ static void RootlessPolyFillRect(DrawablePtr dst, GCPtr pGC,
{
GC_SAVE(pGC);
GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
+ GC_SKIP_ROOT(dst, pGC);
RL_DEBUG_MSG("fill rect start (win 0x%x, fillStyle 0x%x)", dst,
pGC->fillStyle);
@@ -1137,7 +1146,7 @@ static void RootlessPolyFillArc(DrawablePtr dst, GCPtr pGC,
{
GC_SAVE(pGC);
GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
+ GC_SKIP_ROOT(dst, pGC);
RL_DEBUG_MSG("fill arc start ");
if (narcsInit > 0) {
@@ -1192,7 +1201,7 @@ static void RootlessImageText8(DrawablePtr dst, GCPtr pGC,
{
GC_SAVE(pGC);
GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
+ GC_SKIP_ROOT(dst, pGC);
RL_DEBUG_MSG("imagetext8 start ");
if (count > 0) {
@@ -1246,7 +1255,10 @@ static int RootlessPolyText8(DrawablePtr dst, GCPtr pGC,
GCOP_UNWRAP(pGC);
if (GC_IS_ROOT(dst))
+ {
+ GCOP_WRAP(pGC);
return 0;
+ }
RL_DEBUG_MSG("polytext8 start ");
@@ -1284,7 +1296,7 @@ static void RootlessImageText16(DrawablePtr dst, GCPtr pGC,
{
GC_SAVE(pGC);
GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
+ GC_SKIP_ROOT(dst, pGC);
RL_DEBUG_MSG("imagetext16 start ");
if (count > 0) {
@@ -1338,7 +1350,10 @@ static int RootlessPolyText16(DrawablePtr dst, GCPtr pGC,
GCOP_UNWRAP(pGC);
if (GC_IS_ROOT(dst))
+ {
+ GCOP_WRAP(pGC);
return 0;
+ }
RL_DEBUG_MSG("polytext16 start ");
@@ -1377,7 +1392,7 @@ static void RootlessImageGlyphBlt(DrawablePtr dst, GCPtr pGC,
{
GC_SAVE(pGC);
GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
+ GC_SKIP_ROOT(dst, pGC);
RL_DEBUG_MSG("imageglyph start ");
if (nglyphInit > 0) {
@@ -1438,7 +1453,7 @@ static void RootlessPolyGlyphBlt(DrawablePtr dst, GCPtr pGC,
CharInfoPtr *ppci, pointer pglyphBase)
{
GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
+ GC_SKIP_ROOT(dst, pGC);
RL_DEBUG_MSG("polyglyph start ");
RootlessStartDrawing((WindowPtr) dst);
@@ -1484,7 +1499,7 @@ RootlessPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr dst,
BoxRec box;
GCOP_UNWRAP(pGC);
- GC_SKIP_ROOT(dst);
+ GC_SKIP_ROOT(dst, pGC);
RL_DEBUG_MSG("push pixels start ");
RootlessStartDrawing((WindowPtr) dst);
diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c
index 356fec798..503d57c0d 100644
--- a/miext/rootless/rootlessScreen.c
+++ b/miext/rootless/rootlessScreen.c
@@ -42,6 +42,7 @@
#include "propertyst.h"
#include "mivalidate.h"
#include "picturestr.h"
+#include "colormapst.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -64,6 +65,7 @@ extern Bool RootlessCreateGC(GCPtr pGC);
int rootlessGCPrivateIndex = -1;
int rootlessScreenPrivateIndex = -1;
int rootlessWindowPrivateIndex = -1;
+int rootlessWindowOldPixmapPrivateIndex = -1;
/*
@@ -469,6 +471,67 @@ RootlessMarkOverlappedWindows(WindowPtr pWin, WindowPtr pFirst,
return result;
}
+ColormapPtr
+RootlessGetColormap (ScreenPtr pScreen)
+{
+ RootlessScreenRec *s = SCREENREC (pScreen);
+
+ return s->colormap;
+}
+
+static void
+RootlessInstallColormap (ColormapPtr pMap)
+{
+ ScreenPtr pScreen = pMap->pScreen;
+ RootlessScreenRec *s = SCREENREC (pScreen);
+
+ SCREEN_UNWRAP(pScreen, InstallColormap);
+
+ if (s->colormap != pMap) {
+ s->colormap = pMap;
+ s->colormap_changed = TRUE;
+ RootlessQueueRedisplay (pScreen);
+ }
+
+ pScreen->InstallColormap (pMap);
+
+ SCREEN_WRAP (pScreen, InstallColormap);
+}
+
+static void
+RootlessUninstallColormap (ColormapPtr pMap)
+{
+ ScreenPtr pScreen = pMap->pScreen;
+ RootlessScreenRec *s = SCREENREC (pScreen);
+
+ SCREEN_UNWRAP(pScreen, UninstallColormap);
+
+ if (s->colormap == pMap)
+ s->colormap = NULL;
+
+ pScreen->UninstallColormap (pMap);
+
+ SCREEN_WRAP(pScreen, UninstallColormap);
+}
+
+static void
+RootlessStoreColors (ColormapPtr pMap, int ndef, xColorItem *pdef)
+{
+ ScreenPtr pScreen = pMap->pScreen;
+ RootlessScreenRec *s = SCREENREC (pScreen);
+
+ SCREEN_UNWRAP(pScreen, StoreColors);
+
+ if (s->colormap == pMap && ndef > 0) {
+ s->colormap_changed = TRUE;
+ RootlessQueueRedisplay (pScreen);
+ }
+
+ pScreen->StoreColors (pMap, ndef, pdef);
+
+ SCREEN_WRAP(pScreen, StoreColors);
+}
+
static CARD32
RootlessRedisplayCallback(OsTimerPtr timer, CARD32 time, void *arg)
@@ -556,6 +619,8 @@ RootlessAllocatePrivates(ScreenPtr pScreen)
if (rootlessGCPrivateIndex == -1) return FALSE;
rootlessWindowPrivateIndex = AllocateWindowPrivateIndex();
if (rootlessWindowPrivateIndex == -1) return FALSE;
+ rootlessWindowOldPixmapPrivateIndex = AllocateWindowPrivateIndex();
+ if (rootlessWindowOldPixmapPrivateIndex == -1) return FALSE;
rootlessGeneration = serverGeneration;
}
@@ -565,6 +630,8 @@ RootlessAllocatePrivates(ScreenPtr pScreen)
return FALSE;
if (!AllocateWindowPrivate(pScreen, rootlessWindowPrivateIndex, 0))
return FALSE;
+ if (!AllocateWindowPrivate(pScreen, rootlessWindowOldPixmapPrivateIndex, 0))
+ return FALSE;
s = xalloc(sizeof(RootlessScreenRec));
if (! s) return FALSE;
@@ -616,6 +683,9 @@ RootlessWrap(ScreenPtr pScreen)
WRAP(MarkOverlappedWindows);
WRAP(ValidateTree);
WRAP(ChangeWindowAttributes);
+ WRAP(InstallColormap);
+ WRAP(UninstallColormap);
+ WRAP(StoreColors);
#ifdef SHAPE
WRAP(SetShape);
@@ -655,6 +725,8 @@ Bool RootlessInit(ScreenPtr pScreen, RootlessFrameProcsPtr procs)
pScreen->devPrivates[rootlessScreenPrivateIndex].ptr;
s->imp = procs;
+ s->colormap = NULL;
+ s->redisplay_expired = FALSE;
RootlessWrap(pScreen);
diff --git a/miext/rootless/rootlessValTree.c b/miext/rootless/rootlessValTree.c
index 97348f58e..4f16530cc 100644
--- a/miext/rootless/rootlessValTree.c
+++ b/miext/rootless/rootlessValTree.c
@@ -93,6 +93,7 @@ Equipment Corporation.
#include <dix-config.h>
#endif
+#include <stddef.h> /* For NULL */
#include <X11/X.h>
#include "scrnintstr.h"
#include "validate.h"
diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index e89ebf897..43e1735a7 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -33,11 +33,25 @@
#include <dix-config.h>
#endif
-#include "rootlessCommon.h"
-#include "rootlessWindow.h"
-
+#include <stddef.h> /* For NULL */
+#include <limits.h> /* For CHAR_BIT */
+#include <assert.h>
+#ifdef __APPLE__
+//#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include "mi.h"
+#include "pixmapstr.h"
+#include "windowstr.h"
+#include <Xplugin.h>
+//#include <X11/extensions/applewm.h>
+extern int darwinMainScreenX, darwinMainScreenY;
+#endif
#include "fb.h"
+#define AppleWMNumWindowLevels 5
+
+#include "rootlessCommon.h"
+#include "rootlessWindow.h"
#ifdef ROOTLESS_GLOBAL_COORDS
#define SCREEN_TO_GLOBAL_X \
@@ -49,6 +63,125 @@
#define SCREEN_TO_GLOBAL_Y 0
#endif
+#define DEFINE_ATOM_HELPER(func,atom_name) \
+ static Atom func (void) { \
+ static unsigned int generation; \
+ static Atom atom; \
+ if (generation != serverGeneration) { \
+ generation = serverGeneration; \
+ atom = MakeAtom (atom_name, strlen (atom_name), TRUE); \
+ } \
+ return atom; \
+ }
+
+DEFINE_ATOM_HELPER (xa_native_screen_origin, "_NATIVE_SCREEN_ORIGIN")
+DEFINE_ATOM_HELPER (xa_native_window_id, "_NATIVE_WINDOW_ID")
+DEFINE_ATOM_HELPER (xa_apple_no_order_in, "_APPLE_NO_ORDER_IN")
+
+static Bool no_configure_window;
+static Bool windows_hidden;
+// TODO - abstract xp functions
+
+static const int normal_window_levels[AppleWMNumWindowLevels+1] = {
+ 0, 3, 4, 5, LONG_MIN + 30, LONG_MIN + 29,
+};
+static const int rooted_window_levels[AppleWMNumWindowLevels+1] = {
+ 202, 203, 204, 205, 201, 200
+};
+
+static inline int
+configure_window (xp_window_id id, unsigned int mask,
+ const xp_window_changes *values)
+{
+ if (!no_configure_window)
+ return xp_configure_window (id, mask, values);
+ else
+ return XP_Success;
+}
+
+/*static inline unsigned long
+current_time_in_seconds (void)
+{
+ unsigned long t = 0;
+
+ t += currentTime.milliseconds / 1000;
+ t += currentTime.months * 4294967;
+
+ return t;
+ } */
+
+static inline Bool
+rootlessHasRoot (ScreenPtr pScreen)
+{
+ return WINREC (WindowTable[pScreen->myNum]) != NULL;
+}
+
+void
+RootlessNativeWindowStateChanged (WindowPtr pWin, unsigned int state)
+{
+ RootlessWindowRec *winRec;
+
+ if (pWin == NULL) return;
+
+ winRec = WINREC (pWin);
+ if (winRec == NULL) return;
+
+ winRec->is_offscreen = ((state & XP_WINDOW_STATE_OFFSCREEN) != 0);
+ winRec->is_obscured = ((state & XP_WINDOW_STATE_OBSCURED) != 0);
+ pWin->rootlessUnhittable = winRec->is_offscreen;
+}
+
+void
+RootlessNativeWindowMoved (WindowPtr pWin)
+{
+ xp_box bounds;
+ int sx, sy;
+ XID vlist[2];
+ Mask mask;
+ ClientPtr client;
+ RootlessWindowRec *winRec = WINREC(pWin);
+
+ if (xp_get_window_bounds ((xp_window_id)winRec->wid, &bounds) != Success) return;
+
+ sx = dixScreenOrigins[pWin->drawable.pScreen->myNum].x + darwinMainScreenX;
+ sy = dixScreenOrigins[pWin->drawable.pScreen->myNum].y + darwinMainScreenY;
+
+ /* Fake up a ConfigureWindow packet to resize the window to the current bounds. */
+
+ vlist[0] = (INT16) bounds.x1 - sx;
+ vlist[1] = (INT16) bounds.y1 - sy;
+ mask = CWX | CWY;
+
+ /* pretend we're the owner of the window! */
+ client = LookupClient (pWin->drawable.id, NullClient);
+
+ /* Don't want to do anything to the physical window (avoids
+ notification-response feedback loops) */
+
+ no_configure_window = TRUE;
+ ConfigureWindow (pWin, mask, vlist, client);
+ no_configure_window = FALSE;
+}
+
+/* Updates the _NATIVE_SCREEN_ORIGIN property on the given root window. */
+static void
+set_screen_origin (WindowPtr pWin)
+{
+ long data[2];
+
+ if (!IsRoot (pWin))
+ return;
+
+ /* FIXME: move this to an extension? */
+
+ data[0] = (dixScreenOrigins[pWin->drawable.pScreen->myNum].x
+ + darwinMainScreenX);
+ data[1] = (dixScreenOrigins[pWin->drawable.pScreen->myNum].y
+ + darwinMainScreenY);
+
+ ChangeWindowProperty (pWin, xa_native_screen_origin (), XA_INTEGER,
+ 32, PropModeReplace, 2, data, TRUE);
+}
/*
* RootlessCreateWindow
@@ -63,6 +196,7 @@ RootlessCreateWindow(WindowPtr pWin)
RegionRec saveRoot;
WINREC(pWin) = NULL;
+ pWin->devPrivates[rootlessWindowOldPixmapPrivateIndex].ptr = NULL;
SCREEN_UNWRAP(pWin->drawable.pScreen, CreateWindow);
@@ -312,6 +446,12 @@ RootlessInitializeFrame(WindowPtr pWin, RootlessWindowRec *winRec)
}
+Bool
+RootlessColormapCallback (void *data, int first_color, int n_colors, uint32_t *colors)
+{
+ return RootlessResolveColormap (data, first_color, n_colors, colors);
+}
+
/*
* RootlessEnsureFrame
* Make sure the given window is framed. If the window doesn't have a
@@ -325,13 +465,13 @@ RootlessEnsureFrame(WindowPtr pWin)
RootlessWindowRec *winRec;
#ifdef SHAPE
RegionRec shape;
- RegionPtr pShape = NULL;
#endif
+ RegionPtr pShape = NULL;
if (WINREC(pWin) != NULL)
return WINREC(pWin);
- if (!IsTopLevel(pWin))
+ if (!IsTopLevel(pWin) && !IsRoot(pWin))
return NULL;
if (pWin->drawable.class != InputOutput)
@@ -370,6 +510,9 @@ RootlessEnsureFrame(WindowPtr pWin)
return NULL;
}
+ if (pWin->drawable.depth == 8)
+ RootlessFlushWindowColormap(pWin);
+
#ifdef SHAPE
if (pShape != NULL)
REGION_UNINIT(pScreen, &shape);
@@ -563,7 +706,6 @@ RootlessRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib)
RL_DEBUG_MSG("restackwindow end\n");
}
-
/*
* Specialized window copy procedures
*/
@@ -704,13 +846,13 @@ RootlessCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
top = TopLevelParent(pWin);
if (top == NULL) {
RL_DEBUG_MSG("no parent\n");
- return;
+ goto out;
}
winRec = WINREC(top);
if (winRec == NULL) {
RL_DEBUG_MSG("not framed\n");
- return;
+ goto out;
}
/* Move region to window local coords */
@@ -733,6 +875,7 @@ RootlessCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
RootlessDamageRegion(pWin, prgnSrc);
}
+out:
REGION_UNINIT(pScreen, &rgnDst);
fbValidateDrawable(&pWin->drawable);
@@ -1195,34 +1338,55 @@ RootlessResizeWindow(WindowPtr pWin, int x, int y,
RegionRec saveRoot;
RL_DEBUG_MSG("resizewindow start (win 0x%x) ", pWin);
+
+ if(pWin->parent) {
+ if (winRec) {
+ oldBW = winRec->borderWidth;
+ oldX = winRec->x;
+ oldY = winRec->y;
+ oldW = winRec->width;
+ oldH = winRec->height;
- if (winRec) {
- oldBW = winRec->borderWidth;
- oldX = winRec->x;
- oldY = winRec->y;
- oldW = winRec->width;
- oldH = winRec->height;
-
- newBW = oldBW;
- newX = x;
- newY = y;
- newW = w + 2*newBW;
- newH = h + 2*newBW;
-
- resize_after = StartFrameResize(pWin, TRUE,
- oldX, oldY, oldW, oldH, oldBW,
- newX, newY, newW, newH, newBW);
- }
+ newBW = oldBW;
+ newX = x;
+ newY = y;
+ newW = w + 2*newBW;
+ newH = h + 2*newBW;
- HUGE_ROOT(pWin);
- SCREEN_UNWRAP(pScreen, ResizeWindow);
- pScreen->ResizeWindow(pWin, x, y, w, h, pSib);
- SCREEN_WRAP(pScreen, ResizeWindow);
- NORMAL_ROOT(pWin);
+ resize_after = StartFrameResize(pWin, TRUE,
+ oldX, oldY, oldW, oldH, oldBW,
+ newX, newY, newW, newH, newBW);
+ }
- if (winRec) {
- FinishFrameResize(pWin, TRUE, oldX, oldY, oldW, oldH, oldBW,
- newX, newY, newW, newH, newBW, resize_after);
+ HUGE_ROOT(pWin);
+ SCREEN_UNWRAP(pScreen, ResizeWindow);
+ pScreen->ResizeWindow(pWin, x, y, w, h, pSib);
+ SCREEN_WRAP(pScreen, ResizeWindow);
+ NORMAL_ROOT(pWin);
+
+ if (winRec) {
+ FinishFrameResize(pWin, TRUE, oldX, oldY, oldW, oldH, oldBW,
+ newX, newY, newW, newH, newBW, resize_after);
+ }
+ } else {
+ /* Special case for resizing the root window */
+ BoxRec box;
+
+ pWin->drawable.x = x;
+ pWin->drawable.y = y;
+ pWin->drawable.width = w;
+ pWin->drawable.height = h;
+
+ box.x1 = x; box.y1 = y;
+ box.x2 = x + w; box.y2 = y + h;
+ REGION_UNINIT(pScreen, &pWin->winSize);
+ REGION_INIT(pScreen, &pWin->winSize, &box, 1);
+ REGION_COPY(pScreen, &pWin->borderSize, &pWin->winSize);
+ REGION_COPY(pScreen, &pWin->clipList, &pWin->winSize);
+ REGION_COPY(pScreen, &pWin->borderClip, &pWin->winSize);
+
+ miSendExposures(pWin, &pWin->borderClip,
+ pWin->drawable.x, pWin->drawable.y);
}
RL_DEBUG_MSG("resizewindow end\n");
@@ -1283,6 +1447,10 @@ RootlessReparentWindow(WindowPtr pWin, WindowPtr pPriorParent)
pTopWin = TopLevelParent(pWin);
assert(pTopWin != pWin);
+
+ pWin->rootlessUnhittable = FALSE;
+
+ DeleteProperty (pWin, xa_native_window_id ());
if (WINREC(pTopWin) != NULL) {
/* We're screwed. */
@@ -1323,6 +1491,25 @@ out:
}
+void
+RootlessFlushWindowColormap (WindowPtr pWin)
+{
+ RootlessWindowRec *winRec = WINREC (pWin);
+ xp_window_changes wc;
+
+ if (winRec == NULL)
+ return;
+
+ RootlessStopDrawing (pWin, FALSE);
+
+ /* This is how we tell xp that the colormap may have changed. */
+
+ wc.colormap = RootlessColormapCallback;
+ wc.colormap_data = pWin->drawable.pScreen;
+
+ configure_window ((xp_window_id)winRec->wid, XP_COLORMAP, &wc);
+}
+
/*
* SetPixmapOfAncestors
* Set the Pixmaps on all ParentRelative windows up the ancestor chain.
@@ -1464,3 +1651,29 @@ RootlessChangeBorderWidth(WindowPtr pWin, unsigned int width)
RL_DEBUG_MSG("change border width end\n");
}
+
+/*
+ * RootlessOrderAllWindows
+ * Brings all X11 windows to the top of the window stack
+ * (i.e in front of Aqua windows) -- called when X11.app is given focus
+ */
+void
+RootlessOrderAllWindows (void)
+{
+ int i;
+ WindowPtr pWin;
+
+ RL_DEBUG_MSG("RootlessOrderAllWindows() ");
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ if (screenInfo.screens[i] == NULL) continue;
+ pWin = WindowTable[i];
+ if (pWin == NULL) continue;
+
+ for (pWin = pWin->firstChild; pWin != NULL; pWin = pWin->nextSib) {
+ if (!pWin->realized) continue;
+ if (RootlessEnsureFrame(pWin) == NULL) continue;
+ RootlessReorderWindow (pWin);
+ }
+ }
+ RL_DEBUG_MSG("RootlessOrderAllWindows() done");
+}
diff --git a/miext/rootless/rootlessWindow.h b/miext/rootless/rootlessWindow.h
index 093a2b384..3bdb3bd19 100644
--- a/miext/rootless/rootlessWindow.h
+++ b/miext/rootless/rootlessWindow.h
@@ -36,7 +36,6 @@
#include "rootlessCommon.h"
-
Bool RootlessCreateWindow(WindowPtr pWin);
Bool RootlessDestroyWindow(WindowPtr pWin);
@@ -59,5 +58,7 @@ void RootlessPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion,
void RootlessPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion,
int what);
void RootlessChangeBorderWidth(WindowPtr pWin, unsigned int width);
+void RootlessNativeWindowMoved (WindowPtr pWin);
+void RootlessNativeWindowStateChanged (WindowPtr pWin, unsigned int state);
#endif
diff --git a/miext/rootless/safeAlpha/safeAlphaPicture.c b/miext/rootless/safeAlpha/safeAlphaPicture.c
deleted file mode 100644
index 8550cc01f..000000000
--- a/miext/rootless/safeAlpha/safeAlphaPicture.c
+++ /dev/null
@@ -1,642 +0,0 @@
-/*
- * Support for RENDER extension while protecting the alpha channel
- */
-/*
- * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
- * Copyright (c) 2002 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.
- */
-/* This file is largely based on fbcompose.c and fbpict.c, which contain
- * the following copyright:
- *
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
- */
-
-#ifdef RENDER
-
-#include "fb.h"
-#include "picturestr.h"
-#include "mipict.h"
-#include "fbpict.h"
-#include "safeAlpha.h"
-#include "rootlessCommon.h"
-
-# define mod(a,b) ((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (b) - (-a) % (b))
-
-
-typedef void (*CompositeFunc) (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height);
-
-
-/* Optimized version of fbCompositeSolidMask_nx8x8888 */
-void
-SafeAlphaCompositeSolidMask_nx8x8888(
- CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- CARD32 src, srca;
- CARD32 *dstLine, *dst, d, dstMask;
- CARD8 *maskLine, *mask, m;
- FbStride dstStride, maskStride;
- CARD16 w;
-
- fbComposeGetSolid(pSrc, src, pDst->format);
-
- dstMask = FbFullMask (pDst->pDrawable->depth);
- srca = src >> 24;
- if (src == 0)
- return;
-
- fbComposeGetStart (pDst, xDst, yDst, CARD32, dstStride, dstLine, 1);
- fbComposeGetStart (pMask, xMask, yMask, CARD8, maskStride, maskLine, 1);
-
- if (dstMask == FB_ALLONES && pDst->pDrawable->bitsPerPixel == 32 &&
- width * height > rootless_CompositePixels_threshold &&
- SCREENREC(pDst->pDrawable->pScreen)->imp->CompositePixels)
- {
- void *srcp[2], *destp[2];
- unsigned int dest_rowbytes[2];
- unsigned int fn;
-
- srcp[0] = &src; srcp[1] = &src;
- /* null rowbytes pointer means use first value as a constant */
- destp[0] = dstLine; destp[1] = dstLine;
- dest_rowbytes[0] = dstStride * 4; dest_rowbytes[1] = dest_rowbytes[0];
- fn = RL_COMPOSITE_FUNCTION(RL_COMPOSITE_OVER, RL_DEPTH_ARGB8888,
- RL_DEPTH_A8, RL_DEPTH_ARGB8888);
-
- if (SCREENREC(pDst->pDrawable->pScreen)->imp->CompositePixels(
- width, height, fn, srcp, NULL,
- maskLine, maskStride,
- destp, dest_rowbytes) == Success)
- {
- return;
- }
- }
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- mask = maskLine;
- maskLine += maskStride;
- w = width;
-
- while (w--)
- {
- m = *mask++;
- if (m == 0xff)
- {
- if (srca == 0xff)
- *dst = src & dstMask;
- else
- *dst = fbOver (src, *dst) & dstMask;
- }
- else if (m)
- {
- d = fbIn (src, m);
- *dst = fbOver (d, *dst) & dstMask;
- }
- dst++;
- }
- }
-}
-
-void
-SafeAlphaComposite (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- RegionRec region;
- int n;
- BoxPtr pbox;
- CompositeFunc func = 0;
- Bool srcRepeat = pSrc->repeat;
- Bool maskRepeat = FALSE;
- Bool srcAlphaMap = pSrc->alphaMap != 0;
- Bool maskAlphaMap = FALSE;
- Bool dstAlphaMap = pDst->alphaMap != 0;
- int x_msk, y_msk, x_src, y_src, x_dst, y_dst;
- int w, h, w_this, h_this;
- int dstDepth = pDst->pDrawable->depth;
- int oldFormat = pDst->format;
-
- xDst += pDst->pDrawable->x;
- yDst += pDst->pDrawable->y;
- xSrc += pSrc->pDrawable->x;
- ySrc += pSrc->pDrawable->y;
- if (pMask)
- {
- xMask += pMask->pDrawable->x;
- yMask += pMask->pDrawable->y;
- maskRepeat = pMask->repeat;
- maskAlphaMap = pMask->alphaMap != 0;
- }
-
-
- /*
- * We can use the more optimized fbpict code, but it sets bits above
- * the depth to zero. Temporarily adjust destination depth if needed.
- */
- if (pDst->pDrawable->type == DRAWABLE_WINDOW
- && pDst->pDrawable->depth == 24
- && pDst->pDrawable->bitsPerPixel == 32)
- {
- pDst->pDrawable->depth = 32;
- }
- /* For rootless preserve the alpha in x8r8g8b8 which really is
- * a8r8g8b8
- */
- if (oldFormat == PICT_x8r8g8b8)
- {
- pDst->format = PICT_a8r8g8b8;
- }
-
-
-
- if (!pSrc->transform && !(pMask && pMask->transform))
- if (!maskAlphaMap && !srcAlphaMap && !dstAlphaMap)
- switch (op) {
- case PictOpSrc:
-#ifdef USE_MMX
- if (!pMask && pSrc->format == pDst->format &&
- pSrc->pDrawable != pDst->pDrawable)
- {
- func = fbCompositeCopyAreammx;
- }
-#endif
- break;
- case PictOpOver:
- if (pMask)
- {
- if (srcRepeat &&
- pSrc->pDrawable->width == 1 &&
- pSrc->pDrawable->height == 1)
- {
- srcRepeat = FALSE;
- if (PICT_FORMAT_COLOR(pSrc->format)) {
- switch (pMask->format) {
- case PICT_a8:
- switch (pDst->format) {
- case PICT_r5g6b5:
- case PICT_b5g6r5:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSolidMask_nx8x0565mmx;
- else
-#endif
- func = fbCompositeSolidMask_nx8x0565;
- break;
- case PICT_r8g8b8:
- case PICT_b8g8r8:
- func = fbCompositeSolidMask_nx8x0888;
- break;
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
- case PICT_a8b8g8r8:
- case PICT_x8b8g8r8:
- func = SafeAlphaCompositeSolidMask_nx8x8888;
- break;
- }
- break;
- case PICT_a8r8g8b8:
- if (pMask->componentAlpha) {
- switch (pDst->format) {
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSolidMask_nx8888x8888Cmmx;
- else
-#endif
- func = fbCompositeSolidMask_nx8888x8888C;
- break;
- case PICT_r5g6b5:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSolidMask_nx8888x0565Cmmx;
- else
-#endif
- func = fbCompositeSolidMask_nx8888x0565C;
- break;
- }
- }
- break;
- case PICT_a8b8g8r8:
- if (pMask->componentAlpha) {
- switch (pDst->format) {
- case PICT_a8b8g8r8:
- case PICT_x8b8g8r8:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSolidMask_nx8888x8888Cmmx;
- else
-#endif
- func = fbCompositeSolidMask_nx8888x8888C;
- break;
- case PICT_b5g6r5:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSolidMask_nx8888x0565Cmmx;
- else
-#endif
- func = fbCompositeSolidMask_nx8888x0565C;
- break;
- }
- }
- break;
- case PICT_a1:
- switch (pDst->format) {
- case PICT_r5g6b5:
- case PICT_b5g6r5:
- case PICT_r8g8b8:
- case PICT_b8g8r8:
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
- case PICT_a8b8g8r8:
- case PICT_x8b8g8r8:
- func = fbCompositeSolidMask_nx1xn;
- break;
- }
- break;
- }
- }
- }
- else /* has mask and non-repeating source */
- {
- if (pSrc->pDrawable == pMask->pDrawable &&
- xSrc == xMask && ySrc == yMask &&
- !pMask->componentAlpha)
- {
- /* source == mask: non-premultiplied data */
- switch (pSrc->format) {
- case PICT_x8b8g8r8:
- switch (pMask->format) {
- case PICT_a8r8g8b8:
- case PICT_a8b8g8r8:
- switch (pDst->format) {
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSrc_8888RevNPx8888mmx;
-#endif
- break;
- case PICT_r5g6b5:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSrc_8888RevNPx0565mmx;
-#endif
- break;
- }
- break;
- }
- break;
- case PICT_x8r8g8b8:
- switch (pMask->format) {
- case PICT_a8r8g8b8:
- case PICT_a8b8g8r8:
- switch (pDst->format) {
- case PICT_a8b8g8r8:
- case PICT_x8b8g8r8:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSrc_8888RevNPx8888mmx;
-#endif
- break;
- case PICT_r5g6b5:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSrc_8888RevNPx0565mmx;
-#endif
- break;
- }
- break;
- }
- break;
- }
- break;
- }
- else
- {
- /* non-repeating source, repeating mask => translucent window */
- if (maskRepeat &&
- pMask->pDrawable->width == 1 &&
- pMask->pDrawable->height == 1)
- {
- if (pSrc->format == PICT_x8r8g8b8 &&
- pDst->format == PICT_x8r8g8b8 &&
- pMask->format == PICT_a8)
- {
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSrc_8888x8x8888mmx;
-#endif
- }
- }
- }
- }
- }
- else /* no mask */
- {
- if (srcRepeat &&
- pSrc->pDrawable->width == 1 &&
- pSrc->pDrawable->height == 1)
- {
- /* no mask and repeating source */
- switch (pSrc->format) {
- case PICT_a8r8g8b8:
- switch (pDst->format) {
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
-#ifdef USE_MMX
- if (fbHaveMMX())
- {
- srcRepeat = FALSE;
- func = fbCompositeSolid_nx8888mmx;
- }
-#endif
- break;
- case PICT_r5g6b5:
-#ifdef USE_MMX
- if (fbHaveMMX())
- {
- srcRepeat = FALSE;
- func = fbCompositeSolid_nx0565mmx;
- }
-#endif
- break;
- }
- break;
- }
- }
- else
- {
- switch (pSrc->format) {
- case PICT_a8r8g8b8:
- switch (pDst->format) {
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSrc_8888x8888mmx;
- else
-#endif
- func = fbCompositeSrc_8888x8888;
- break;
- case PICT_r8g8b8:
- func = fbCompositeSrc_8888x0888;
- break;
- case PICT_r5g6b5:
- func = fbCompositeSrc_8888x0565;
- break;
- }
- break;
- case PICT_x8r8g8b8:
- switch (pDst->format) {
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeCopyAreammx;
-#endif
- break;
- }
- case PICT_x8b8g8r8:
- switch (pDst->format) {
- case PICT_a8b8g8r8:
- case PICT_x8b8g8r8:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeCopyAreammx;
-#endif
- break;
- }
- break;
- case PICT_a8b8g8r8:
- switch (pDst->format) {
- case PICT_a8b8g8r8:
- case PICT_x8b8g8r8:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSrc_8888x8888mmx;
- else
-#endif
- func = fbCompositeSrc_8888x8888;
- break;
- case PICT_b8g8r8:
- func = fbCompositeSrc_8888x0888;
- break;
- case PICT_b5g6r5:
- func = fbCompositeSrc_8888x0565;
- break;
- }
- break;
- case PICT_r5g6b5:
- switch (pDst->format) {
- case PICT_r5g6b5:
- func = fbCompositeSrc_0565x0565;
- break;
- }
- break;
- case PICT_b5g6r5:
- switch (pDst->format) {
- case PICT_b5g6r5:
- func = fbCompositeSrc_0565x0565;
- break;
- }
- break;
- }
- }
- }
- break;
- case PictOpAdd:
- if (pMask == 0)
- {
- switch (pSrc->format) {
- case PICT_a8r8g8b8:
- switch (pDst->format) {
- case PICT_a8r8g8b8:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSrcAdd_8888x8888mmx;
- else
-#endif
- func = fbCompositeSrcAdd_8888x8888;
- break;
- }
- break;
- case PICT_a8b8g8r8:
- switch (pDst->format) {
- case PICT_a8b8g8r8:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSrcAdd_8888x8888mmx;
- else
-#endif
- func = fbCompositeSrcAdd_8888x8888;
- break;
- }
- break;
- case PICT_a8:
- switch (pDst->format) {
- case PICT_a8:
-#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSrcAdd_8000x8000mmx;
- else
-#endif
- func = fbCompositeSrcAdd_8000x8000;
- break;
- }
- break;
- case PICT_a1:
- switch (pDst->format) {
- case PICT_a1:
- func = fbCompositeSrcAdd_1000x1000;
- break;
- }
- break;
- }
- }
- break;
- }
-
- if (!func) {
- /* no fast path, use the general code */
- fbCompositeGeneral(op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height);
- // Reset destination depth and format to their true value
- pDst->pDrawable->depth = dstDepth;
- pDst->format = oldFormat;
- return;
- }
-
- if (!miComputeCompositeRegion (&region,
- pSrc,
- pMask,
- pDst,
- xSrc,
- ySrc,
- xMask,
- yMask,
- xDst,
- yDst,
- width,
- height))
- return;
-
- n = REGION_NUM_RECTS (&region);
- pbox = REGION_RECTS (&region);
- while (n--)
- {
- h = pbox->y2 - pbox->y1;
- y_src = pbox->y1 - yDst + ySrc;
- y_msk = pbox->y1 - yDst + yMask;
- y_dst = pbox->y1;
- while (h)
- {
- h_this = h;
- w = pbox->x2 - pbox->x1;
- x_src = pbox->x1 - xDst + xSrc;
- x_msk = pbox->x1 - xDst + xMask;
- x_dst = pbox->x1;
- if (maskRepeat)
- {
- y_msk = mod (y_msk, pMask->pDrawable->height);
- if (h_this > pMask->pDrawable->height - y_msk)
- h_this = pMask->pDrawable->height - y_msk;
- }
- if (srcRepeat)
- {
- y_src = mod (y_src, pSrc->pDrawable->height);
- if (h_this > pSrc->pDrawable->height - y_src)
- h_this = pSrc->pDrawable->height - y_src;
- }
- while (w)
- {
- w_this = w;
- if (maskRepeat)
- {
- x_msk = mod (x_msk, pMask->pDrawable->width);
- if (w_this > pMask->pDrawable->width - x_msk)
- w_this = pMask->pDrawable->width - x_msk;
- }
- if (srcRepeat)
- {
- x_src = mod (x_src, pSrc->pDrawable->width);
- if (w_this > pSrc->pDrawable->width - x_src)
- w_this = pSrc->pDrawable->width - x_src;
- }
- (*func) (op, pSrc, pMask, pDst,
- x_src, y_src, x_msk, y_msk, x_dst, y_dst,
- w_this, h_this);
- w -= w_this;
- x_src += w_this;
- x_msk += w_this;
- x_dst += w_this;
- }
- h -= h_this;
- y_src += h_this;
- y_msk += h_this;
- y_dst += h_this;
- }
- pbox++;
- }
- REGION_UNINIT (pDst->pDrawable->pScreen, &region);
-
- // Reset destination depth/format to its true value
- pDst->pDrawable->depth = dstDepth;
- pDst->format = oldFormat;
-}
-
-#endif /* RENDER */
diff --git a/miext/rootless/safeAlpha/safeAlphaWindow.c b/miext/rootless/safeAlpha/safeAlphaWindow.c
deleted file mode 100644
index 8884c107e..000000000
--- a/miext/rootless/safeAlpha/safeAlphaWindow.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Specialized window functions to protect the alpha channel
- */
-/*
- * Copyright (c) 2002-2003 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.
- */
-/* Portions of this file are based on fbwindow.c, which contains the
- * following copyright:
- *
- * Copyright © 1998 Keith Packard
- */
-
-#include "fb.h"
-#include "safeAlpha.h"
-#include "rootlessCommon.h"
-
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-#endif
-
-/*
- * SafeAlphaFillRegionTiled
- * Fill using a tile while leaving the alpha channel untouched.
- * Based on fbfillRegionTiled.
- */
-void
-SafeAlphaFillRegionTiled(
- DrawablePtr pDrawable,
- RegionPtr pRegion,
- PixmapPtr pTile)
-{
- FbBits *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
- FbBits *tile;
- FbStride tileStride;
- int tileBpp;
- int tileXoff, tileYoff; /* XXX assumed to be zero */
- int tileWidth, tileHeight;
- int n = REGION_NUM_RECTS(pRegion);
- BoxPtr pbox = REGION_RECTS(pRegion);
- int xRot = pDrawable->x;
- int yRot = pDrawable->y;
- FbBits planeMask;
-
-#ifdef PANORAMIX
- if(!noPanoramiXExtension)
- {
- int index = pDrawable->pScreen->myNum;
- if(&WindowTable[index]->drawable == pDrawable)
- {
- xRot -= panoramiXdataPtr[index].x;
- yRot -= panoramiXdataPtr[index].y;
- }
- }
-#endif
- fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
- fbGetDrawable (&pTile->drawable, tile, tileStride, tileBpp,
- tileXoff, tileYoff);
- tileWidth = pTile->drawable.width;
- tileHeight = pTile->drawable.height;
- xRot += dstXoff;
- yRot += dstYoff;
- planeMask = FB_ALLONES & ~RootlessAlphaMask(dstBpp);
-
- while (n--)
- {
- fbTile (dst + (pbox->y1 + dstYoff) * dstStride,
- dstStride,
- (pbox->x1 + dstXoff) * dstBpp,
- (pbox->x2 - pbox->x1) * dstBpp,
- pbox->y2 - pbox->y1,
- tile,
- tileStride,
- tileWidth * dstBpp,
- tileHeight,
- GXcopy,
- planeMask,
- dstBpp,
- xRot * dstBpp,
- yRot - pbox->y1);
- pbox++;
- }
-}
-
-
-/*
- * SafeAlphaPaintWindow
- * Paint the window while filling in the alpha channel with all on.
- * We can't use fbPaintWindow because it zeros the alpha channel.
- */
-void
-SafeAlphaPaintWindow(
- WindowPtr pWin,
- RegionPtr pRegion,
- int what)
-{
- switch (what) {
- case PW_BACKGROUND:
-
- switch (pWin->backgroundState) {
- case None:
- break;
- case ParentRelative:
- do {
- pWin = pWin->parent;
- } while (pWin->backgroundState == ParentRelative);
- (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion,
- what);
- break;
- case BackgroundPixmap:
- SafeAlphaFillRegionTiled (&pWin->drawable,
- pRegion,
- pWin->background.pixmap);
- break;
- case BackgroundPixel:
- {
- Pixel pixel = pWin->background.pixel |
- RootlessAlphaMask(pWin->drawable.bitsPerPixel);
- fbFillRegionSolid (&pWin->drawable, pRegion, 0,
- fbReplicatePixel (pixel,
- pWin->drawable.bitsPerPixel));
- break;
- }
- }
- break;
- case PW_BORDER:
- if (pWin->borderIsPixel)
- {
- Pixel pixel = pWin->border.pixel |
- RootlessAlphaMask(pWin->drawable.bitsPerPixel);
- fbFillRegionSolid (&pWin->drawable, pRegion, 0,
- fbReplicatePixel (pixel,
- pWin->drawable.bitsPerPixel));
- }
- else
- {
- WindowPtr pBgWin;
- for (pBgWin = pWin; pBgWin->backgroundState == ParentRelative;
- pBgWin = pBgWin->parent);
-
- SafeAlphaFillRegionTiled (&pBgWin->drawable,
- pRegion,
- pWin->border.pixmap);
- }
- break;
- }
- fbValidateDrawable (&pWin->drawable);
-}
diff --git a/os/connection.c b/os/connection.c
index 98e83ae4c..ac8b48683 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -74,6 +74,7 @@ SOFTWARE.
#define TRANS_SERVER
#define TRANS_REOPEN
#include <X11/Xtrans/Xtrans.h>
+#include <X11/Xtrans/Xtransint.h>
#include <errno.h>
#include <signal.h>
#include <stdio.h>
@@ -670,9 +671,15 @@ ClientAuthorized(ClientPtr client,
XID auth_id;
char *reason = NULL;
XtransConnInfo trans_conn;
-
+ struct sockaddr *saddr;
priv = (OsCommPtr)client->osPrivate;
trans_conn = priv->trans_conn;
+ saddr = (struct sockaddr *) (trans_conn->addr);
+
+ /* Allow any client to connect without authorization on a launchd socket,
+ because it is securely created -- this prevents a race condition on launch */
+ if (saddr->sa_len > 11 && saddr->sa_family == AF_UNIX &&
+ !strncmp(saddr->sa_data, "/tmp/launch", 11)) goto done;
auth_id = CheckAuthorization (proto_n, auth_proto,
string_n, auth_string, client, &reason);
@@ -721,6 +728,7 @@ ClientAuthorized(ClientPtr client,
}
}
priv->auth_id = auth_id;
+done:
priv->conn_time = 0;
#ifdef XDMCP
diff --git a/render/animcur.c b/render/animcur.c
index 8e4f59d1b..1f25e79d0 100644
--- a/render/animcur.c
+++ b/render/animcur.c
@@ -87,8 +87,8 @@ static CursorBits animCursorBits = {
empty, empty, 2, 1, 1, 0, 0, 1
};
-int AnimCurScreenPrivateIndex = -1;
-int AnimCurGeneration;
+static int AnimCurScreenPrivateIndex = -1;
+static int AnimCurGeneration;
#define IsAnimCur(c) ((c)->bits == &animCursorBits)
#define GetAnimCur(c) ((AnimCurPtr) ((c) + 1))
diff --git a/render/filter.c b/render/filter.c
index 71375dae9..092313f6e 100644
--- a/render/filter.c
+++ b/render/filter.c
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Copyright © 2002 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
diff --git a/render/glyph.c b/render/glyph.c
index 2ca02f042..42ae65d6b 100644
--- a/render/glyph.c
+++ b/render/glyph.c
@@ -83,22 +83,22 @@ static GlyphHashSetRec glyphHashSets[] = {
#define NGLYPHHASHSETS (sizeof(glyphHashSets)/sizeof(glyphHashSets[0]))
-const CARD8 glyphDepths[GlyphFormatNum] = { 1, 4, 8, 16, 32 };
+static const CARD8 glyphDepths[GlyphFormatNum] = { 1, 4, 8, 16, 32 };
-GlyphHashRec globalGlyphs[GlyphFormatNum];
+static GlyphHashRec globalGlyphs[GlyphFormatNum];
-int globalTotalGlyphPrivateSize = 0;
+static int globalTotalGlyphPrivateSize = 0;
static int glyphPrivateCount = 0;
void
-ResetGlyphPrivates ()
+ResetGlyphPrivates (void)
{
glyphPrivateCount = 0;
}
int
-AllocateGlyphPrivateIndex ()
+AllocateGlyphPrivateIndex (void)
{
return glyphPrivateCount++;
}
diff --git a/render/glyphstr.h b/render/glyphstr.h
index 64cedfa16..22150deee 100644
--- a/render/glyphstr.h
+++ b/render/glyphstr.h
@@ -91,8 +91,6 @@ typedef struct _GlyphList {
PictFormatPtr format;
} GlyphListRec, *GlyphListPtr;
-extern GlyphHashRec globalGlyphs[GlyphFormatNum];
-
GlyphHashSetPtr
FindGlyphHashSet (CARD32 filled);
diff --git a/render/mipict.c b/render/mipict.c
index 3d6c1aeeb..87dccbbda 100644
--- a/render/mipict.c
+++ b/render/mipict.c
@@ -1,4 +1,4 @@
- /*
+/*
*
* Copyright © 1999 Keith Packard
*
@@ -266,19 +266,19 @@ miChangePictureFilter (PicturePtr pPicture,
#define BOUND(v) (INT16) ((v) < MINSHORT ? MINSHORT : (v) > MAXSHORT ? MAXSHORT : (v))
-static __inline Bool
-miClipPictureReg (RegionPtr pRegion,
- RegionPtr pClip,
+static inline pixman_bool_t
+miClipPictureReg (pixman_region16_t * pRegion,
+ pixman_region16_t * pClip,
int dx,
int dy)
{
- if (REGION_NUM_RECTS(pRegion) == 1 &&
- REGION_NUM_RECTS(pClip) == 1)
+ if (pixman_region_n_rects(pRegion) == 1 &&
+ pixman_region_n_rects(pClip) == 1)
{
- BoxPtr pRbox = REGION_RECTS(pRegion);
- BoxPtr pCbox = REGION_RECTS(pClip);
+ pixman_box16_t * pRbox = pixman_region_rectangles(pRegion, NULL);
+ pixman_box16_t * pCbox = pixman_region_rectangles(pClip, NULL);
int v;
-
+
if (pRbox->x1 < (v = pCbox->x1 + dx))
pRbox->x1 = BOUND(v);
if (pRbox->x2 > (v = pCbox->x2 + dx))
@@ -290,23 +290,23 @@ miClipPictureReg (RegionPtr pRegion,
if (pRbox->x1 >= pRbox->x2 ||
pRbox->y1 >= pRbox->y2)
{
- REGION_EMPTY(pScreen, pRegion);
+ pixman_region_init (pRegion);
}
}
- else if (!REGION_NOTEMPTY (pScreen, pClip))
+ else if (!pixman_region_not_empty (pClip))
return FALSE;
else
{
if (dx || dy)
- REGION_TRANSLATE(pScreen, pRegion, -dx, -dy);
- if (!REGION_INTERSECT (pScreen, pRegion, pRegion, pClip))
+ pixman_region_translate (pRegion, -dx, -dy);
+ if (!pixman_region_intersect (pRegion, pRegion, pClip))
return FALSE;
if (dx || dy)
- REGION_TRANSLATE(pScreen, pRegion, dx, dy);
+ pixman_region_translate(pRegion, dx, dy);
}
- return REGION_NOTEMPTY(pScreen, pRegion);
+ return pixman_region_not_empty(pRegion);
}
-
+
static __inline Bool
miClipPictureSrc (RegionPtr pRegion,
PicturePtr pPicture,
@@ -320,13 +320,13 @@ miClipPictureSrc (RegionPtr pRegion,
{
if (pPicture->clientClipType != CT_NONE)
{
- REGION_TRANSLATE(pScreen, pRegion,
+ pixman_region_translate ( pRegion,
dx - pPicture->clipOrigin.x,
dy - pPicture->clipOrigin.y);
if (!REGION_INTERSECT (pScreen, pRegion, pRegion,
- (RegionPtr) pPicture->clientClip))
+ (RegionPtr) pPicture->pCompositeClip)) // clientClip))
return FALSE;
- REGION_TRANSLATE(pScreen, pRegion,
+ pixman_region_translate ( pRegion,
- (dx - pPicture->clipOrigin.x),
- (dy - pPicture->clipOrigin.y));
}
@@ -341,7 +341,7 @@ miClipPictureSrc (RegionPtr pRegion,
}
}
-static void
+void
miCompositeSourceValidate (PicturePtr pPicture,
INT16 x,
INT16 y,
@@ -417,6 +417,7 @@ miComputeCompositeRegion (RegionPtr pRegion,
CARD16 width,
CARD16 height)
{
+
int v;
pRegion->extents.x1 = xDst;
@@ -430,13 +431,13 @@ miComputeCompositeRegion (RegionPtr pRegion,
if (pRegion->extents.x1 >= pRegion->extents.x2 ||
pRegion->extents.y1 >= pRegion->extents.y2)
{
- REGION_EMPTY (pDst->pDrawable->pScreen, pRegion);
+ pixman_region_init (pRegion);
return FALSE;
}
/* clip against dst */
if (!miClipPictureReg (pRegion, pDst->pCompositeClip, 0, 0))
{
- REGION_UNINIT (pScreen, pRegion);
+ pixman_region_fini (pRegion);
return FALSE;
}
if (pDst->alphaMap)
@@ -445,14 +446,14 @@ miComputeCompositeRegion (RegionPtr pRegion,
-pDst->alphaOrigin.x,
-pDst->alphaOrigin.y))
{
- REGION_UNINIT (pScreen, pRegion);
+ pixman_region_fini (pRegion);
return FALSE;
}
}
/* clip against src */
if (!miClipPictureSrc (pRegion, pSrc, xDst - xSrc, yDst - ySrc))
{
- REGION_UNINIT (pScreen, pRegion);
+ pixman_region_fini (pRegion);
return FALSE;
}
if (pSrc->alphaMap)
@@ -461,7 +462,7 @@ miComputeCompositeRegion (RegionPtr pRegion,
xDst - (xSrc + pSrc->alphaOrigin.x),
yDst - (ySrc + pSrc->alphaOrigin.y)))
{
- REGION_UNINIT (pScreen, pRegion);
+ pixman_region_fini (pRegion);
return FALSE;
}
}
@@ -470,7 +471,7 @@ miComputeCompositeRegion (RegionPtr pRegion,
{
if (!miClipPictureSrc (pRegion, pMask, xDst - xMask, yDst - yMask))
{
- REGION_UNINIT (pScreen, pRegion);
+ pixman_region_fini (pRegion);
return FALSE;
}
if (pMask->alphaMap)
@@ -479,14 +480,17 @@ miComputeCompositeRegion (RegionPtr pRegion,
xDst - (xMask + pMask->alphaOrigin.x),
yDst - (yMask + pMask->alphaOrigin.y)))
{
- REGION_UNINIT (pScreen, pRegion);
+ pixman_region_fini (pRegion);
return FALSE;
}
}
}
+
+
miCompositeSourceValidate (pSrc, xSrc, ySrc, width, height);
if (pMask)
miCompositeSourceValidate (pMask, xMask, yMask, width, height);
+
return TRUE;
}
diff --git a/render/mipict.h b/render/mipict.h
index eef155f7d..bd7c23f4b 100644
--- a/render/mipict.h
+++ b/render/mipict.h
@@ -88,6 +88,12 @@ miClipPicture (RegionPtr pRegion,
INT16 xPict,
INT16 yPict);
+void
+miCompositeSourceValidate (PicturePtr pPicture,
+ INT16 x,
+ INT16 y,
+ CARD16 width,
+ CARD16 height);
Bool
miComputeCompositeRegion (RegionPtr pRegion,
PicturePtr pSrc,
diff --git a/render/picture.c b/render/picture.c
index a3443c20e..e30edf31a 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -43,7 +43,7 @@
_X_EXPORT int PictureScreenPrivateIndex = -1;
int PictureWindowPrivateIndex;
-int PictureGeneration;
+static int PictureGeneration;
RESTYPE PictureType;
RESTYPE PictFormatType;
RESTYPE GlyphSetType;
@@ -890,54 +890,22 @@ static unsigned int INTERPOLATE_PIXEL_256(unsigned int x, unsigned int a,
return x;
}
-static void initGradientColorTable(SourcePictPtr pGradient, int *error)
+CARD32
+PictureGradientColor (PictGradientStopPtr stop1,
+ PictGradientStopPtr stop2,
+ CARD32 x)
{
- int begin_pos, end_pos;
- xFixed incr, dpos;
- int pos, current_stop;
- PictGradientStopPtr stops = pGradient->linear.stops;
- int nstops = pGradient->linear.nstops;
-
- /* The position where the gradient begins and ends */
- begin_pos = (stops[0].x * PICT_GRADIENT_STOPTABLE_SIZE) >> 16;
- end_pos = (stops[nstops - 1].x * PICT_GRADIENT_STOPTABLE_SIZE) >> 16;
-
- pos = 0; /* The position in the color table. */
-
- /* Up to first point */
- while (pos <= begin_pos) {
- pGradient->linear.colorTable[pos] = xRenderColorToCard32(stops[0].color);
- ++pos;
- }
-
- incr = (1<<16)/ PICT_GRADIENT_STOPTABLE_SIZE; /* the double increment. */
- dpos = incr * pos; /* The position in terms of 0-1. */
-
- current_stop = 0; /* We always interpolate between current and current + 1. */
-
- /* Gradient area */
- while (pos < end_pos) {
- unsigned int current_color = xRenderColorToCard32(stops[current_stop].color);
- unsigned int next_color = xRenderColorToCard32(stops[current_stop + 1].color);
+ CARD32 current_color, next_color;
+ int dist, idist;
- int dist = (int)(256*(dpos - stops[current_stop].x)
- / (stops[current_stop+1].x - stops[current_stop].x));
- int idist = 256 - dist;
+ current_color = xRenderColorToCard32 (stop1->color);
+ next_color = xRenderColorToCard32 (stop2->color);
- pGradient->linear.colorTable[pos] = premultiply(INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist));
+ dist = (int) (256 * (x - stop1->x) / (stop2->x - stop1->x));
+ idist = 256 - dist;
- ++pos;
- dpos += incr;
-
- if (dpos > stops[current_stop + 1].x)
- ++current_stop;
- }
-
- /* After last point */
- while (pos < PICT_GRADIENT_STOPTABLE_SIZE) {
- pGradient->linear.colorTable[pos] = xRenderColorToCard32(stops[nstops - 1].color);
- ++pos;
- }
+ return premultiply (INTERPOLATE_PIXEL_256 (current_color, idist,
+ next_color, dist));
}
static void initGradient(SourcePictPtr pGradient, int stopCount,
@@ -953,26 +921,30 @@ static void initGradient(SourcePictPtr pGradient, int stopCount,
dpos = -1;
for (i = 0; i < stopCount; ++i) {
- if (stopPoints[i] <= dpos || stopPoints[i] > (1<<16)) {
+ if (stopPoints[i] < dpos || stopPoints[i] > (1<<16)) {
*error = BadValue;
return;
}
dpos = stopPoints[i];
}
- pGradient->linear.stops = xalloc(stopCount*sizeof(PictGradientStop));
- if (!pGradient->linear.stops) {
+ pGradient->gradient.stops = xalloc(stopCount*sizeof(PictGradientStop));
+ if (!pGradient->gradient.stops) {
*error = BadAlloc;
return;
}
- pGradient->linear.nstops = stopCount;
+ pGradient->gradient.nstops = stopCount;
for (i = 0; i < stopCount; ++i) {
- pGradient->linear.stops[i].x = stopPoints[i];
- pGradient->linear.stops[i].color = stopColors[i];
+ pGradient->gradient.stops[i].x = stopPoints[i];
+ pGradient->gradient.stops[i].color = stopColors[i];
}
- initGradientColorTable(pGradient, error);
+
+ pGradient->gradient.class = SourcePictClassUnknown;
+ pGradient->gradient.stopRange = 0xffff;
+ pGradient->gradient.colorTable = NULL;
+ pGradient->gradient.colorTableSize = 0;
}
static PicturePtr createSourcePicture(void)
@@ -980,9 +952,9 @@ static PicturePtr createSourcePicture(void)
PicturePtr pPicture;
pPicture = (PicturePtr) xalloc(sizeof(PictureRec));
pPicture->pDrawable = 0;
- pPicture->format = PICT_a8r8g8b8;
pPicture->pFormat = 0;
pPicture->pNext = 0;
+ pPicture->format = PICT_a8r8g8b8;
pPicture->devPrivates = 0;
SetPictureToDefaults(pPicture);
@@ -1027,10 +999,6 @@ CreateLinearGradientPicture (Picture pid, xPointFixed *p1, xPointFixed *p2,
*error = BadAlloc;
return 0;
}
- if (p1->x == p2->x && p1->y == p2->y) {
- *error = BadValue;
- return 0;
- }
pPicture->id = pid;
pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictLinearGradient));
@@ -1072,14 +1040,6 @@ CreateRadialGradientPicture (Picture pid, xPointFixed *inner, xPointFixed *outer
*error = BadAlloc;
return 0;
}
- {
- double dx = (double)(inner->x - outer->x);
- double dy = (double)(inner->y - outer->y);
- if (sqrt(dx*dx + dy*dy) + (double)(innerRadius) > (double)(outerRadius)) {
- *error = BadValue;
- return 0;
- }
- }
pPicture->id = pid;
pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictRadialGradient));
@@ -1091,22 +1051,19 @@ CreateRadialGradientPicture (Picture pid, xPointFixed *inner, xPointFixed *outer
radial = &pPicture->pSourcePict->radial;
radial->type = SourcePictTypeRadial;
- {
- double x = (double)innerRadius / (double)outerRadius;
- radial->dx = (outer->x - inner->x);
- radial->dy = (outer->y - inner->y);
- radial->fx = (inner->x) - x*radial->dx;
- radial->fy = (inner->y) - x*radial->dy;
- radial->m = 1./(1+x);
- radial->b = -x*radial->m;
- radial->dx /= 65536.;
- radial->dy /= 65536.;
- radial->fx /= 65536.;
- radial->fy /= 65536.;
- x = outerRadius/65536.;
- radial->a = x*x - radial->dx*radial->dx - radial->dy*radial->dy;
- }
-
+ radial->c1.x = inner->x;
+ radial->c1.y = inner->y;
+ radial->c1.radius = innerRadius;
+ radial->c2.x = outer->x;
+ radial->c2.y = outer->y;
+ radial->c2.radius = outerRadius;
+ radial->cdx = (radial->c2.x - radial->c1.x) / 65536.;
+ radial->cdy = (radial->c2.y - radial->c1.y) / 65536.;
+ radial->dr = (radial->c2.radius - radial->c1.radius) / 65536.;
+ radial->A = ( radial->cdx * radial->cdx
+ + radial->cdy * radial->cdy
+ - radial->dr * radial->dr);
+
initGradient(pPicture->pSourcePict, nStops, stops, colors, error);
if (*error) {
xfree(pPicture);
@@ -1627,13 +1584,17 @@ FreePicture (pointer value,
{
if (pPicture->transform)
xfree (pPicture->transform);
- if (!pPicture->pDrawable) {
- if (pPicture->pSourcePict) {
- if (pPicture->pSourcePict->type != SourcePictTypeSolidFill)
- xfree(pPicture->pSourcePict->linear.stops);
- xfree(pPicture->pSourcePict);
- }
- } else {
+
+ if (pPicture->pSourcePict)
+ {
+ if (pPicture->pSourcePict->type != SourcePictTypeSolidFill)
+ xfree(pPicture->pSourcePict->linear.stops);
+
+ xfree(pPicture->pSourcePict);
+ }
+
+ if (pPicture->pDrawable)
+ {
ScreenPtr pScreen = pPicture->pDrawable->pScreen;
PictureScreenPtr ps = GetPictureScreen(pScreen);
@@ -1680,7 +1641,7 @@ FreePictFormat (pointer pPictFormat,
* unnecessary. It may also avoid destination reads sometimes if apps aren't
* being careful to avoid these cases.
*/
-static Bool
+static CARD8
ReduceCompositeOp (CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst)
{
Bool no_src_alpha, no_dst_alpha;
@@ -1918,9 +1879,6 @@ AddTraps (PicturePtr pPicture,
(*ps->AddTraps) (pPicture, xOff, yOff, ntrap, traps);
}
-#define MAX_FIXED_48_16 ((xFixed_48_16) 0x7fffffff)
-#define MIN_FIXED_48_16 (-((xFixed_48_16) 1 << 31))
-
_X_EXPORT Bool
PictureTransformPoint3d (PictTransformPtr transform,
PictVectorPtr vector)
diff --git a/render/picture.h b/render/picture.h
index 1b622340d..563a81b43 100644
--- a/render/picture.h
+++ b/render/picture.h
@@ -25,6 +25,8 @@
#ifndef _PICTURE_H_
#define _PICTURE_H_
+#include <pixman.h>
+
typedef struct _DirectFormat *DirectFormatPtr;
typedef struct _PictFormat *PictFormatPtr;
typedef struct _Picture *PicturePtr;
@@ -34,12 +36,7 @@ typedef struct _Picture *PicturePtr;
* sample implementation allows only packed RGB and GBR
* representations for data to simplify software rendering,
*/
-#define PICT_FORMAT(bpp,type,a,r,g,b) (((bpp) << 24) | \
- ((type) << 16) | \
- ((a) << 12) | \
- ((r) << 8) | \
- ((g) << 4) | \
- ((b)))
+#define PICT_FORMAT(bpp,type,a,r,g,b) PIXMAN_FORMAT(bpp, type, a, r, g, b)
/*
* gray/color formats use a visual index instead of argb
@@ -48,77 +45,77 @@ typedef struct _Picture *PicturePtr;
((type) << 16) | \
((vi)))
-#define PICT_FORMAT_BPP(f) (((f) >> 24) )
-#define PICT_FORMAT_TYPE(f) (((f) >> 16) & 0xff)
-#define PICT_FORMAT_A(f) (((f) >> 12) & 0x0f)
-#define PICT_FORMAT_R(f) (((f) >> 8) & 0x0f)
-#define PICT_FORMAT_G(f) (((f) >> 4) & 0x0f)
-#define PICT_FORMAT_B(f) (((f) ) & 0x0f)
-#define PICT_FORMAT_RGB(f) (((f) ) & 0xfff)
-#define PICT_FORMAT_VIS(f) (((f) ) & 0xffff)
+#define PICT_FORMAT_BPP(f) PIXMAN_FORMAT_BPP(f)
+#define PICT_FORMAT_TYPE(f) PIXMAN_FORMAT_TYPE(f)
+#define PICT_FORMAT_A(f) PIXMAN_FORMAT_A(f)
+#define PICT_FORMAT_R(f) PIXMAN_FORMAT_R(f)
+#define PICT_FORMAT_G(f) PIXMAN_FORMAT_G(f)
+#define PICT_FORMAT_B(f) PIXMAN_FORMAT_B(f)
+#define PICT_FORMAT_RGB(f) PIXMAN_FORMAT_RGB(f)
+#define PICT_FORMAT_VIS(f) PIXMAN_FORMAT_VIS(f)
-#define PICT_TYPE_OTHER 0
-#define PICT_TYPE_A 1
-#define PICT_TYPE_ARGB 2
-#define PICT_TYPE_ABGR 3
-#define PICT_TYPE_COLOR 4
-#define PICT_TYPE_GRAY 5
+#define PICT_TYPE_OTHER PIXMAN_TYPE_OTHER
+#define PICT_TYPE_A PIXMAN_TYPE_A
+#define PICT_TYPE_ARGB PIXMAN_TYPE_ARGB
+#define PICT_TYPE_ABGR PIXMAN_TYPE_ABGR
+#define PICT_TYPE_COLOR PIXMAN_TYPE_COLOR
+#define PICT_TYPE_GRAY PIXMAN_TYPE_GRAY
-#define PICT_FORMAT_COLOR(f) (PICT_FORMAT_TYPE(f) & 2)
+#define PICT_FORMAT_COLOR(f) PIXMAN_FORMAT_COLOR(f)
/* 32bpp formats */
typedef enum _PictFormatShort {
- PICT_a8r8g8b8 = PICT_FORMAT(32,PICT_TYPE_ARGB,8,8,8,8),
- PICT_x8r8g8b8 = PICT_FORMAT(32,PICT_TYPE_ARGB,0,8,8,8),
- PICT_a8b8g8r8 = PICT_FORMAT(32,PICT_TYPE_ABGR,8,8,8,8),
- PICT_x8b8g8r8 = PICT_FORMAT(32,PICT_TYPE_ABGR,0,8,8,8),
+ PICT_a8r8g8b8 = PIXMAN_a8r8g8b8,
+ PICT_x8r8g8b8 = PIXMAN_x8r8g8b8,
+ PICT_a8b8g8r8 = PIXMAN_a8b8g8r8,
+ PICT_x8b8g8r8 = PIXMAN_x8b8g8r8,
/* 24bpp formats */
- PICT_r8g8b8 = PICT_FORMAT(24,PICT_TYPE_ARGB,0,8,8,8),
- PICT_b8g8r8 = PICT_FORMAT(24,PICT_TYPE_ABGR,0,8,8,8),
+ PICT_r8g8b8 = PIXMAN_r8g8b8,
+ PICT_b8g8r8 = PIXMAN_b8g8r8,
/* 16bpp formats */
- PICT_r5g6b5 = PICT_FORMAT(16,PICT_TYPE_ARGB,0,5,6,5),
- PICT_b5g6r5 = PICT_FORMAT(16,PICT_TYPE_ABGR,0,5,6,5),
-
- PICT_a1r5g5b5 = PICT_FORMAT(16,PICT_TYPE_ARGB,1,5,5,5),
- PICT_x1r5g5b5 = PICT_FORMAT(16,PICT_TYPE_ARGB,0,5,5,5),
- PICT_a1b5g5r5 = PICT_FORMAT(16,PICT_TYPE_ABGR,1,5,5,5),
- PICT_x1b5g5r5 = PICT_FORMAT(16,PICT_TYPE_ABGR,0,5,5,5),
- PICT_a4r4g4b4 = PICT_FORMAT(16,PICT_TYPE_ARGB,4,4,4,4),
- PICT_x4r4g4b4 = PICT_FORMAT(16,PICT_TYPE_ARGB,0,4,4,4),
- PICT_a4b4g4r4 = PICT_FORMAT(16,PICT_TYPE_ABGR,4,4,4,4),
- PICT_x4b4g4r4 = PICT_FORMAT(16,PICT_TYPE_ABGR,0,4,4,4),
+ PICT_r5g6b5 = PIXMAN_r5g6b5,
+ PICT_b5g6r5 = PIXMAN_b5g6r5,
+
+ PICT_a1r5g5b5 = PIXMAN_a1r5g5b5,
+ PICT_x1r5g5b5 = PIXMAN_x1r5g5b5,
+ PICT_a1b5g5r5 = PIXMAN_a1b5g5r5,
+ PICT_x1b5g5r5 = PIXMAN_x1b5g5r5,
+ PICT_a4r4g4b4 = PIXMAN_a4r4g4b4,
+ PICT_x4r4g4b4 = PIXMAN_x4r4g4b4,
+ PICT_a4b4g4r4 = PIXMAN_a4b4g4r4,
+ PICT_x4b4g4r4 = PIXMAN_x4b4g4r4,
/* 8bpp formats */
- PICT_a8 = PICT_FORMAT(8,PICT_TYPE_A,8,0,0,0),
- PICT_r3g3b2 = PICT_FORMAT(8,PICT_TYPE_ARGB,0,3,3,2),
- PICT_b2g3r3 = PICT_FORMAT(8,PICT_TYPE_ABGR,0,3,3,2),
- PICT_a2r2g2b2 = PICT_FORMAT(8,PICT_TYPE_ARGB,2,2,2,2),
- PICT_a2b2g2r2 = PICT_FORMAT(8,PICT_TYPE_ABGR,2,2,2,2),
+ PICT_a8 = PIXMAN_a8,
+ PICT_r3g3b2 = PIXMAN_r3g3b2,
+ PICT_b2g3r3 = PIXMAN_b2g3r3,
+ PICT_a2r2g2b2 = PIXMAN_a2r2g2b2,
+ PICT_a2b2g2r2 = PIXMAN_a2b2g2r2,
- PICT_c8 = PICT_FORMAT(8,PICT_TYPE_COLOR,0,0,0,0),
- PICT_g8 = PICT_FORMAT(8,PICT_TYPE_GRAY,0,0,0,0),
+ PICT_c8 = PIXMAN_c8,
+ PICT_g8 = PIXMAN_g8,
- PICT_x4a4 = PICT_FORMAT(8,PICT_TYPE_A,4,0,0,0),
+ PICT_x4a4 = PIXMAN_x4a4,
- PICT_x4c4 = PICT_FORMAT(8,PICT_TYPE_COLOR,0,0,0,0),
- PICT_x4g4 = PICT_FORMAT(8,PICT_TYPE_GRAY,0,0,0,0),
+ PICT_x4c4 = PIXMAN_x4c4,
+ PICT_x4g4 = PIXMAN_x4g4,
/* 4bpp formats */
- PICT_a4 = PICT_FORMAT(4,PICT_TYPE_A,4,0,0,0),
- PICT_r1g2b1 = PICT_FORMAT(4,PICT_TYPE_ARGB,0,1,2,1),
- PICT_b1g2r1 = PICT_FORMAT(4,PICT_TYPE_ABGR,0,1,2,1),
- PICT_a1r1g1b1 = PICT_FORMAT(4,PICT_TYPE_ARGB,1,1,1,1),
- PICT_a1b1g1r1 = PICT_FORMAT(4,PICT_TYPE_ABGR,1,1,1,1),
+ PICT_a4 = PIXMAN_a4,
+ PICT_r1g2b1 = PIXMAN_r1g2b1,
+ PICT_b1g2r1 = PIXMAN_b1g2r1,
+ PICT_a1r1g1b1 = PIXMAN_a1r1g1b1,
+ PICT_a1b1g1r1 = PIXMAN_a1b1g1r1,
- PICT_c4 = PICT_FORMAT(4,PICT_TYPE_COLOR,0,0,0,0),
- PICT_g4 = PICT_FORMAT(4,PICT_TYPE_GRAY,0,0,0,0),
+ PICT_c4 = PIXMAN_c4,
+ PICT_g4 = PIXMAN_g4,
/* 1bpp formats */
- PICT_a1 = PICT_FORMAT(1,PICT_TYPE_A,1,0,0,0),
+ PICT_a1 = PIXMAN_a1,
- PICT_g1 = PICT_FORMAT(1,PICT_TYPE_GRAY,0,0,0,0),
+ PICT_g1 = PIXMAN_g1,
} PictFormatShort;
/*
@@ -171,54 +168,35 @@ extern int RenderClientPrivateIndex;
/* Fixed point updates from Carl Worth, USC, Information Sciences Institute */
-#if defined(WIN32) && !defined(__GNUC__)
-typedef __int64 xFixed_32_32;
-#else
-# if defined (_LP64) || \
- defined(__alpha__) || defined(__alpha) || \
- defined(ia64) || defined(__ia64__) || \
- defined(__sparc64__) || \
- defined(__s390x__) || \
- defined(amd64) || defined (__amd64__) || \
- (defined(sgi) && (_MIPS_SZLONG == 64))
-typedef long xFixed_32_32;
-# else
-# if defined(__GNUC__) && \
- ((__GNUC__ > 2) || \
- ((__GNUC__ == 2) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ > 7)))
-__extension__
-# endif
-typedef long long int xFixed_32_32;
-# endif
-#endif
-
-typedef xFixed_32_32 xFixed_48_16;
-
-#define MAX_FIXED_48_16 ((xFixed_48_16) 0x7fffffff)
-#define MIN_FIXED_48_16 (-((xFixed_48_16) 1 << 31))
-
-typedef CARD32 xFixed_1_31;
-typedef CARD32 xFixed_1_16;
-typedef INT32 xFixed_16_16;
+typedef pixman_fixed_32_32_t xFixed_32_32;
+
+typedef pixman_fixed_48_16_t xFixed_48_16;
+
+#define MAX_FIXED_48_16 pixman_max_fixed_48_16
+#define MIN_FIXED_48_16 pixman_min_fixed_48_16
+
+typedef pixman_fixed_1_31_t xFixed_1_31;
+typedef pixman_fixed_1_16_t xFixed_1_16;
+typedef pixman_fixed_16_16_t xFixed_16_16;
/*
* An unadorned "xFixed" is the same as xFixed_16_16,
* (since it's quite common in the code)
*/
-typedef xFixed_16_16 xFixed;
+typedef pixman_fixed_t xFixed;
#define XFIXED_BITS 16
-#define xFixedToInt(f) (int) ((f) >> XFIXED_BITS)
-#define IntToxFixed(i) ((xFixed) (i) << XFIXED_BITS)
-#define xFixedE ((xFixed) 1)
-#define xFixed1 (IntToxFixed(1))
-#define xFixed1MinusE (xFixed1 - xFixedE)
-#define xFixedFrac(f) ((f) & xFixed1MinusE)
-#define xFixedFloor(f) ((f) & ~xFixed1MinusE)
-#define xFixedCeil(f) xFixedFloor((f) + xFixed1MinusE)
-
-#define xFixedFraction(f) ((f) & xFixed1MinusE)
-#define xFixedMod2(f) ((f) & (xFixed1 | xFixed1MinusE))
+#define xFixedToInt(f) pixman_fixed_to_int(f)
+#define IntToxFixed(i) pixman_int_to_fixed(i)
+#define xFixedE pixman_fixed_e
+#define xFixed1 pixman_fixed_1
+#define xFixed1MinusE pixman_fixed_1_minus_e
+#define xFixedFrac(f) pixman_fixed_frac(f)
+#define xFixedFloor(f) pixman_fixed_floor(f)
+#define xFixedCeil(f) pixman_fixed_ceil(f)
+
+#define xFixedFraction(f) pixman_fixed_fraction(f)
+#define xFixedMod2(f) pixman_fixed_mod2(f)
/* whether 't' is a well defined not obviously empty trapezoid */
#define xTrapezoidValid(t) ((t)->left.p1.y != (t)->left.p2.y && \
diff --git a/render/picturestr.h b/render/picturestr.h
index f1617f627..aabce842e 100644
--- a/render/picturestr.h
+++ b/render/picturestr.h
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Copyright © 2000 SuSE, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -26,8 +24,8 @@
#ifndef _PICTURESTR_H_
#define _PICTURESTR_H_
-#include "glyphstr.h"
#include "scrnintstr.h"
+#include "glyphstr.h"
#include "resource.h"
typedef struct _DirectFormat {
@@ -54,13 +52,8 @@ typedef struct _PictFormat {
IndexFormatRec index;
} PictFormatRec;
-typedef struct _PictVector {
- xFixed vector[3];
-} PictVector, *PictVectorPtr;
-
-typedef struct _PictTransform {
- xFixed matrix[3][3];
-} PictTransform, *PictTransformPtr;
+typedef struct pixman_vector PictVector, *PictVectorPtr;
+typedef struct pixman_transform PictTransform, *PictTransformPtr;
#define PICT_GRADIENT_STOPTABLE_SIZE 1024
#define SourcePictTypeSolidFill 0
@@ -68,8 +61,13 @@ typedef struct _PictTransform {
#define SourcePictTypeRadial 2
#define SourcePictTypeConical 3
+#define SourcePictClassUnknown 0
+#define SourcePictClassHorizontal 1
+#define SourcePictClassVertical 2
+
typedef struct _PictSolidFill {
unsigned int type;
+ unsigned int class;
CARD32 color;
} PictSolidFill, *PictSolidFillPtr;
@@ -80,39 +78,56 @@ typedef struct _PictGradientStop {
typedef struct _PictGradient {
unsigned int type;
+ unsigned int class;
int nstops;
PictGradientStopPtr stops;
- CARD32 colorTable[PICT_GRADIENT_STOPTABLE_SIZE];
+ int stopRange;
+ CARD32 *colorTable;
+ int colorTableSize;
} PictGradient, *PictGradientPtr;
typedef struct _PictLinearGradient {
unsigned int type;
+ unsigned int class;
int nstops;
PictGradientStopPtr stops;
- CARD32 colorTable[PICT_GRADIENT_STOPTABLE_SIZE];
+ int stopRange;
+ CARD32 *colorTable;
+ int colorTableSize;
xPointFixed p1;
xPointFixed p2;
} PictLinearGradient, *PictLinearGradientPtr;
+typedef struct _PictCircle {
+ xFixed x;
+ xFixed y;
+ xFixed radius;
+} PictCircle, *PictCirclePtr;
+
typedef struct _PictRadialGradient {
unsigned int type;
+ unsigned int class;
int nstops;
PictGradientStopPtr stops;
- CARD32 colorTable[PICT_GRADIENT_STOPTABLE_SIZE];
- double fx;
- double fy;
- double dx;
- double dy;
- double a;
- double m;
- double b;
+ int stopRange;
+ CARD32 *colorTable;
+ int colorTableSize;
+ PictCircle c1;
+ PictCircle c2;
+ double cdx;
+ double cdy;
+ double dr;
+ double A;
} PictRadialGradient, *PictRadialGradientPtr;
typedef struct _PictConicalGradient {
unsigned int type;
+ unsigned int class;
int nstops;
PictGradientStopPtr stops;
- CARD32 colorTable[PICT_GRADIENT_STOPTABLE_SIZE];
+ int stopRange;
+ CARD32 *colorTable;
+ int colorTableSize;
xPointFixed center;
xFixed angle;
} PictConicalGradient, *PictConicalGradientPtr;
@@ -624,6 +639,11 @@ Bool
PictureTransformPoint3d (PictTransformPtr transform,
PictVectorPtr vector);
+CARD32
+PictureGradientColor (PictGradientStopPtr stop1,
+ PictGradientStopPtr stop2,
+ CARD32 x);
+
void RenderExtensionInit (void);
Bool
@@ -639,6 +659,10 @@ AddTraps (PicturePtr pPicture,
int ntraps,
xTrap *traps);
+pixman_image_t *
+PixmanImageFromPicture (PicturePtr pPict,
+ Bool hasClip);
+
PicturePtr
CreateSolidPicture (Picture pid,
xRenderColor *color,
diff --git a/render/render.c b/render/render.c
index bb7208d73..2da8a3fff 100644
--- a/render/render.c
+++ b/render/render.c
@@ -620,15 +620,15 @@ ProcRenderCreatePicture (ClientPtr client)
PicturePtr pPicture;
DrawablePtr pDrawable;
PictFormatPtr pFormat;
- int len;
- int error;
+ int len, error;
REQUEST(xRenderCreatePictureReq);
REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq);
LEGAL_NEW_RESOURCE(stuff->pid, client);
SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client,
- SecurityWriteAccess);
+ SecurityWriteAccess);
+
pFormat = (PictFormatPtr) SecurityLookupIDByType (client,
stuff->format,
PictFormatType,
@@ -1698,9 +1698,7 @@ ProcRenderQueryFilters (ClientPtr client)
int nnames;
ScreenPtr pScreen;
PictureScreenPtr ps;
- int i, j;
- int len;
- int total_bytes;
+ int i, j, len, total_bytes;
INT16 *aliases;
char *names;
@@ -2075,6 +2073,8 @@ SProcRenderSetPictureClipRectangles (ClientPtr client)
REQUEST(xRenderSetPictureClipRectanglesReq);
swaps(&stuff->length, n);
swapl(&stuff->picture, n);
+ swaps(&stuff->xOrigin, n);
+ swaps(&stuff->yOrigin, n);
SwapRestS(stuff);
return (*ProcRenderVector[stuff->renderReqType]) (client);
}
diff --git a/render/renderedge.c b/render/renderedge.c
index 199ec22ee..d0ee30716 100644
--- a/render/renderedge.c
+++ b/render/renderedge.c
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Copyright © 2004 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -36,16 +34,7 @@
_X_EXPORT xFixed
RenderSampleCeilY (xFixed y, int n)
{
- xFixed f = xFixedFrac(y);
- xFixed i = xFixedFloor(y);
-
- f = ((f + Y_FRAC_FIRST(n)) / STEP_Y_SMALL(n)) * STEP_Y_SMALL(n) + Y_FRAC_FIRST(n);
- if (f > Y_FRAC_LAST(n))
- {
- f = Y_FRAC_FIRST(n);
- i += xFixed1;
- }
- return (i | f);
+ return pixman_sample_ceil_y (y, n);
}
#define _div(a,b) ((a) >= 0 ? (a) / (b) : -((-(a) + (b) - 1) / (b)))
@@ -57,16 +46,7 @@ RenderSampleCeilY (xFixed y, int n)
_X_EXPORT xFixed
RenderSampleFloorY (xFixed y, int n)
{
- xFixed f = xFixedFrac(y);
- xFixed i = xFixedFloor (y);
-
- f = _div(f - Y_FRAC_FIRST(n), STEP_Y_SMALL(n)) * STEP_Y_SMALL(n) + Y_FRAC_FIRST(n);
- if (f < Y_FRAC_FIRST(n))
- {
- f = Y_FRAC_LAST(n);
- i -= xFixed1;
- }
- return (i | f);
+ return pixman_sample_floor_y (y, n);
}
/*
@@ -75,52 +55,7 @@ RenderSampleFloorY (xFixed y, int n)
_X_EXPORT void
RenderEdgeStep (RenderEdge *e, int n)
{
- xFixed_48_16 ne;
-
- e->x += n * e->stepx;
-
- ne = e->e + n * (xFixed_48_16) e->dx;
-
- if (n >= 0)
- {
- if (ne > 0)
- {
- int nx = (ne + e->dy - 1) / e->dy;
- e->e = ne - nx * (xFixed_48_16) e->dy;
- e->x += nx * e->signdx;
- }
- }
- else
- {
- if (ne <= -e->dy)
- {
- int nx = (-ne) / e->dy;
- e->e = ne + nx * (xFixed_48_16) e->dy;
- e->x -= nx * e->signdx;
- }
- }
-}
-
-/*
- * A private routine to initialize the multi-step
- * elements of an edge structure
- */
-static void
-_RenderEdgeMultiInit (RenderEdge *e, int n, xFixed *stepx_p, xFixed *dx_p)
-{
- xFixed stepx;
- xFixed_48_16 ne;
-
- ne = n * (xFixed_48_16) e->dx;
- stepx = n * e->stepx;
- if (ne > 0)
- {
- int nx = ne / e->dy;
- ne -= nx * e->dy;
- stepx += nx * e->signdx;
- }
- *dx_p = ne;
- *stepx_p = stepx;
+ pixman_edge_step (e, n);
}
/*
@@ -136,34 +71,7 @@ RenderEdgeInit (RenderEdge *e,
xFixed x_bot,
xFixed y_bot)
{
- xFixed dx, dy;
-
- e->x = x_top;
- e->e = 0;
- dx = x_bot - x_top;
- dy = y_bot - y_top;
- e->dy = dy;
- if (dy)
- {
- if (dx >= 0)
- {
- e->signdx = 1;
- e->stepx = dx / dy;
- e->dx = dx % dy;
- e->e = -dy;
- }
- else
- {
- e->signdx = -1;
- e->stepx = -(-dx / dy);
- e->dx = -dx % dy;
- e->e = 0;
- }
-
- _RenderEdgeMultiInit (e, STEP_Y_SMALL(n), &e->stepx_small, &e->dx_small);
- _RenderEdgeMultiInit (e, STEP_Y_BIG(n), &e->stepx_big, &e->dx_big);
- }
- RenderEdgeStep (e, y_start - y_top);
+ pixman_edge_init (e, n, y_start, x_top, y_top, x_bot, y_bot);
}
/*
@@ -178,24 +86,6 @@ RenderLineFixedEdgeInit (RenderEdge *e,
int x_off,
int y_off)
{
- xFixed x_off_fixed = IntToxFixed(x_off);
- xFixed y_off_fixed = IntToxFixed(y_off);
- xPointFixed *top, *bot;
-
- if (line->p1.y <= line->p2.y)
- {
- top = &line->p1;
- bot = &line->p2;
- }
- else
- {
- top = &line->p2;
- bot = &line->p1;
- }
- RenderEdgeInit (e, n, y,
- top->x + x_off_fixed,
- top->y + y_off_fixed,
- bot->x + x_off_fixed,
- bot->y + y_off_fixed);
+ pixman_line_fixed_edge_init (e, n, y, (pixman_line_fixed_t *)line, x_off, y_off);
}
diff --git a/render/renderedge.h b/render/renderedge.h
index d621d9dcf..644d9d9e5 100644
--- a/render/renderedge.h
+++ b/render/renderedge.h
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Copyright © 2004 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -50,20 +48,7 @@
* and can be quickly stepped across small or large gaps in the
* sample grid
*/
-
-typedef struct {
- xFixed x;
- xFixed e;
- xFixed stepx;
- xFixed signdx;
- xFixed dy;
- xFixed dx;
-
- xFixed stepx_small;
- xFixed stepx_big;
- xFixed dx_small;
- xFixed dx_big;
-} RenderEdge;
+typedef pixman_edge_t RenderEdge;
/*
* Step across a small sample grid gap