1895 are supported on this display. |
1895 are supported on this display. |
1896 Both Smalltalk has to be compiled to support it (as client), |
1896 Both Smalltalk has to be compiled to support it (as client), |
1897 and the display we are connected to must support it, |
1897 and the display we are connected to must support it, |
1898 to return true here." |
1898 to return true here." |
1899 |
1899 |
1900 ^ XftFontDescription notNil |
1900 ^ XftFontDescription notNil and:[hasXftLibrary]. |
1901 and:[self class hasXftLibrary |
|
1902 and:[self hasRenderExtension]] |
|
1903 |
1901 |
1904 " |
1902 " |
1905 Display supportsXftFonts |
1903 Display supportsXftFonts |
1906 Display hasRenderExtension |
1904 Display hasRenderExtension |
1907 Display class hasXftLibrary |
1905 Display class hasXftLibrary |
9335 initializeScreenProperties |
9333 initializeScreenProperties |
9336 |masks| |
9334 |masks| |
9337 |
9335 |
9338 super initializeScreenProperties. |
9336 super initializeScreenProperties. |
9339 |
9337 |
9340 hasShapeExtension := self queryShapeExtension. |
9338 hasShapeExtension := self hasExtension:#SHAPE. |
9341 hasShmExtension := self querySHMExtension. |
9339 hasShmExtension := self hasExtension:#MIT_SHM. |
9342 hasDPSExtension := self queryDPSExtension. |
9340 hasDPSExtension := self hasExtension:#DPS. |
9343 hasXVideoExtension := self queryXVideoExtension. |
9341 hasXVideoExtension := self hasExtension:#XVideo. |
9344 hasMbufExtension := self queryMBUFExtension. |
9342 hasMbufExtension := self hasExtension:#'Multi-Buffering'. |
9345 hasPEXExtension := self queryPEXExtension. |
9343 hasPEXExtension := self hasExtension:#'X3D-PEX'. |
9346 hasImageExtension := self queryXIEExtension. |
9344 hasImageExtension := self hasExtension:#XIE. |
9347 hasInputExtension := self queryXIExtension. |
9345 hasInputExtension := self hasExtension:#XInputExtension. |
9348 hasXineramaExtension := self queryXineramaExtension. |
9346 hasXineramaExtension := self hasExtension:#XINERAMA. |
9349 hasRenderExtension := self queryRenderExtension. |
9347 hasRenderExtension := self hasExtension:#RENDER. |
9350 hasXftLibrary := self queryXftLibrary. |
9348 hasXftLibrary := hasRenderExtension and:[self class hasXftLibrary]. |
9351 |
9349 |
9352 primaryAtom := self atomIDOf:#PRIMARY. |
9350 primaryAtom := self atomIDOf:#PRIMARY. |
9353 stringAtom := self atomIDOf:#STRING. |
9351 stringAtom := self atomIDOf:#STRING. |
9354 clipboardAtom := self atomIDOf:#CLIPBOARD. |
9352 clipboardAtom := self atomIDOf:#CLIPBOARD. |
9355 |
9353 |
9369 visualType := self queryDefaultVisualType. |
9367 visualType := self queryDefaultVisualType. |
9370 |
9368 |
9371 hasColors := hasGreyscales := true. |
9369 hasColors := hasGreyscales := true. |
9372 (visualType == #StaticGray |
9370 (visualType == #StaticGray |
9373 or:[ visualType == #GrayScale]) ifTrue:[ |
9371 or:[ visualType == #GrayScale]) ifTrue:[ |
9374 hasColors := false. |
9372 hasColors := false. |
9375 monitorType := #monochrome. |
9373 monitorType := #monochrome. |
9376 ]. |
9374 ]. |
9377 |
9375 |
9378 ncells == 2 ifTrue:[ |
9376 ncells == 2 ifTrue:[ |
9379 hasColors := hasGreyscales := false. |
9377 hasColors := hasGreyscales := false. |
9380 ]. |
9378 ]. |
9381 |
9379 |
9382 masks := self queryRGBMasks. |
9380 masks := self queryRGBMasks. |
9383 redMask := masks at:1. |
9381 redMask := masks at:1. |
9384 greenMask := masks at:2. |
9382 greenMask := masks at:2. |
9385 blueMask := masks at:3. |
9383 blueMask := masks at:3. |
9386 bitsPerRGB := masks at:4. |
9384 bitsPerRGB := masks at:4. |
9387 |
9385 |
9388 visualType == #TrueColor ifTrue:[ |
9386 visualType == #TrueColor ifTrue:[ |
9389 redShift := redMask lowBit - 1. |
9387 redShift := redMask lowBit - 1. |
9390 greenShift := greenMask lowBit - 1. |
9388 greenShift := greenMask lowBit - 1. |
9391 blueShift := blueMask lowBit - 1. |
9389 blueShift := blueMask lowBit - 1. |
9392 |
9390 |
9393 bitsRed := redMask highBit - redMask lowBit + 1. |
9391 bitsRed := redMask highBit - redMask lowBit + 1. |
9394 bitsGreen := greenMask highBit - greenMask lowBit + 1. |
9392 bitsGreen := greenMask highBit - greenMask lowBit + 1. |
9395 bitsBlue := blueMask highBit - blueMask lowBit + 1. |
9393 bitsBlue := blueMask highBit - blueMask lowBit + 1. |
9396 ]. |
9394 ]. |
9397 |
9395 |
9398 %{ |
9396 %{ |
9399 |
9397 |
9400 Display *dpy; |
9398 Display *dpy; |
9409 int nvi, i; |
9407 int nvi, i; |
9410 char *type, *nm; |
9408 char *type, *nm; |
9411 int dummy; |
9409 int dummy; |
9412 |
9410 |
9413 if (ISCONNECTED) { |
9411 if (ISCONNECTED) { |
9414 dpy = myDpy; |
9412 dpy = myDpy; |
9415 |
9413 |
9416 /* |
9414 /* |
9417 * look for RGB visual with the highest depth |
9415 * look for RGB visual with the highest depth |
9418 */ |
9416 */ |
9419 nvi = 0; |
9417 nvi = 0; |
9420 viproto.screen = scr; |
9418 viproto.screen = scr; |
9421 vip = XGetVisualInfo (dpy, VisualScreenMask, &viproto, &nvi); |
9419 vip = XGetVisualInfo (dpy, VisualScreenMask, &viproto, &nvi); |
9422 maxRGBDepth = maxRGBADepth = 0; |
9420 maxRGBDepth = maxRGBADepth = 0; |
9423 for (i = 0; i < nvi; i++) { |
9421 for (i = 0; i < nvi; i++) { |
9424 int thisDepth = vip[i].depth; |
9422 int thisDepth = vip[i].depth; |
9425 |
9423 |
9426 switch (vip[i].class) { |
9424 switch (vip[i].class) { |
9427 case TrueColor: |
9425 case TrueColor: |
9428 if (thisDepth > maxRGBDepth) { |
9426 if (thisDepth > maxRGBDepth) { |
9429 if (thisDepth <= 24) { |
9427 if (thisDepth <= 24) { |
9430 maxRGBDepth = thisDepth; |
9428 maxRGBDepth = thisDepth; |
9431 rgbRedMask = vip[i].red_mask; |
9429 rgbRedMask = vip[i].red_mask; |
9432 rgbGreenMask = vip[i].green_mask; |
9430 rgbGreenMask = vip[i].green_mask; |
9433 rgbBlueMask = vip[i].blue_mask; |
9431 rgbBlueMask = vip[i].blue_mask; |
9434 rgbVisualID = vip[i].visualid; |
9432 rgbVisualID = vip[i].visualid; |
9435 } else { |
9433 } else { |
9436 if (thisDepth > maxRGBADepth) { |
9434 if (thisDepth > maxRGBADepth) { |
9437 // printf("found rgba visual!\n"); |
9435 // printf("found rgba visual!\n"); |
9438 maxRGBADepth = thisDepth; |
9436 maxRGBADepth = thisDepth; |
9439 rgbaRedMask = vip[i].red_mask; |
9437 rgbaRedMask = vip[i].red_mask; |
9440 rgbaGreenMask = vip[i].green_mask; |
9438 rgbaGreenMask = vip[i].green_mask; |
9441 rgbaBlueMask = vip[i].blue_mask; |
9439 rgbaBlueMask = vip[i].blue_mask; |
9442 rgbaVisualID = vip[i].visualid; |
9440 rgbaVisualID = vip[i].visualid; |
9443 } |
9441 } |
9444 } |
9442 } |
9445 } |
9443 } |
9446 break; |
9444 break; |
9447 } |
9445 } |
9448 } |
9446 } |
9449 if (vip) XFree ((char *) vip); |
9447 if (vip) XFree ((char *) vip); |
9450 |
9448 |
9451 if (maxRGBDepth) { |
9449 if (maxRGBDepth) { |
9452 __INST(rgbVisual) = __MKEXTERNALADDRESS(rgbVisualID); __STORESELF(rgbVisual); |
9450 __INST(rgbVisual) = __MKEXTERNALADDRESS(rgbVisualID); __STORESELF(rgbVisual); |
9453 } |
9451 } |
9454 if (maxRGBADepth) { |
9452 if (maxRGBADepth) { |
9455 __INST(rgbaVisual) = __MKEXTERNALADDRESS(rgbaVisualID); __STORESELF(rgbaVisual); |
9453 __INST(rgbaVisual) = __MKEXTERNALADDRESS(rgbaVisualID); __STORESELF(rgbaVisual); |
9456 if (!maxRGBDepth) { |
9454 if (!maxRGBDepth) { |
9457 __INST(rgbVisual) = __INST(rgbaVisual); __STORESELF(rgbVisual); |
9455 __INST(rgbVisual) = __INST(rgbaVisual); __STORESELF(rgbVisual); |
9458 } |
9456 } |
9459 } |
9457 } |
9460 } |
9458 } |
9461 %}. |
9459 %}. |
9462 ! |
9460 ! |
9463 |
9461 |
9464 initializeSpecialFlags |
9462 initializeSpecialFlags |
9904 %}. |
9764 %}. |
9905 ^ nil |
9765 ^ nil |
9906 |
9766 |
9907 " |
9767 " |
9908 Display queryWidthMM |
9768 Display queryWidthMM |
9909 " |
|
9910 ! |
|
9911 |
|
9912 queryXIEExtension |
|
9913 %{ /* NOCONTEXT */ |
|
9914 |
|
9915 #ifdef XIE |
|
9916 if (ISCONNECTED) { |
|
9917 Display *dpy; |
|
9918 int dummy; |
|
9919 |
|
9920 dpy = myDpy; |
|
9921 |
|
9922 if (XQueryExtension(dpy, xieExtName, &dummy, &dummy, &dummy)) { |
|
9923 RETURN ( true ); |
|
9924 } |
|
9925 } |
|
9926 #endif |
|
9927 %}. |
|
9928 ^ false |
|
9929 |
|
9930 " |
|
9931 Display queryXIEExtension |
|
9932 " |
|
9933 ! |
|
9934 |
|
9935 queryXIExtension |
|
9936 %{ /* NOCONTEXT */ |
|
9937 |
|
9938 #ifdef XI |
|
9939 if (ISCONNECTED) { |
|
9940 Display *dpy; |
|
9941 int dummy; |
|
9942 |
|
9943 dpy = myDpy; |
|
9944 |
|
9945 if (XQueryExtension(dpy, "XInputExtension", &dummy, &dummy, &dummy)) { |
|
9946 RETURN ( true ); |
|
9947 } |
|
9948 } |
|
9949 #endif |
|
9950 %}. |
|
9951 ^ false |
|
9952 |
|
9953 " |
|
9954 Display queryXIExtension |
|
9955 " |
|
9956 ! |
|
9957 |
|
9958 queryXVideoExtension |
|
9959 %{ /* NOCONTEXT */ |
|
9960 |
|
9961 #ifdef XVIDEO |
|
9962 if (ISCONNECTED) { |
|
9963 Display *dpy; |
|
9964 int dummy; |
|
9965 |
|
9966 dpy = myDpy; |
|
9967 |
|
9968 if (XQueryExtension(dpy, "XVideo", &dummy, &dummy, &dummy)) { |
|
9969 RETURN ( true ); |
|
9970 } |
|
9971 } |
|
9972 #endif |
|
9973 %}. |
|
9974 ^ false |
|
9975 |
|
9976 " |
|
9977 Display queryXVideoExtension |
|
9978 " |
|
9979 ! |
|
9980 |
|
9981 queryXftLibrary |
|
9982 %{ |
|
9983 #ifndef XFT |
|
9984 RETURN (false); |
|
9985 #endif |
|
9986 %}. |
|
9987 ^ self queryRenderExtension |
|
9988 ! |
|
9989 |
|
9990 queryXineramaExtension |
|
9991 %{ /* NOCONTEXT */ |
|
9992 |
|
9993 #ifdef XINERAMA |
|
9994 if (ISCONNECTED) { |
|
9995 Display *dpy; |
|
9996 int dummy; |
|
9997 |
|
9998 dpy = myDpy; |
|
9999 |
|
10000 if (XineramaQueryExtension (dpy, &dummy, &dummy)) { |
|
10001 RETURN ( true ); |
|
10002 } |
|
10003 } |
|
10004 #endif |
|
10005 %}. |
|
10006 ^ false |
|
10007 |
|
10008 " |
|
10009 Display queryXineramaExtension |
|
10010 " |
9769 " |
10011 ! |
9770 ! |
10012 |
9771 |
10013 reinitialize |
9772 reinitialize |
10014 preWaitAction notNil ifTrue:[ |
9773 preWaitAction notNil ifTrue:[ |