001    /*******************************************************************************
002     * Copyright (c) 2009 Progress Software, Inc.
003     * Copyright (c) 2003, 2006 IBM Corporation and others.
004     *
005     * All rights reserved. This program and the accompanying materials
006     * are made available under the terms of the Eclipse Public License v1.0
007     * which accompanies this distribution, and is available at
008     * http://www.eclipse.org/legal/epl-v10.html
009     *
010     *******************************************************************************/
011    package org.fusesource.hawtjni.generator;
012    
013    import java.io.*;
014    import java.util.*;
015    
016    /**
017     * Produces the java classes mapping to XPCOM Mozilla objects.
018     * 
019     * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
020     */
021    public class MozillaGenerator {
022    
023        static boolean DEBUG = false;
024    
025        FileReader r = null;
026        FileWriter w = null;
027        int maxLines = 1000;
028        int cntLines = 0;
029        int n = 0;
030        String[] b = null;
031        String body = null;
032        int nMethods = 0;
033        String uuidName;
034        String uuidValue;
035        String className;
036        String parentName;
037        String[] constantNames;
038        String[] constantValues;
039        String[] methodNames;
040        String[][] argTypes;
041        String[][] argNames;
042        String bodyOrder;
043        TreeMap<Integer, TreeSet<String>> vtbls = new TreeMap<Integer, TreeSet<String>>();
044    
045    
046        // Contains the characters found before a method name
047        // Useful to extract the method name. e.g.
048        // NS_IMETHOD QueryInterface(const nsIID & uuid, void * *result) = 0;
049        // NS_IMETHOD_(nsrefcnt) AddRef(void) = 0;
050        // method name follows: QueryInterface, AddRef etc.
051        static String[] BEFORE_METHOD_NAME = { "  NS_IMETHOD ", "  NS_IMETHOD_(nsrefcnt) ", "  NS_IMETHOD_(void *) ", "  NS_IMETHOD_(void) ", "  NS_IMETHOD_(nsresult) ",
052                "  NS_SCRIPTABLE NS_IMETHOD ", "  NS_SCRIPTABLE NS_IMETHOD_(nsrefcnt) ", "  NS_SCRIPTABLE NS_IMETHOD_(void *) ", "  NS_SCRIPTABLE NS_IMETHOD_(void) ",
053                "  NS_SCRIPTABLE NS_IMETHOD_(nsresult) ", };
054    
055        static String NO_SUPER_CLASS = "SWT_NO_SUPER_CLASS";
056    
057        static String[][] TYPES_C2JAVA = { { "PRBool *", "int[]" },
058                { "nsIID &", "nsID" },
059                { "nsCID &", "nsID" },
060                { "nsCID * *", "int /*long*/" }, // nsID[] not supported by jnigen
061                { "* *", "int /*long*/[]" }, { "**", "int /*long*/[]" }, { "* &", "int /*long*/[]" }, { "PRUint32 *", "int[]" }, { "PRInt32 *", "int[]" }, { "PRInt64 *", "long[]" },
062                { "PRUnichar *", "char[]" }, { "char *", "byte[]" }, { "float *", "float[]" }, { "PRUint16 *", "short[]" }, { "nativeWindow *", "int /*long*/[]" },
063                { "nsWriteSegmentFun", "int /*long*/" }, { "nativeWindow", "int /*long*/" },
064    
065                { "*", "int /*long*/" }, // c type containing one or more * (and any
066                                         // other character, and did not match
067                                         // previous patterns) is a simple pointer
068                { "&", "int /*long*/" },
069    
070                { "PRUint32", "int" }, { "PRInt32", "int" }, { "PRInt64", "long" }, { "nsresult", "int" }, { "PRBool", "int" }, { "float", "float" }, { "PRUint16", "short" },
071                { "size_t", "int" }, };
072    
073        static String GECKO = "/bluebird/teamhawtjni/hawtjni-builddir/mozilla/1.4/linux_gtk2/mozilla/dist/include/";
074    
075        static String TARGET_FOLDER = "/bluebird/teamhawtjni/chrisx/amd64/workspace/org.eclipse.hawtjni/Eclipse SWT Mozilla/common/org/eclipse/hawtjni/internal/mozilla/";
076    
077        static String[] XPCOM_HEADERS = { "profile/nsIProfile.h", "widget/nsIAppShell.h", "widget/nsIBaseWindow.h", "xpcom/nsIComponentManager.h", "xpcom/nsIComponentRegistrar.h",
078                "webbrwsr/nsIContextMenuListener.h", "docshell/nsIDocShell.h", "dom/nsIDOMEvent.h", "dom/nsIDOMMouseEvent.h", "dom/nsIDOMUIEvent.h", "dom/nsIDOMWindow.h",
079                "uriloader/nsIDownload.h",
080                "webbrwsr/nsIEmbeddingSiteWindow.h",
081                "xpcom/nsIFactory.h",
082                "xpcom/nsIFile.h",
083                "helperAppDlg/nsIHelperAppLauncherDialog.h",
084                "exthandler/nsIExternalHelperAppService.h", // contains
085                                                            // nsIHelperAppLauncher
086                "xpcom/nsIInputStream.h", "xpcom/nsIInterfaceRequestor.h", "necko/nsIIOService.h", "xpcom/nsILocalFile.h", "xpcom/nsIMemory.h", "progressDlg/nsIProgressDialog.h",
087                "windowwatcher/nsIPromptService.h", "xpcom/nsIServiceManager.h", "xpcom/nsISupports.h", "webbrwsr/nsITooltipListener.h", "necko/nsIURI.h",
088                "uriloader/nsIURIContentListener.h", "xpcom/nsIWeakReference.h", "webbrwsr/nsIWebBrowser.h", "webbrwsr/nsIWebBrowserChrome.h", "webbrwsr/nsIWebBrowserChromeFocus.h",
089                "webbrwsr/nsIWebBrowserFocus.h", "docshell/nsIWebNavigation.h", "uriloader/nsIWebProgress.h", "uriloader/nsIWebProgressListener.h", "embed_base/nsIWindowCreator.h",
090                "windowwatcher/nsIWindowWatcher.h" };
091    
092        public static void main(String[] args) {
093            MozillaGenerator x = new MozillaGenerator();
094            for (int i = 0; i < XPCOM_HEADERS.length; i++)
095                x.parse(GECKO + XPCOM_HEADERS[i], TARGET_FOLDER);
096            x.outputVtblCall();
097            System.out.println("done");
098        }
099    
100    
101        /** Write callbacks */
102        public void write(String data) {
103            if (DEBUG) {
104                System.out.print(data);
105                return;
106            }
107            try {
108                w.write(data);
109            } catch (IOException e) {
110                e.printStackTrace();
111            }
112        }
113    
114        public void writeLine() {
115            if (DEBUG) {
116                System.out.println();
117                return;
118            }
119            write("\r\n");
120        }
121    
122        public void writeLine(String data) {
123            if (DEBUG) {
124                System.out.println(data);
125                return;
126            }
127            write(data + "\r\n");
128        }
129    
130        public void writeCopyrights() {
131            writeLine(COPYRIGHTS);
132        }
133    
134        public void writePackageDeclaration() {
135            writeLine(PACKAGE_DECLARATION);
136        }
137    
138        public void writeClassDeclaration(String className, String parentName) {
139            String line = "public class " + className;
140            if (!parentName.equals(NO_SUPER_CLASS))
141                line += " extends " + parentName;
142            line += " {";
143            writeLine(line);
144        }
145    
146        public void writeLastMethodId(String parentName, int nMethods) {
147            String line = "\tstatic final int LAST_METHOD_ID = ";
148            if (!parentName.equals(NO_SUPER_CLASS))
149                line += parentName + ".LAST_METHOD_ID + " + nMethods + ";";
150            else
151                line += "" + (nMethods - 1) + ";"; // zero indexed
152            writeLine(line);
153        }
154    
155        public void writeIID(String uuidName, String uuidValue) {
156            writeLine("\tpublic static final String " + uuidName + " =");
157            writeLine("\t\t\"" + uuidValue + "\";");
158            writeLine();
159            String iid = uuidName.substring(0, uuidName.indexOf("_STR"));
160            writeLine("\tpublic static final nsID " + iid + " =");
161            writeLine("\t\tnew nsID(" + uuidName + ");");
162        }
163    
164        public void writeAddressField() {
165            writeLine("\tint /*long*/ address;");
166        }
167    
168        public void writeConstructor(String className, String parentName) {
169            writeLine("\tpublic " + className + "(int /*long*/ address) {");
170            if (!parentName.equals(NO_SUPER_CLASS)) {
171                writeLine("\t\tsuper(address);");
172            } else {
173                writeLine("\t\tthis.address = address;");
174            }
175            writeLine("\t}");
176        }
177    
178        public void writeAddressGetter() {
179            writeLine("\tpublic int /*long*/ getAddress() {");
180            writeLine("\t\treturn this.address;");
181            writeLine("\t}");
182        }
183    
184        public void writeConstant(String name, String value) {
185            writeLine("\tpublic static final int " + name + " = " + value + ";");
186        }
187    
188        public void writeMethod(String name, String parentName, int methodIndex, String[] argTypes, String[] argNames) {
189            write("\tpublic int " + name + "(");
190            for (int i = 0; i < argTypes.length; i++) {
191                write(argTypes[i] + " " + argNames[i]);
192                if (i < argTypes.length - 1)
193                    write(", ");
194            }
195            write(") {");
196            writeLine();
197            String line = "\t\treturn XPCOM.VtblCall(";
198            if (!parentName.equals(NO_SUPER_CLASS))
199                line += parentName + ".LAST_METHOD_ID + " + (methodIndex + 1) + ", getAddress()";
200            else
201                line += methodIndex + ", getAddress()"; // zero indexed
202            write(line);
203            if (argTypes.length > 0)
204                write(", ");
205            for (int i = 0; i < argTypes.length; i++) {
206                write(argNames[i]);
207                if (i < argTypes.length - 1)
208                    write(", ");
209            }
210            writeLine(");");
211            writeLine("\t}");
212        }
213    
214        public void writeClassEnd() {
215            write("}");
216        }
217    
218        public void logVtblCall(String[] argTypes) {
219            String vtbl = "static final native int VtblCall(int fnNumber, int /*long*/ ppVtbl";
220            if (argTypes.length > 0)
221                vtbl += ", ";
222            for (int i = 0; i < argTypes.length; i++) {
223                vtbl += argTypes[i] + " arg" + i;
224                if (i < argTypes.length - 1)
225                    vtbl += ", ";
226            }
227            vtbl += ");";
228            Integer key = new Integer(argTypes.length);
229            TreeSet<String> list = vtbls.get(key);
230            if (list == null) {
231                list = new TreeSet<String>();
232                vtbls.put(key, list);
233            }
234            boolean duplicate = false;
235            
236            for (String s : list) {
237                if (vtbl.equals(s)) {
238                    duplicate = true;
239                    break;
240                }
241            }
242            if (!duplicate)
243                list.add(vtbl);
244        }
245    
246        public void outputVtblCall() {
247            Collection<TreeSet<String>> values = vtbls.values();
248            for (TreeSet<String> elts : values) {
249                for (String elt : elts) {
250                    System.out.println(elt);
251                }
252            }
253        }
254    
255        /** Parsing invoking write callbacks */
256    
257        /*
258         * Convert a C header file into a Java source file matching SWT Mozilla
259         * binding.
260         */
261        public void parse(String src, String destPath) {
262            if (DEBUG)
263                writeLine("*** PARSING <" + src + "> to folder " + destPath);
264            b = new String[maxLines];
265            cntLines = 0;
266            try {
267                r = new FileReader(src);
268                BufferedReader br = new BufferedReader(r);
269                while ((b[cntLines] = br.readLine()) != null) {
270                    cntLines++;
271                }
272                br.close();
273            } catch (IOException e) {
274                e.printStackTrace();
275                return;
276            }
277            n = 0;
278            boolean lookForClasses = true;
279            while (lookForClasses) {
280                /* parsing */
281                lookForClasses = parse();
282    
283                String destFile = destPath + className + ".java";
284                try {
285                    w = new FileWriter(destFile);
286                    if (DEBUG)
287                        writeLine("** CREATED JAVA FILE <" + destFile + ">");
288                } catch (IOException e) {
289                    e.printStackTrace();
290                    return;
291                }
292    
293                /* writing */
294                writeCopyrights();
295                writePackageDeclaration();
296                writeLine();
297                writeClassDeclaration(className, parentName);
298                writeLine();
299                writeLastMethodId(parentName, nMethods);
300                writeLine();
301                writeIID(uuidName, uuidValue);
302                writeLine();
303                if (parentName.equals(NO_SUPER_CLASS)) {
304                    writeAddressField();
305                    writeLine();
306                }
307                writeConstructor(className, parentName);
308                writeLine();
309    
310                if (parentName.equals(NO_SUPER_CLASS)) {
311                    writeAddressGetter();
312                    writeLine();
313                }
314    
315                int constantIndex = 0, methodIndex = 0;
316                for (int i = 0; i < bodyOrder.length(); i++) {
317                    if (bodyOrder.charAt(i) == 'C') {
318                        writeConstant(constantNames[constantIndex], constantValues[constantIndex]);
319                        if (i < bodyOrder.length() - 1)
320                            writeLine();
321                        constantIndex++;
322                    } else if (bodyOrder.charAt(i) == 'M') {
323                        writeMethod(methodNames[methodIndex], parentName, methodIndex, argTypes[methodIndex], argNames[methodIndex]);
324                        if (i < bodyOrder.length() - 1)
325                            writeLine();
326                        methodIndex++;
327                    }
328                }
329    
330                writeClassEnd();
331    
332                try {
333                    w.close();
334                } catch (IOException e) {
335                    e.printStackTrace();
336                }
337            }
338        }
339    
340        public String getPackages() {
341            return "package org.eclipse.hawtjni.internal.mozilla;";
342        }
343    
344        public boolean parse() {
345            if (!jumpToUuidDeclaration())
346                return false;
347            uuidName = getUuidName(b[n]);
348            if (DEBUG)
349                System.out.println("UUID name: <" + uuidName + ">");
350            uuidValue = getUuidValue(b[n]);
351            if (DEBUG)
352                System.out.println("UUID value: <" + uuidValue + ">");
353            jumpToInterfaceDeclaration();
354            className = getClassName(b[n]);
355            if (DEBUG)
356                System.out.println("Interface name: <" + className + ">");
357            parentName = getParentName(b[n]);
358            if (DEBUG)
359                System.out.println("parentName: <" + parentName + ">");
360            parseBody();
361            return true;
362        }
363    
364        boolean jumpToUuidDeclaration() {
365            // jump to line matching:
366            // "#define NS_IWEBBROWSERCHROME_IID_STR "ba434c60-9d52-11d3-afb0-00a024ffc08c""
367            while (!(b[n].startsWith("#define ") && b[n].indexOf("_IID_STR \"") != -1)) {
368                n++;
369                if (n >= cntLines)
370                    return false;
371            }
372            return true;
373        }
374    
375        // assume a declaration matching:
376        // "#define NS_IWEBBROWSERCHROME_IID_STR "ba434c60-9d52-11d3-afb0-00a024ffc08c""
377        // returns NS_IWEBBROWSERCHROME_IID_STR
378        String getUuidName(String declaration) {
379            return declaration.substring(declaration.indexOf("#define ") + "#define ".length(), declaration.indexOf(" \""));
380        }
381    
382        // assume a declaration matching:
383        // "#define NS_IWEBBROWSERCHROME_IID_STR "ba434c60-9d52-11d3-afb0-00a024ffc08c""
384        // returns ba434c60-9d52-11d3-afb0-00a024ffc08c
385        String getUuidValue(String declaration) {
386            return declaration.substring(declaration.indexOf("_IID_STR \"") + "_IID_STR \"".length(), declaration.lastIndexOf('"'));
387        }
388    
389        void jumpToInterfaceDeclaration() {
390            // jump to line matching:
391            // "class NS_NO_VTABLE nsIWebBrowserChrome : public nsISupports {"
392            while (!(b[n].startsWith("class NS_NO_VTABLE "))) {
393                n++;
394            }
395        }
396    
397        // Assume a declaration matching:
398        // "class NS_NO_VTABLE nsIWebBrowserChrome : public nsISupports {"
399        // or
400        // "class NS_NO_VTABLE NS_SCRIPTABLE nsIWebBrowserChrome : public nsISupports {"
401        // returns nsIWebBrowserChrome.
402        // Special case for nsISupports that has no super class: class NS_NO_VTABLE
403        // nsISupports {
404        String getClassName(String declaration) {
405            int endIndex = declaration.indexOf(" :");
406            // nsISupports special case (no super class)
407            if (endIndex == -1)
408                endIndex = declaration.indexOf(" {");
409            String searchString = "class NS_NO_VTABLE NS_SCRIPTABLE";
410            int startIndex = declaration.indexOf(searchString);
411            if (startIndex == -1) {
412                searchString = "class NS_NO_VTABLE ";
413                startIndex = declaration.indexOf(searchString);
414            }
415            return declaration.substring(startIndex + searchString.length(), endIndex);
416        }
417    
418        // assume a declaration matching:
419        // "class NS_NO_VTABLE nsIWebBrowserChrome : public nsISupports {"
420        // returns nsISupports
421        // special case for nsISupports that has no super class: class NS_NO_VTABLE
422        // nsISupports {
423        String getParentName(String declaration) {
424            if (declaration.indexOf(" :") == -1)
425                return NO_SUPER_CLASS;
426            return declaration.substring(declaration.indexOf(": public ") + ": public ".length(), declaration.indexOf(" {"));
427        }
428    
429        // parse methods and constants declarations starting at the current index
430        // out:
431        // .String body - contains the corresponding java content
432        // .n - set to the end of the interface body declaration ( line with the
433        // enclosing "};" )
434        // .nMethods - set to the number of methods parsed
435        void parseBody() {
436            body = "";
437            bodyOrder = "";
438            int nConstants = 0;
439            nMethods = 0;
440    
441            int tmp_n = n;
442            while (true) {
443                int type = jumpToNextConstantOrMethod();
444                if (type == CONSTANT)
445                    nConstants++;
446                if (type == METHOD)
447                    nMethods++;
448                if (type == END_BODY)
449                    break;
450                n++;
451            }
452            n = tmp_n;
453            constantNames = new String[nConstants];
454            constantValues = new String[nConstants];
455            methodNames = new String[nMethods];
456            argTypes = new String[nMethods][];
457            argNames = new String[nMethods][];
458            int constantIndex = 0, methodIndex = 0;
459            while (true) {
460                int type = jumpToNextConstantOrMethod();
461                if (type == CONSTANT) {
462                    parseConstant(b[n], constantIndex);
463                    bodyOrder += "C";
464                    constantIndex++;
465                }
466                if (type == METHOD) {
467                    parseMethod(b[n], methodIndex);
468                    logVtblCall(argTypes[methodIndex]);
469                    bodyOrder += "M";
470                    methodIndex++;
471                }
472                if (type == END_BODY)
473                    return;
474                n++;
475            }
476        }
477    
478        static int CONSTANT = 0;
479    
480        static int METHOD = 1;
481    
482        static int END_BODY = 2;
483    
484        boolean isEndOfInterfaceBody() {
485            return b[n].startsWith("};");
486        }
487    
488        int jumpToNextConstantOrMethod() {
489            while (!isEndOfInterfaceBody()) {
490                if (b[n].startsWith("  enum { ")) {
491                    return CONSTANT;
492                }
493                if (methodNameStartIndexOf(b[n]) != -1) {
494                    return METHOD;
495                }
496                n++;
497            }
498            return END_BODY;
499        }
500    
501        void parseConstant(String constant, int constantIndex) {
502            String constantName = constant.substring(constant.indexOf(" enum { ") + " enum { ".length(), constant.indexOf(" ="));
503            if (DEBUG)
504                writeLine("constantName <" + constantName + ">");
505            constantNames[constantIndex] = constantName;
506    
507            // most constants values have a trailing U
508            // enum { APP_TYPE_UNKNOWN = 0U };
509            int endIndex = constant.indexOf("U };");
510            // a few others don't
511            // enum { ENUMERATE_FORWARDS = 0 };
512            if (endIndex == -1)
513                endIndex = constant.indexOf(" };");
514            String constantValue = constant.substring(constant.indexOf(" = ") + " = ".length(), endIndex);
515            if (DEBUG)
516                writeLine("constantValue <" + constantValue + ">");
517            constantValues[constantIndex] = constantValue;
518        }
519    
520        // NS_IMETHOD SetStatus(PRUint32 statusType, const PRUnichar *status) = 0;
521        // identify:
522        // method name: <SetStatus>
523        // Nbr of arguments: 2
524        // Type of argument 0: PRUint32
525        // Name of argument 0: statusType
526        // Type of argument 1: const PRUnichar *
527        // Name of argument 1: status
528        void parseMethod(String line, int methodIndex) {
529            int start = methodNameStartIndexOf(line);
530            int end = methodNameEndIndexOf(line);
531            String methodName = line.substring(start, end);
532            if (DEBUG)
533                writeLine("method name: <" + methodName + ">");
534            methodNames[methodIndex] = methodName;
535            int argStart = end + "(".length();
536            int argEnd = line.indexOf(")", argStart);
537            parseArgs(line.substring(argStart, argEnd), methodIndex);
538        }
539    
540        // Given a line, returns the start of the method name or -1
541        // if the line does not contain a method declaration.
542        int methodNameStartIndexOf(String line) {
543            for (int i = 0; i < BEFORE_METHOD_NAME.length; i++) {
544                int index = line.indexOf(BEFORE_METHOD_NAME[i]);
545                if (index != -1)
546                    return index + BEFORE_METHOD_NAME[i].length();
547            }
548            return -1;
549        }
550    
551        int methodNameEndIndexOf(String line) {
552            int startIndex = methodNameStartIndexOf(line);
553            return line.indexOf("(", startIndex);
554        }
555    
556        void parseArgs(String args, int methodIndex) {
557            int nArgs = -1;
558            // methods with no args look like: () or (void)
559            String[] noArgs = new String[] { "", "void" };
560            for (int i = 0; i < noArgs.length; i++) {
561                if (args.equals(noArgs[i])) {
562                    nArgs = 0;
563                    break;
564                }
565            }
566            if (nArgs == -1)
567                nArgs = count(args, ", ") + 1;
568            String[] argTypes = new String[nArgs];
569            this.argTypes[methodIndex] = argTypes;
570            String[] argNames = new String[nArgs];
571            this.argNames[methodIndex] = argNames;
572            int typeStart = 0;
573    
574            // name is separated from its type by either of the following (sorted by
575            // decreasing size to find the most complete pattern */
576            String[] typeNameSep = new String[] { " * *", " **", " * & ", " * ", " *", " & ", " " };
577            for (int i = 0; i < nArgs; i++) {
578                /* get the type */
579                int nextTypeStart = i < nArgs - 1 ? args.indexOf(", ", typeStart) + ", ".length() : args.length();
580                int typeNameSepIndex = 0;
581                int separatorIndex = 0;
582                for (; typeNameSepIndex < typeNameSep.length; typeNameSepIndex++) {
583                    separatorIndex = args.indexOf(typeNameSep[typeNameSepIndex], typeStart);
584                    if (separatorIndex != -1 && separatorIndex < nextTypeStart)
585                        break;
586                }
587                String separator = typeNameSep[typeNameSepIndex];
588                argTypes[i] = getC2JavaType(args.substring(typeStart, separatorIndex + separator.length()));
589                if (DEBUG)
590                    writeLine("arg type" + i + ": <" + argTypes[i] + ">");
591                /* get the name */
592                int nameStart = separatorIndex + separator.length();
593                int nameEnd = i < nArgs - 1 ? args.indexOf(", ", nameStart) : args.length();
594                argNames[i] = args.substring(nameStart, nameEnd);
595                if (DEBUG)
596                    writeLine("arg name" + i + ": <" + argNames[i] + ">");
597    
598                typeStart = nextTypeStart;
599            }
600        }
601    
602        String getC2JavaType(String cType) {
603            for (int i = 0; i < TYPES_C2JAVA.length; i++) {
604                if (cType.indexOf(TYPES_C2JAVA[i][0]) != -1)
605                    return TYPES_C2JAVA[i][1];
606            }
607            return "!ERROR UNKNOWN C TYPE <" + cType + ">!";
608        }
609    
610        // how many times part can be found in s
611        static int count(String s, String part) {
612            int index = -1, cnt = 0;
613            while ((index = s.indexOf(part, index + 1)) != -1)
614                cnt++;
615            return cnt;
616        }
617    
618        static String COPYRIGHTS = "/* ***** BEGIN LICENSE BLOCK *****\r\n" + " * Version: MPL 1.1\r\n" + " *\r\n"
619                + " * The contents of this file are subject to the Mozilla Public License Version\r\n"
620                + " * 1.1 (the \"License\"); you may not use this file except in compliance with\r\n" + " * the License. You may obtain a copy of the License at\r\n"
621                + " * http://www.mozilla.org/MPL/\r\n" + " *\r\n" + " * Software distributed under the License is distributed on an \"AS IS\" basis,\r\n"
622                + " * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\r\n" + " * for the specific language governing rights and limitations under the\r\n"
623                + " * License.\r\n" + " *\r\n" + " * The Original Code is Mozilla Communicator client code, released March 31, 1998.\r\n" + " *\r\n"
624                + " * The Initial Developer of the Original Code is\r\n" + " * Netscape Communications Corporation.\r\n"
625                + " * Portions created by Netscape are Copyright (C) 1998-1999\r\n" + " * Netscape Communications Corporation.  All Rights Reserved.\r\n" + " *\r\n"
626                + " * Contributor(s):\r\n" + " *\r\n" + " * IBM\r\n" + " * -  Binding to permit interfacing between Mozilla and SWT\r\n"
627                + " * -  Copyright (C) 2003, 2009 IBM Corp.  All Rights Reserved.\r\n" + " *\r\n" + " * ***** END LICENSE BLOCK ***** */";
628    
629        static String PACKAGE_DECLARATION = "package org.eclipse.hawtjni.internal.mozilla;";
630    
631    }