harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Petrenko" <alexey.a.petre...@gmail.com>
Subject Re: [classlib][awt/swing] Windows version dependencies? (was: Re: [general] What platforms do we support?)
Date Tue, 10 Apr 2007 05:00:19 GMT
So I was right in my concerns...

I would change the patch to something like the following...
=== cut ===
static void (__stdcall *drawThemeBackground) (void*, void*, int, int,
void*, void*) = NULL;
static int isUxThemeAvailable = 1;

 JNIEXPORT void JNICALL
Java_org_apache_harmony_awt_theme_windows_WinThemeGraphics_drawXpBackground
         (JNIEnv * env, jclass clazz, jlong gip, jint x, jint y, jint
w, jint h,
          jlong hTheme, jint type, jint state) {

    if (isUxThemeAvailable && drawThemeBackground == NULL) {
        HMODULE libUxTheme = LoadLibrary("UxTheme");
        isUxThemeAvailable = libUxTheme != NULL;

        if (isUxThemeAvailable) {
            drawThemeBackground = (void (__stdcall *) (void*, void*,
int, int, void*, void*)) GetProcAddress(libUxTheme,
"DrawThemeBackground");
            isUxThemeAvailable = drawThemeBackground != NULL;
        }
    }

    if (!isUxThemeAvailable)
        return;

     GraphicsInfo *gi = (GraphicsInfo *)gip;

     RECT bounds = { (int)x, (int)y, (int)x + (int)w, (int)y + (int)h };
    drawThemeBackground((void*) hTheme, (void*) gi->hdc, (int) type,
(int) state, (void*) &bounds, (void*) NULL);
 }
=== cut ===

Disclaimer. I've never tested this code and I'm diving in Egypt. So I
do not guarantee that this code is ok! :)

SY, Alexey

2007/4/10, Nathan Beyer <ndbeyer@apache.org>:
> Yeah, that's what it is doing. The tests are just being reported as VM
> crashes.
>
> What's the intention of this patch? I thought it was to make
> uxtheme.dll optional, but it just fails it in a different way.
>
> -Nathan
>
> On 4/9/07, Alexey Petrenko <alexey.a.petrenko@gmail.com> wrote:
> > Andrey,
> >
> > AFAIU your patch will fail on assert call if there is no uxtheme.dll
> > or DrawThemeBackground function in it, will not it?
> >
> > SY, Alexey
> >
> > 2007/4/9, Pavlenko, Andrey A <andrey.a.pavlenko@intel.com>:
> > > I've attached a patch, but I haven't win2000 to check if this patch
> > > fixes the issue.
> > >
> > > Could somebody check it?
> > >
> > > -----Original Message-----
> > > From: Alexey Petrenko [mailto:alexey.a.petrenko@gmail.com]
> > > Sent: Wednesday, April 04, 2007 11:54 AM
> > > To: dev@harmony.apache.org
> > > Subject: Re: [classlib][awt/swing] Windows version dependencies? (was:
> > > Re: [general] What platforms do we support?)
> > >
> > > I've created corresponding JIRA issue:
> > > https://issues.apache.org/jira/browse/HARMONY-3569
> > >
> > > SY, Alexey
> > >
> > > 2007/4/4, Alexey Petrenko <alexey.a.petrenko@gmail.com>:
> > > > As I replied to Nathan before, yes, it looks like we can make this
> > > > dependency optional.
> > > >
> > > > SY, Alexey
> > > >
> > > > 2007/4/2, Tim Ellison <t.p.ellison@gmail.com>:
> > > > > Nathan Beyer wrote:
> > > > > > On 3/31/07, Tim Ellison <t.p.ellison@gmail.com> wrote:
> > > > > >> I'd call out the current Windows OS support as "Windows
2000
> > > > > >> Professional with SP3, or better". Not sure that we have
anyone
> > > testing
> > > > > >> on that version, but I'd be interested to know if people
don't
> > > think
> > > > > >> that is achievable.
> > > > > >
> > > > > > I have a Windows 2000 (on a P3) box running buildtest now, but
> > > it's
> > > > > > blowing up. I couldn't get DRLVM to do much of anything. The
> > > classlib
> > > > > > + ibmvm runs, but the tests for AWT/Swing always fail because
> > > they're
> > > > > > dependent on some XP/2003 library.
> > > > >
> > > > > Can anyone tell us what it will take to get AWT and Swing to work
on
> > > > > Windows 2000?
> > > > >
> > > > > Regards,
> > > > > Tim
> > > > >
> > > >
> > >
> >
>

Mime
View raw message