[rfc][icedtea-web] IcedTea-Web for Windows

Jacob Wisor gitne at gmx.de
Mon Sep 15 02:06:10 UTC 2014


On 09/11/2014 12:03 AM, Jiri Vanek wrote:
> On 09/11/2014 03:38 AM, Jacob Wisor wrote:
>> Hello there!
>> [...]
>> Long story short, I came to the conclusion that it is probably best to start
>> implementing Windows
>> specific code now and to blend it with the existing Un*x code later.
>
> Do you think it is even possible?

Yes it is. Many projects do this. ;-) However, it is best to identify code 
portions which are platform specific first and then keep and maintain them 
cleanly apart than vigorously trying to stuff everything into one set of source 
files littered with preprocessor directives for different platforms. Most people 
have failed terribly on the latter approach (although it sounds most intuitive 
at the first glance).

>>  [...]
>> diff --git a/.hgignore b/.hgignore
>> --- a/.hgignore
>> +++ b/.hgignore
>> @@ -1,13 +1,23 @@
>> -Makefile.in
>> -aclocal.m4
>> -autom4te.cache
>> +Makefile\.in
>> +aclocal\.m4
>> +autom4te\.cache
>>   build
>>   configure
>>   install-sh
>>   missing
>> -config.guess
>> -config.sub
>> -netx/net/sourceforge/jnlp/resources/AUTHORS.html
>> -netx/net/sourceforge/jnlp/resources/COPYING.html
>> -netx/net/sourceforge/jnlp/resources/ChangeLog.html
>> -netx/net/sourceforge/jnlp/resources/NEWS.html
>> +config\.guess
>> +config\.sub
>> +.+\.patch
>> +.+\.[Rr][Ee][Ss]
>> +.+\.(o|[Oo][Bb][Jj])
>> +.+\.[Ee][Xx][Ee]
>> +.+\.(so|[Dd][Ll]{2})
>> +.+\.(a|[Ll][Ii][Bb])
>> +.+\.[Mm][Ss][Ii]
>> +.+\.rpm
>> +.+\.[Xx][Pp][Ii]
>> +(\.settings|\.project|\.cproject)
>> +netx/net/sourceforge/jnlp/resources/AUTHORS\.html
>> +netx/net/sourceforge/jnlp/resources/COPYING\.html
>> +netx/net/sourceforge/jnlp/resources/ChangeLog\.html
>> +netx/net/sourceforge/jnlp/resources/NEWS\.html
>
> Except the .project  this part is ok to go as separate changeset.
>
> .project, is legacy habit to  include classapth code style modules for eclipse
> in main trunk.
>
> Personally I'm for removing those, and uplaod them for download to
> http://icedtea.classpath.org/wiki/IcedTea-Web#Code_style
>
> Once uploaded and deleted, .project can be excluded.

Sounds good to me. I have included modifications to .hgignore mainly because the 
format of the file is actually a list of lines with regular expressions than 
simple file names with shell globbing. So, especially the dots (.) in the file 
names were actually intended as "\.". And then, I have added patterns for files 
that may get generated and written to source code directories when building 
IcedTea-Web. This should prevent committing intermediate or binary files. 
Although usually files have to be added to the commit list first, some users may 
enable the "--addremove" switch when committing, so they may run into problems 
there. Anyway, I have always found it soothing and reassuring to have the 
versioning tool to automatically ignore the non-source stuff. So, this brings us 
to the point where we could turn the concept upside down. Instead of Mercurial 
having ignore specific files it could instead ignore all files by default and 
only track those which have actually been added.

Okay, I am going to prepare a separate patch which deals with .hgignore and 
.project only.

>> diff --git a/javaws.ico b/javaws.ico
>> new file mode 100644
>> index
>> e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..d8f848b89ffe5b7986e83e1d4d0a250c40ac6afb
>>
>
> Why this? The ico is same as javaws.png. So I would inlicne to runtime
> generation from jaavws.png to javaws.ico.
> Also  - why not to use png?

I would agree to this if there was a readily available tool that would produce 
acceptable quality ico equivalents of png icon files. Unfortunately, there is 
none. Well, maybe there does exist a free GIMP script which handles this job 
perfectly. But then, it would be an awful gigantic dependency to have, like GIMP 
plus some possibly obscure plug-in script just for the build process to generate 
an ico file from a png file.
You see, in order to produce modern Windows ico files you cannot just do a 
simple conversion of one png image. Modern Windows ico files are a set layers of 
different sizes, color spaces, and palettes. So, unless you can come up with a 
good command-line tool which is available on Linux *and* Windows that does the 
job, it is best to have two icon files and try to keep them in sync manually, as 
good as possible.

