WinWorkstation.st
changeset 8895 e8bf0fe9996f
parent 8894 b81ac2bb259c
child 8897 8fb9d7c6eb60
child 8899 fe8d508c7e2f
equal deleted inserted replaced
8894:b81ac2bb259c 8895:e8bf0fe9996f
     1 "{ Encoding: utf8 }"
       
     2 
       
     3 "
     1 "
     4 COPYRIGHT (c) 1996 by Claus Gittinger
     2 COPYRIGHT (c) 1996 by Claus Gittinger
     5 	      All Rights Reserved
     3 	      All Rights Reserved
     6 
     4 
     7  This software is furnished under a license and may be used
     5  This software is furnished under a license and may be used
  2142                     } else {
  2140                     } else {
  2143                         sleep(0);
  2141                         sleep(0);
  2144                     }
  2142                     }
  2145                     goto again;
  2143                     goto again;
  2146                 }
  2144                 }
  2147                 /* fail evtl. später ändern und in st verzögert aufrufen
  2145                 /* fail evtl. später ändern und in st verzögert aufrufen
  2148                 */
  2146                 */
  2149                 console_fprintf(stderr, "WinWorkstation [info]: UnregisterClass %s failed.\n",(char*)ev->ev_arg1);
  2147                 console_fprintf(stderr, "WinWorkstation [info]: UnregisterClass %s failed.\n",(char*)ev->ev_arg1);
  2150             }
  2148             }
  2151             free((char*)ev->ev_arg1);
  2149             free((char*)ev->ev_arg1);
  2152             ev->ev_arg1 = 0;
  2150             ev->ev_arg1 = 0;
  6264     "
  6262     "
  6265      WinWorkstation initializeStandardColorNames
  6263      WinWorkstation initializeStandardColorNames
  6266     "
  6264     "
  6267 ! !
  6265 ! !
  6268 
  6266 
  6269 !WinWorkstation class methodsFor:'actions'!
       
  6270 
       
  6271 commonSetDpiAwareModeForExpeccoBinaries:dpiAwareMode
       
  6272     |currentBinary otherBinary 
       
  6273      registryKeyForDpiAware|
       
  6274 
       
  6275     currentBinary := OperatingSystem pathOfSTXExecutable asFilename.
       
  6276     currentBinary suffix asLowercase = 'exe' ifTrue:[
       
  6277         otherBinary := currentBinary withSuffix:'com'. 
       
  6278     ] ifFalse:[
       
  6279         otherBinary := currentBinary withSuffix:'exe'. 
       
  6280     ].
       
  6281 
       
  6282     registryKeyForDpiAware := self registryKeyForHighDpiAware. 
       
  6283 
       
  6284     (Array
       
  6285         with:currentBinary
       
  6286         with:otherBinary) do:[:eachBinaryFilename |
       
  6287             registryKeyForDpiAware
       
  6288                 valueNamed:eachBinaryFilename nameString 
       
  6289                 put:dpiAwareMode.
       
  6290         ].
       
  6291 
       
  6292     "Created: / 25-11-2019 / 09:43:56 / Stefan Reise"
       
  6293 !
       
  6294 
       
  6295 setHighDpiAware
       
  6296     "after set this key,
       
  6297      the next started stx/expecco instance will not be scaled by windows
       
  6298      you can check for success by inspect the binary properties 
       
  6299      via windows context menu of the binary"
       
  6300 
       
  6301     "
       
  6302         self unsetHighDpiAware.    
       
  6303         self isApplicationHighDpiAware.
       
  6304         self setHighDpiAware.          
       
  6305         self isApplicationHighDpiAware.   
       
  6306     "
       
  6307 
       
  6308     self commonSetDpiAwareModeForExpeccoBinaries:self registryValueForHighDpiAware.
       
  6309 
       
  6310     "Created: / 25-11-2019 / 09:44:30 / Stefan Reise"
       
  6311 !
       
  6312 
       
  6313 unsetHighDpiAware
       
  6314     "after unset this key,
       
  6315      the next started stx/expecco instance will be scaled by windows
       
  6316      you can check for success by inspect the binary properties 
       
  6317      via windows context menu of the binary"
       
  6318 
       
  6319     "
       
  6320         self unsetHighDpiAware.    
       
  6321         self isApplicationHighDpiAware.
       
  6322         self setHighDpiAware.          
       
  6323         self isApplicationHighDpiAware.
       
  6324     "
       
  6325 
       
  6326     self commonSetDpiAwareModeForExpeccoBinaries:self regitsryValueForHighDpiUnAware.
       
  6327 
       
  6328     "Created: / 25-11-2019 / 09:44:55 / Stefan Reise"
       
  6329 ! !
       
  6330 
       
  6331 !WinWorkstation class methodsFor:'constants'!
       
  6332 
       
  6333 registryValueForHighDpiAware
       
  6334     ^ '~HIGHDPIAWARE'
       
  6335 
       
  6336     "Created: / 25-11-2019 / 09:52:25 / Stefan Reise"
       
  6337 !
       
  6338 
       
  6339 regitsryValueForHighDpiUnAware
       
  6340     ^ '~DPIUNAWARE'
       
  6341 
       
  6342     "Created: / 25-11-2019 / 09:53:30 / Stefan Reise"
       
  6343 ! !
       
  6344 
       
  6345 !WinWorkstation class methodsFor:'converting'!
  6267 !WinWorkstation class methodsFor:'converting'!
  6346 
  6268 
  6347 convertVirtualResolutionPointToCurrentResolutionPoint:aPoint
  6269 convertVirtualResolutionPointToCurrentResolutionPoint:aPoint
  6348     "this is required when you want to access the root display coordinates correctly,
  6270     "this is required when you want to access the root display coordinates correctly,
  6349      because may the os did scale the application (when the app is not high DPI aware),
  6271      because may the os did scale the application (when the app is not high DPI aware),
  6786      WinWorkstation always returns 'WIN32'."
  6708      WinWorkstation always returns 'WIN32'."
  6787 
  6709 
  6788     ^ 'WIN32'
  6710     ^ 'WIN32'
  6789 
  6711 
  6790     "Modified: 26.5.1996 / 15:32:46 / cg"
  6712     "Modified: 26.5.1996 / 15:32:46 / cg"
  6791 !
       
  6792 
       
  6793 registryKeyForHighDpiAware
       
  6794     "
       
  6795         self registryKeyForHighDpiAware    
       
  6796     "
       
  6797 
       
  6798     ^ Win32OperatingSystem::RegistryEntry
       
  6799         key:'HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers'
       
  6800         createIfAbsent:true.
       
  6801 
       
  6802     "Created: / 25-11-2019 / 09:51:45 / Stefan Reise"
       
  6803 ! !
  6713 ! !
  6804 
  6714 
  6805 !WinWorkstation class methodsFor:'queries - monitor'!
  6715 !WinWorkstation class methodsFor:'queries - monitor'!
  6806 
  6716 
  6807 monitorDeviceNameForPoint:aPoint
  6717 monitorDeviceNameForPoint:aPoint
 20627 	    RETURN (self);
 20537 	    RETURN (self);
 20628 	}
 20538 	}
 20629     }
 20539     }
 20630 %}
 20540 %}
 20631     "
 20541     "
 20632      (StandardSystemView new label:'äöü') open
 20542      (StandardSystemView new label:'äöü') open
 20633     "
 20543     "
 20634 !
 20544 !
 20635 
 20545 
 20636 setWindowShapeEllipticalX:x Y:y width:w height:h in:aWindowId
 20546 setWindowShapeEllipticalX:x Y:y width:w height:h in:aWindowId
 20637     "set the windows shape to an elliptical region"
 20547     "set the windows shape to an elliptical region"