~ubuntu-branches/debian/sid/swt-gtk/sid

« back to all changes in this revision

Viewing changes to org/eclipse/swt/browser/MozillaDelegate.java

  • Committer: Bazaar Package Importer
  • Author(s): Adrian Perez
  • Date: 2009-12-07 10:22:24 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20091207102224-70w2tax575mcks1w
Tags: 3.5.1-1
* New upstream release. Closes: #558663.
* debian/control: 
  - Add Vcs-* fields for Git repository.
  - Allow DM-Uploads.
  - Remove "Conflicts", package should live with eclipse.
* debian/rules: Fix default-java path around AWT_LIB_PATH.
* debian/copyright: Minor update.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*******************************************************************************
2
 
 * Copyright (c) 2003, 2008 IBM Corporation and others.
 
2
 * Copyright (c) 2003, 2009 IBM Corporation and others.
3
3
 * All rights reserved. This program and the accompanying materials
4
4
 * are made available under the terms of the Eclipse Public License v1.0
5
5
 * which accompanies this distribution, and is available at
14
14
import org.eclipse.swt.browser.Browser;
15
15
import org.eclipse.swt.internal.*;
16
16
import org.eclipse.swt.internal.gtk.*;
 
17
import org.eclipse.swt.internal.mozilla.*;
17
18
import org.eclipse.swt.widgets.*;
18
19
 
19
20
class MozillaDelegate {
25
26
        static int /*long*/ eventProc;
26
27
        static final int STOP_PROPOGATE = 1;
27
28
 
28
 
        static boolean IsLinux;
 
29
        static boolean IsSparc;
29
30
        static {
30
31
                String osName = System.getProperty ("os.name").toLowerCase (); //$NON-NLS-1$
31
 
                IsLinux = osName.startsWith ("linux"); //$NON-NLS-1$
 
32
                String osArch = System.getProperty ("os.arch").toLowerCase (); //$NON-NLS-1$
 
33
                IsSparc = (osName.startsWith ("sunos") || osName.startsWith ("solaris")) && osArch.startsWith("sparc"); //$NON-NLS-1$
32
34
        }
33
35
 
34
36
MozillaDelegate (Browser browser) {
35
37
        super ();
36
 
        if (!IsLinux) {
37
 
                browser.dispose ();
38
 
                SWT.error (SWT.ERROR_NO_HANDLES, null, " [Unsupported platform]"); //$NON-NLS-1$
 
38
        /*
 
39
        * The mozilla libraries on SPARC need the C++ runtime library to be loaded, but they do not declare
 
40
        * this dependency because they usually get it for free as a result of the mozilla executable pulling it
 
41
        * in.  Load this library here and scope it globally so that the mozilla libraries can resolve.
 
42
        */
 
43
        if (IsSparc) {
 
44
                byte[] buffer = Converter.wcsToMbcs (null, "libCrun.so.1", true); //$NON-NLS-1$
 
45
                OS.dlopen (buffer, OS.RTLD_NOW | OS.RTLD_GLOBAL);
39
46
        }
40
47
        this.browser = browser;
41
48
}
69
76
        return Converter.wcsToMbcs (codePage, string, terminate);
70
77
}
71
78
 
 
79
void addWindowSubclass () {
 
80
}
 
81
 
 
82
int createBaseWindow (nsIBaseWindow baseWindow) {
 
83
        return baseWindow.Create ();
 
84
}
 
85
 
72
86
int /*long*/ getHandle () {
73
87
        /*
74
88
        * Bug in Mozilla Linux GTK.  Embedding Mozilla into a GtkFixed
86
100
        return embedHandle;
87
101
}
88
102
 
 
103
String getJSLibraryName () {
 
104
        return "libmozjs.so"; //$NON-NLS-1$
 
105
}
 
106
 
89
107
String getLibraryName () {
90
108
        return "libxpcom.so"; //$NON-NLS-1$
91
109
}
195
213
        browser = null;
196
214
}
197
215
 
 
216
void removeWindowSubclass () {
 
217
}
 
218
 
198
219
void setSize (int /*long*/ embedHandle, int width, int height) {
199
220
        OS.gtk_widget_set_size_request (embedHandle, width, height);
200
221
}