XWorkstation.st
branchjv
changeset 7137 7a13ed1d9309
parent 7128 e49af1b43177
child 7143 e216536ea990
equal deleted inserted replaced
7129:b9f00860bc01 7137:7a13ed1d9309
    66 
    66 
    67 #define SUPPORT_MOTIF_WM_HINTS
    67 #define SUPPORT_MOTIF_WM_HINTS
    68 
    68 
    69 #ifdef LINUX
    69 #ifdef LINUX
    70 # ifndef __arm__
    70 # ifndef __arm__
    71 #  define SHM
    71 #  define SHM 
    72 # endif
    72 # endif
    73 #endif
    73 #endif
    74 
    74 
    75 #define COUNT_RESOURCES
    75 #define COUNT_RESOURCES
    76 #ifdef COUNT_RESOURCES
    76 #ifdef COUNT_RESOURCES
   326 #  define OL_DECOR_ALL              (OL_DECOR_CLOSE | OL_DECOR_RESIZEH | OL_DECOR_HEADER | OL_DECOR_ICON_NAME)
   326 #  define OL_DECOR_ALL              (OL_DECOR_CLOSE | OL_DECOR_RESIZEH | OL_DECOR_HEADER | OL_DECOR_ICON_NAME)
   327 #  define OL_ANY_HINTS              (1L << 7)
   327 #  define OL_ANY_HINTS              (1L << 7)
   328 # endif
   328 # endif
   329 #endif /* SUPPORT_OPENLOOCK_WM_HINTS */
   329 #endif /* SUPPORT_OPENLOOCK_WM_HINTS */
   330 
   330 
   331 
       
   332 %}
   331 %}
   333 ! !
   332 ! !
   334 
   333 
   335 !XWorkstation primitiveVariables!
   334 !XWorkstation primitiveVariables!
   336 %{
   335 %{
   343 static unsigned INT lastResource = 0;
   342 static unsigned INT lastResource = 0;
   344 
   343 
   345 static int __debug__ = 0;
   344 static int __debug__ = 0;
   346 
   345 
   347 #define DPRINTF(x)      if (__debug__) { console_printf x; }
   346 #define DPRINTF(x)      if (__debug__) { console_printf x; }
       
   347 
       
   348 
       
   349 /* Some libraries, notably Cairo uses MIT-SHM extension 
       
   350  * that sends back ShmCompletion event. Such event needs
       
   351  * to be silently ignored. 
       
   352  * However, since it comes from an extension, the event type
       
   353  * must be queried. To avoid a query each time we get it, 
       
   354  * cache the value in a variable. 
       
   355  */
       
   356 #ifdef SHM
       
   357 static int ShmCompletionType = -1;
       
   358 #endif
       
   359 
   348 
   360 
   349 %}
   361 %}
   350 ! !
   362 ! !
   351 
   363 
   352 !XWorkstation primitiveFunctions!
   364 !XWorkstation primitiveFunctions!
  5436 
  5448 
  5437 resizeRequest:aView width:width height:height
  5449 resizeRequest:aView width:width height:height
  5438     "ignored for now"
  5450     "ignored for now"
  5439 
  5451 
  5440     "/ aView resizeRequest
  5452     "/ aView resizeRequest
       
  5453 
       
  5454 !
       
  5455 
       
  5456 shmCompletion: aView
       
  5457     "ignored for now"
       
  5458 
       
  5459 
  5441 ! !
  5460 ! !
  5442 
  5461 
  5443 !XWorkstation methodsFor:'event handling'!
  5462 !XWorkstation methodsFor:'event handling'!
  5444 
  5463 
  5445 defaultEventMask
  5464 defaultEventMask
  6246 	    __ArrayInstPtr(anEventArray)->a_element[2] = @symbol(reparentedView:parentId:x:y:);
  6265 	    __ArrayInstPtr(anEventArray)->a_element[2] = @symbol(reparentedView:parentId:x:y:);
  6247 	    t = __MKEXTERNALADDRESS(rpe->parent);
  6266 	    t = __MKEXTERNALADDRESS(rpe->parent);
  6248 	    __ArrayInstPtr(anEventArray)->a_element[3] = t; __STORE(anEventArray, t);
  6267 	    __ArrayInstPtr(anEventArray)->a_element[3] = t; __STORE(anEventArray, t);
  6249 	    __ArrayInstPtr(anEventArray)->a_element[4] = __mkSmallInteger(rpe->x);
  6268 	    __ArrayInstPtr(anEventArray)->a_element[4] = __mkSmallInteger(rpe->x);
  6250 	    __ArrayInstPtr(anEventArray)->a_element[5] = __mkSmallInteger(rpe->y);
  6269 	    __ArrayInstPtr(anEventArray)->a_element[5] = __mkSmallInteger(rpe->y);
  6251 	    break;
  6270 	    break;	   
  6252 
  6271 
  6253 	default:
  6272 	default:
       
  6273 #ifdef SHM
       
  6274 	    if (ev.type == ShmCompletionType) {
       
  6275 	        __ArrayInstPtr(anEventArray)->a_element[2] = @symbol(shmCompletion:);
       
  6276 	        break;
       
  6277 	    }
       
  6278 #endif
  6254 	    __ArrayInstPtr(anEventArray)->a_element[2] = @symbol(unknownX11Event);
  6279 	    __ArrayInstPtr(anEventArray)->a_element[2] = @symbol(unknownX11Event);
  6255 	    break;
  6280 	    break;
  6256     }
  6281     }
  6257 #undef ae
  6282 #undef ae
  6258 #undef ee
  6283 #undef ee
  9237 	    __INST(rgbaVisual) = __MKEXTERNALADDRESS(rgbaVisualID); __STORESELF(rgbaVisual);
  9262 	    __INST(rgbaVisual) = __MKEXTERNALADDRESS(rgbaVisualID); __STORESELF(rgbaVisual);
  9238 	    if (!maxRGBDepth) {
  9263 	    if (!maxRGBDepth) {
  9239 		__INST(rgbVisual) = __INST(rgbaVisual); __STORESELF(rgbVisual);
  9264 		__INST(rgbVisual) = __INST(rgbaVisual); __STORESELF(rgbVisual);
  9240 	    }
  9265 	    }
  9241 	}
  9266 	}
  9242     }
  9267 
       
  9268     }
       
  9269 #ifdef SHM
       
  9270     if (__INST(hasShmExtension) == true) {
       
  9271         ShmCompletionType = XShmGetEventBase(dpy) + ShmCompletion;
       
  9272     }
       
  9273 #endif    
       
  9274 
  9243 %}.
  9275 %}.
  9244 !
  9276 !
  9245 
  9277 
  9246 initializeSpecialFlags
  9278 initializeSpecialFlags
  9247     "perform additional special server implementation flags"
  9279     "perform additional special server implementation flags"
  9589 !
  9621 !
  9590 
  9622 
  9591 querySHMExtension
  9623 querySHMExtension
  9592 %{  /* NOCONTEXT */
  9624 %{  /* NOCONTEXT */
  9593 
  9625 
  9594 #ifdef xxSHM
  9626 #ifdef SHM
  9595     if (ISCONNECTED) {
  9627     if (ISCONNECTED) {
  9596 	Display *dpy;
  9628 	Display *dpy;
  9597 	int dummy;
  9629 	int dummy;
  9598 
  9630 
  9599 	dpy = myDpy;
  9631 	dpy = myDpy;
  9600 
  9632 
  9601 	if (XQueryExtension(dpy, "MIT_SHM", &dummy, &dummy, &dummy)) {
  9633 	if (XQueryExtension(dpy, "MIT-SHM", &dummy, &dummy, &dummy)) {
  9602 	    RETURN ( true );
  9634 	    RETURN ( true );
  9603 	}
  9635 	}
  9604     }
  9636     }
  9605 #endif
  9637 #endif
  9606 %}.
  9638 %}.