<Swing Dev> RFR: 6422025: ThemeReader.cpp can be updated for VC7

Sergey Bylokhov serb at openjdk.java.net
Fri Nov 6 09:02:09 UTC 2020


On Fri, 6 Nov 2020 08:51:46 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

> Some of the type definitions have been imported from `UxTheme.h` to the `ThemeReader.cpp` because at that time we supported the windows OS below XP as well as VC6.
> 
> It is time to use `UxTheme.h ` directly, note I did not change how we load this library(JDK_LoadSystemLibrary(), as suggested in the comments of the bug it is not necessary that the application will use the win L&F and it is not necessary to link it directly.
> 
> mach5 is green

src/java.desktop/windows/classes/sun/awt/windows/ThemeReader.java line 38:

> 36: import java.util.concurrent.locks.ReentrantReadWriteLock;
> 37: 
> 38: /* !!!! WARNING !!!!

The comment is outdated we do not support win L&F on any Unix.

src/java.desktop/windows/classes/sun/awt/windows/ThemeReader.java line 302:

> 300:     }
> 301: 
> 302:     public static native boolean isGetThemeTransitionDurationDefined();

This method was added in Vista so we guarded it by the runtime check.

src/java.desktop/windows/native/libawt/windows/ThemeReader.cpp line 177:

> 175:            && SetWindowThemeFunc
> 176:            && IsThemeBackgroundPartiallyTransparentFunc
> 177:            && GetThemeTransitionDurationFunc

Now we check `GetThemeTransitionDurationFunc` as well.

-------------

PR: https://git.openjdk.java.net/jdk/pull/1090


More information about the swing-dev mailing list