> Ifabove seems to be unacceptable, then I would move this icon to windows folder.

Okay, accepted.

>> GIT binary patch
>> literal 77494
>> zc%1EB2S5`^7vA&)2uVmn at 4a^r1gT<|rhrtj04f$#P!SPSR1`s^BX-4J(6cLwsMxWc
>> zo?Yx<LF@=f{@H8 at A%sv2sQ2HO-OSGJ?CjgO)91Z65QKv85S0o6R~8zFfuL{*f at Eb8
>
> ...snip...
>
>> zJ3&{NHu;q)P3aebq6(`8!(@>R#C?BGW-Mv)BI&o8ekA=jr${9KG(UjCVzqbxk{_GD
>> zpd-iM^uPo at KgZid0E*9#;qw#P@>lTrYg&-k+F#o-zY3qf>2;bIkkC<oW6RfV*N-p=
>> z)s7$2>@R8Y`fd0r&Hjo``fFOSqqV=b1$#IQNNC63>_r&Rj-TiC*(pq at Kd}XScnbG6
>> z{1q);w?lpvUVlw%zay`|me1eNf*tG^WVJxc*Xe*C)6$>F=Px0&^jGlvDJ}hQN!Y^g
>> Q*wSCi?@ti!Z)o!W4+)&_H~;_u
>>
>> diff --git a/plugin/icedteanp/windows/GUIDs.c b/plugin/icedteanp/windows/GUIDs.c
>> new file mode 100644
>> --- /dev/null
>> +++ b/plugin/icedteanp/windows/GUIDs.c
> ...
>> diff --git a/plugin/icedteanp/windows/IcedTea-Web.h
>> b/plugin/icedteanp/windows/IcedTea-Web.h
>> new file mode 100644
>> --- /dev/null
>> +++ b/plugin/icedteanp/windows/IcedTea-Web.h
> ....
>> diff --git a/plugin/icedteanp/windows/IcedTea-Web.rc
>> b/plugin/icedteanp/windows/IcedTea-Web.rc
>> new file mode 100644
>> --- /dev/null
>> +++ b/plugin/icedteanp/windows/IcedTea-Web.rc
>
> ...Well.. What to say.. Really magnificent.
> ...
>
> thoseˇ
>> +#endif /* HAVE_JAVA8 */
>> +
>> +#ifndef ICEDTEA_WEB_MIME_TYPES
>> +#define ICEDTEA_WEB_MIME_TYPES \
>> +  "application/x-java-applet|" \
>> +  "application/x-java-applet|" \
>> +  "application/x-java-applet;version=1.1|" \
>> +  "application/x-java-applet;version=1.1|" \
>> +  "application/x-java-applet;version=1.1.1|" \
>> +  "application/x-java-applet;version=1.1.1|" \
>> +  "application/x-java-applet;version=1.1.2|" \
>> ...
>> +  "application/x-java-bean;version=1.6|" \
>> +  "application/x-java-bean;version=1.6|" \
>> +  "application/x-java-bean;version=1.7|" \
>> +  "application/x-java-bean;version=1.7|" \
>> +  PLUGIN_BEAN_MIME_DESC \
>> +  PLUGIN_BEAN_MIME_DESC \
>
> ...those...
>
>> +//                           "class|jar|"
>> +//                           "class|jar|"
>> +//                           "class|jar|"
>> +//                           "class|jar|"
>> +//                           "class|jar|"
>> +//                           "class|jar|"
>> +//                           "class|jar|"
>> +//                           "jnlp|"
>> +//                           "class|jar"
>> +//      VALUE "FileOpenName", "Java-Klassendatei (*.class)|"
>> +//                            "Java-Archiv (*.jar)|"
>> +//                            "Java-Klassendatei (*.class)|"
>> +//                            "Java-Archiv (*.jar)|"
>> +//                            "Java-Klassendatei (*.class)|"
>> +//                            "Java-Archiv (*.jar)|"
>> +//                            "Java-Klassendatei (*.class)|"
>> +//                            "Java-Archiv (*.jar)|"
> ...those...
>> +                           "class|jar|"
>> +                           "class|jar|"
>> +                           "class|jar|"
>> +                           "class|jar|"
>> +                           "class|jar|"
>> +                           "jnlp|"
>> +                           "class|jar"
>> +      VALUE "FileOpenName", "Java Class File (*.class)|"
>> +                            "Java Archive (*.jar)|"
>> +                            "Java Class File (*.class)|"
>> +                            "Java Archive (*.jar)|"
>> +                            "Java Class File (*.class)|"
>> +                            "Java Archive (*.jar)|"
>> +                            "Java Class File (*.class)|"
>> +                            "Java Archive (*.jar)|"
>> +                            "Java Class File (*.class)|"
>> +                            "Java Archive (*.jar)|"
>> +                            "Java Class File (*.class)|"
>
> ...those...
>
>> +//                            "Archiwum Java (*.jar)|"
>> +//                            "Plik Klassy Java (*.class)|"
>> +//                            "Archiwum Java (*.jar)|"
>> +//                            "Plik Klassy Java (*.class)|"
>> +//                            "Archiwum Java (*.jar)|"
>> +//                            "Archiwum Java (*.jar)|"
>> +//                            "Plik Klassy Java (*.class)|"
>> +//                            "Archiwum Java (*.jar)|"
>> +//                            "Plik Klassy Java (*.class)|"
>> +//                            "Archiwum Java (*.jar)|"
>> +//                            "Plik Klassy Java (*.class)|"
>> +//                            "Archiwum Java (*.jar)|"
>> +//                            "Plik Klassy Java (*.class)|"
>> +//                            "Archiwum Java (*.jar)|"
>> +//                            "Plik Klassy Java (*.class)|"
>> +//                            "Archiwum Java (*.jar)|"
>> +//                            "Plik Klassy Java (*.class)|"
>> +//                            "Archiwum Java (*.jar)|"
>> +//                            "Plik Klassy Java (*.class)|"
>> +//                            "Archiwum Java (*.jar)|"
>> +//                            "Plik Klassy Java (*.class)|"
>> +//                            "Archiwum Java (*.jar)|"
>> +//                            "Plik Klassy Java (*.class)|"
>> +//                            "Archiwum Java (*.jar)|"
>> +//                            "Plik Klassy Java (*.class)|"
>> +//                            "Archiwum Java (*.jar)|"
>> +//                            "Plik Klassy Java (*.class)|"
>> +//                            "Archiwum Java (*.jar)|"
>> +//                            "Plik Klassy Java (*.class)|"
>> +//                            "Archiwum Java (*.jar)|"
>> +//                            "Plik Klassy Java (*.class)|"
>> +//                            "Archiwum Java (*.jar)|"
>> +//                            "Plik Klassy Java (*.class)|"
>> +//                            "Archiwum Java (*.jar)|"
>> +//                            "Plik Klassy Java (*.class)|"
>> +//                            "Archiwum Java (*.jar)|"
>> +//                            "Plik Klassy Java (*.class)|"
>> +//                            "Archiwum Java (*.jar)|"
>> +//                            "Plik Klassy Java (*.class)|"
>> +//                            "Archiwum Java (*.jar)|"
>> +//                            "Aplikacja JNLP (*.jnlp)|"
>> +//                            "Plik Klassy Java (*.class)|"
>> +//                            "Archiwum Java (*.jar)"
>> +//      VALUE "Language", "pl"
>> +//    }
>> +  }
> and those ^ seems to me like most easy to be belnded. Together with ITW

Yes and no. Unfortunately, the MIME type description format Mozilla uses is 
quite different for Windows or OS/2 and Un*x plug-ins. I am sure one could come 
up with a set of preprocessor directives to blend them together, but I fear that 
the only person who will have had written such set of preprocessor directives is 
also going to be the only one who will understand it and be able to maintain it. :-D
Nevertheless, I will think about it, but this is probably a task for later when 
we have the first IcedTea-Web for Windows prototype running.

> But defintiely not as this changeset.

Right.

>> +
>> +  BLOCK "VarFileInfo" {
>> +    VALUE "Translation", LANG_CZECH, 1250, /* Czech */
>> +                         LANG_GERMAN, 1252, /* German */
>> +                         LANG_ENGLISH, 1252, /* English */
>> +                         LANG_POLISH, 1250  /* Polish */
>> +  }
>> +}
>> +
>> +ID_ICON ICON "../../../javaws.ico"
>> +
>> +STRINGTABLE LANGUAGE LANG_CZECH, SUBLANG_DEFAULT {
>> +  IDS_FRIENDLYTYPENAME "JNLP aplikace"
>> +}
>> +
>> +STRINGTABLE LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT {
>> +  IDS_FRIENDLYTYPENAME "JNLP Application"
>> +  IDS_OPEN "&Open"
>> +}
>> +
>> +STRINGTABLE LANGUAGE LANG_GERMAN, SUBLANG_DEFAULT {
>> +  IDS_FRIENDLYTYPENAME "JNLP-Anwendung"
>> +  IDS_OPEN "Ö&ffnen"
>> +}
>> +
>> +STRINGTABLE LANGUAGE LANG_POLISH, SUBLANG_DEFAULT {
>> +  IDS_FRIENDLYTYPENAME "Aplikacja JNLP"
>> +  IDS_OPEN "O&twórz"
>> +}
>> +
>> +#else /* OS2 */
>> +#include <npapi.h>
>> +
>> +NP_INFO_ProductVersion RC_DATA {
>> +  PACKAGE_MAJOR_VERSION,
>> +  PACKAGE_MINOR_VERSION,
>> +  PACKAGE_PATCH_VERSION,
>> +  PACKAGE_BUILD_VERSION
>> +}
>> +NP_INFO_MIMEType RC_DATA {
>> +  ICEDTEA_WEB_MIME_TYPES "\0"
>> +}
>> +NP_INFO_FileOpenName RC_DATA {
>> +  "Java Class File (*.class)|"
>> +  "Java Archive (*.jar)|"
>> +  "JNLP Application (*.jnlp)|\0"
>> +}
>> +NP_INFO_FileExtents RC_DATA {
>> +  "class|jar|jnlp\0"
>> +}
>> +NP_INFO_FileDescription RC_DATA {
>> +  PACKAGE_DESCRIPTION "\0"
>> +}
>> +NP_INFO_ProductName RC_DATA {
>> +  PACKAGE_NAME "\0"
>> +}
>> +NP_INFO_CompanyName RC_DATA {
>> +  PACKAGE_VENDOR "\0"
>> +}
>> +NP_INFO_FileVersion RC_DATA {
>> +  PACKAGE_MAJOR_VERSION,
>> +  PACKAGE_MINOR_VERSION,
>> +  PACKAGE_PATCH_VERSION,
>> +  PACKAGE_BUILD_VERSION
>> +}
>> +NP_INFO_InternalName RC_DATA {
>> +  "NP" PACKAGE_NAME "\0"
>> +}
>> +NP_INFO_LegalCopyright RC_DATA {
>> +  "GPLv2, see the file COPYING for details\0"
>> +}
>> +NP_INFO_OriginalFilename RC_DATA {
>> +  "NP" PACKAGE_NAME ".DLL\0"
>> +}
>> +#endif /* OS2 */
>> +#endif /* RC_INVOKED */
>> +#endif /*_ICEDTEA_WEB_RC_  */
>> diff --git a/plugin/icedteanp/windows/IcedTeaIEPlugin.c
>> b/plugin/icedteanp/windows/IcedTeaIEPlugin.c
>> new file mode 100644
>> --- /dev/null
>> +++ b/plugin/icedteanp/windows/IcedTeaIEPlugin.c
>> @@ -0,0 +1,2191 @@
>> +#define INC_OLE2
>> +#include <windows.h>
>> +#include <olectl.h>
>
>   ...
> http://en.wiktionary.org/wiki/to_je_pro_m%C4%9B_%C5%A1pan%C4%9Blsk%C3%A1_vesnice
> :))

Don't worry! :-) Well then, get a friend who has got the expertise.

Btw, the phrase above transliterates to "Böhmische Dörfer" (Bohemian villages) 
in German. You see, there is the connotation to the Czech again. It's a small 
world! ;-)

>> +}
>> diff --git a/plugin/icedteanp/windows/IcedTeaIEPlugin.h
>> b/plugin/icedteanp/windows/IcedTeaIEPlugin.h
>> new file mode 100644
>> --- /dev/null
>> +++ b/plugin/icedteanp/windows/IcedTeaIEPlugin.h
>> @@ -0,0 +1,3 @@
>
> ....still the same.
>> \ No newline at end of file
>>
>
>
> Well one general hint - Maybe its the time to restructure plugin directory?
>
> I would go for something like
> plugin/windows/src (your "c a nd rest" files)
> plugin/windows/build (mingw make or whatever you may need for build (the ico if
> you will insists?-) ) ))
> plugin/linux/src (current icedteanp)
> plugin/linux/build? And so  extract plugin parts from main makefile?
> plugin/share/java (current current java)
> plugin/share/docs
> plugin/share/tests

Yes, this reads reasonable. However, I am going to do this for Windows now only. 
Moving the Un*x/Linux sources will require adapting the build scripts to the new 
file structure or things will break. So, I do not want to touch the Un*x/Linux 
sources now because it is going to take a changeset of its own.

Jacob


More information about the distro-pkg-dev mailing list