summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/Accessible.java24
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java32
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/OpenWindowListener.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/WebBrowser.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java41
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TableCursor.java115
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TreeCursor.java963
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragSourceEffect.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragSourceEffect.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDropTargetEffect.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java25
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp146
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp31
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h27
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java298
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2.java29
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java62
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMDocument.java111
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMElement.java107
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMNode.java167
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFocusManager.java139
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHttpChannel.java119
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHttpHeaderVisitor.java47
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsISeekableStream.java61
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIUploadChannel.java51
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java25
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras11
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/FoundationFull.bridgesupport.extras6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAttributedString.java7
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java23
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/common_j2me/org/eclipse/swt/internal/Library.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/common_j2se/org/eclipse/swt/internal/Library.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/atk_structs.c16
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c530
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h13
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c50
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h46
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.c124
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.h26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/accessibility/gtk/AtkActionIface.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/accessibility/gtk/AtkObjectClass.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/accessibility/gtk/AtkTableIface.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCombo.java23
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkFileSelection.java59
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java364
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c33
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java17
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Program/gtk/org/eclipse/swt/program/Program.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.c40
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.h2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk_stats.c4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk_stats.h4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java25
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/internal/webkit/WebKitGTK.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/library/webkit_win32.cpp15
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/library/webkit_win32_stats.cpp7
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/library/webkit_win32_stats.h3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebKit.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/internal/webkit/WebKit_win32.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Path.java21
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java19
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TrayItem.java82
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/library/make_common.mak4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java19
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageLoader.java17
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGFileFormat.java1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngEncoder.java24
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/version.txt2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common_j2me/org/eclipse/swt/internal/Compatibility.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/Compatibility.java7
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages.properties2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GCData.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java250
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java760
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java103
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FileDialog.java174
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java7
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java17
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java67
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java13
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java61
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java29
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Button.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java9
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TabFolder.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TrayItem.java42
-rw-r--r--bundles/org.eclipse.swt/buildSWT.xml76
-rw-r--r--bundles/org.eclipse.swt/buildnotes_swt.html108
-rw-r--r--examples/org.eclipse.swt.examples/.classpath2
-rw-r--r--examples/org.eclipse.swt.examples/src/examples_control.properties12
-rw-r--r--examples/org.eclipse.swt.examples/src/examples_images.properties4
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java140
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet143.java9
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet359.java51
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet360.java155
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet96.java17
125 files changed, 4231 insertions, 2412 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/Accessible.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/Accessible.java
index 0f49642983..9c2821c9f5 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/Accessible.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/Accessible.java
@@ -13,7 +13,6 @@ package org.eclipse.swt.accessibility;
import java.util.*;
import org.eclipse.swt.*;
-import org.eclipse.swt.events.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.internal.gtk.*;
@@ -112,12 +111,6 @@ public class Accessible {
super ();
this.control = control;
AccessibleFactory.registerAccessible (this);
- control.addDisposeListener (new DisposeListener () {
- public void widgetDisposed (DisposeEvent e) {
- AccessibleFactory.unregisterAccessible (Accessible.this);
- release ();
- }
- });
}
/**
@@ -496,6 +489,23 @@ public class Accessible {
}
/**
+ * Invokes platform specific functionality to dispose an accessible object.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Accessible</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ public void internal_dispose_Accessible() {
+ AccessibleFactory.unregisterAccessible (Accessible.this);
+ release ();
+ }
+
+ /**
* Invokes platform specific functionality to allocate a new accessible object.
* <p>
* <b>IMPORTANT:</b> This method is <em>not</em> part of the public
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java
index 0cf345d1a9..0dec3ceb7b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java
@@ -1558,7 +1558,8 @@ public class Accessible {
if (accessibleActionListeners.size() > 0 || accessibleAttributeListeners.size() > 0 ||
accessibleHyperlinkListeners.size() > 0 || accessibleTableListeners.size() > 0 ||
accessibleTableCellListeners.size() > 0 || accessibleTextExtendedListeners.size() > 0 ||
- accessibleValueListeners.size() > 0 || getRelationCount() > 0) {
+ accessibleValueListeners.size() > 0 || getRelationCount() > 0
+ || (control instanceof Button && ((control.getStyle() & SWT.RADIO) != 0))) {
if (objIServiceProvider == null) createIServiceProvider();
COM.MoveMemory(ppvObject, new int /*long*/[] { objIServiceProvider.getAddress() }, OS.PTR_SIZEOF);
AddRef();
@@ -1721,7 +1722,8 @@ public class Accessible {
if (accessibleActionListeners.size() > 0 || accessibleAttributeListeners.size() > 0 ||
accessibleHyperlinkListeners.size() > 0 || accessibleTableListeners.size() > 0 ||
accessibleTableCellListeners.size() > 0 || accessibleTextExtendedListeners.size() > 0 ||
- accessibleValueListeners.size() > 0 || getRelationCount() > 0) {
+ accessibleValueListeners.size() > 0 || getRelationCount() > 0
+ || (control instanceof Button && ((control.getStyle() & SWT.RADIO) != 0))) {
if (objIAccessible2 == null) createIAccessible2();
COM.MoveMemory(ppvObject, new int /*long*/[] { objIAccessible2.getAddress() }, OS.PTR_SIZEOF);
AddRef();
@@ -2331,7 +2333,8 @@ public class Accessible {
/* Get the default keyboard shortcut from the OS. */
code = iaccessible.get_accKeyboardShortcut(varChild, pszKeyboardShortcut);
if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
- if (accessibleListeners.size() == 0) return code;
+ /* Process TabFolder even if there are no apps listening. */
+ if (accessibleListeners.size() == 0 && !(control instanceof TabFolder)) return code;
if (code == COM.S_OK) {
int /*long*/[] pKeyboardShortcut = new int /*long*/[1];
COM.MoveMemory(pKeyboardShortcut, pszKeyboardShortcut, OS.PTR_SIZEOF);
@@ -2347,6 +2350,10 @@ public class Accessible {
AccessibleEvent event = new AccessibleEvent(this);
event.childID = osToChildID(v.lVal);
event.result = osKeyboardShortcut;
+ /* SWT TabFolders use Ctrl+PageDown to switch pages (not Ctrl+Tab). */
+ if (v.lVal == COM.CHILDID_SELF && control instanceof TabFolder) {
+ event.result = SWT.getMessage ("SWT_SwitchPage_Shortcut"); //$NON-NLS-1$
+ }
for (int i = 0; i < accessibleListeners.size(); i++) {
AccessibleListener listener = (AccessibleListener) accessibleListeners.elementAt(i);
listener.getKeyboardShortcut(event);
@@ -2873,11 +2880,24 @@ public class Accessible {
int groupLevel = 0;
COM.MoveMemory(pGroupLevel, new int [] { groupLevel }, 4);
//get the children of the parent
- //collect all children with the same role, if none, then 0 (for N/A)
+ //count all children with the same role, if none, then 0 (for N/A)
+ //find this control's 1-based index in the same-type children of the parent (0 for N/A)
int similarItemsInGroup = 0;
- COM.MoveMemory(pSimilarItemsInGroup, new int [] { similarItemsInGroup }, 4);
- //find this guy's 1-based index in the children of the parent (0 for N/A)
int positionInGroup = 0;
+ if (control instanceof Button && ((control.getStyle() & SWT.RADIO) != 0)) {
+ /* We currently only determine position and count for radio buttons. */
+ Control [] children = control.getParent().getChildren();
+ positionInGroup = 1;
+ similarItemsInGroup = 1;
+ for (int i = 0; i < children.length; i++) {
+ Control child = children[i];
+ if (child instanceof Button && ((child.getStyle() & SWT.RADIO) != 0)) {
+ if (child == control) positionInGroup = similarItemsInGroup;
+ else similarItemsInGroup++;
+ }
+ }
+ }
+ COM.MoveMemory(pSimilarItemsInGroup, new int [] { similarItemsInGroup }, 4);
COM.MoveMemory(pPositionInGroup, new int [] { positionInGroup }, 4);
if (DEBUG) print(this + ".IAccessible2::get_groupPosition() returning" + hresult(groupLevel == 0 && similarItemsInGroup == 0 && positionInGroup == 0 ? COM.S_FALSE : COM.S_OK));
if (groupLevel == 0 && similarItemsInGroup == 0 && positionInGroup == 0) return COM.S_FALSE;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/OpenWindowListener.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/OpenWindowListener.java
index 140f7c3d33..877e52448d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/OpenWindowListener.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/OpenWindowListener.java
@@ -45,7 +45,7 @@ public interface OpenWindowListener extends SWTEventListener {
* <ul>
* <li>(in/out) required true if the platform requires the user to provide a
* <code>Browser</code> to handle the new window or false otherwise.
- * <li>(out) browser the new <code>Browser</code> that will host the
+ * <li>(out) browser the new (unique) <code>Browser</code> that will host the
* content of the new window.
* <li>(in) widget the <code>Browser</code> that is requesting to open a
* new window
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/WebBrowser.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/WebBrowser.java
index 1c828e4eb0..656aa7dec1 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/WebBrowser.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/WebBrowser.java
@@ -392,21 +392,21 @@ public Object evaluate (String script) throws SWTException {
buffer.append (functionName);
buffer.append (" == undefined) {window.external.callJava("); // $NON-NLS-1$
buffer.append (index);
- buffer.append (',');
+ buffer.append (",'"); //$NON-NLS-1$
buffer.append (function.token);
- buffer.append (", ['"); // $NON-NLS-1$
+ buffer.append ("', ['"); // $NON-NLS-1$
buffer.append (ERROR_ID);
buffer.append ("']);} else {try {var result = "); // $NON-NLS-1$
buffer.append (functionName);
buffer.append ("(); window.external.callJava("); // $NON-NLS-1$
buffer.append (index);
- buffer.append (',');
+ buffer.append (",'"); //$NON-NLS-1$
buffer.append (function.token);
- buffer.append (", [result]);} catch (e) {window.external.callJava("); // $NON-NLS-1$
+ buffer.append ("', [result]);} catch (e) {window.external.callJava("); // $NON-NLS-1$
buffer.append (index);
- buffer.append (',');
+ buffer.append (",'"); //$NON-NLS-1$
buffer.append (function.token);
- buffer.append (", ['"); // $NON-NLS-1$
+ buffer.append ("', ['"); // $NON-NLS-1$
buffer.append (ERROR_ID);
buffer.append ("' + e.message]);}}"); // $NON-NLS-1$
execute (buffer.toString ());
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java
index 49cae17511..10c005e006 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java
@@ -162,6 +162,14 @@ public CCombo (Composite parent, int style) {
for (int i=0; i<arrowEvents.length; i++) arrow.addListener (arrowEvents [i], listener);
createPopup(null, -1);
+ if ((style & SWT.SIMPLE) == 0) {
+ int itemHeight = list.getItemHeight ();
+ if (itemHeight != 0) {
+ int maxHeight = getMonitor().getClientArea().height / 3;
+ visibleItemCount = Math.max(visibleItemCount, maxHeight / itemHeight);
+ }
+ }
+
initAccessible();
}
static int checkStyle (int style) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java
index f9f31b7a0c..27413a2f50 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java
@@ -1034,12 +1034,12 @@ void initAccessible() {
if (text != null) {
char mnemonic = _findMnemonic(text);
if (mnemonic != '\0') {
- shortcut = "Alt+"+mnemonic; //$NON-NLS-1$
+ shortcut = SWT.getMessage ("SWT_Page_Mnemonic", new Object[] {new Character(mnemonic)}); //$NON-NLS-1$
}
}
}
if (childID == ACC.CHILDID_SELF) {
- shortcut = "Ctrl+PageDown"; //$NON-NLS-1$
+ shortcut = SWT.getMessage ("SWT_SwitchPage_Shortcut"); //$NON-NLS-1$
}
e.result = shortcut;
}
@@ -1064,6 +1064,7 @@ void initAccessible() {
childID = items.length + MAXIMIZE_CHILD_ID;
} else {
Rectangle location = getBounds();
+ location.x = location.y = 0;
location.height = location.height - getClientArea().height;
if (location.contains(testPoint)) {
childID = ACC.CHILDID_SELF;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
index 852816035f..edb5b6a6b1 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
@@ -5281,7 +5281,7 @@ int getVisualLineIndex(TextLayout layout, int offsetInLine) {
int[] offsets = layout.getLineOffsets();
if (lineIndex != 0 && offsetInLine == offsets[lineIndex]) {
int lineY = layout.getLineBounds(lineIndex).y;
- int caretY = getCaret().getLocation().y - topMargin - getLinePixel(getCaretLine());
+ int caretY = getCaret().getLocation().y - getLinePixel(getCaretLine());
if (lineY > caretY) lineIndex--;
caretAlignment = OFFSET_LEADING;
}
@@ -6132,19 +6132,7 @@ void handleResize(Event event) {
clientAreaWidth = clientArea.width;
if (!alwaysShowScroll && ignoreResize != 0) return;
- /* Redraw the old or new right/bottom margin if needed */
- if (oldWidth != clientAreaWidth) {
- if (rightMargin > 0) {
- int x = (oldWidth < clientAreaWidth ? oldWidth : clientAreaWidth) - rightMargin;
- super.redraw(x, 0, rightMargin, oldHeight, false);
- }
- }
- if (oldHeight != clientAreaHeight) {
- if (bottomMargin > 0) {
- int y = (oldHeight < clientAreaHeight ? oldHeight : clientAreaHeight) - bottomMargin;
- super.redraw(0, y, oldWidth, bottomMargin, false);
- }
- }
+ redrawMargins(oldHeight, oldWidth);
if (wordWrap) {
if (oldWidth != clientAreaWidth) {
renderer.reset(0, content.getLineCount());
@@ -7433,6 +7421,21 @@ void redrawLinesBullet (int[] redrawLines) {
super.redraw(0, y, width, height, false);
}
}
+void redrawMargins(int oldHeight, int oldWidth) {
+ /* Redraw the old or new right/bottom margin if needed */
+ if (oldWidth != clientAreaWidth) {
+ if (rightMargin > 0) {
+ int x = (oldWidth < clientAreaWidth ? oldWidth : clientAreaWidth) - rightMargin;
+ super.redraw(x, 0, rightMargin, oldHeight, false);
+ }
+ }
+ if (oldHeight != clientAreaHeight) {
+ if (bottomMargin > 0) {
+ int y = (oldHeight < clientAreaHeight ? oldHeight : clientAreaHeight) - bottomMargin;
+ super.redraw(0, y, oldWidth, bottomMargin, false);
+ }
+ }
+}
/**
* Redraws the specified text range.
*
@@ -8180,7 +8183,7 @@ public void setAlignment(int alignment) {
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
- * @ since 3.8
+ * @since 3.8
*/
public void setAlwaysShowScrollBars(boolean show) {
checkWidget();
@@ -9328,6 +9331,8 @@ void setScrollBars(boolean vertical) {
if (!isFixedLineHeight() || !alwaysShowScroll) vertical = true;
ScrollBar verticalBar = vertical ? getVerticalBar() : null;
ScrollBar horizontalBar = getHorizontalBar();
+ int oldHeight = clientAreaHeight;
+ int oldWidth = clientAreaWidth;
if (!alwaysShowScroll) {
if (verticalBar != null) verticalBar.setVisible(false);
if (horizontalBar != null) horizontalBar.setVisible(false);
@@ -9339,8 +9344,14 @@ void setScrollBars(boolean vertical) {
setScrollBar(horizontalBar, clientAreaWidth, renderer.getWidth(), leftMargin + rightMargin);
if (!alwaysShowScroll && horizontalBar.getVisible() && verticalBar != null) {
setScrollBar(verticalBar, clientAreaHeight, renderer.getHeight(), topMargin + bottomMargin);
+ if (verticalBar.getVisible()) {
+ setScrollBar(horizontalBar, clientAreaWidth, renderer.getWidth(), leftMargin + rightMargin);
+ }
}
}
+ if (!alwaysShowScroll) {
+ redrawMargins(oldHeight, oldWidth);
+ }
ignoreResize--;
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TableCursor.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TableCursor.java
index 0408aa5fd7..a597b782e5 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TableCursor.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TableCursor.java
@@ -20,108 +20,9 @@ import org.eclipse.swt.events.*;
* A TableCursor provides a way for the user to navigate around a Table
* using the keyboard. It also provides a mechanism for selecting an
* individual cell in a table.
- *
- * <p> Here is an example of using a TableCursor to navigate to a cell and then edit it.
- *
- * <code><pre>
- * public static void main(String[] args) {
- * Display display = new Display();
- * Shell shell = new Shell(display);
- * shell.setLayout(new GridLayout());
- *
- * // create a a table with 3 columns and fill with data
- * final Table table = new Table(shell, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
- * table.setLayoutData(new GridData(GridData.FILL_BOTH));
- * TableColumn column1 = new TableColumn(table, SWT.NONE);
- * TableColumn column2 = new TableColumn(table, SWT.NONE);
- * TableColumn column3 = new TableColumn(table, SWT.NONE);
- * for (int i = 0; i &lt; 100; i++) {
- * TableItem item = new TableItem(table, SWT.NONE);
- * item.setText(new String[] { "cell "+i+" 0", "cell "+i+" 1", "cell "+i+" 2"});
- * }
- * column1.pack();
- * column2.pack();
- * column3.pack();
- *
- * // create a TableCursor to navigate around the table
- * final TableCursor cursor = new TableCursor(table, SWT.NONE);
- * // create an editor to edit the cell when the user hits "ENTER"
- * // while over a cell in the table
- * final ControlEditor editor = new ControlEditor(cursor);
- * editor.grabHorizontal = true;
- * editor.grabVertical = true;
- *
- * cursor.addSelectionListener(new SelectionAdapter() {
- * // when the TableEditor is over a cell, select the corresponding row in
- * // the table
- * public void widgetSelected(SelectionEvent e) {
- * table.setSelection(new TableItem[] {cursor.getRow()});
- * }
- * // when the user hits "ENTER" in the TableCursor, pop up a text editor so that
- * // they can change the text of the cell
- * public void widgetDefaultSelected(SelectionEvent e){
- * final Text text = new Text(cursor, SWT.NONE);
- * TableItem row = cursor.getRow();
- * int column = cursor.getColumn();
- * text.setText(row.getText(column));
- * text.addKeyListener(new KeyAdapter() {
- * public void keyPressed(KeyEvent e) {
- * // close the text editor and copy the data over
- * // when the user hits "ENTER"
- * if (e.character == SWT.CR) {
- * TableItem row = cursor.getRow();
- * int column = cursor.getColumn();
- * row.setText(column, text.getText());
- * text.dispose();
- * }
- * // close the text editor when the user hits "ESC"
- * if (e.character == SWT.ESC) {
- * text.dispose();
- * }
- * }
- * });
- * editor.setEditor(text);
- * text.setFocus();
- * }
- * });
- * // Hide the TableCursor when the user hits the "MOD1" or "MOD2" key.
- * // This allows the user to select multiple items in the table.
- * cursor.addKeyListener(new KeyAdapter() {
- * public void keyPressed(KeyEvent e) {
- * if (e.keyCode == SWT.MOD1 ||
- * e.keyCode == SWT.MOD2 ||
- * (e.stateMask & SWT.MOD1) != 0 ||
- * (e.stateMask & SWT.MOD2) != 0) {
- * cursor.setVisible(false);
- * }
- * }
- * });
- * // Show the TableCursor when the user releases the "MOD2" or "MOD1" key.
- * // This signals the end of the multiple selection task.
- * table.addKeyListener(new KeyAdapter() {
- * public void keyReleased(KeyEvent e) {
- * if (e.keyCode == SWT.MOD1 && (e.stateMask & SWT.MOD2) != 0) return;
- * if (e.keyCode == SWT.MOD2 && (e.stateMask & SWT.MOD1) != 0) return;
- * if (e.keyCode != SWT.MOD1 && (e.stateMask & SWT.MOD1) != 0) return;
- * if (e.keyCode != SWT.MOD2 && (e.stateMask & SWT.MOD2) != 0) return;
- *
- * TableItem[] selection = table.getSelection();
- * TableItem row = (selection.length == 0) ? table.getItem(table.getTopIndex()) : selection[0];
- * table.showItem(row);
- * cursor.setSelection(row, 0);
- * cursor.setVisible(true);
- * cursor.setFocus();
- * }
- * });
- *
- * shell.open();
- * while (!shell.isDisposed()) {
- * if (!display.readAndDispatch())
- * display.sleep();
- * }
- * display.dispose();
- * }
- * </pre></code>
+ * <p>
+ * For a detailed example of using a TableCursor to navigate to a cell and then edit it see
+ * http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet96.java .
*
* <dl>
* <dt><b>Styles:</b></dt>
@@ -144,7 +45,7 @@ public class TableCursor extends Canvas {
Color background = null;
Color foreground = null;
- // By default, invert the list selection colors
+ /* By default, invert the list selection colors */
static final int BACKGROUND = SWT.COLOR_LIST_SELECTION_TEXT;
static final int FOREGROUND = SWT.COLOR_LIST_SELECTION;
@@ -414,7 +315,6 @@ void paint(Event event) {
if (row == null) return;
int columnIndex = column == null ? 0 : table.indexOf(column);
GC gc = event.gc;
- Display display = getDisplay();
gc.setBackground(getBackground());
gc.setForeground(getForeground());
gc.fillRectangle(event.x, event.y, event.width, event.height);
@@ -472,6 +372,7 @@ void paint(Event event) {
gc.drawString(text, x, textY);
}
if (isFocusControl()) {
+ Display display = getDisplay();
gc.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
gc.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
gc.drawFocus(0, 0, size.x, size.y);
@@ -621,9 +522,9 @@ void _resize() {
}
}
/**
- * Returns the column over which the TableCursor is positioned.
+ * Returns the index of the column over which the TableCursor is positioned.
*
- * @return the column for the current position
+ * @return the column index for the current position
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
@@ -661,7 +562,7 @@ public Color getForeground() {
/**
* Returns the row over which the TableCursor is positioned.
*
- * @return the item for the current position
+ * @return the item for the current position, or <code>null</code> if none
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TreeCursor.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TreeCursor.java
new file mode 100644
index 0000000000..a15f4041c9
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TreeCursor.java
@@ -0,0 +1,963 @@
+/*******************************************************************************
+ * Copyright (c) 2011 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.custom;
+
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.accessibility.*;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.widgets.*;
+
+/**
+ * A TreeCursor provides a way for the user to navigate around a Tree with columns using the
+ * keyboard. It also provides a mechanism for selecting an individual cell in a tree.
+ * <p>
+ * For a detailed example of using a TreeCursor to navigate to a cell and then edit it see
+ * http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet360.java .
+ *
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>BORDER</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection, DefaultSelection</dd>
+ * </dl>
+ *
+ * @since 3.8
+ */
+public class TreeCursor extends Canvas {
+ Tree tree;
+ TreeItem row;
+ TreeColumn column;
+ Listener listener, treeListener, resizeListener, disposeItemListener, disposeColumnListener;
+
+ Color background = null;
+ Color foreground = null;
+
+ /* By default, invert the list selection colors */
+ static final int BACKGROUND = SWT.COLOR_LIST_SELECTION_TEXT;
+ static final int FOREGROUND = SWT.COLOR_LIST_SELECTION;
+
+/**
+ * Constructs a new instance of this class given its parent tree and a style value describing
+ * its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in class <code>SWT</code> which
+ * is applicable to instances of this class, or must be built by <em>bitwise OR</em>'ing
+ * together (that is, using the <code>int</code> "|" operator) two or more of those
+ * <code>SWT</code> style constants. The class description lists the style constants that are
+ * applicable to the class. Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a Tree control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#BORDER
+ * @see Widget#checkSubclass()
+ * @see Widget#getStyle()
+ */
+public TreeCursor(Tree parent, int style) {
+ super(parent, style);
+ tree = parent;
+ setBackground(null);
+ setForeground(null);
+
+ listener = new Listener() {
+ public void handleEvent(Event event) {
+ if (row != null) {
+ /*
+ * Detect cases where the cursor position has become invalid and fix it.
+ * The typical cause of this is programmatic tree changes, such as
+ * expanding/collapsing and item and creating/disposing items.
+ */
+ if (row.isDisposed()) {
+ unhookRowColumnListeners();
+ _resize();
+ tree.setFocus();
+ return;
+ }
+ TreeItem current = row;
+ TreeItem parentItem = row.getParentItem();
+ while (parentItem != null && !parentItem.getExpanded()) {
+ current = parentItem;
+ parentItem = current.getParentItem();
+ }
+ if (current != row) {
+ setRowColumn(current, column, false);
+ }
+ }
+ switch (event.type) {
+ case SWT.Dispose:
+ onDispose(event);
+ break;
+ case SWT.FocusIn:
+ case SWT.FocusOut:
+ redraw();
+ break;
+ case SWT.KeyDown:
+ keyDown(event);
+ break;
+ case SWT.Paint:
+ paint(event);
+ break;
+ case SWT.Traverse:
+ event.doit = true;
+ switch (event.detail) {
+ case SWT.TRAVERSE_ARROW_NEXT:
+ case SWT.TRAVERSE_ARROW_PREVIOUS:
+ case SWT.TRAVERSE_RETURN:
+ event.doit = false;
+ break;
+ }
+ break;
+ }
+ }
+ };
+ int[] events = new int[] { SWT.Dispose, SWT.FocusIn, SWT.FocusOut, SWT.KeyDown, SWT.Paint, SWT.Traverse };
+ for (int i = 0; i < events.length; i++) {
+ addListener(events[i], listener);
+ }
+
+ treeListener = new Listener() {
+ public void handleEvent(Event event) {
+ switch (event.type) {
+ case SWT.Collapse:
+ treeCollapse(event);
+ break;
+ case SWT.Expand:
+ treeExpand(event);
+ break;
+ case SWT.FocusIn:
+ treeFocusIn(event);
+ break;
+ case SWT.MouseDown:
+ treeMouseDown(event);
+ break;
+ }
+ }
+ };
+ tree.addListener(SWT.Collapse, treeListener);
+ tree.addListener(SWT.Expand, treeListener);
+ tree.addListener(SWT.FocusIn, treeListener);
+ tree.addListener(SWT.MouseDown, treeListener);
+
+ disposeItemListener = new Listener() {
+ public void handleEvent(Event event) {
+ TreeItem currentItem = row;
+ while (currentItem != null) {
+ currentItem.removeListener(SWT.Dispose, disposeItemListener);
+ currentItem = currentItem.getParentItem();
+ }
+ TreeItem disposedItem = (TreeItem)event.widget;
+ TreeItem parentItem = disposedItem.getParentItem();
+ if (parentItem != null) {
+ setRowColumn(parentItem, column, true);
+ } else {
+ if (tree.getItemCount() == 1) {
+ unhookRowColumnListeners();
+ } else {
+ TreeItem newFocus = null;
+ int rowIndex = tree.indexOf(disposedItem);
+ if (rowIndex != 0) {
+ TreeItem previousItem = tree.getItem(rowIndex - 1);
+ if (!previousItem.isDisposed()) {
+ newFocus = previousItem;
+ }
+ }
+ if (newFocus == null && rowIndex + 1 < tree.getItemCount()) {
+ TreeItem nextItem = tree.getItem(rowIndex + 1);
+ if (!nextItem.isDisposed()) {
+ newFocus = nextItem;
+ }
+ }
+ if (newFocus != null) {
+ setRowColumn(newFocus, column, true);
+ } else {
+ unhookRowColumnListeners();
+ }
+ }
+ }
+ _resize();
+ }
+ };
+ disposeColumnListener = new Listener() {
+ public void handleEvent(Event event) {
+ if (column != null) {
+ if (tree.getColumnCount() == 1) {
+ column = null;
+ } else {
+ int columnIndex = tree.indexOf(column);
+ int positionIndex = columnIndex;
+ int[] columnOrder = tree.getColumnOrder();
+ for (int i = 0; i < columnOrder.length; i++) {
+ if (columnOrder[i] == columnIndex) {
+ positionIndex = i;
+ break;
+ }
+ }
+ if (positionIndex == columnOrder.length - 1) {
+ setRowColumn(row, tree.getColumn(columnOrder[positionIndex - 1]), true);
+ } else {
+ setRowColumn(row, tree.getColumn(columnOrder[positionIndex + 1]), true);
+ }
+ }
+ }
+ _resize();
+ }
+ };
+ resizeListener = new Listener() {
+ public void handleEvent(Event event) {
+ _resize();
+ }
+ };
+ ScrollBar hBar = tree.getHorizontalBar();
+ if (hBar != null) {
+ hBar.addListener(SWT.Selection, resizeListener);
+ }
+ ScrollBar vBar = tree.getVerticalBar();
+ if (vBar != null) {
+ vBar.addListener(SWT.Selection, resizeListener);
+ }
+
+ getAccessible().addAccessibleControlListener(new AccessibleControlAdapter() {
+ public void getRole(AccessibleControlEvent e) {
+ e.detail = ACC.ROLE_TABLECELL;
+ }
+ });
+ getAccessible().addAccessibleListener(new AccessibleAdapter() {
+ public void getName(AccessibleEvent e) {
+ if (row == null) return;
+ int columnIndex = column == null ? 0 : tree.indexOf(column);
+ e.result = row.getText(columnIndex);
+ }
+ });
+}
+
+/**
+ * Adds the listener to the collection of listeners who will be notified when the receiver's
+ * selection changes, by sending it one of the messages defined in the
+ * <code>SelectionListener</code> interface.
+ * <p>
+ * When <code>widgetSelected</code> is called, the item field of the event object is valid. If
+ * the receiver has <code>SWT.CHECK</code> style set and the check selection changes, the event
+ * object detail field contains the value <code>SWT.CHECK</code>.
+ * <code>widgetDefaultSelected</code> is typically called when an item is double-clicked.
+ * </p>
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see SelectionEvent
+ * @see #removeSelectionListener(SelectionListener)
+ */
+public void addSelectionListener(SelectionListener listener) {
+ checkWidget();
+ if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener(listener);
+ addListener(SWT.Selection, typedListener);
+ addListener(SWT.DefaultSelection, typedListener);
+}
+
+int countSubTreePages(TreeItem root) {
+ int pages = 1;
+ if (root == null) return 0;
+ if (root.getItemCount() == 0) return 1;
+ if (!root.getExpanded()) return 1;
+ TreeItem[] items = root.getItems();
+ for (int i = 0; i < items.length; i++) {
+ pages += countSubTreePages(items[i]);
+ }
+ return pages;
+}
+
+int findIndex(TreeItem[] items, TreeItem treeItem) {
+ if (items == null || treeItem == null) return -1;
+ Rectangle rect = treeItem.getBounds();
+ int index = 0;
+ for (int i = 0; i < items.length; i++) {
+ TreeItem previousItem = null;
+ TreeItem currentItem = items[i];
+ if (i > 0) previousItem = items[i - 1];
+ Rectangle rect1 = currentItem.getBounds();
+ if (rect.y == rect1.y) return index;
+ if (rect.y < rect1.y) {
+ return index - 1 + findIndex(previousItem.getItems(), treeItem);
+ }
+ if (rect.y > rect1.y && i == items.length - 1) {
+ return index + findIndex(currentItem.getItems(), treeItem);
+ }
+ if (rect.y >= rect1.y + (1 + currentItem.getItemCount()) * tree.getItemHeight() && currentItem.getExpanded()) {
+ index += countSubTreePages(currentItem);
+ continue;
+ }
+ index++;
+ }
+ return -1;
+}
+
+TreeItem findItem(TreeItem[] items, Point pt) {
+ int start = 0, end = items.length - 1;
+ int index = end / 2;
+ while (end - start > 1) {
+ TreeItem currentItem = items[index];
+ Rectangle bounds = currentItem.getBounds();
+ if (pt.y < bounds.y) {
+ end = index;
+ index = (end - start) / 2;
+ } else {
+ start = index;
+ index = start + ((end - start) / 2);
+ }
+ }
+
+ Rectangle endBounds = items[end].getBounds();
+ if (endBounds.y < pt.y) {
+ if (endBounds.y + endBounds.height < pt.y) {
+ if (!items[end].getExpanded()) return null;
+ return findItem(items[end].getItems(), pt);
+ }
+ int[] columnOrder = tree.getColumnOrder();
+ Rectangle bounds = null;
+ if (columnOrder.length > 0) {
+ Rectangle rect1 = items[end].getBounds(columnOrder[0]);
+ Rectangle rect2 = items[end].getBounds(columnOrder[columnOrder.length - 1]);
+ bounds = rect1.union(rect2);
+ bounds.height += tree.getLinesVisible() ? tree.getGridLineWidth() : 0;
+ } else {
+ bounds = items[end].getBounds();
+ }
+ return bounds.contains(pt) ? items[end] : null;
+ }
+
+ Rectangle startBounds = items[start].getBounds();
+ if (startBounds.y + startBounds.height < pt.y) {
+ return findItem(items[start].getItems(), pt);
+ }
+ int[] columnOrder = tree.getColumnOrder();
+ Rectangle bounds = null;
+ if (columnOrder.length > 0) {
+ Rectangle rect1 = items[start].getBounds(columnOrder[0]);
+ Rectangle rect2 = items[start].getBounds(columnOrder[columnOrder.length - 1]);
+ bounds = rect1.union(rect2);
+ bounds.height += tree.getLinesVisible() ? tree.getGridLineWidth() : 0;
+ } else {
+ bounds = items[start].getBounds();
+ }
+ return bounds.contains(pt) ? items[start] : null;
+}
+
+/**
+ * Returns the background color that the receiver will use to draw.
+ *
+ * @return the receiver's background color
+ */
+public Color getBackground() {
+ checkWidget();
+ if (background == null) {
+ return getDisplay().getSystemColor(BACKGROUND);
+ }
+ return background;
+}
+
+/**
+ * Returns the index of the column over which the TreeCursor is positioned.
+ *
+ * @return the column index for the current position
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getColumn() {
+ checkWidget();
+ return column == null ? 0 : tree.indexOf(column);
+}
+
+/**
+ * Returns the foreground color that the receiver will use to draw.
+ *
+ * @return the receiver's foreground color
+ */
+public Color getForeground() {
+ checkWidget();
+ if (foreground == null) {
+ return getDisplay().getSystemColor(FOREGROUND);
+ }
+ return foreground;
+}
+
+TreeItem getLastVisibleItem(TreeItem[] items) {
+ if (items == null) return null;
+ TreeItem last = items[items.length - 1];
+ if (last.getExpanded() && last.getItemCount() > 0) {
+ return getLastVisibleItem(last.getItems());
+ }
+ return last;
+}
+
+TreeItem getNextItem(TreeItem item) {
+ if (item == null) return null;
+ if (item.getExpanded() && item.getItemCount() > 0) {
+ return item.getItem(0);
+ }
+
+ TreeItem parentItem = item.getParentItem();
+ while (parentItem != null) {
+ int index = parentItem.indexOf(item);
+ if (index == -1) return null;
+ if (index < parentItem.getItemCount() - 1) {
+ return parentItem.getItem(index + 1);
+ }
+ item = parentItem;
+ parentItem = item.getParentItem();
+ }
+ int index = tree.indexOf(item);
+ if (index == -1) return null;
+ if (index == tree.getItemCount() - 1) return null;
+ return tree.getItem(index + 1);
+}
+
+TreeItem getPreviousItem(TreeItem item) {
+ if (item == null) return null;
+ TreeItem parentItem = item.getParentItem();
+ if (parentItem == null) {
+ int index = tree.indexOf(item);
+ if (index == -1 || index == 0) return null;
+ item = tree.getItem(index - 1);
+ if (item.getExpanded() && item.getItemCount() > 0) {
+ return getLastVisibleItem(item.getItems());
+ }
+ return item;
+ }
+ int index = parentItem.indexOf(item);
+ if (index == -1) return null;
+ if (index == 0) return parentItem;
+ item = parentItem.getItem(index - 1);
+ if (item.getExpanded() && item.getItemCount() > 0) {
+ return getLastVisibleItem(item.getItems());
+ }
+ return item;
+}
+
+/**
+ * Returns the row over which the TreeCursor is positioned.
+ *
+ * @return the item for the current position, or <code>null</code> if none
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TreeItem getRow() {
+ checkWidget();
+ return row;
+}
+
+void keyDown(Event event) {
+ if (row == null) return;
+ switch (event.character) {
+ case SWT.CR:
+ notifyListeners(SWT.DefaultSelection, new Event());
+ return;
+ }
+ switch (event.keyCode) {
+ case SWT.ARROW_UP:
+ TreeItem previousItem = getPreviousItem(row);
+ if (previousItem != null) {
+ setRowColumn(previousItem, column, true);
+ }
+ break;
+ case SWT.ARROW_DOWN:
+ TreeItem nextItem = getNextItem(row);
+ if (nextItem != null) {
+ setRowColumn(nextItem, column, true);
+ }
+ break;
+ case SWT.ARROW_LEFT:
+ case SWT.ARROW_RIGHT: {
+ if ((event.stateMask & SWT.MOD1) != 0) {
+ row.setExpanded (event.keyCode == SWT.ARROW_RIGHT);
+ break;
+ }
+ int columnCount = tree.getColumnCount();
+ if (columnCount == 0) break;
+ int columnIndex = column == null ? 0 : tree.indexOf(column);
+ int[] columnOrder = tree.getColumnOrder();
+ int index = 0;
+ while (index < columnOrder.length) {
+ if (columnOrder[index] == columnIndex) break;
+ index++;
+ }
+ if (index == columnOrder.length) index = 0;
+ int leadKey = (getStyle() & SWT.RIGHT_TO_LEFT) != 0 ? SWT.ARROW_RIGHT : SWT.ARROW_LEFT;
+ TreeItem parentRow = row.getParentItem();
+ int rowIndex = tree.indexOf(row);
+ if (event.keyCode == leadKey) {
+ if (parentRow != null) {
+ setRowColumn(row, tree.getColumn(columnOrder[Math.max(0, index - 1)]), true);
+ } else {
+ setRowColumn(rowIndex, columnOrder[Math.max(0, index - 1)], true);
+ }
+ } else {
+ if (parentRow != null) {
+ setRowColumn(row, tree.getColumn(columnOrder[Math.min(columnCount - 1, index + 1)]), true);
+ } else {
+ setRowColumn(rowIndex, columnOrder[Math.min(columnCount - 1, index + 1)], true);
+ }
+ }
+ break;
+ }
+ case SWT.HOME:
+ int columnIndex = column == null ? 0 : tree.indexOf(column);
+ setRowColumn(0, columnIndex, true);
+ break;
+ case SWT.END: {
+ TreeItem[] items = tree.getItems();
+ setRowColumn(getLastVisibleItem(items), column, true);
+ break;
+ }
+ case SWT.PAGE_UP: {
+ Rectangle rect = tree.getClientArea();
+ Rectangle itemRect = tree.getTopItem().getBounds();
+ TreeItem item = row;
+ int index = findIndex(tree.getItems(), item);
+ int itemHeight = tree.getItemHeight();
+ rect.height -= itemRect.y;
+ int page = Math.max(1, rect.height / itemHeight);
+ if (index - page <= 0) {
+ TreeItem first = tree.getItem(0);
+ setRowColumn(first, column, true);
+ break;
+ }
+ for (int i = 0; i < page; i++) {
+ item = getPreviousItem(item);
+ }
+ setRowColumn(item, column, true);
+ break;
+ }
+ case SWT.PAGE_DOWN: {
+ Rectangle rect = tree.getClientArea();
+ Rectangle itemRect = tree.getTopItem().getBounds();
+ TreeItem item = row;
+ int index = findIndex(tree.getItems(), item);
+ int height = tree.getItemHeight();
+ rect.height -= itemRect.y;
+ TreeItem last = getLastVisibleItem(tree.getItems());
+ int page = Math.max(1, rect.height / height);
+ int end = findIndex(tree.getItems(), last);
+ if (end <= index + page) {
+ setRowColumn(last, column, true);
+ break;
+ }
+ for (int i = 0; i < page; i++) {
+ item = getNextItem(item);
+ }
+ setRowColumn(item, column, true);
+ break;
+ }
+ }
+}
+
+void onDispose(Event event) {
+ removeListener(SWT.Dispose, listener);
+ notifyListeners(SWT.Dispose, event);
+ event.type = SWT.None;
+
+ tree.removeListener(SWT.Collapse, treeListener);
+ tree.removeListener(SWT.Expand, treeListener);
+ tree.removeListener(SWT.FocusIn, treeListener);
+ tree.removeListener(SWT.MouseDown, treeListener);
+ unhookRowColumnListeners();
+ ScrollBar hBar = tree.getHorizontalBar();
+ if (hBar != null) {
+ hBar.removeListener(SWT.Selection, resizeListener);
+ }
+ ScrollBar vBar = tree.getVerticalBar();
+ if (vBar != null) {
+ vBar.removeListener(SWT.Selection, resizeListener);
+ }
+}
+
+void paint(Event event) {
+ if (row == null) return;
+ int columnIndex = column == null ? 0 : tree.indexOf(column);
+ int orderedIndex = columnIndex;
+ int[] columnOrder = tree.getColumnOrder();
+ for (int i = 0; i < columnOrder.length; i++) {
+ if (columnOrder[i] == columnIndex) {
+ orderedIndex = i;
+ break;
+ }
+ }
+ GC gc = event.gc;
+ gc.setBackground(getBackground());
+ gc.setForeground(getForeground());
+ gc.fillRectangle(event.x, event.y, event.width, event.height);
+ Image image = row.getImage(columnIndex);
+ int x = 0;
+ // Temporary code - need a better way to determine trim
+ String platform = SWT.getPlatform();
+ if (image != null) {
+ if ("win32".equals(platform)) { //$NON-NLS-1$
+ if (orderedIndex > 0) {
+ x += 2;
+ }
+ } else {
+ x += 2;
+ }
+ }
+ Point size = getSize();
+ if (image != null) {
+ Rectangle imageSize = image.getBounds();
+ int imageY = (size.y - imageSize.height) / 2;
+ gc.drawImage(image, x, imageY);
+ x += imageSize.width;
+ }
+ String text = row.getText(columnIndex);
+ if (text.length() > 0) {
+ Rectangle bounds = row.getBounds(columnIndex);
+ Point extent = gc.stringExtent(text);
+ // Temporary code - need a better way to determine trim
+ if ("win32".equals(platform)) { //$NON-NLS-1$
+ if (tree.getColumnCount() == 0 || orderedIndex == 0) {
+ x += image == null ? 2 : 5;
+ } else {
+ int alignmnent = column.getAlignment();
+ switch (alignmnent) {
+ case SWT.LEFT:
+ x += image == null ? 5 : 3;
+ break;
+ case SWT.RIGHT:
+ x = bounds.width - extent.x - 2;
+ break;
+ case SWT.CENTER:
+ x += Math.ceil((bounds.width - x - extent.x) / 2.0);
+ break;
+ }
+ }
+ } else {
+ if (tree.getColumnCount() == 0) {
+ x += image == null ? 4 : 3;
+ } else {
+ int alignmnent = column.getAlignment();
+ switch (alignmnent) {
+ case SWT.LEFT:
+ x += image == null ? 5 : 3;
+ break;
+ case SWT.RIGHT:
+ x = bounds.width - extent.x - 2;
+ break;
+ case SWT.CENTER:
+ x += (bounds.width - x - extent.x) / 2 + 2;
+ break;
+ }
+ }
+ }
+ int textY = (size.y - extent.y) / 2;
+ gc.drawString(text, x, textY);
+ }
+ if (isFocusControl()) {
+ Display display = getDisplay();
+ gc.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
+ gc.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
+ gc.drawFocus(0, 0, size.x, size.y);
+ }
+}
+
+/**
+ * Removes the listener from the collection of listeners who will be notified when the
+ * receiver's selection changes.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener(SelectionListener)
+ */
+public void removeSelectionListener(SelectionListener listener) {
+ checkWidget();
+ if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ removeListener(SWT.Selection, listener);
+ removeListener(SWT.DefaultSelection, listener);
+}
+
+void _resize() {
+ if (row == null) {
+ setBounds(-200, -200, 0, 0);
+ } else {
+ int columnIndex = column == null ? 0 : tree.indexOf(column);
+ setBounds(row.getBounds(columnIndex));
+ }
+}
+
+/**
+ * Sets the receiver's background color to the color specified
+ * by the argument, or to the default system color for the control
+ * if the argument is null.
+ * <p>
+ * Note: This operation is a hint and may be overridden by the platform.
+ * For example, on Windows the background of a Button cannot be changed.
+ * </p>
+ * @param color the new color (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setBackground (Color color) {
+ background = color;
+ super.setBackground(getBackground());
+ redraw();
+}
+/**
+ * Sets the receiver's foreground color to the color specified
+ * by the argument, or to the default system color for the control
+ * if the argument is null.
+ * <p>
+ * Note: This operation is a hint and may be overridden by the platform.
+ * </p>
+ * @param color the new color (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setForeground (Color color) {
+ foreground = color;
+ super.setForeground(getForeground());
+ redraw();
+}
+
+void setRowColumn(int row, int column, boolean notify) {
+ TreeItem item = row == -1 ? null : tree.getItem(row);
+ TreeColumn col = column == -1 || tree.getColumnCount() == 0 ? null : tree.getColumn(column);
+ setRowColumn(item, col, notify);
+}
+
+void setRowColumn(TreeItem row, TreeColumn column, boolean notify) {
+ if (this.row != null && this.row != row) {
+ TreeItem currentItem = this.row;
+ while (currentItem != null) {
+ currentItem.removeListener(SWT.Dispose, disposeItemListener);
+ currentItem = currentItem.getParentItem();
+ }
+ this.row = null;
+ }
+ if (this.column != null && this.column != column) {
+ this.column.removeListener(SWT.Dispose, disposeColumnListener);
+ this.column.removeListener(SWT.Move, resizeListener);
+ this.column.removeListener(SWT.Resize, resizeListener);
+ this.column = null;
+ }
+ if (row != null) {
+ if (this.row != row) {
+ this.row = row;
+ TreeItem currentItem = row;
+ while (currentItem != null) {
+ currentItem.addListener(SWT.Dispose, disposeItemListener);
+ currentItem = currentItem.getParentItem();
+ }
+ tree.showItem(row);
+ }
+ if (this.column != column && column != null) {
+ this.column = column;
+ column.addListener(SWT.Dispose, disposeColumnListener);
+ column.addListener(SWT.Move, resizeListener);
+ column.addListener(SWT.Resize, resizeListener);
+ tree.showColumn(column);
+ }
+ int columnIndex = column == null ? 0 : tree.indexOf(column);
+ setBounds(row.getBounds(columnIndex));
+ redraw();
+ if (notify) notifyListeners(SWT.Selection, new Event());
+ }
+}
+
+/**
+ * Positions the TreeCursor over the root-level cell at the given row and column in the parent tree.
+ *
+ * @param row the index of the root-level row for the cell to select
+ * @param column the index of column for the cell to select
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection(int row, int column) {
+ checkWidget();
+ int columnCount = tree.getColumnCount();
+ int maxColumnIndex = columnCount == 0 ? 0 : columnCount - 1;
+ if (row < 0 || row >= tree.getItemCount() || column < 0 || column > maxColumnIndex) {
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+ setRowColumn(row, column, false);
+}
+
+/**
+ * Positions the TreeCursor over the cell at the given row and column in the parent tree.
+ *
+ * @param row the TreeItem of the row for the cell to select
+ * @param column the index of column for the cell to select
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection(TreeItem row, int column) {
+ checkWidget();
+ int columnCount = tree.getColumnCount();
+ int maxColumnIndex = columnCount == 0 ? 0 : columnCount - 1;
+ if (row == null || row.isDisposed() || column < 0 || column > maxColumnIndex) {
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+ TreeColumn col = tree.getColumnCount() == 0 ? null : tree.getColumn(column);
+ setRowColumn(row, col, false);
+}
+
+public void setVisible(boolean visible) {
+ checkWidget();
+ if (visible) {
+ _resize();
+ }
+ super.setVisible(visible);
+}
+
+void treeCollapse(Event event) {
+ if (row == null) return;
+ TreeItem root = (TreeItem)event.item;
+ TreeItem parentItem = row.getParentItem();
+ while (parentItem != null) {
+ if (parentItem == root) {
+ setRowColumn(root, column, true);
+ return;
+ }
+ parentItem = parentItem.getParentItem();
+ }
+
+ getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ if (isDisposed()) return;
+ setRowColumn(row, column, true);
+ }
+ });
+}
+
+void treeExpand(Event event) {
+ getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ if (isDisposed()) return;
+ setRowColumn(row, column, true);
+ }
+ });
+}
+
+void treeFocusIn(Event event) {
+ if (isVisible()) {
+ if (row == null && column == null) return;
+ setFocus();
+ }
+}
+
+void treeMouseDown(Event event) {
+ if (tree.getItemCount() == 0) return;
+ Point pt = new Point(event.x, event.y);
+ TreeItem item = tree.getItem(pt);
+ if (item == null && (tree.getStyle() & SWT.FULL_SELECTION) == 0) {
+ TreeItem currentItem = tree.getTopItem();
+ TreeItem parentItem = currentItem.getParentItem();
+ while (parentItem != null) {
+ currentItem = parentItem;
+ parentItem = currentItem.getParentItem();
+ }
+ int start = tree.indexOf(currentItem);
+ int viewportItemCount = tree.getClientArea().height / tree.getItemHeight();
+ int end = Math.min(start + viewportItemCount, tree.getItemCount() - 1);
+ TreeItem[] allItems = tree.getItems();
+ TreeItem[] items = new TreeItem[end - start + 1];
+ System.arraycopy(allItems, start, items, 0, end - start + 1);
+ item = findItem(items, pt);
+ }
+ if (item == null) return;
+
+ TreeColumn newColumn = null;
+ int lineWidth = tree.getLinesVisible() ? tree.getGridLineWidth() : 0;
+ int columnCount = tree.getColumnCount();
+ if (columnCount > 0) {
+ for (int i = 0; i < columnCount; i++) {
+ Rectangle rect = item.getBounds(i);
+ rect.width += lineWidth;
+ rect.height += lineWidth;
+ if (rect.contains(pt)) {
+ newColumn = tree.getColumn(i);
+ break;
+ }
+ }
+ if (newColumn == null) {
+ newColumn = tree.getColumn(0);
+ }
+ }
+ setRowColumn(item, newColumn, true);
+ setFocus();
+}
+
+void unhookRowColumnListeners() {
+ if (column != null && !column.isDisposed()) {
+ column.removeListener(SWT.Dispose, disposeColumnListener);
+ column.removeListener(SWT.Move, resizeListener);
+ column.removeListener(SWT.Resize, resizeListener);
+ }
+ column = null;
+ if (row != null && !row.isDisposed()) {
+ TreeItem currentItem = row;
+ while (currentItem != null) {
+ currentItem.removeListener(SWT.Dispose, disposeItemListener);
+ currentItem = currentItem.getParentItem();
+ }
+ }
+ row = null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragSourceEffect.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragSourceEffect.java
index d5bd29b79c..5eeddf3ad0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragSourceEffect.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragSourceEffect.java
@@ -101,7 +101,8 @@ public class TableDragSourceEffect extends DragSourceEffect {
if (count == 1) {
int /*long*/ path = OS.g_list_nth_data (list, 0);
int /*long*/ pixmap = OS.gtk_tree_view_create_row_drag_icon(handle, path);
- dragSourceImage = Image.gtk_new(display, SWT.ICON, pixmap, 0);
+ dragSourceImage = Image.gtk_new(display, SWT.ICON, pixmap, 0);
+ OS.gtk_tree_path_free (path);
} else {
int width = 0, height = 0;
int[] w = new int[1], h = new int[1];
@@ -117,6 +118,7 @@ public class TableDragSourceEffect extends DragSourceEffect {
height = rect.y + h[0] - yy[0];
yy[i] = rect.y;
hh[i] = h[0];
+ OS.gtk_tree_path_free (path);
}
int /*long*/ source = OS.gdk_pixmap_new(OS.GDK_ROOT_PARENT(), width, height, -1);
int /*long*/ gcSource = OS.gdk_gc_new(source);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragSourceEffect.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragSourceEffect.java
index 593c80b37c..fa475d2db6 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragSourceEffect.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragSourceEffect.java
@@ -100,7 +100,8 @@ public class TreeDragSourceEffect extends DragSourceEffect {
if (count == 1) {
int /*long*/ path = OS.g_list_nth_data (list, 0);
int /*long*/ pixmap = OS.gtk_tree_view_create_row_drag_icon(handle, path);
- dragSourceImage = Image.gtk_new(display, SWT.ICON, pixmap, 0);
+ dragSourceImage = Image.gtk_new(display, SWT.ICON, pixmap, 0);
+ OS.gtk_tree_path_free (path);
} else {
int width = 0, height = 0;
int[] w = new int[1], h = new int[1];
@@ -116,6 +117,7 @@ public class TreeDragSourceEffect extends DragSourceEffect {
height = rect.y + h[0] - yy[0];
yy[i] = rect.y;
hh[i] = h[0];
+ OS.gtk_tree_path_free (path);
}
int /*long*/ source = OS.gdk_pixmap_new(OS.GDK_ROOT_PARENT(), width, height, -1);
int /*long*/ gcSource = OS.gdk_gc_new(source);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDropTargetEffect.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDropTargetEffect.java
index ace9718800..77e2a7ce52 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDropTargetEffect.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDropTargetEffect.java
@@ -167,7 +167,11 @@ public class TreeDropTargetEffect extends DropTargetEffect {
OS.gtk_tree_view_get_cell_area (handle, path[0], 0, cellRect);
if (cellRect.y < cellRect.height) {
int[] tx = new int[1], ty = new int[1];
- OS.gtk_tree_view_widget_to_tree_coords(handle, cellRect.x, cellRect.y - cellRect.height, tx, ty);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) {
+ OS.gtk_tree_view_convert_widget_to_bin_window_coords(handle, cellRect.x, cellRect.y - cellRect.height, tx, ty);
+ } else {
+ OS.gtk_tree_view_widget_to_tree_coords(handle, cellRect.x, cellRect.y - cellRect.height, tx, ty);
+ }
OS.gtk_tree_view_scroll_to_point (handle, -1, ty[0]);
} else {
//scroll down
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java
index ed79dec786..716e1c34e9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java
@@ -19,6 +19,7 @@ import org.eclipse.swt.widgets.*;
class MozillaDelegate {
Browser browser;
+ Shell eventShell;
Listener listener;
boolean hasFocus;
@@ -122,16 +123,22 @@ void handleFocus () {
listener = new Listener () {
public void handleEvent (Event event) {
if (event.widget == browser) return;
- ((Mozilla)browser.webBrowser).Deactivate ();
- hasFocus = false;
- browser.getDisplay ().removeFilter (SWT.FocusIn, this);
- browser.getShell ().removeListener (SWT.Deactivate, this);
+ if (event.type != SWT.Dispose) {
+ ((Mozilla)browser.webBrowser).Deactivate ();
+ hasFocus = false;
+ }
+ eventShell.getDisplay ().removeFilter (SWT.FocusIn, this);
+ eventShell.removeListener (SWT.Deactivate, this);
+ eventShell.removeListener (SWT.Dispose, this);
+ eventShell = null;
listener = null;
}
};
- browser.getDisplay ().addFilter (SWT.FocusIn, listener);
- browser.getShell ().addListener (SWT.Deactivate, listener);
+ eventShell = browser.getShell ();
+ eventShell.getDisplay ().addFilter (SWT.FocusIn, listener);
+ eventShell.addListener (SWT.Deactivate, listener);
+ eventShell.addListener (SWT.Dispose, listener);
}
void handleMouseDown () {
@@ -150,8 +157,10 @@ boolean needsSpinup () {
void onDispose (int /*long*/ embedHandle) {
if (listener != null) {
- browser.getDisplay ().removeFilter (SWT.FocusIn, listener);
- browser.getShell ().removeListener (SWT.Deactivate, listener);
+ eventShell.getDisplay ().removeFilter (SWT.FocusIn, listener);
+ eventShell.removeListener (SWT.Deactivate, listener);
+ eventShell.removeListener (SWT.Dispose, listener);
+ eventShell = null;
listener = null;
}
browser = null;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp
index 1e5ec46838..22e2ae0a02 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -662,6 +662,35 @@ fail:
}
#endif
+#if (!defined(NO__1VtblCall__IIIIII_3I) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJIIII_3I) && defined(JNI64))
+#ifndef JNI64
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIIIII_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jint arg3, jint arg4, jint arg5, jintArray arg6);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIIIII_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jint arg3, jint arg4, jint arg5, jintArray arg6)
+#else
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJIIII_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jint arg3, jint arg4, jint arg5, jintArray arg6);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJIIII_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jint arg3, jint arg4, jint arg5, jintArray arg6)
+#endif
+{
+ jint *lparg6=NULL;
+ jint rc = 0;
+#ifndef JNI64
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IIIIII_3I_FUNC);
+#else
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IJIIII_3I_FUNC);
+#endif
+ if (arg6) if ((lparg6 = env->GetIntArrayElements(arg6, NULL)) == NULL) goto fail;
+ rc = (jint)((jint (STDMETHODCALLTYPE *)(jintLong, jint, jint, jint, jint, jint *))(*(jintLong **)arg1)[arg0])(arg1, arg2, arg3, arg4, arg5, lparg6);
+fail:
+ if (arg6 && lparg6) env->ReleaseIntArrayElements(arg6, lparg6, 0);
+#ifndef JNI64
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IIIIII_3I_FUNC);
+#else
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IJIIII_3I_FUNC);
+#endif
+ return rc;
+}
+#endif
+
#if (!defined(NO__1VtblCall__IIIIII_3I_3I) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJIIII_3I_3I) && defined(JNI64))
#ifndef JNI64
extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIIIII_3I_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jint arg3, jint arg4, jint arg5, jintArray arg6, jintArray arg7);
@@ -1210,6 +1239,31 @@ fail:
}
#endif
+#if (!defined(NO__1VtblCall__IIIJ) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJIJ) && defined(JNI64))
+#ifndef JNI64
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIIJ)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jlong arg3);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIIJ)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jlong arg3)
+#else
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJIJ)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jlong arg3);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJIJ)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jlong arg3)
+#endif
+{
+ jint rc = 0;
+#ifndef JNI64
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IIIJ_FUNC);
+#else
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IJIJ_FUNC);
+#endif
+ rc = (jint)((jint (STDMETHODCALLTYPE *)(jintLong, jint, jlong))(*(jintLong **)arg1)[arg0])(arg1, arg2, arg3);
+#ifndef JNI64
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IIIJ_FUNC);
+#else
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IJIJ_FUNC);
+#endif
+ return rc;
+}
+#endif
+
#if (!defined(NO__1VtblCall__IIIJJ) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJIJJ) && defined(JNI64))
#ifndef JNI64
extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIIJJ)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jlong arg3, jlong arg4);
@@ -2191,6 +2245,35 @@ fail:
}
#endif
+#if (!defined(NO__1VtblCall__III_3J) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJI_3J) && defined(JNI64))
+#ifndef JNI64
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__III_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jlongArray arg3);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__III_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jlongArray arg3)
+#else
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJI_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jlongArray arg3);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJI_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jlongArray arg3)
+#endif
+{
+ jlong *lparg3=NULL;
+ jint rc = 0;
+#ifndef JNI64
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__III_3J_FUNC);
+#else
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IJI_3J_FUNC);
+#endif
+ if (arg3) if ((lparg3 = env->GetLongArrayElements(arg3, NULL)) == NULL) goto fail;
+ rc = (jint)((jint (STDMETHODCALLTYPE *)(jintLong, jint, jlong *))(*(jintLong **)arg1)[arg0])(arg1, arg2, lparg3);
+fail:
+ if (arg3 && lparg3) env->ReleaseLongArrayElements(arg3, lparg3, 0);
+#ifndef JNI64
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__III_3J_FUNC);
+#else
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IJI_3J_FUNC);
+#endif
+ return rc;
+}
+#endif
+
#if (!defined(NO__1VtblCall__IIJ) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJJ) && defined(JNI64))
#ifndef JNI64
extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIJ)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2);
@@ -2476,6 +2559,38 @@ fail:
}
#endif
+#if (!defined(NO__1VtblCall__IIJI_3J_3J) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJJI_3J_3J) && defined(JNI64))
+#ifndef JNI64
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIJI_3J_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jint arg3, jlongArray arg4, jlongArray arg5);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIJI_3J_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jint arg3, jlongArray arg4, jlongArray arg5)
+#else
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJJI_3J_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jint arg3, jlongArray arg4, jlongArray arg5);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJJI_3J_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jint arg3, jlongArray arg4, jlongArray arg5)
+#endif
+{
+ jlong *lparg4=NULL;
+ jlong *lparg5=NULL;
+ jint rc = 0;
+#ifndef JNI64
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IIJI_3J_3J_FUNC);
+#else
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IJJI_3J_3J_FUNC);
+#endif
+ if (arg4) if ((lparg4 = env->GetLongArrayElements(arg4, NULL)) == NULL) goto fail;
+ if (arg5) if ((lparg5 = env->GetLongArrayElements(arg5, NULL)) == NULL) goto fail;
+ rc = (jint)((jint (STDMETHODCALLTYPE *)(jintLong, jlong, jint, jlong *, jlong *))(*(jintLong **)arg1)[arg0])(arg1, arg2, arg3, lparg4, lparg5);
+fail:
+ if (arg5 && lparg5) env->ReleaseLongArrayElements(arg5, lparg5, 0);
+ if (arg4 && lparg4) env->ReleaseLongArrayElements(arg4, lparg4, 0);
+#ifndef JNI64
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IIJI_3J_3J_FUNC);
+#else
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IJJI_3J_3J_FUNC);
+#endif
+ return rc;
+}
+#endif
+
#if (!defined(NO__1VtblCall__IIJJ) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJJJ) && defined(JNI64))
#ifndef JNI64
extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIJJ)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jlong arg3);
@@ -2576,6 +2691,35 @@ JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJJJIIII)(JNIEnv *env, jclass th
}
#endif
+#if (!defined(NO__1VtblCall__IIJJII_3J) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJJJII_3J) && defined(JNI64))
+#ifndef JNI64
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIJJII_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jlong arg3, jint arg4, jint arg5, jlongArray arg6);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIJJII_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jlong arg3, jint arg4, jint arg5, jlongArray arg6)
+#else
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJJJII_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jlong arg3, jint arg4, jint arg5, jlongArray arg6);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJJJII_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jlong arg3, jint arg4, jint arg5, jlongArray arg6)
+#endif
+{
+ jlong *lparg6=NULL;
+ jint rc = 0;
+#ifndef JNI64
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IIJJII_3J_FUNC);
+#else
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IJJJII_3J_FUNC);
+#endif
+ if (arg6) if ((lparg6 = env->GetLongArrayElements(arg6, NULL)) == NULL) goto fail;
+ rc = (jint)((jint (STDMETHODCALLTYPE *)(jintLong, jlong, jlong, jint, jint, jlong *))(*(jintLong **)arg1)[arg0])(arg1, arg2, arg3, arg4, arg5, lparg6);
+fail:
+ if (arg6 && lparg6) env->ReleaseLongArrayElements(arg6, lparg6, 0);
+#ifndef JNI64
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IIJJII_3J_FUNC);
+#else
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IJJJII_3J_FUNC);
+#endif
+ return rc;
+}
+#endif
+
#if (!defined(NO__1VtblCall__IIJJIJ_3C_3I_3I) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJJJIJ_3C_3I_3I) && defined(JNI64))
#ifndef JNI64
extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIJJIJ_3C_3I_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jlong arg3, jint arg4, jlong arg5, jcharArray arg6, jintArray arg7, jintArray arg8);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp
index f0ac6ad2af..f8427214ea 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,8 +14,8 @@
#ifdef NATIVE_STATS
-int XPCOM_nativeFunctionCount = 226;
-int XPCOM_nativeFunctionCallCount[226];
+int XPCOM_nativeFunctionCount = 231;
+int XPCOM_nativeFunctionCallCount[231];
char * XPCOM_nativeFunctionNames[] = {
#ifndef JNI64
"_1Call__I",
@@ -129,6 +129,11 @@ char * XPCOM_nativeFunctionNames[] = {
"_1VtblCall__IJIIII_3C_3I_3I",
#endif
#ifndef JNI64
+ "_1VtblCall__IIIIII_3I",
+#else
+ "_1VtblCall__IJIIII_3I",
+#endif
+#ifndef JNI64
"_1VtblCall__IIIIII_3I_3I",
#else
"_1VtblCall__IJIIII_3I_3I",
@@ -219,6 +224,11 @@ char * XPCOM_nativeFunctionNames[] = {
"_1VtblCall__IJII_3J",
#endif
#ifndef JNI64
+ "_1VtblCall__IIIJ",
+#else
+ "_1VtblCall__IJIJ",
+#endif
+#ifndef JNI64
"_1VtblCall__IIIJJ",
#else
"_1VtblCall__IJIJJ",
@@ -364,6 +374,11 @@ char * XPCOM_nativeFunctionNames[] = {
"_1VtblCall__IJI_3I_3I_3J",
#endif
#ifndef JNI64
+ "_1VtblCall__III_3J",
+#else
+ "_1VtblCall__IJI_3J",
+#endif
+#ifndef JNI64
"_1VtblCall__IIJ",
#else
"_1VtblCall__IJJ",
@@ -414,6 +429,11 @@ char * XPCOM_nativeFunctionNames[] = {
"_1VtblCall__IJJI_3J",
#endif
#ifndef JNI64
+ "_1VtblCall__IIJI_3J_3J",
+#else
+ "_1VtblCall__IJJI_3J_3J",
+#endif
+#ifndef JNI64
"_1VtblCall__IIJJ",
#else
"_1VtblCall__IJJJ",
@@ -434,6 +454,11 @@ char * XPCOM_nativeFunctionNames[] = {
"_1VtblCall__IJJJIIII",
#endif
#ifndef JNI64
+ "_1VtblCall__IIJJII_3J",
+#else
+ "_1VtblCall__IJJJII_3J",
+#endif
+#ifndef JNI64
"_1VtblCall__IIJJIJ_3C_3I_3I",
#else
"_1VtblCall__IJJJIJ_3C_3I_3I",
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h
index eef0e1bcb9..87e516ef5e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -137,6 +137,11 @@ typedef enum {
_1VtblCall__IJIIII_3C_3I_3I_FUNC,
#endif
#ifndef JNI64
+ _1VtblCall__IIIIII_3I_FUNC,
+#else
+ _1VtblCall__IJIIII_3I_FUNC,
+#endif
+#ifndef JNI64
_1VtblCall__IIIIII_3I_3I_FUNC,
#else
_1VtblCall__IJIIII_3I_3I_FUNC,
@@ -227,6 +232,11 @@ typedef enum {
_1VtblCall__IJII_3J_FUNC,
#endif
#ifndef JNI64
+ _1VtblCall__IIIJ_FUNC,
+#else
+ _1VtblCall__IJIJ_FUNC,
+#endif
+#ifndef JNI64
_1VtblCall__IIIJJ_FUNC,
#else
_1VtblCall__IJIJJ_FUNC,
@@ -372,6 +382,11 @@ typedef enum {
_1VtblCall__IJI_3I_3I_3J_FUNC,
#endif
#ifndef JNI64
+ _1VtblCall__III_3J_FUNC,
+#else
+ _1VtblCall__IJI_3J_FUNC,
+#endif
+#ifndef JNI64
_1VtblCall__IIJ_FUNC,
#else
_1VtblCall__IJJ_FUNC,
@@ -422,6 +437,11 @@ typedef enum {
_1VtblCall__IJJI_3J_FUNC,
#endif
#ifndef JNI64
+ _1VtblCall__IIJI_3J_3J_FUNC,
+#else
+ _1VtblCall__IJJI_3J_3J_FUNC,
+#endif
+#ifndef JNI64
_1VtblCall__IIJJ_FUNC,
#else
_1VtblCall__IJJJ_FUNC,
@@ -442,6 +462,11 @@ typedef enum {
_1VtblCall__IJJJIIII_FUNC,
#endif
#ifndef JNI64
+ _1VtblCall__IIJJII_3J_FUNC,
+#else
+ _1VtblCall__IJJJII_3J_FUNC,
+#endif
+#ifndef JNI64
_1VtblCall__IIJJIJ_3C_3I_3I_FUNC,
#else
_1VtblCall__IJJJIJ_3C_3I_3I_FUNC,
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java
index bea10f2751..69e41c1c42 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java
@@ -46,7 +46,7 @@ class Mozilla extends WebBrowser {
int chromeFlags = nsIWebBrowserChrome.CHROME_DEFAULT;
int registerFunctionsOnState = 0;
int refCount, lastKeyCode, lastCharCode, authCount;
- int /*long*/ request;
+ int /*long*/ request, badCertRequest;
Point location, size;
boolean visible, isChild, ignoreDispose, isRetrievingBadCert, isViewingErrorPage, ignoreAllMessages, untrustedText;
boolean updateLastNavigateUrl;
@@ -954,7 +954,56 @@ public void create (Composite parent, int style) {
break;
}
case SWT.Resize: onResize (); break;
- case SWT.FocusIn: Activate (); break;
+ case SWT.FocusIn: {
+ Activate ();
+
+ /* if tabbing onto a page for the first time then full-Browser focus ring should be shown */
+
+ int /*long*/[] result = new int /*long*/[1];
+ int rc = XPCOM.NS_GetServiceManager (result);
+ if (rc != XPCOM.NS_OK) error (rc);
+ if (result[0] == 0) error (XPCOM.NS_NOINTERFACE);
+ nsIServiceManager serviceManager = new nsIServiceManager (result[0]);
+ result[0] = 0;
+ byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_FOCUSMANAGER_CONTRACTID, true);
+ rc = serviceManager.GetServiceByContractID (aContractID, nsIFocusManager.NS_IFOCUSMANAGER_IID, result);
+ serviceManager.Release ();
+
+ if (rc == XPCOM.NS_OK && result[0] != 0) {
+ nsIFocusManager focusManager = new nsIFocusManager (result[0]);
+ result[0] = 0;
+ rc = focusManager.GetFocusedElement (result);
+ if (rc == XPCOM.NS_OK) {
+ if (result[0] != 0) {
+ new nsISupports (result[0]).Release ();
+ result[0] = 0;
+ } else {
+ /* show full browser focus ring */
+ rc = webBrowser.GetContentDOMWindow (result);
+ if (rc == XPCOM.NS_OK && result[0] != 0) {
+ nsIDOMWindow domWindow = new nsIDOMWindow (result[0]);
+ result[0] = 0;
+ rc = domWindow.GetDocument (result);
+ domWindow.Release ();
+ if (rc == XPCOM.NS_OK && result[0] != 0) {
+ nsIDOMDocument domDocument = new nsIDOMDocument (result[0]);
+ result[0] = 0;
+ rc = domDocument.GetDocumentElement (result);
+ domDocument.Release ();
+ if (rc == XPCOM.NS_OK && result[0] != 0) {
+ nsIDOMElement domElement = new nsIDOMElement (result[0]);
+ result[0] = 0;
+ rc = focusManager.SetFocus (domElement.getAddress (), nsIFocusManager.FLAG_BYKEY);
+ domElement.Release ();
+ }
+ }
+ }
+ }
+ }
+ focusManager.Release ();
+ }
+ break;
+ }
case SWT.Activate: Activate (); break;
case SWT.Deactivate: {
Display display = event.display;
@@ -2514,6 +2563,10 @@ void onDispose (Display display) {
locationListeners = oldLocationListeners;
}
+ if (badCertRequest != 0) {
+ new nsISupports (badCertRequest).Release ();
+ }
+
int rc = webBrowser.RemoveWebBrowserListener (weakReference.getAddress (), nsIWebProgressListener.NS_IWEBPROGRESSLISTENER_IID);
if (rc != XPCOM.NS_OK) error (rc);
@@ -2593,6 +2646,150 @@ void Deactivate () {
webBrowserFocus.Release ();
}
+void navigate (int /*long*/ requestHandle) {
+ nsIRequest request = new nsIRequest (requestHandle);
+
+ /* get the request post data, if any */
+ int /*long*/[] result = new int /*long*/[1];
+ byte[] postData = null;
+ final Vector headers = new Vector ();
+ int rc = request.QueryInterface (nsIUploadChannel.NS_IUPLOADCHANNEL_IID, result);
+ if (rc == XPCOM.NS_OK && result[0] != 0) {
+ nsIUploadChannel uploadChannel = new nsIUploadChannel (result[0]);
+ result[0] = 0;
+ rc = uploadChannel.GetUploadStream (result);
+ if (rc == XPCOM.NS_OK && result[0] != 0) {
+ nsIInputStream inputStream = new nsIInputStream (result[0]);
+ result[0] = 0;
+ rc = inputStream.QueryInterface (nsISeekableStream.NS_ISEEKABLESTREAM_IID, result);
+ if (rc == XPCOM.NS_OK && result[0] != 0) {
+ nsISeekableStream seekableStream = new nsISeekableStream (result[0]);
+ result[0] = 0;
+ long[] initialOffset = new long[1];
+ rc = seekableStream.Tell (initialOffset);
+ if (rc == XPCOM.NS_OK) {
+ rc = seekableStream.Seek (nsISeekableStream.NS_SEEK_SET, 0);
+ if (rc == XPCOM.NS_OK) {
+ int[] available = new int[1];
+ rc = inputStream.Available (available);
+ if (rc == XPCOM.NS_OK) {
+ int length = available[0];
+ byte[] bytes = new byte[length];
+ int[] retVal = new int[1];
+ rc = inputStream.Read (bytes, length, retVal);
+ if (rc == XPCOM.NS_OK) {
+ int start = 0;
+ for (int i = 0; i < length; i++) {
+ if (bytes[i] == 13) {
+ byte[] current = new byte[i - start];
+ System.arraycopy (bytes, start, current, 0, i - start);
+ String string = new String (current).trim ();
+ if (string.length () != 0) {
+ headers.add (string);
+ } else {
+ start = i + 2; /* skip \r\n */
+ postData = new byte[length - start];
+ System.arraycopy (bytes, start, postData, 0, length - start);
+ break;
+ }
+ start = i;
+ }
+ }
+ }
+ }
+ }
+ seekableStream.Seek (nsISeekableStream.NS_SEEK_SET, initialOffset[0]);
+ }
+ seekableStream.Release ();
+ }
+ inputStream.Release ();
+ }
+ uploadChannel.Release ();
+ }
+
+ /* get the request headers */
+ XPCOMObject visitor = new XPCOMObject (new int[] {2, 0, 0, 2}) {
+ int refCount = 0;
+ public int /*long*/ method0 (int /*long*/[] args) {
+ /* QueryInterface */
+ int /*long*/ riid = args[0];
+ int /*long*/ ppvObject = args[1];
+ if (riid == 0 || ppvObject == 0) return XPCOM.NS_ERROR_NO_INTERFACE;
+ nsID guid = new nsID ();
+ XPCOM.memmove (guid, riid, nsID.sizeof);
+ if (guid.Equals (nsISupports.NS_ISUPPORTS_IID) || guid.Equals (nsIHttpHeaderVisitor.NS_IHTTPHEADERVISITOR_IID)) {
+ XPCOM.memmove (ppvObject, new int /*long*/[] {getAddress ()}, C.PTR_SIZEOF);
+ refCount++;
+ return XPCOM.NS_OK;
+ }
+ XPCOM.memmove (ppvObject, new int /*long*/[] {0}, C.PTR_SIZEOF);
+ return XPCOM.NS_ERROR_NO_INTERFACE;
+ }
+ public int /*long*/ method1 (int /*long*/[] args) {
+ /* AddRef */
+ return ++refCount;
+ }
+ public int /*long*/ method2 (int /*long*/[] args) {
+ /* Release */
+ if (--refCount == 0) dispose ();
+ return refCount;
+ }
+ public int /*long*/ method3 (int /*long*/[] args) {
+ /* VisitHeader */
+ int /*long*/ aHeader = args[0];
+ int /*long*/ aValue = args[1];
+
+ int length = XPCOM.nsEmbedCString_Length (aHeader);
+ int /*long*/ buffer = XPCOM.nsEmbedCString_get (aHeader);
+ byte[] dest = new byte[length];
+ XPCOM.memmove (dest, buffer, length);
+ String header = new String (dest);
+
+ length = XPCOM.nsEmbedCString_Length (aValue);
+ buffer = XPCOM.nsEmbedCString_get (aValue);
+ dest = new byte[length];
+ XPCOM.memmove (dest, buffer, length);
+ String value = new String (dest);
+
+ headers.add(header + ':' + value);
+ return XPCOM.NS_OK;
+ }
+ };
+
+ new nsISupports (visitor.getAddress ()).AddRef ();
+ rc = request.QueryInterface (nsIHttpChannel.NS_IHTTPCHANNEL_IID, result);
+ if (rc == XPCOM.NS_OK && result[0] != 0) {
+ nsIHttpChannel httpChannel = new nsIHttpChannel (result[0]);
+ result[0] = 0;
+ httpChannel.VisitRequestHeaders (visitor.getAddress ());
+ httpChannel.Release ();
+ }
+ new nsISupports (visitor.getAddress ()).Release ();
+
+ String[] headersArray = null;
+ int size = headers.size ();
+ if (size > 0) {
+ headersArray = new String[size];
+ headers.copyInto (headersArray);
+ }
+
+ /* a request's name often (but not always) is its url */
+ String url = lastNavigateURL;
+ int /*long*/ name = XPCOM.nsEmbedCString_new ();
+ rc = request.GetName (name);
+ if (rc == XPCOM.NS_OK) {
+ int length = XPCOM.nsEmbedCString_Length (name);
+ int /*long*/ buffer = XPCOM.nsEmbedCString_get (name);
+ byte[] bytes = new byte[length];
+ XPCOM.memmove (bytes, buffer, length);
+ String value = new String (bytes);
+ if (value.indexOf (":/") != -1) url = value; //$NON-NLS-1$
+ }
+ XPCOM.nsEmbedCString_delete (name);
+
+ setUrl (url, postData, headersArray);
+}
+
void onResize () {
Rectangle rect = browser.getClientArea ();
int width = Math.max (1, rect.width);
@@ -2782,6 +2979,14 @@ public boolean setText (String html, boolean trusted) {
}
public boolean setUrl (String url, String postData, String[] headers) {
+ byte[] postDataBytes = null;
+ if (postData != null) {
+ postDataBytes = MozillaDelegate.wcsToMbcs (null, postData, false);
+ }
+ return setUrl (url, postDataBytes, headers);
+}
+
+boolean setUrl (String url, byte[] postData, String[] headers) {
htmlBytes = null;
int /*long*/[] result = new int /*long*/[1];
@@ -2814,8 +3019,7 @@ public boolean setUrl (String url, String postData, String[] headers) {
componentManager.Release();
if (rc == XPCOM.NS_OK && result[0] != 0) { /* nsIMIMEInputStream is not in mozilla 1.4 */
- byte[] bytes = MozillaDelegate.wcsToMbcs (null, postData, false);
- dataStream = new InputStream (bytes);
+ dataStream = new InputStream (postData);
dataStream.AddRef ();
postDataStream = new nsIMIMEInputStream (result[0]);
rc = postDataStream.SetData (dataStream.getAddress ());
@@ -3201,7 +3405,6 @@ int OnStateChange (int /*long*/ aWebProgress, int /*long*/ aRequest, int aStateF
* callbacks on the channel so that our nsIBadCertListener2 will be invoked.
*/
if (isRetrievingBadCert) {
- isRetrievingBadCert = false;
nsIRequest request = new nsIRequest (aRequest);
int rc = request.QueryInterface (nsIChannel.NS_ICHANNEL_IID, result);
if (rc != XPCOM.NS_OK) error (rc);
@@ -3233,6 +3436,37 @@ int OnStateChange (int /*long*/ aWebProgress, int /*long*/ aRequest, int aStateF
registerFunctionsOnState = nsIWebProgressListener.STATE_TRANSFERRING;
updateLastNavigateUrl = true;
} else if ((aStateFlags & nsIWebProgressListener.STATE_STOP) != 0) {
+ if (isRetrievingBadCert) {
+ isRetrievingBadCert = false;
+ return XPCOM.NS_OK;
+ }
+
+ /*
+ * If a site with a bad certificate is being encountered for the first time
+ * then store the request for future reference, set the isRetrievingBadCert
+ * flag and re-navigate to the site so that notification callbacks can be
+ * hooked on it to get its certificate info.
+ */
+ switch (aStatus) {
+ case XPCOM.SSL_ERROR_BAD_CERT_DOMAIN:
+ case XPCOM.SEC_ERROR_CA_CERT_INVALID:
+ case XPCOM.SEC_ERROR_EXPIRED_CERTIFICATE:
+ case XPCOM.SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE:
+ case XPCOM.SEC_ERROR_INADEQUATE_KEY_USAGE:
+ case XPCOM.SEC_ERROR_UNKNOWN_ISSUER:
+ case XPCOM.SEC_ERROR_UNTRUSTED_CERT:
+ case XPCOM.SEC_ERROR_UNTRUSTED_ISSUER: {
+ new nsISupports (aRequest).AddRef ();
+ if (badCertRequest != 0) {
+ new nsISupports (badCertRequest).Release ();
+ }
+ badCertRequest = aRequest;
+ isRetrievingBadCert = true;
+ navigate (aRequest);
+ return XPCOM.NS_OK;
+ }
+ }
+
/*
* If this page's nsIDOMWindow handle is still in unhookedDOMWindows then
* add its DOM listeners now. It's possible for this to happen since
@@ -3973,7 +4207,7 @@ int OnStartURIOpen (int /*long*/ aURI, int /*long*/ retval) {
if (value.indexOf ("aboutCertError.xhtml") != -1 || (isViewingErrorPage && value.indexOf ("javascript:showSecuritySection") != -1)) { //$NON-NLS-1$ //$NON-NLS-2$
XPCOM.memmove (retval, new int[] {1}, 4); /* PRBool */
isRetrievingBadCert = true;
- setUrl (lastNavigateURL, null, null);
+ setUrl (lastNavigateURL, (byte[])null, null);
return XPCOM.NS_OK;
}
isViewingErrorPage = value.indexOf ("netError.xhtml") != -1; //$NON-NLS-1$
@@ -4635,33 +4869,35 @@ int NotifyCertProblem (int /*long*/ socketInfo, int /*long*/ status, int /*long*
browser.getDisplay().asyncExec(new Runnable() {
public void run() {
if (browser.isDisposed ()) return;
- if (!url.equals (lastNavigateURL)) return; /* user has navigated elsewhere */
-
- String message = Compatibility.getMessage ("SWT_InvalidCert_Message", new String[] {urlPort}); //$NON-NLS-1$
- if (new PromptDialog (browser.getShell ()).invalidCert (browser, message, finalProblems, cert)) {
- int /*long*/[] result = new int /*long*/[1];
- int rc = XPCOM.NS_GetServiceManager (result);
- if (rc != XPCOM.NS_OK) error (rc);
- if (result[0] == 0) error (XPCOM.NS_NOINTERFACE);
-
- nsIServiceManager serviceManager = new nsIServiceManager (result[0]);
- result[0] = 0;
- byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_CERTOVERRIDE_CONTRACTID, true);
- rc = serviceManager.GetServiceByContractID (aContractID, nsICertOverrideService.NS_ICERTOVERRIDESERVICE_IID, result);
- if (rc != XPCOM.NS_OK) error (rc);
- if (result[0] == 0) error (XPCOM.NS_NOINTERFACE);
- serviceManager.Release ();
-
- nsICertOverrideService overrideService = new nsICertOverrideService (result[0]);
- result[0] = 0;
- byte[] hostBytes = MozillaDelegate.wcsToMbcs (null, host, false);
- int /*long*/ hostString = XPCOM.nsEmbedCString_new (hostBytes, hostBytes.length);
- rc = overrideService.RememberValidityOverride (hostString, port, cert.getAddress (), finalFlags, 1);
- browser.setUrl (url);
- XPCOM.nsEmbedCString_delete (hostString);
- overrideService.Release ();
+ if (url.equals (lastNavigateURL)) {
+ String message = Compatibility.getMessage ("SWT_InvalidCert_Message", new String[] {urlPort}); //$NON-NLS-1$
+ if (new PromptDialog (browser.getShell ()).invalidCert (browser, message, finalProblems, cert)) {
+ int /*long*/[] result = new int /*long*/[1];
+ int rc = XPCOM.NS_GetServiceManager (result);
+ if (rc != XPCOM.NS_OK) error (rc);
+ if (result[0] == 0) error (XPCOM.NS_NOINTERFACE);
+
+ nsIServiceManager serviceManager = new nsIServiceManager (result[0]);
+ result[0] = 0;
+ byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_CERTOVERRIDE_CONTRACTID, true);
+ rc = serviceManager.GetServiceByContractID (aContractID, nsICertOverrideService.NS_ICERTOVERRIDESERVICE_IID, result);
+ if (rc != XPCOM.NS_OK) error (rc);
+ if (result[0] == 0) error (XPCOM.NS_NOINTERFACE);
+ serviceManager.Release ();
+
+ nsICertOverrideService overrideService = new nsICertOverrideService (result[0]);
+ result[0] = 0;
+ byte[] hostBytes = MozillaDelegate.wcsToMbcs (null, host, false);
+ int /*long*/ hostString = XPCOM.nsEmbedCString_new (hostBytes, hostBytes.length);
+ rc = overrideService.RememberValidityOverride (hostString, port, cert.getAddress (), finalFlags, 1);
+ navigate (badCertRequest);
+ XPCOM.nsEmbedCString_delete (hostString);
+ overrideService.Release ();
+ }
}
cert.Release ();
+ new nsISupports (badCertRequest).Release ();
+ badCertRequest = 0;
}
});
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2.java
index 7f1d718a43..c641a2409b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2.java
@@ -21,17 +21,6 @@ class PromptService2 {
XPCOMObject promptService2;
int refCount = 0;
- static final String[] certErrorCodes = new String[] {
- "ssl_error_bad_cert_domain",
- "sec_error_ca_cert_invalid",
- "sec_error_expired_certificate",
- "sec_error_expired_issuer_certificate",
- "sec_error_inadequate_key_usage",
- "sec_error_unknown_issuer",
- "sec_error_untrusted_cert",
- "sec_error_untrusted_issuer",
- }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
-
PromptService2 () {
createCOMInterfaces ();
}
@@ -173,22 +162,12 @@ int Alert (int /*long*/ aParent, int /*long*/ aDialogTitle, int /*long*/ aText)
String textLabel = new String (dest);
/*
- * If mozilla is showing its errors with dialogs (as opposed to pages) then the only
- * opportunity to detect that a page has an invalid certificate, without receiving
- * all notification callbacks on the channel, is to detect the displaying of an alert
- * whose message contains an internal cert error code. If a such a message is
- * detected then instead of showing it, re-navigate to the page with the invalid
- * certificate so that the browser's nsIBadCertListener2 will be invoked.
+ * If mozilla is re-navigating to a page with a bad certificate in order
+ * to get its certificate info then do not show cert error message alerts.
*/
if (browser != null) {
- for (int i = 0; i < certErrorCodes.length; i++) {
- if (textLabel.indexOf (certErrorCodes[i]) != -1) {
- Mozilla mozilla = (Mozilla)browser.webBrowser;
- mozilla.isRetrievingBadCert = true;
- browser.setUrl (mozilla.lastNavigateURL);
- return XPCOM.NS_OK;
- }
- }
+ Mozilla mozilla = (Mozilla)browser.webBrowser;
+ if (mozilla.isRetrievingBadCert) return XPCOM.NS_OK;
}
Shell shell = browser == null ? new Shell () : browser.getShell ();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java
index 3d8d084526..a59b118957 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java
@@ -70,6 +70,7 @@ public class XPCOM extends C {
public static final String NS_DOMSERIALIZER_CONTRACTID = "@mozilla.org/xmlextras/xmlserializer;1"; //$NON-NLS-1$
public static final String NS_DOWNLOAD_CONTRACTID = "@mozilla.org/download;1"; //$NON-NLS-1$
public static final String NS_FILEPICKER_CONTRACTID = "@mozilla.org/filepicker;1"; //$NON-NLS-1$
+ public static final String NS_FOCUSMANAGER_CONTRACTID = "@mozilla.org/focus-manager;1"; //$NON-NLS-1$
public static final String NS_HELPERAPPLAUNCHERDIALOG_CONTRACTID = "@mozilla.org/helperapplauncherdialog;1"; //$NON-NLS-1$
public static final String NS_MEMORY_CONTRACTID = "@mozilla.org/xpcom/memory-service;1"; //$NON-NLS-1$
public static final String NS_MIMEINPUTSTREAM_CONTRACTID = "@mozilla.org/network/mime-input-stream;1"; //$NON-NLS-1$
@@ -132,6 +133,14 @@ public class XPCOM extends C {
public static final int NS_ERROR_HTMLPARSER_UNRESOLVEDDTD = 0x804e03f3;
public static final int NS_ERROR_FILE_NOT_FOUND = 0x80520012;
public static final int NS_ERROR_FILE_UNRECOGNIZED_PATH = 0x80520001;
+ public static final int SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE = 0x805A1FE2;
+ public static final int SEC_ERROR_CA_CERT_INVALID = 0x805A1FDC;
+ public static final int SEC_ERROR_EXPIRED_CERTIFICATE = 0x805A1FF5;
+ public static final int SEC_ERROR_INADEQUATE_KEY_USAGE = 0x805A1FA6;
+ public static final int SEC_ERROR_UNKNOWN_ISSUER = 0x805A1FF3;
+ public static final int SEC_ERROR_UNTRUSTED_CERT = 0x805A1FEB;
+ public static final int SEC_ERROR_UNTRUSTED_ISSUER = 0x805A1FEC;
+ public static final int SSL_ERROR_BAD_CERT_DOMAIN = 0x805A2FF4;
public static final native int nsDynamicFunctionLoad_sizeof ();
@@ -663,6 +672,15 @@ static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1)
lock.unlock();
}
}
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, long arg1);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, long arg1) {
+ lock.lock();
+ try {
+ return _VtblCall(fnNumber, ppVtbl, arg0, arg1);
+ } finally {
+ lock.unlock();
+ }
+}
static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, int arg1);
static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, int arg1) {
lock.lock();
@@ -690,8 +708,17 @@ static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int[] arg
lock.unlock();
}
}
-static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long [] arg1);
-static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long [] arg1) {
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, long[] arg1);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, long[] arg1) {
+ lock.lock();
+ try {
+ return _VtblCall(fnNumber, ppVtbl, arg0, arg1);
+ } finally {
+ lock.unlock();
+ }
+}
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long[] arg1);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long[] arg1) {
lock.lock();
try {
return _VtblCall(fnNumber, ppVtbl, arg0, arg1);
@@ -1116,8 +1143,8 @@ static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long arg
lock.unlock();
}
}
-static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, int arg1, long [] arg2);
-static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, int arg1, long [] arg2) {
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, int arg1, long[] arg2);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, int arg1, long[] arg2) {
lock.lock();
try {
return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2);
@@ -1639,6 +1666,15 @@ static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1,
lock.unlock();
}
}
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, int arg1, long[] arg2, long[] arg3);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, int arg1, long[] arg2, long[] arg3) {
+ lock.lock();
+ try {
+ return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3);
+ } finally {
+ lock.unlock();
+ }
+}
static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long arg1, int[] arg2, int[] arg3);
static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long arg1, int[] arg2, int[] arg3) {
lock.lock();
@@ -1685,6 +1721,15 @@ static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1,
lock.unlock();
}
}
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1, int arg2, int arg3, int[] arg4);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1, int arg2, int arg3, int[] arg4) {
+ lock.lock();
+ try {
+ return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3, arg4);
+ } finally {
+ lock.unlock();
+ }
+}
static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int[] arg1, int[] arg2, int[] arg3, int[] arg4);
static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int[] arg1, int[] arg2, int[] arg3, int[] arg4) {
lock.lock();
@@ -1776,6 +1821,15 @@ static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, int arg1
lock.unlock();
}
}
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long arg1, int arg2, int arg3, long[] arg4);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long arg1, int arg2, int arg3, long[] arg4) {
+ lock.lock();
+ try {
+ return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3, arg4);
+ } finally {
+ lock.unlock();
+ }
+}
static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, byte[] arg1, byte[] arg2, byte[] arg3, int arg4, int[] arg5);
static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, byte[] arg1, byte[] arg2, byte[] arg3, int arg4, int[] arg5) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMDocument.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMDocument.java
new file mode 100644
index 0000000000..662613c0b7
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMDocument.java
@@ -0,0 +1,111 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2011 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIDOMDocument extends nsIDOMNode {
+
+ static final int LAST_METHOD_ID = nsIDOMNode.LAST_METHOD_ID + 17;
+
+ public static final String NS_IDOMDOCUMENT_IID_STR =
+ "a6cf9075-15b3-11d2-932e-00805f8add32";
+
+ public static final nsID NS_IDOMDOCUMENT_IID =
+ new nsID(NS_IDOMDOCUMENT_IID_STR);
+
+ public nsIDOMDocument(int /*long*/ address) {
+ super(address);
+ }
+
+ public int GetDoctype(int /*long*/[] aDoctype) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 1, getAddress(), aDoctype);
+ }
+
+ public int GetImplementation(int /*long*/[] aImplementation) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 2, getAddress(), aImplementation);
+ }
+
+ public int GetDocumentElement(int /*long*/[] aDocumentElement) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 3, getAddress(), aDocumentElement);
+ }
+
+ public int CreateElement(int /*long*/ tagName, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 4, getAddress(), tagName, _retval);
+ }
+
+ public int CreateDocumentFragment(int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 5, getAddress(), _retval);
+ }
+
+ public int CreateTextNode(int /*long*/ data, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 6, getAddress(), data, _retval);
+ }
+
+ public int CreateComment(int /*long*/ data, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 7, getAddress(), data, _retval);
+ }
+
+ public int CreateCDATASection(int /*long*/ data, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 8, getAddress(), data, _retval);
+ }
+
+ public int CreateProcessingInstruction(int /*long*/ target, int /*long*/ data, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 9, getAddress(), target, data, _retval);
+ }
+
+ public int CreateAttribute(int /*long*/ name, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 10, getAddress(), name, _retval);
+ }
+
+ public int CreateEntityReference(int /*long*/ name, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 11, getAddress(), name, _retval);
+ }
+
+ public int GetElementsByTagName(int /*long*/ tagname, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 12, getAddress(), tagname, _retval);
+ }
+
+ public int ImportNode(int /*long*/ importedNode, int deep, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 13, getAddress(), importedNode, deep, _retval);
+ }
+
+ public int CreateElementNS(int /*long*/ namespaceURI, int /*long*/ qualifiedName, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 14, getAddress(), namespaceURI, qualifiedName, _retval);
+ }
+
+ public int CreateAttributeNS(int /*long*/ namespaceURI, int /*long*/ qualifiedName, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 15, getAddress(), namespaceURI, qualifiedName, _retval);
+ }
+
+ public int GetElementsByTagNameNS(int /*long*/ namespaceURI, int /*long*/ localName, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 16, getAddress(), namespaceURI, localName, _retval);
+ }
+
+ public int GetElementById(int /*long*/ elementId, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 17, getAddress(), elementId, _retval);
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMElement.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMElement.java
new file mode 100644
index 0000000000..2116d320d4
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMElement.java
@@ -0,0 +1,107 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2011 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIDOMElement extends nsIDOMNode {
+
+ static final int LAST_METHOD_ID = nsIDOMNode.LAST_METHOD_ID + 16;
+
+ public static final String NS_IDOMELEMENT_IID_STR =
+ "a6cf9078-15b3-11d2-932e-00805f8add32";
+
+ public static final nsID NS_IDOMELEMENT_IID =
+ new nsID(NS_IDOMELEMENT_IID_STR);
+
+ public nsIDOMElement(int /*long*/ address) {
+ super(address);
+ }
+
+ public int GetTagName(int /*long*/ aTagName) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 1, getAddress(), aTagName);
+ }
+
+ public int GetAttribute(int /*long*/ name, int /*long*/ _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 2, getAddress(), name, _retval);
+ }
+
+ public int SetAttribute(int /*long*/ name, int /*long*/ value) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 3, getAddress(), name, value);
+ }
+
+ public int RemoveAttribute(int /*long*/ name) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 4, getAddress(), name);
+ }
+
+ public int GetAttributeNode(int /*long*/ name, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 5, getAddress(), name, _retval);
+ }
+
+ public int SetAttributeNode(int /*long*/ newAttr, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 6, getAddress(), newAttr, _retval);
+ }
+
+ public int RemoveAttributeNode(int /*long*/ oldAttr, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 7, getAddress(), oldAttr, _retval);
+ }
+
+ public int GetElementsByTagName(int /*long*/ name, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 8, getAddress(), name, _retval);
+ }
+
+ public int GetAttributeNS(int /*long*/ namespaceURI, int /*long*/ localName, int /*long*/ _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 9, getAddress(), namespaceURI, localName, _retval);
+ }
+
+ public int SetAttributeNS(int /*long*/ namespaceURI, int /*long*/ qualifiedName, int /*long*/ value) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 10, getAddress(), namespaceURI, qualifiedName, value);
+ }
+
+ public int RemoveAttributeNS(int /*long*/ namespaceURI, int /*long*/ localName) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 11, getAddress(), namespaceURI, localName);
+ }
+
+ public int GetAttributeNodeNS(int /*long*/ namespaceURI, int /*long*/ localName, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 12, getAddress(), namespaceURI, localName, _retval);
+ }
+
+ public int SetAttributeNodeNS(int /*long*/ newAttr, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 13, getAddress(), newAttr, _retval);
+ }
+
+ public int GetElementsByTagNameNS(int /*long*/ namespaceURI, int /*long*/ localName, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 14, getAddress(), namespaceURI, localName, _retval);
+ }
+
+ public int HasAttribute(int /*long*/ name, int[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 15, getAddress(), name, _retval);
+ }
+
+ public int HasAttributeNS(int /*long*/ namespaceURI, int /*long*/ localName, int[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 16, getAddress(), namespaceURI, localName, _retval);
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMNode.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMNode.java
new file mode 100644
index 0000000000..9ec806a3ad
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMNode.java
@@ -0,0 +1,167 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2011 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIDOMNode extends nsISupports {
+
+ static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 25;
+
+ public static final String NS_IDOMNODE_IID_STR =
+ "a6cf907c-15b3-11d2-932e-00805f8add32";
+
+ public static final nsID NS_IDOMNODE_IID =
+ new nsID(NS_IDOMNODE_IID_STR);
+
+ public nsIDOMNode(int /*long*/ address) {
+ super(address);
+ }
+
+ public static final int ELEMENT_NODE = 1;
+
+ public static final int ATTRIBUTE_NODE = 2;
+
+ public static final int TEXT_NODE = 3;
+
+ public static final int CDATA_SECTION_NODE = 4;
+
+ public static final int ENTITY_REFERENCE_NODE = 5;
+
+ public static final int ENTITY_NODE = 6;
+
+ public static final int PROCESSING_INSTRUCTION_NODE = 7;
+
+ public static final int COMMENT_NODE = 8;
+
+ public static final int DOCUMENT_NODE = 9;
+
+ public static final int DOCUMENT_TYPE_NODE = 10;
+
+ public static final int DOCUMENT_FRAGMENT_NODE = 11;
+
+ public static final int NOTATION_NODE = 12;
+
+ public int GetNodeName(int /*long*/ aNodeName) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aNodeName);
+ }
+
+ public int GetNodeValue(int /*long*/ aNodeValue) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aNodeValue);
+ }
+
+ public int SetNodeValue(int /*long*/ aNodeValue) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), aNodeValue);
+ }
+
+ public int GetNodeType(short[] aNodeType) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), aNodeType);
+ }
+
+ public int GetParentNode(int /*long*/[] aParentNode) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), aParentNode);
+ }
+
+ public int GetChildNodes(int /*long*/[] aChildNodes) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 6, getAddress(), aChildNodes);
+ }
+
+ public int GetFirstChild(int /*long*/[] aFirstChild) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 7, getAddress(), aFirstChild);
+ }
+
+ public int GetLastChild(int /*long*/[] aLastChild) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 8, getAddress(), aLastChild);
+ }
+
+ public int GetPreviousSibling(int /*long*/[] aPreviousSibling) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 9, getAddress(), aPreviousSibling);
+ }
+
+ public int GetNextSibling(int /*long*/[] aNextSibling) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 10, getAddress(), aNextSibling);
+ }
+
+ public int GetAttributes(int /*long*/[] aAttributes) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 11, getAddress(), aAttributes);
+ }
+
+ public int GetOwnerDocument(int /*long*/[] aOwnerDocument) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 12, getAddress(), aOwnerDocument);
+ }
+
+ public int InsertBefore(int /*long*/ newChild, int /*long*/ refChild, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 13, getAddress(), newChild, refChild, _retval);
+ }
+
+ public int ReplaceChild(int /*long*/ newChild, int /*long*/ oldChild, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 14, getAddress(), newChild, oldChild, _retval);
+ }
+
+ public int RemoveChild(int /*long*/ oldChild, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 15, getAddress(), oldChild, _retval);
+ }
+
+ public int AppendChild(int /*long*/ newChild, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 16, getAddress(), newChild, _retval);
+ }
+
+ public int HasChildNodes(int[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 17, getAddress(), _retval);
+ }
+
+ public int CloneNode(int deep, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 18, getAddress(), deep, _retval);
+ }
+
+ public int Normalize() {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 19, getAddress());
+ }
+
+ public int IsSupported(int /*long*/ feature, int /*long*/ version, int[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 20, getAddress(), feature, version, _retval);
+ }
+
+ public int GetNamespaceURI(int /*long*/ aNamespaceURI) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 21, getAddress(), aNamespaceURI);
+ }
+
+ public int GetPrefix(int /*long*/ aPrefix) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 22, getAddress(), aPrefix);
+ }
+
+ public int SetPrefix(int /*long*/ aPrefix) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 23, getAddress(), aPrefix);
+ }
+
+ public int GetLocalName(int /*long*/ aLocalName) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 24, getAddress(), aLocalName);
+ }
+
+ public int HasAttributes(int[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 25, getAddress(), _retval);
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFocusManager.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFocusManager.java
new file mode 100644
index 0000000000..cf15868a10
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFocusManager.java
@@ -0,0 +1,139 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2011 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIFocusManager extends nsISupports {
+
+ static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 17;
+
+ public static final String NS_IFOCUSMANAGER_IID_STR =
+ "cd6040a8-243f-412a-8a16-0bf2aa1083b9";
+
+ public static final nsID NS_IFOCUSMANAGER_IID =
+ new nsID(NS_IFOCUSMANAGER_IID_STR);
+
+ public nsIFocusManager(int /*long*/ address) {
+ super(address);
+ }
+
+ public int GetActiveWindow(int /*long*/[] aActiveWindow) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aActiveWindow);
+ }
+
+ public int SetActiveWindow(int /*long*/ aActiveWindow) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aActiveWindow);
+ }
+
+ public int GetFocusedWindow(int /*long*/[] aFocusedWindow) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), aFocusedWindow);
+ }
+
+ public int SetFocusedWindow(int /*long*/ aFocusedWindow) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), aFocusedWindow);
+ }
+
+ public int GetFocusedElement(int /*long*/[] aFocusedElement) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), aFocusedElement);
+ }
+
+ public int GetLastFocusMethod(int /*long*/ window, int[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 6, getAddress(), window, _retval);
+ }
+
+ public int SetFocus(int /*long*/ aElement, int aFlags) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 7, getAddress(), aElement, aFlags);
+ }
+
+ public int MoveFocus(int /*long*/ aWindow, int /*long*/ aStartElement, int aType, int aFlags, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 8, getAddress(), aWindow, aStartElement, aType, aFlags, _retval);
+ }
+
+ public int ClearFocus(int /*long*/ aWindow) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 9, getAddress(), aWindow);
+ }
+
+ public int GetFocusedElementForWindow(int /*long*/ aWindow, int aDeep, int /*long*/[] aFocusedWindow, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 10, getAddress(), aWindow, aDeep, aFocusedWindow, _retval);
+ }
+
+ public int MoveCaretToFocus(int /*long*/ aWindow) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 11, getAddress(), aWindow);
+ }
+
+ public static final int FLAG_RAISE = 1;
+
+ public static final int FLAG_NOSCROLL = 2;
+
+ public static final int FLAG_NOSWITCHFRAME = 4;
+
+ public static final int FLAG_BYMOUSE = 4096;
+
+ public static final int FLAG_BYKEY = 8192;
+
+ public static final int FLAG_BYMOVEFOCUS = 16384;
+
+ public static final int MOVEFOCUS_FORWARD = 1;
+
+ public static final int MOVEFOCUS_BACKWARD = 2;
+
+ public static final int MOVEFOCUS_FORWARDDOC = 3;
+
+ public static final int MOVEFOCUS_BACKWARDDOC = 4;
+
+ public static final int MOVEFOCUS_FIRST = 5;
+
+ public static final int MOVEFOCUS_LAST = 6;
+
+ public static final int MOVEFOCUS_ROOT = 7;
+
+ public static final int MOVEFOCUS_CARET = 8;
+
+ public int WindowRaised(int /*long*/ aWindow) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 12, getAddress(), aWindow);
+ }
+
+ public int WindowLowered(int /*long*/ aWindow) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 13, getAddress(), aWindow);
+ }
+
+ public int ContentRemoved(int /*long*/ aDocument, int /*long*/ aElement) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 14, getAddress(), aDocument, aElement);
+ }
+
+ public int WindowShown(int /*long*/ aWindow) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 15, getAddress(), aWindow);
+ }
+
+ public int WindowHidden(int /*long*/ aWindow) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 16, getAddress(), aWindow);
+ }
+
+ public int FireDelayedEvents(int /*long*/ aDocument) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 17, getAddress(), aDocument);
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHttpChannel.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHttpChannel.java
new file mode 100644
index 0000000000..eb19f2a696
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHttpChannel.java
@@ -0,0 +1,119 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2011 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIHttpChannel extends nsIChannel {
+
+ static final int LAST_METHOD_ID = nsIChannel.LAST_METHOD_ID + 19;
+
+ public static final String NS_IHTTPCHANNEL_IID_STR =
+ "9277fe09-f0cc-4cd9-bbce-581dd94b0260";
+
+ public static final nsID NS_IHTTPCHANNEL_IID =
+ new nsID(NS_IHTTPCHANNEL_IID_STR);
+
+ public nsIHttpChannel(int /*long*/ address) {
+ super(address);
+ }
+
+ public int GetRequestMethod(int /*long*/ aRequestMethod) {
+ return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 1, getAddress(), aRequestMethod);
+ }
+
+ public int SetRequestMethod(int /*long*/ aRequestMethod) {
+ return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 2, getAddress(), aRequestMethod);
+ }
+
+ public int GetReferrer(int /*long*/[] aReferrer) {
+ return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 3, getAddress(), aReferrer);
+ }
+
+ public int SetReferrer(int /*long*/ aReferrer) {
+ return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 4, getAddress(), aReferrer);
+ }
+
+ public int GetRequestHeader(int /*long*/ aHeader, int /*long*/ _retval) {
+ return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 5, getAddress(), aHeader, _retval);
+ }
+
+ public int SetRequestHeader(int /*long*/ aHeader, int /*long*/ aValue, int aMerge) {
+ return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 6, getAddress(), aHeader, aValue, aMerge);
+ }
+
+ public int VisitRequestHeaders(int /*long*/ aVisitor) {
+ return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 7, getAddress(), aVisitor);
+ }
+
+ public int GetAllowPipelining(int[] aAllowPipelining) {
+ return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 8, getAddress(), aAllowPipelining);
+ }
+
+ public int SetAllowPipelining(int aAllowPipelining) {
+ return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 9, getAddress(), aAllowPipelining);
+ }
+
+ public int GetRedirectionLimit(int[] aRedirectionLimit) {
+ return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 10, getAddress(), aRedirectionLimit);
+ }
+
+ public int SetRedirectionLimit(int aRedirectionLimit) {
+ return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 11, getAddress(), aRedirectionLimit);
+ }
+
+ public int GetResponseStatus(int[] aResponseStatus) {
+ return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 12, getAddress(), aResponseStatus);
+ }
+
+ public int GetResponseStatusText(int /*long*/ aResponseStatusText) {
+ return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 13, getAddress(), aResponseStatusText);
+ }
+
+ public int GetRequestSucceeded(int[] aRequestSucceeded) {
+ return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 14, getAddress(), aRequestSucceeded);
+ }
+
+ public int GetResponseHeader(int /*long*/ header, int /*long*/ _retval) {
+ return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 15, getAddress(), header, _retval);
+ }
+
+ public int SetResponseHeader(int /*long*/ header, int /*long*/ value, int merge) {
+ return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 16, getAddress(), header, value, merge);
+ }
+
+ public int VisitResponseHeaders(int /*long*/ aVisitor) {
+ return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 17, getAddress(), aVisitor);
+ }
+
+ public int IsNoStoreResponse(int[] _retval) {
+ return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 18, getAddress(), _retval);
+ }
+
+ public int IsNoCacheResponse(int[] _retval) {
+ return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 19, getAddress(), _retval);
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHttpHeaderVisitor.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHttpHeaderVisitor.java
new file mode 100644
index 0000000000..556a5e22c8
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHttpHeaderVisitor.java
@@ -0,0 +1,47 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2011 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIHttpHeaderVisitor extends nsISupports {
+
+ static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 1;
+
+ public static final String NS_IHTTPHEADERVISITOR_IID_STR =
+ "0cf40717-d7c1-4a94-8c1e-d6c9734101bb";
+
+ public static final nsID NS_IHTTPHEADERVISITOR_IID =
+ new nsID(NS_IHTTPHEADERVISITOR_IID_STR);
+
+ public nsIHttpHeaderVisitor(int /*long*/ address) {
+ super(address);
+ }
+
+ public int VisitHeader(int /*long*/ aHeader, int /*long*/ aValue) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aHeader, aValue);
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsISeekableStream.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsISeekableStream.java
new file mode 100644
index 0000000000..32a49203cf
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsISeekableStream.java
@@ -0,0 +1,61 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2011 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsISeekableStream extends nsISupports {
+
+ static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 3;
+
+ public static final String NS_ISEEKABLESTREAM_IID_STR =
+ "8429d350-1040-4661-8b71-f2a6ba455980";
+
+ public static final nsID NS_ISEEKABLESTREAM_IID =
+ new nsID(NS_ISEEKABLESTREAM_IID_STR);
+
+ public nsISeekableStream(int /*long*/ address) {
+ super(address);
+ }
+
+ public static final int NS_SEEK_SET = 0;
+
+ public static final int NS_SEEK_CUR = 1;
+
+ public static final int NS_SEEK_END = 2;
+
+ public int Seek(int whence, long offset) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), whence, offset);
+ }
+
+ public int Tell(long[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), _retval);
+ }
+
+ public int SetEOF() {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress());
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIUploadChannel.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIUploadChannel.java
new file mode 100644
index 0000000000..08807366f7
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIUploadChannel.java
@@ -0,0 +1,51 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2011 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIUploadChannel extends nsISupports {
+
+ static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 2;
+
+ public static final String NS_IUPLOADCHANNEL_IID_STR =
+ "ddf633d8-e9a4-439d-ad88-de636fd9bb75";
+
+ public static final nsID NS_IUPLOADCHANNEL_IID =
+ new nsID(NS_IUPLOADCHANNEL_IID_STR);
+
+ public nsIUploadChannel(int /*long*/ address) {
+ super(address);
+ }
+
+ public int SetUploadStream(int /*long*/ aStream, int /*long*/ aContentType, int aContentLength) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aStream, aContentType, aContentLength);
+ }
+
+ public int GetUploadStream(int /*long*/[] aUploadStream) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aUploadStream);
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java
index d5de1b3c1d..230aacb629 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java
@@ -19,6 +19,7 @@ import org.eclipse.swt.widgets.*;
class MozillaDelegate {
Browser browser;
+ Shell eventShell;
int /*long*/ mozillaHandle, embedHandle;
boolean hasFocus;
Listener listener;
@@ -138,15 +139,21 @@ void handleFocus () {
listener = new Listener () {
public void handleEvent (Event event) {
if (event.widget == browser) return;
- ((Mozilla)browser.webBrowser).Deactivate ();
- hasFocus = false;
- browser.getDisplay ().removeFilter (SWT.FocusIn, this);
- browser.getShell ().removeListener (SWT.Deactivate, this);
+ if (event.type != SWT.Dispose) {
+ ((Mozilla)browser.webBrowser).Deactivate ();
+ hasFocus = false;
+ }
+ eventShell.getDisplay ().removeFilter (SWT.FocusIn, this);
+ eventShell.removeListener (SWT.Deactivate, this);
+ eventShell.removeListener (SWT.Dispose, this);
+ eventShell = null;
listener = null;
}
};
- browser.getDisplay ().addFilter (SWT.FocusIn, listener);
- browser.getShell ().addListener (SWT.Deactivate, listener);
+ eventShell = browser.getShell ();
+ eventShell.getDisplay ().addFilter (SWT.FocusIn, listener);
+ eventShell.addListener (SWT.Deactivate, listener);
+ eventShell.addListener (SWT.Dispose, listener);
}
void handleMouseDown () {
@@ -211,8 +218,10 @@ boolean needsSpinup () {
void onDispose (int /*long*/ embedHandle) {
if (listener != null) {
- browser.getDisplay ().removeFilter (SWT.FocusIn, listener);
- browser.getShell ().removeListener (SWT.Deactivate, listener);
+ eventShell.getDisplay ().removeFilter (SWT.FocusIn, listener);
+ eventShell.removeListener (SWT.Deactivate, listener);
+ eventShell.removeListener (SWT.Dispose, listener);
+ eventShell = null;
listener = null;
}
browser = null;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras
index c56f7e04b2..3d248b28fb 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras
@@ -4751,6 +4751,17 @@
<enum name="NSFileHandlingPanelOKButton" swt_gen="true"></enum>
<enum name="NSFlagsChanged" swt_gen="true"></enum>
<enum name="NSFocusRingTypeNone" swt_gen="true"></enum>
+ <enum name="NSFontPanelAllEffectsModeMask" swt_gen="true"></enum>
+ <enum name="NSFontPanelAllModesMask" swt_gen="true"></enum>
+ <enum name="NSFontPanelCollectionModeMask" swt_gen="true"></enum>
+ <enum name="NSFontPanelDocumentColorEffectModeMask" swt_gen="true"></enum>
+ <enum name="NSFontPanelFaceModeMask" swt_gen="true"></enum>
+ <enum name="NSFontPanelShadowEffectModeMask" swt_gen="true"></enum>
+ <enum name="NSFontPanelSizeModeMask" swt_gen="true"></enum>
+ <enum name="NSFontPanelStandardModesMask" swt_gen="true"></enum>
+ <enum name="NSFontPanelStrikethroughEffectModeMask" swt_gen="true"></enum>
+ <enum name="NSFontPanelTextColorEffectModeMask" swt_gen="true"></enum>
+ <enum name="NSFontPanelUnderlineEffectModeMask" swt_gen="true"></enum>
<enum name="NSHelpFunctionKey" swt_gen="true"></enum>
<enum name="NSHelpKeyMask" swt_gen="true"></enum>
<enum name="NSHourMinuteDatePickerElementFlag" swt_gen="true"></enum>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/FoundationFull.bridgesupport.extras b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/FoundationFull.bridgesupport.extras
index ef51c74258..8947ccd70a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/FoundationFull.bridgesupport.extras
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/FoundationFull.bridgesupport.extras
@@ -50,6 +50,12 @@
</method>
</class>
<class name="NSAttributedString" swt_gen="mixed">
+ <method selector="attribute:atIndex:effectiveRange:" swt_gen="true">
+ <arg swt_gen="true"></arg>
+ <arg swt_gen="true"></arg>
+ <arg swt_gen="true"></arg>
+ <retval swt_gen="true"></retval>
+ </method>
<method selector="attributedSubstringFromRange:" swt_gen="true">
<arg swt_gen="true"></arg>
<retval swt_gen="true"></retval>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAttributedString.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAttributedString.java
index 7d26d529f4..336244f429 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAttributedString.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAttributedString.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -69,6 +69,11 @@ public NSSize size() {
return result;
}
+public id attribute(NSString attrName, int /*long*/ location, int /*long*/ range) {
+ int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_attribute_atIndex_effectiveRange_, attrName != null ? attrName.id : 0, location, range);
+ return result != 0 ? new id(result) : null;
+}
+
public NSAttributedString attributedSubstringFromRange(NSRange range) {
int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_attributedSubstringFromRange_, range);
return result == this.id ? this : (result != 0 ? new NSAttributedString(result) : null);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
index 01d3f53403..979688a89a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
@@ -960,6 +960,7 @@ public static final int /*long*/ sel_arrayWithCapacity_ = sel_registerName("arra
public static final int /*long*/ sel_arrayWithObject_ = sel_registerName("arrayWithObject:");
public static final int /*long*/ sel_arrowCursor = sel_registerName("arrowCursor");
public static final int /*long*/ sel_ascender = sel_registerName("ascender");
+public static final int /*long*/ sel_attribute_atIndex_effectiveRange_ = sel_registerName("attribute:atIndex:effectiveRange:");
public static final int /*long*/ sel_attributedStringValue = sel_registerName("attributedStringValue");
public static final int /*long*/ sel_attributedStringWithAttachment_ = sel_registerName("attributedStringWithAttachment:");
public static final int /*long*/ sel_attributedSubstringFromRange_ = sel_registerName("attributedSubstringFromRange:");
@@ -2281,17 +2282,17 @@ public static final int NSEventTypeSwipe = 31;
public static final int NSFileHandlingPanelOKButton = 1;
public static final int NSFlagsChanged = 12;
public static final int NSFocusRingTypeNone = 1;
-public static final int NSFontPanelFaceModeMask = 1 << 0;
-public static final int NSFontPanelSizeModeMask = 1 << 1;
-public static final int NSFontPanelCollectionModeMask = 1 << 2;
-public static final int NSFontPanelUnderlineEffectModeMask = 1<<8;
-public static final int NSFontPanelStrikethroughEffectModeMask = 1<<9;
-public static final int NSFontPanelTextColorEffectModeMask = 1<< 10;
-public static final int NSFontPanelDocumentColorEffectModeMask = 1<<11;
-public static final int NSFontPanelShadowEffectModeMask = 1<<12;
-public static final int NSFontPanelAllEffectsModeMask = 0XFFF00;
-public static final int NSFontPanelStandardModesMask = 0xFFFF;
-public static final int NSFontPanelAllModesMask = 0xFFFFFFFF;
+public static final int NSFontPanelAllEffectsModeMask = 1048320;
+public static final int NSFontPanelAllModesMask = -1;
+public static final int NSFontPanelCollectionModeMask = 4;
+public static final int NSFontPanelDocumentColorEffectModeMask = 2048;
+public static final int NSFontPanelFaceModeMask = 1;
+public static final int NSFontPanelShadowEffectModeMask = 4096;
+public static final int NSFontPanelSizeModeMask = 2;
+public static final int NSFontPanelStandardModesMask = 65535;
+public static final int NSFontPanelStrikethroughEffectModeMask = 512;
+public static final int NSFontPanelTextColorEffectModeMask = 1024;
+public static final int NSFontPanelUnderlineEffectModeMask = 256;
public static final int NSHelpFunctionKey = 63302;
public static final int NSHelpKeyMask = 4194304;
public static final int NSHourMinuteDatePickerElementFlag = 12;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/common_j2me/org/eclipse/swt/internal/Library.java b/bundles/org.eclipse.swt/Eclipse SWT PI/common_j2me/org/eclipse/swt/internal/Library.java
index 3ad3e491a6..666f990c5c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/common_j2me/org/eclipse/swt/internal/Library.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/common_j2me/org/eclipse/swt/internal/Library.java
@@ -22,7 +22,7 @@ public class Library {
/**
* SWT Minor version number (must be in the range 0..999)
*/
- static int MINOR_VERSION = 807;
+ static int MINOR_VERSION = 818;
/**
* SWT revision number (must be >= 0)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/common_j2se/org/eclipse/swt/internal/Library.java b/bundles/org.eclipse.swt/Eclipse SWT PI/common_j2se/org/eclipse/swt/internal/Library.java
index a7ceb2594d..3600a3b9e9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/common_j2se/org/eclipse/swt/internal/Library.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/common_j2se/org/eclipse/swt/internal/Library.java
@@ -24,7 +24,7 @@ public class Library {
/**
* SWT Minor version number (must be in the range 0..999)
*/
- static int MINOR_VERSION = 807;
+ static int MINOR_VERSION = 818;
/**
* SWT revision number (must be >= 0)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/atk_structs.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/atk_structs.c
index cf07ec8f1f..92fd43096a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/atk_structs.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/atk_structs.c
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2000, 2012 IBM Corporation and others. All rights reserved.
* The contents of this file are made available under the terms
* of the GNU Lesser General Public License (LGPL) Version 2.1 that
* accompanies this distribution (lgpl-v21.txt). The LGPL is also
@@ -43,9 +43,9 @@ AtkActionIface *getAtkActionIfaceFields(JNIEnv *env, jobject lpObject, AtkAction
if (!AtkActionIfaceFc.cached) cacheAtkActionIfaceFields(env, lpObject);
lpStruct->do_action = (gboolean (*)())(*env)->GetIntLongField(env, lpObject, AtkActionIfaceFc.do_action);
lpStruct->get_n_actions = (gint (*)())(*env)->GetIntLongField(env, lpObject, AtkActionIfaceFc.get_n_actions);
- lpStruct->get_description = (G_CONST_RETURN gchar *(*)())(*env)->GetIntLongField(env, lpObject, AtkActionIfaceFc.get_description);
- lpStruct->get_name = (G_CONST_RETURN gchar *(*)())(*env)->GetIntLongField(env, lpObject, AtkActionIfaceFc.get_name);
- lpStruct->get_keybinding = (G_CONST_RETURN gchar *(*)())(*env)->GetIntLongField(env, lpObject, AtkActionIfaceFc.get_keybinding);
+ lpStruct->get_description = (const gchar *(*)())(*env)->GetIntLongField(env, lpObject, AtkActionIfaceFc.get_description);
+ lpStruct->get_name = (const gchar *(*)())(*env)->GetIntLongField(env, lpObject, AtkActionIfaceFc.get_name);
+ lpStruct->get_keybinding = (const gchar *(*)())(*env)->GetIntLongField(env, lpObject, AtkActionIfaceFc.get_keybinding);
lpStruct->set_description = (gboolean (*)())(*env)->GetIntLongField(env, lpObject, AtkActionIfaceFc.set_description);
return lpStruct;
}
@@ -292,8 +292,8 @@ void cacheAtkObjectClassFields(JNIEnv *env, jobject lpObject)
AtkObjectClass *getAtkObjectClassFields(JNIEnv *env, jobject lpObject, AtkObjectClass *lpStruct)
{
if (!AtkObjectClassFc.cached) cacheAtkObjectClassFields(env, lpObject);
- lpStruct->get_name = (G_CONST_RETURN gchar *(*)())(*env)->GetIntLongField(env, lpObject, AtkObjectClassFc.get_name);
- lpStruct->get_description = (G_CONST_RETURN gchar *(*)())(*env)->GetIntLongField(env, lpObject, AtkObjectClassFc.get_description);
+ lpStruct->get_name = (const gchar *(*)())(*env)->GetIntLongField(env, lpObject, AtkObjectClassFc.get_name);
+ lpStruct->get_description = (const gchar *(*)())(*env)->GetIntLongField(env, lpObject, AtkObjectClassFc.get_description);
lpStruct->get_parent = (AtkObject *(*)())(*env)->GetIntLongField(env, lpObject, AtkObjectClassFc.get_parent);
lpStruct->get_n_children = (gint (*)())(*env)->GetIntLongField(env, lpObject, AtkObjectClassFc.get_n_children);
lpStruct->ref_child = (AtkObject *(*)())(*env)->GetIntLongField(env, lpObject, AtkObjectClassFc.ref_child);
@@ -502,9 +502,9 @@ AtkTableIface *getAtkTableIfaceFields(JNIEnv *env, jobject lpObject, AtkTableIfa
lpStruct->get_column_extent_at = (gint (*)())(*env)->GetIntLongField(env, lpObject, AtkTableIfaceFc.get_column_extent_at);
lpStruct->get_row_extent_at = (gint (*)())(*env)->GetIntLongField(env, lpObject, AtkTableIfaceFc.get_row_extent_at);
lpStruct->get_caption = (AtkObject* (*)())(*env)->GetIntLongField(env, lpObject, AtkTableIfaceFc.get_caption);
- lpStruct->get_column_description = (G_CONST_RETURN gchar* (*)())(*env)->GetIntLongField(env, lpObject, AtkTableIfaceFc.get_column_description);
+ lpStruct->get_column_description = (const gchar* (*)())(*env)->GetIntLongField(env, lpObject, AtkTableIfaceFc.get_column_description);
lpStruct->get_column_header = (AtkObject* (*)())(*env)->GetIntLongField(env, lpObject, AtkTableIfaceFc.get_column_header);
- lpStruct->get_row_description = (G_CONST_RETURN gchar* (*)())(*env)->GetIntLongField(env, lpObject, AtkTableIfaceFc.get_row_description);
+ lpStruct->get_row_description = (const gchar* (*)())(*env)->GetIntLongField(env, lpObject, AtkTableIfaceFc.get_row_description);
lpStruct->get_row_header = (AtkObject* (*)())(*env)->GetIntLongField(env, lpObject, AtkTableIfaceFc.get_row_header);
lpStruct->get_summary = (AtkObject* (*)())(*env)->GetIntLongField(env, lpObject, AtkTableIfaceFc.get_summary);
lpStruct->set_caption = (void (*)())(*env)->GetIntLongField(env, lpObject, AtkTableIfaceFc.set_caption);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak
index 3976fe4799..ad5b1cae27 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak
@@ -122,7 +122,7 @@ ifndef NO_STRIP
LFLAGS := $(LFLAGS) -s
endif
-all: make_swt make_atk make_glx
+all: make_swt make_atk make_glx make_webkit
#
# SWT libs
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
index 54ef237281..ef400a98d6 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2000, 2012 IBM Corporation and others. All rights reserved.
* The contents of this file are made available under the terms
* of the GNU Lesser General Public License (LGPL) Version 2.1 that
* accompanies this distribution (lgpl-v21.txt). The LGPL is also
@@ -267,6 +267,18 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(GTK_1TEXTVIEW_1IM_1CONTEXT)
}
#endif
+#ifndef NO_GTK_1TOOLTIPS_1GET_1TIP_1TEXT
+JNIEXPORT jintLong JNICALL OS_NATIVE(GTK_1TOOLTIPS_1GET_1TIP_1TEXT)
+ (JNIEnv *env, jclass that, jintLong arg0)
+{
+ jintLong rc = 0;
+ OS_NATIVE_ENTER(env, that, GTK_1TOOLTIPS_1GET_1TIP_1TEXT_FUNC);
+ rc = (jintLong)GTK_TOOLTIPS_GET_TIP_TEXT((GtkTooltipsData *)arg0);
+ OS_NATIVE_EXIT(env, that, GTK_1TOOLTIPS_1GET_1TIP_1TEXT_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_GTK_1TOOLTIPS_1SET_1ACTIVE
JNIEXPORT void JNICALL OS_NATIVE(GTK_1TOOLTIPS_1SET_1ACTIVE)
(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
@@ -891,30 +903,6 @@ JNIEXPORT jint JNICALL OS_NATIVE(GtkColorSelectionDialog_1sizeof)
}
#endif
-#ifndef NO_GtkCombo_1sizeof
-JNIEXPORT jint JNICALL OS_NATIVE(GtkCombo_1sizeof)
- (JNIEnv *env, jclass that)
-{
- jint rc = 0;
- OS_NATIVE_ENTER(env, that, GtkCombo_1sizeof_FUNC);
- rc = (jint)GtkCombo_sizeof();
- OS_NATIVE_EXIT(env, that, GtkCombo_1sizeof_FUNC);
- return rc;
-}
-#endif
-
-#ifndef NO_GtkFileSelection_1sizeof
-JNIEXPORT jint JNICALL OS_NATIVE(GtkFileSelection_1sizeof)
- (JNIEnv *env, jclass that)
-{
- jint rc = 0;
- OS_NATIVE_ENTER(env, that, GtkFileSelection_1sizeof_FUNC);
- rc = (jint)GtkFileSelection_sizeof();
- OS_NATIVE_EXIT(env, that, GtkFileSelection_1sizeof_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO_GtkFixedClass_1sizeof
JNIEXPORT jint JNICALL OS_NATIVE(GtkFixedClass_1sizeof)
(JNIEnv *env, jclass that)
@@ -1683,18 +1671,6 @@ JNIEXPORT jboolean JNICALL OS_NATIVE(_1GTK_1WIDGET_1HAS_1FOCUS)
}
#endif
-#ifndef NO__1GTK_1WIDGET_1IS_1SENSITIVE
-JNIEXPORT jboolean JNICALL OS_NATIVE(_1GTK_1WIDGET_1IS_1SENSITIVE)
- (JNIEnv *env, jclass that, jintLong arg0)
-{
- jboolean rc = 0;
- OS_NATIVE_ENTER(env, that, _1GTK_1WIDGET_1IS_1SENSITIVE_FUNC);
- rc = (jboolean)GTK_WIDGET_IS_SENSITIVE(arg0);
- OS_NATIVE_EXIT(env, that, _1GTK_1WIDGET_1IS_1SENSITIVE_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO__1GTK_1WIDGET_1MAPPED
JNIEXPORT jboolean JNICALL OS_NATIVE(_1GTK_1WIDGET_1MAPPED)
(JNIEnv *env, jclass that, jintLong arg0)
@@ -3071,6 +3047,30 @@ fail:
}
#endif
+#ifndef NO__1g_1file_1new_1for_1commandline_1arg
+JNIEXPORT jintLong JNICALL OS_NATIVE(_1g_1file_1new_1for_1commandline_1arg)
+ (JNIEnv *env, jclass that, jbyteArray arg0)
+{
+ jbyte *lparg0=NULL;
+ jintLong rc = 0;
+ OS_NATIVE_ENTER(env, that, _1g_1file_1new_1for_1commandline_1arg_FUNC);
+ if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail;
+/*
+ rc = (jintLong)g_file_new_for_commandline_arg(lparg0);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, g_file_new_for_commandline_arg)
+ if (fp) {
+ rc = (jintLong)((jintLong (CALLING_CONVENTION*)(jbyte *))fp)(lparg0);
+ }
+ }
+fail:
+ if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0);
+ OS_NATIVE_EXIT(env, that, _1g_1file_1new_1for_1commandline_1arg_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO__1g_1file_1new_1for_1path
JNIEXPORT jintLong JNICALL OS_NATIVE(_1g_1file_1new_1for_1path)
(JNIEnv *env, jclass that, jbyteArray arg0)
@@ -4448,6 +4448,18 @@ JNIEXPORT jboolean JNICALL OS_NATIVE(_1g_1thread_1supported)
}
#endif
+#ifndef NO__1g_1timeout_1add
+JNIEXPORT jint JNICALL OS_NATIVE(_1g_1timeout_1add)
+ (JNIEnv *env, jclass that, jint arg0, jintLong arg1, jintLong arg2)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, _1g_1timeout_1add_FUNC);
+ rc = (jint)g_timeout_add((guint32)arg0, (GSourceFunc)arg1, (gpointer)arg2);
+ OS_NATIVE_EXIT(env, that, _1g_1timeout_1add_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO__1g_1type_1add_1interface_1static
JNIEXPORT void JNICALL OS_NATIVE(_1g_1type_1add_1interface_1static)
(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2)
@@ -5032,6 +5044,16 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gdk_1cairo_1set_1source_1window)
}
#endif
+#ifndef NO__1gdk_1color_1free
+JNIEXPORT void JNICALL OS_NATIVE(_1gdk_1color_1free)
+ (JNIEnv *env, jclass that, jintLong arg0)
+{
+ OS_NATIVE_ENTER(env, that, _1gdk_1color_1free_FUNC);
+ gdk_color_free((GdkColor *)arg0);
+ OS_NATIVE_EXIT(env, that, _1gdk_1color_1free_FUNC);
+}
+#endif
+
#ifndef NO__1gdk_1color_1white
JNIEXPORT jboolean JNICALL OS_NATIVE(_1gdk_1color_1white)
(JNIEnv *env, jclass that, jintLong arg0, jobject arg1)
@@ -7868,6 +7890,26 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1cell_1layout_1clear)
}
#endif
+#ifndef NO__1gtk_1cell_1layout_1get_1cells
+JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1cell_1layout_1get_1cells)
+ (JNIEnv *env, jclass that, jintLong arg0)
+{
+ jintLong rc = 0;
+ OS_NATIVE_ENTER(env, that, _1gtk_1cell_1layout_1get_1cells_FUNC);
+/*
+ rc = (jintLong)gtk_cell_layout_get_cells(arg0);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_cell_layout_get_cells)
+ if (fp) {
+ rc = (jintLong)((jintLong (CALLING_CONVENTION*)(jintLong))fp)(arg0);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, _1gtk_1cell_1layout_1get_1cells_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO__1gtk_1cell_1layout_1pack_1start
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1cell_1layout_1pack_1start)
(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jboolean arg2)
@@ -8349,48 +8391,6 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1combo_1box_1set_1focus_1on_1click)
}
#endif
-#ifndef NO__1gtk_1combo_1disable_1activate
-JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1combo_1disable_1activate)
- (JNIEnv *env, jclass that, jintLong arg0)
-{
- OS_NATIVE_ENTER(env, that, _1gtk_1combo_1disable_1activate_FUNC);
- gtk_combo_disable_activate((GtkCombo *)arg0);
- OS_NATIVE_EXIT(env, that, _1gtk_1combo_1disable_1activate_FUNC);
-}
-#endif
-
-#ifndef NO__1gtk_1combo_1new
-JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1combo_1new)
- (JNIEnv *env, jclass that)
-{
- jintLong rc = 0;
- OS_NATIVE_ENTER(env, that, _1gtk_1combo_1new_FUNC);
- rc = (jintLong)gtk_combo_new();
- OS_NATIVE_EXIT(env, that, _1gtk_1combo_1new_FUNC);
- return rc;
-}
-#endif
-
-#ifndef NO__1gtk_1combo_1set_1case_1sensitive
-JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1combo_1set_1case_1sensitive)
- (JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
-{
- OS_NATIVE_ENTER(env, that, _1gtk_1combo_1set_1case_1sensitive_FUNC);
- gtk_combo_set_case_sensitive((GtkCombo *)arg0, (gboolean)arg1);
- OS_NATIVE_EXIT(env, that, _1gtk_1combo_1set_1case_1sensitive_FUNC);
-}
-#endif
-
-#ifndef NO__1gtk_1combo_1set_1popdown_1strings
-JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1combo_1set_1popdown_1strings)
- (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
-{
- OS_NATIVE_ENTER(env, that, _1gtk_1combo_1set_1popdown_1strings_FUNC);
- gtk_combo_set_popdown_strings((GtkCombo *)arg0, (GList *)arg1);
- OS_NATIVE_EXIT(env, that, _1gtk_1combo_1set_1popdown_1strings_FUNC);
-}
-#endif
-
#ifndef NO__1gtk_1container_1add
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1container_1add)
(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
@@ -9560,76 +9560,6 @@ fail:
}
#endif
-#ifndef NO__1gtk_1file_1selection_1get_1filename
-JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1file_1selection_1get_1filename)
- (JNIEnv *env, jclass that, jintLong arg0)
-{
- jintLong rc = 0;
- OS_NATIVE_ENTER(env, that, _1gtk_1file_1selection_1get_1filename_FUNC);
- rc = (jintLong)gtk_file_selection_get_filename((GtkFileSelection *)arg0);
- OS_NATIVE_EXIT(env, that, _1gtk_1file_1selection_1get_1filename_FUNC);
- return rc;
-}
-#endif
-
-#ifndef NO__1gtk_1file_1selection_1get_1selections
-JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1file_1selection_1get_1selections)
- (JNIEnv *env, jclass that, jintLong arg0)
-{
- jintLong rc = 0;
- OS_NATIVE_ENTER(env, that, _1gtk_1file_1selection_1get_1selections_FUNC);
- rc = (jintLong)gtk_file_selection_get_selections((GtkFileSelection *)arg0);
- OS_NATIVE_EXIT(env, that, _1gtk_1file_1selection_1get_1selections_FUNC);
- return rc;
-}
-#endif
-
-#ifndef NO__1gtk_1file_1selection_1hide_1fileop_1buttons
-JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1file_1selection_1hide_1fileop_1buttons)
- (JNIEnv *env, jclass that, jintLong arg0)
-{
- OS_NATIVE_ENTER(env, that, _1gtk_1file_1selection_1hide_1fileop_1buttons_FUNC);
- gtk_file_selection_hide_fileop_buttons((GtkFileSelection *)arg0);
- OS_NATIVE_EXIT(env, that, _1gtk_1file_1selection_1hide_1fileop_1buttons_FUNC);
-}
-#endif
-
-#ifndef NO__1gtk_1file_1selection_1new
-JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1file_1selection_1new)
- (JNIEnv *env, jclass that, jbyteArray arg0)
-{
- jbyte *lparg0=NULL;
- jintLong rc = 0;
- OS_NATIVE_ENTER(env, that, _1gtk_1file_1selection_1new_FUNC);
- if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail;
- rc = (jintLong)gtk_file_selection_new((const gchar *)lparg0);
-fail:
- if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0);
- OS_NATIVE_EXIT(env, that, _1gtk_1file_1selection_1new_FUNC);
- return rc;
-}
-#endif
-
-#ifndef NO__1gtk_1file_1selection_1set_1filename
-JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1file_1selection_1set_1filename)
- (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
-{
- OS_NATIVE_ENTER(env, that, _1gtk_1file_1selection_1set_1filename_FUNC);
- gtk_file_selection_set_filename((GtkFileSelection *)arg0, (const gchar *)arg1);
- OS_NATIVE_EXIT(env, that, _1gtk_1file_1selection_1set_1filename_FUNC);
-}
-#endif
-
-#ifndef NO__1gtk_1file_1selection_1set_1select_1multiple
-JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1file_1selection_1set_1select_1multiple)
- (JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
-{
- OS_NATIVE_ENTER(env, that, _1gtk_1file_1selection_1set_1select_1multiple_FUNC);
- gtk_file_selection_set_select_multiple((GtkFileSelection *)arg0, (gboolean)arg1);
- OS_NATIVE_EXIT(env, that, _1gtk_1file_1selection_1set_1select_1multiple_FUNC);
-}
-#endif
-
#ifndef NO__1gtk_1fixed_1move
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1fixed_1move)
(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jint arg2, jint arg3)
@@ -10438,72 +10368,6 @@ fail:
}
#endif
-#ifndef NO__1gtk_1list_1append_1items
-JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1list_1append_1items)
- (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
-{
- OS_NATIVE_ENTER(env, that, _1gtk_1list_1append_1items_FUNC);
- gtk_list_append_items((GtkList *)arg0, (GList *)arg1);
- OS_NATIVE_EXIT(env, that, _1gtk_1list_1append_1items_FUNC);
-}
-#endif
-
-#ifndef NO__1gtk_1list_1clear_1items
-JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1list_1clear_1items)
- (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jint arg2)
-{
- OS_NATIVE_ENTER(env, that, _1gtk_1list_1clear_1items_FUNC);
- gtk_list_clear_items((GtkList *)arg0, arg1, arg2);
- OS_NATIVE_EXIT(env, that, _1gtk_1list_1clear_1items_FUNC);
-}
-#endif
-
-#ifndef NO__1gtk_1list_1insert_1items
-JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1list_1insert_1items)
- (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jint arg2)
-{
- OS_NATIVE_ENTER(env, that, _1gtk_1list_1insert_1items_FUNC);
- gtk_list_insert_items((GtkList *)arg0, (GList *)arg1, arg2);
- OS_NATIVE_EXIT(env, that, _1gtk_1list_1insert_1items_FUNC);
-}
-#endif
-
-#ifndef NO__1gtk_1list_1item_1new_1with_1label
-JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1list_1item_1new_1with_1label)
- (JNIEnv *env, jclass that, jbyteArray arg0)
-{
- jbyte *lparg0=NULL;
- jintLong rc = 0;
- OS_NATIVE_ENTER(env, that, _1gtk_1list_1item_1new_1with_1label_FUNC);
- if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail;
- rc = (jintLong)gtk_list_item_new_with_label((const gchar *)lparg0);
-fail:
- if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0);
- OS_NATIVE_EXIT(env, that, _1gtk_1list_1item_1new_1with_1label_FUNC);
- return rc;
-}
-#endif
-
-#ifndef NO__1gtk_1list_1remove_1items
-JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1list_1remove_1items)
- (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
-{
- OS_NATIVE_ENTER(env, that, _1gtk_1list_1remove_1items_FUNC);
- gtk_list_remove_items((GtkList *)arg0, (GList *)arg1);
- OS_NATIVE_EXIT(env, that, _1gtk_1list_1remove_1items_FUNC);
-}
-#endif
-
-#ifndef NO__1gtk_1list_1select_1item
-JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1list_1select_1item)
- (JNIEnv *env, jclass that, jintLong arg0, jint arg1)
-{
- OS_NATIVE_ENTER(env, that, _1gtk_1list_1select_1item_FUNC);
- gtk_list_select_item((GtkList *)arg0, arg1);
- OS_NATIVE_EXIT(env, that, _1gtk_1list_1select_1item_FUNC);
-}
-#endif
-
#ifndef NO__1gtk_1list_1store_1append
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1list_1store_1append)
(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
@@ -10672,26 +10536,6 @@ fail:
}
#endif
-#ifndef NO__1gtk_1list_1unselect_1all
-JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1list_1unselect_1all)
- (JNIEnv *env, jclass that, jintLong arg0)
-{
- OS_NATIVE_ENTER(env, that, _1gtk_1list_1unselect_1all_FUNC);
- gtk_list_unselect_all((GtkList *)arg0);
- OS_NATIVE_EXIT(env, that, _1gtk_1list_1unselect_1all_FUNC);
-}
-#endif
-
-#ifndef NO__1gtk_1list_1unselect_1item
-JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1list_1unselect_1item)
- (JNIEnv *env, jclass that, jintLong arg0, jint arg1)
-{
- OS_NATIVE_ENTER(env, that, _1gtk_1list_1unselect_1item_FUNC);
- gtk_list_unselect_item((GtkList *)arg0, arg1);
- OS_NATIVE_EXIT(env, that, _1gtk_1list_1unselect_1item_FUNC);
-}
-#endif
-
#ifndef NO__1gtk_1main
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1main)
(JNIEnv *env, jclass that)
@@ -10777,7 +10621,15 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1menu_1item_1remove_1submenu)
(JNIEnv *env, jclass that, jintLong arg0)
{
OS_NATIVE_ENTER(env, that, _1gtk_1menu_1item_1remove_1submenu_FUNC);
+/*
gtk_menu_item_remove_submenu((GtkMenuItem *)arg0);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_menu_item_remove_submenu)
+ if (fp) {
+ ((void (CALLING_CONVENTION*)(GtkMenuItem *))fp)((GtkMenuItem *)arg0);
+ }
+ }
OS_NATIVE_EXIT(env, that, _1gtk_1menu_1item_1remove_1submenu_FUNC);
}
#endif
@@ -11048,6 +10900,24 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1object_1sink)
}
#endif
+#ifndef NO__1gtk_1orientable_1set_1orientation
+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1orientable_1set_1orientation)
+ (JNIEnv *env, jclass that, jintLong arg0, jint arg1)
+{
+ OS_NATIVE_ENTER(env, that, _1gtk_1orientable_1set_1orientation_FUNC);
+/*
+ gtk_orientable_set_orientation(arg0, (GtkOrientation)arg1);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_orientable_set_orientation)
+ if (fp) {
+ ((void (CALLING_CONVENTION*)(jintLong, GtkOrientation))fp)(arg0, (GtkOrientation)arg1);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, _1gtk_1orientable_1set_1orientation_FUNC);
+}
+#endif
+
#ifndef NO__1gtk_1page_1setup_1get_1bottom_1margin
JNIEXPORT jdouble JNICALL OS_NATIVE(_1gtk_1page_1setup_1get_1bottom_1margin)
(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
@@ -14300,28 +14170,6 @@ fail:
}
#endif
-#ifndef NO__1gtk_1timeout_1add
-JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1timeout_1add)
- (JNIEnv *env, jclass that, jint arg0, jintLong arg1, jintLong arg2)
-{
- jint rc = 0;
- OS_NATIVE_ENTER(env, that, _1gtk_1timeout_1add_FUNC);
- rc = (jint)gtk_timeout_add((guint32)arg0, (GtkFunction)arg1, (gpointer)arg2);
- OS_NATIVE_EXIT(env, that, _1gtk_1timeout_1add_FUNC);
- return rc;
-}
-#endif
-
-#ifndef NO__1gtk_1timeout_1remove
-JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1timeout_1remove)
- (JNIEnv *env, jclass that, jint arg0)
-{
- OS_NATIVE_ENTER(env, that, _1gtk_1timeout_1remove_FUNC);
- gtk_timeout_remove((guint)arg0);
- OS_NATIVE_EXIT(env, that, _1gtk_1timeout_1remove_FUNC);
-}
-#endif
-
#ifndef NO__1gtk_1toggle_1button_1get_1active
JNIEXPORT jboolean JNICALL OS_NATIVE(_1gtk_1toggle_1button_1get_1active)
(JNIEnv *env, jclass that, jintLong arg0)
@@ -14422,7 +14270,15 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1toolbar_1set_1orientation)
(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
{
OS_NATIVE_ENTER(env, that, _1gtk_1toolbar_1set_1orientation_FUNC);
+/*
gtk_toolbar_set_orientation((GtkToolbar *)arg0, (GtkOrientation)arg1);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_toolbar_set_orientation)
+ if (fp) {
+ ((void (CALLING_CONVENTION*)(GtkToolbar *, GtkOrientation))fp)((GtkToolbar *)arg0, (GtkOrientation)arg1);
+ }
+ }
OS_NATIVE_EXIT(env, that, _1gtk_1toolbar_1set_1orientation_FUNC);
}
#endif
@@ -14508,7 +14364,15 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1tooltips_1set_1tip)
OS_NATIVE_ENTER(env, that, _1gtk_1tooltips_1set_1tip_FUNC);
if (arg2) if ((lparg2 = (*env)->GetByteArrayElements(env, arg2, NULL)) == NULL) goto fail;
if (arg3) if ((lparg3 = (*env)->GetByteArrayElements(env, arg3, NULL)) == NULL) goto fail;
- gtk_tooltips_set_tip((GtkTooltips *)arg0, (GtkWidget *)arg1, (const gchar *)lparg2, (const gchar *)lparg3);
+/*
+ gtk_tooltips_set_tip(arg0, arg1, lparg2, lparg3);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_tooltips_set_tip)
+ if (fp) {
+ ((void (CALLING_CONVENTION*)(jintLong, jintLong, jbyte *, jbyte *))fp)(arg0, arg1, lparg2, lparg3);
+ }
+ }
fail:
if (arg3 && lparg3) (*env)->ReleaseByteArrayElements(env, arg3, lparg3, 0);
if (arg2 && lparg2) (*env)->ReleaseByteArrayElements(env, arg2, lparg2, 0);
@@ -15242,7 +15106,15 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1tree_1view_1column_1get_1cell_1rende
{
jintLong rc = 0;
OS_NATIVE_ENTER(env, that, _1gtk_1tree_1view_1column_1get_1cell_1renderers_FUNC);
+/*
rc = (jintLong)gtk_tree_view_column_get_cell_renderers((GtkTreeViewColumn *)arg0);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_tree_view_column_get_cell_renderers)
+ if (fp) {
+ rc = (jintLong)((jintLong (CALLING_CONVENTION*)(GtkTreeViewColumn *))fp)((GtkTreeViewColumn *)arg0);
+ }
+ }
OS_NATIVE_EXIT(env, that, _1gtk_1tree_1view_1column_1get_1cell_1renderers_FUNC);
return rc;
}
@@ -15403,7 +15275,7 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1tree_1view_1column_1set_1cell_1data_1fun
(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2, jintLong arg3, jintLong arg4)
{
OS_NATIVE_ENTER(env, that, _1gtk_1tree_1view_1column_1set_1cell_1data_1func_FUNC);
- gtk_tree_view_column_set_cell_data_func((GtkTreeViewColumn *)arg0, (GtkCellRenderer *)arg1, (GtkTreeCellDataFunc)arg2, (gpointer)arg3, (GtkDestroyNotify)arg4);
+ gtk_tree_view_column_set_cell_data_func((GtkTreeViewColumn *)arg0, (GtkCellRenderer *)arg1, (GtkTreeCellDataFunc)arg2, (gpointer)arg3, (GDestroyNotify)arg4);
OS_NATIVE_EXIT(env, that, _1gtk_1tree_1view_1column_1set_1cell_1data_1func_FUNC);
}
#endif
@@ -15522,6 +15394,31 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1tree_1view_1column_1set_1widget)
}
#endif
+#ifndef NO__1gtk_1tree_1view_1convert_1widget_1to_1bin_1window_1coords
+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1tree_1view_1convert_1widget_1to_1bin_1window_1coords)
+ (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jint arg2, jintArray arg3, jintArray arg4)
+{
+ jint *lparg3=NULL;
+ jint *lparg4=NULL;
+ OS_NATIVE_ENTER(env, that, _1gtk_1tree_1view_1convert_1widget_1to_1bin_1window_1coords_FUNC);
+ if (arg3) if ((lparg3 = (*env)->GetIntArrayElements(env, arg3, NULL)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = (*env)->GetIntArrayElements(env, arg4, NULL)) == NULL) goto fail;
+/*
+ gtk_tree_view_convert_widget_to_bin_window_coords((GtkTreeView *)arg0, arg1, arg2, lparg3, lparg4);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_tree_view_convert_widget_to_bin_window_coords)
+ if (fp) {
+ ((void (CALLING_CONVENTION*)(GtkTreeView *, jint, jint, jint *, jint *))fp)((GtkTreeView *)arg0, arg1, arg2, lparg3, lparg4);
+ }
+ }
+fail:
+ if (arg4 && lparg4) (*env)->ReleaseIntArrayElements(env, arg4, lparg4, 0);
+ if (arg3 && lparg3) (*env)->ReleaseIntArrayElements(env, arg3, lparg3, 0);
+ OS_NATIVE_EXIT(env, that, _1gtk_1tree_1view_1convert_1widget_1to_1bin_1window_1coords_FUNC);
+}
+#endif
+
#ifndef NO__1gtk_1tree_1view_1create_1row_1drag_1icon
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1tree_1view_1create_1row_1drag_1icon)
(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
@@ -15878,23 +15775,6 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1tree_1view_1set_1search_1column)
}
#endif
-#ifndef NO__1gtk_1tree_1view_1tree_1to_1widget_1coords
-JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1tree_1view_1tree_1to_1widget_1coords)
- (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jint arg2, jintArray arg3, jintArray arg4)
-{
- jint *lparg3=NULL;
- jint *lparg4=NULL;
- OS_NATIVE_ENTER(env, that, _1gtk_1tree_1view_1tree_1to_1widget_1coords_FUNC);
- if (arg3) if ((lparg3 = (*env)->GetIntArrayElements(env, arg3, NULL)) == NULL) goto fail;
- if (arg4) if ((lparg4 = (*env)->GetIntArrayElements(env, arg4, NULL)) == NULL) goto fail;
- gtk_tree_view_tree_to_widget_coords((GtkTreeView *)arg0, (gint)arg1, (gint)arg2, (gint *)lparg3, (gint *)lparg4);
-fail:
- if (arg4 && lparg4) (*env)->ReleaseIntArrayElements(env, arg4, lparg4, 0);
- if (arg3 && lparg3) (*env)->ReleaseIntArrayElements(env, arg3, lparg3, 0);
- OS_NATIVE_EXIT(env, that, _1gtk_1tree_1view_1tree_1to_1widget_1coords_FUNC);
-}
-#endif
-
#ifndef NO__1gtk_1tree_1view_1unset_1rows_1drag_1dest
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1tree_1view_1unset_1rows_1drag_1dest)
(JNIEnv *env, jclass that, jintLong arg0)
@@ -15914,7 +15794,15 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1tree_1view_1widget_1to_1tree_1coords)
OS_NATIVE_ENTER(env, that, _1gtk_1tree_1view_1widget_1to_1tree_1coords_FUNC);
if (arg3) if ((lparg3 = (*env)->GetIntArrayElements(env, arg3, NULL)) == NULL) goto fail;
if (arg4) if ((lparg4 = (*env)->GetIntArrayElements(env, arg4, NULL)) == NULL) goto fail;
+/*
gtk_tree_view_widget_to_tree_coords((GtkTreeView *)arg0, arg1, arg2, lparg3, lparg4);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_tree_view_widget_to_tree_coords)
+ if (fp) {
+ ((void (CALLING_CONVENTION*)(GtkTreeView *, jint, jint, jint *, jint *))fp)((GtkTreeView *)arg0, arg1, arg2, lparg3, lparg4);
+ }
+ }
fail:
if (arg4 && lparg4) (*env)->ReleaseIntArrayElements(env, arg4, lparg4, 0);
if (arg3 && lparg3) (*env)->ReleaseIntArrayElements(env, arg3, lparg3, 0);
@@ -16249,6 +16137,26 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1widget_1get_1style)
}
#endif
+#ifndef NO__1gtk_1widget_1get_1tooltip_1text
+JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1widget_1get_1tooltip_1text)
+ (JNIEnv *env, jclass that, jintLong arg0)
+{
+ jintLong rc = 0;
+ OS_NATIVE_ENTER(env, that, _1gtk_1widget_1get_1tooltip_1text_FUNC);
+/*
+ rc = (jintLong)gtk_widget_get_tooltip_text(arg0);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_widget_get_tooltip_text)
+ if (fp) {
+ rc = (jintLong)((jintLong (CALLING_CONVENTION*)(jintLong))fp)(arg0);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, _1gtk_1widget_1get_1tooltip_1text_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO__1gtk_1widget_1get_1toplevel
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1widget_1get_1toplevel)
(JNIEnv *env, jclass that, jintLong arg0)
@@ -17458,6 +17366,18 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(_1pango_1attr_1weight_1new)
}
#endif
+#ifndef NO__1pango_1attribute_1copy
+JNIEXPORT jintLong JNICALL OS_NATIVE(_1pango_1attribute_1copy)
+ (JNIEnv *env, jclass that, jintLong arg0)
+{
+ jintLong rc = 0;
+ OS_NATIVE_ENTER(env, that, _1pango_1attribute_1copy_FUNC);
+ rc = (jintLong)pango_attribute_copy((const PangoAttribute *)arg0);
+ OS_NATIVE_EXIT(env, that, _1pango_1attribute_1copy_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO__1pango_1cairo_1context_1get_1font_1options
JNIEXPORT jintLong JNICALL OS_NATIVE(_1pango_1cairo_1context_1get_1font_1options)
(JNIEnv *env, jclass that, jintLong arg0)
@@ -19771,48 +19691,6 @@ JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_gtk_GtkColor
}
#endif
-#if (!defined(NO_memmove__Lorg_eclipse_swt_internal_gtk_GtkCombo_2I) && !defined(JNI64)) || (!defined(NO_memmove__Lorg_eclipse_swt_internal_gtk_GtkCombo_2J) && defined(JNI64))
-#ifndef JNI64
-JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_gtk_GtkCombo_2I)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1)
-#else
-JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_gtk_GtkCombo_2J)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1)
-#endif
-{
-#ifndef JNI64
- OS_NATIVE_ENTER(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GtkCombo_2I_FUNC);
-#else
- OS_NATIVE_ENTER(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GtkCombo_2J_FUNC);
-#endif
- if (arg0) setGtkComboFields(env, arg0, (GtkCombo *)arg1);
-#ifndef JNI64
- OS_NATIVE_EXIT(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GtkCombo_2I_FUNC);
-#else
- OS_NATIVE_EXIT(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GtkCombo_2J_FUNC);
-#endif
-}
-#endif
-
-#if (!defined(NO_memmove__Lorg_eclipse_swt_internal_gtk_GtkFileSelection_2I) && !defined(JNI64)) || (!defined(NO_memmove__Lorg_eclipse_swt_internal_gtk_GtkFileSelection_2J) && defined(JNI64))
-#ifndef JNI64
-JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_gtk_GtkFileSelection_2I)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1)
-#else
-JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_gtk_GtkFileSelection_2J)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1)
-#endif
-{
-#ifndef JNI64
- OS_NATIVE_ENTER(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GtkFileSelection_2I_FUNC);
-#else
- OS_NATIVE_ENTER(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GtkFileSelection_2J_FUNC);
-#endif
- if (arg0) setGtkFileSelectionFields(env, arg0, (GtkFileSelection *)arg1);
-#ifndef JNI64
- OS_NATIVE_EXIT(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GtkFileSelection_2I_FUNC);
-#else
- OS_NATIVE_EXIT(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GtkFileSelection_2J_FUNC);
-#endif
-}
-#endif
-
#if (!defined(NO_memmove__Lorg_eclipse_swt_internal_gtk_GtkFixed_2I) && !defined(JNI64)) || (!defined(NO_memmove__Lorg_eclipse_swt_internal_gtk_GtkFixed_2J) && defined(JNI64))
#ifndef JNI64
JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_gtk_GtkFixed_2I)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1)
@@ -20199,3 +20077,19 @@ fail:
}
#endif
+#ifndef NO_strcmp
+JNIEXPORT jint JNICALL OS_NATIVE(strcmp)
+ (JNIEnv *env, jclass that, jintLong arg0, jbyteArray arg1)
+{
+ jbyte *lparg1=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, strcmp_FUNC);
+ if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail;
+ rc = (jint)strcmp((const char*)arg0, (const char*)lparg1);
+fail:
+ if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0);
+ OS_NATIVE_EXIT(env, that, strcmp_FUNC);
+ return rc;
+}
+#endif
+
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h
index b3711bb0d8..d993fac1ca 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h
@@ -18,9 +18,12 @@
#define NDEBUG
-/*
#define G_DISABLE_DEPRECATED
+#define GTK_DISABLE_SINGLE_INCLUDES
+/*
#define GTK_DISABLE_DEPRECATED
+#define GDK_DISABLE_DEPRECATED
+#define GSEAL_ENABLE
*/
#include <stdlib.h>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
index 283ea9d15d..fad0944d84 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
@@ -30,7 +30,7 @@
#define LIB_GTK "libgtk-x11-2.0.a(libgtk-x11-2.0.so.0)"
#define LIB_GDK "libgdk-x11-2.0.a(libgdk-x11-2.0.so.0)"
#define LIB_ATK "libatk-1.0.a(libatk-1.0.so.0)"
-#define LIB_PANGO "libpango-1.0.a(libpango-1.0.so.0"
+#define LIB_PANGO "libpango-1.0.a(libpango-1.0.so.0)"
#define LIB_PANGOCAIRO "libpangocairo-1.0.a(libpangocairo-1.0.so.0)"
#define LIB_GIO "libgio-2.0.a(libgio-2.0.so.0)"
#define LIB_FONTCONFIG "libfontconfig.a(libfontconfig.so.1)"
@@ -74,6 +74,7 @@
#define gtk_calendar_set_display_options_LIB LIB_GTK
#define gtk_clipboard_store_LIB LIB_GTK
#define gtk_clipboard_set_can_store_LIB LIB_GTK
+#define gtk_cell_layout_get_cells_LIB LIB_GTK
#define gtk_cell_layout_set_attributes_LIB LIB_GTK
#define gtk_cell_layout_clear_LIB LIB_GTK
#define gtk_cell_layout_pack_start_LIB LIB_GTK
@@ -122,13 +123,19 @@
#define gtk_icon_info_free_LIB LIB_GTK
#define gtk_icon_theme_lookup_by_gicon_LIB LIB_GTK
#define gtk_icon_theme_get_default_LIB LIB_GTK
+#define gtk_menu_item_remove_submenu_LIB LIB_GTK
#define gtk_menu_shell_set_take_focus_LIB LIB_GTK
#define gtk_window_set_keep_below_LIB LIB_GTK
+#define gtk_toolbar_set_orientation_LIB LIB_GTK
#define gtk_tooltip_trigger_tooltip_query_LIB LIB_GTK
+#define gtk_tooltips_set_tip_LIB LIB_GTK
#define gtk_tree_selection_count_selected_rows_LIB LIB_GTK
#define gtk_tree_selection_get_selected_rows_LIB LIB_GTK
+#define gtk_tree_view_column_get_cell_renderers_LIB LIB_GTK
#define gtk_tree_view_column_cell_get_position_LIB LIB_GTK
+#define gtk_tree_view_convert_widget_to_bin_window_coords_LIB LIB_GTK
#define gtk_tree_view_set_grid_lines_LIB LIB_GTK
+#define gtk_tree_view_widget_to_tree_coords_LIB LIB_GTK
#define gtk_entry_set_alignment_LIB LIB_GTK
#define gtk_entry_set_icon_from_stock_LIB LIB_GTK
#define gtk_entry_set_icon_sensitive_LIB LIB_GTK
@@ -159,6 +166,7 @@
#define gtk_window_set_opacity_LIB LIB_GTK
#define gtk_window_set_skip_taskbar_hint_LIB LIB_GTK
#define gtk_widget_is_composited_LIB LIB_GTK
+#define gtk_widget_get_tooltip_text_LIB LIB_GTK
#define gtk_widget_set_tooltip_text_LIB LIB_GTK
#define gdk_x11_screen_get_window_manager_name_LIB LIB_GDK
#define gdk_x11_screen_lookup_visual_LIB LIB_GDK
@@ -188,6 +196,7 @@
#define gdk_cairo_region_LIB LIB_GDK
#define gdk_cairo_create_LIB LIB_GDK
#define gtk_enumerate_printers_LIB LIB_GTK
+#define gtk_orientable_set_orientation_LIB LIB_GTK
#define gtk_page_setup_get_bottom_margin_LIB LIB_GTK
#define gtk_page_setup_get_left_margin_LIB LIB_GTK
#define gtk_page_setup_get_orientation_LIB LIB_GTK
@@ -282,6 +291,7 @@
#define g_file_icon_get_file_LIB LIB_GIO
#define g_file_info_get_content_type_LIB LIB_GIO
#define g_file_info_get_modification_time_LIB LIB_GIO
+#define g_file_new_for_commandline_arg_LIB LIB_GIO
#define g_file_new_for_path_LIB LIB_GIO
#define g_file_new_for_uri_LIB LIB_GIO
#define g_file_read_LIB LIB_GIO
@@ -315,6 +325,7 @@
#define GTK_TEXTVIEW_IM_CONTEXT(arg0) (arg0)->im_context
#define GTK_TOOLTIPS_TIP_WINDOW(arg0) (arg0)->tip_window
#define GTK_TOOLTIPS_SET_ACTIVE(arg0, arg1) (arg0)->active_tips_data = arg1
+#define GTK_TOOLTIPS_GET_TIP_TEXT(arg0) (arg0)->tip_text
#define GTK_WIDGET_Y(arg0) ((GtkWidget *)arg0)->allocation.y
#define GTK_WIDGET_SET_Y(arg0, arg1) (arg0)->allocation.y = arg1
#define GTK_WIDGET_REQUISITION_WIDTH(arg0) (arg0)->requisition.width
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
index 7a5ef021f3..391ebf6fa0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2000, 2012 IBM Corporation and others. All rights reserved.
* The contents of this file are made available under the terms
* of the GNU Lesser General Public License (LGPL) Version 2.1 that
* accompanies this distribution (lgpl-v21.txt). The LGPL is also
@@ -18,8 +18,8 @@
#ifdef NATIVE_STATS
-int OS_nativeFunctionCount = 1399;
-int OS_nativeFunctionCallCount[1399];
+int OS_nativeFunctionCount = 1383;
+int OS_nativeFunctionCallCount[1383];
char * OS_nativeFunctionNames[] = {
#ifndef JNI64
"Call__IIII",
@@ -49,6 +49,7 @@ char * OS_nativeFunctionNames[] = {
"GTK_1SCROLLED_1WINDOW_1SCROLLBAR_1SPACING",
"GTK_1SCROLLED_1WINDOW_1VSCROLLBAR",
"GTK_1TEXTVIEW_1IM_1CONTEXT",
+ "GTK_1TOOLTIPS_1GET_1TIP_1TEXT",
"GTK_1TOOLTIPS_1SET_1ACTIVE",
"GTK_1TOOLTIPS_1TIP_1WINDOW",
"GTK_1WIDGET_1HEIGHT",
@@ -102,8 +103,6 @@ char * OS_nativeFunctionNames[] = {
"GtkCellRendererToggleClass_1sizeof",
"GtkCellRendererToggle_1sizeof",
"GtkColorSelectionDialog_1sizeof",
- "GtkCombo_1sizeof",
- "GtkFileSelection_1sizeof",
"GtkFixedClass_1sizeof",
"GtkFixed_1sizeof",
"GtkRequisition_1sizeof",
@@ -167,7 +166,6 @@ char * OS_nativeFunctionNames[] = {
"_1GTK_1WIDGET_1FLAGS",
"_1GTK_1WIDGET_1HAS_1DEFAULT",
"_1GTK_1WIDGET_1HAS_1FOCUS",
- "_1GTK_1WIDGET_1IS_1SENSITIVE",
"_1GTK_1WIDGET_1MAPPED",
"_1GTK_1WIDGET_1SENSITIVE",
"_1GTK_1WIDGET_1SET_1FLAGS",
@@ -251,6 +249,7 @@ char * OS_nativeFunctionNames[] = {
"_1g_1file_1icon_1get_1file",
"_1g_1file_1info_1get_1content_1type",
"_1g_1file_1info_1get_1modification_1time",
+ "_1g_1file_1new_1for_1commandline_1arg",
"_1g_1file_1new_1for_1path",
"_1g_1file_1new_1for_1uri",
"_1g_1file_1query_1info",
@@ -390,6 +389,7 @@ char * OS_nativeFunctionNames[] = {
"_1g_1strtod",
"_1g_1thread_1init",
"_1g_1thread_1supported",
+ "_1g_1timeout_1add",
"_1g_1type_1add_1interface_1static",
"_1g_1type_1class_1peek",
"_1g_1type_1class_1peek_1parent",
@@ -431,6 +431,7 @@ char * OS_nativeFunctionNames[] = {
"_1gdk_1cairo_1reset_1clip",
"_1gdk_1cairo_1set_1source_1color",
"_1gdk_1cairo_1set_1source_1window",
+ "_1gdk_1color_1free",
"_1gdk_1color_1white",
"_1gdk_1colormap_1alloc_1color",
"_1gdk_1colormap_1free_1colors",
@@ -641,6 +642,7 @@ char * OS_nativeFunctionNames[] = {
"_1gtk_1calendar_1select_1month",
"_1gtk_1calendar_1set_1display_1options",
"_1gtk_1cell_1layout_1clear",
+ "_1gtk_1cell_1layout_1get_1cells",
"_1gtk_1cell_1layout_1pack_1start",
"_1gtk_1cell_1layout_1set_1attributes",
"_1gtk_1cell_1renderer_1get_1size",
@@ -673,10 +675,6 @@ char * OS_nativeFunctionNames[] = {
"_1gtk_1combo_1box_1remove_1text",
"_1gtk_1combo_1box_1set_1active",
"_1gtk_1combo_1box_1set_1focus_1on_1click",
- "_1gtk_1combo_1disable_1activate",
- "_1gtk_1combo_1new",
- "_1gtk_1combo_1set_1case_1sensitive",
- "_1gtk_1combo_1set_1popdown_1strings",
"_1gtk_1container_1add",
"_1gtk_1container_1forall",
"_1gtk_1container_1get_1border_1width",
@@ -756,12 +754,6 @@ char * OS_nativeFunctionNames[] = {
"_1gtk_1file_1filter_1get_1name",
"_1gtk_1file_1filter_1new",
"_1gtk_1file_1filter_1set_1name",
- "_1gtk_1file_1selection_1get_1filename",
- "_1gtk_1file_1selection_1get_1selections",
- "_1gtk_1file_1selection_1hide_1fileop_1buttons",
- "_1gtk_1file_1selection_1new",
- "_1gtk_1file_1selection_1set_1filename",
- "_1gtk_1file_1selection_1set_1select_1multiple",
"_1gtk_1fixed_1move",
"_1gtk_1fixed_1new",
"_1gtk_1fixed_1set_1has_1window",
@@ -831,12 +823,6 @@ char * OS_nativeFunctionNames[] = {
"_1gtk_1label_1set_1text__J_3B",
#endif
"_1gtk_1label_1set_1text_1with_1mnemonic",
- "_1gtk_1list_1append_1items",
- "_1gtk_1list_1clear_1items",
- "_1gtk_1list_1insert_1items",
- "_1gtk_1list_1item_1new_1with_1label",
- "_1gtk_1list_1remove_1items",
- "_1gtk_1list_1select_1item",
"_1gtk_1list_1store_1append",
"_1gtk_1list_1store_1clear",
"_1gtk_1list_1store_1insert",
@@ -867,8 +853,6 @@ char * OS_nativeFunctionNames[] = {
#else
"_1gtk_1list_1store_1set__JJI_3BJ",
#endif
- "_1gtk_1list_1unselect_1all",
- "_1gtk_1list_1unselect_1item",
"_1gtk_1main",
"_1gtk_1main_1do_1event",
"_1gtk_1main_1iteration",
@@ -901,6 +885,7 @@ char * OS_nativeFunctionNames[] = {
"_1gtk_1notebook_1set_1show_1tabs",
"_1gtk_1notebook_1set_1tab_1pos",
"_1gtk_1object_1sink",
+ "_1gtk_1orientable_1set_1orientation",
"_1gtk_1page_1setup_1get_1bottom_1margin",
"_1gtk_1page_1setup_1get_1left_1margin",
"_1gtk_1page_1setup_1get_1orientation",
@@ -1114,8 +1099,6 @@ char * OS_nativeFunctionNames[] = {
"_1gtk_1text_1view_1set_1tabs",
"_1gtk_1text_1view_1set_1wrap_1mode",
"_1gtk_1text_1view_1window_1to_1buffer_1coords",
- "_1gtk_1timeout_1add",
- "_1gtk_1timeout_1remove",
"_1gtk_1toggle_1button_1get_1active",
"_1gtk_1toggle_1button_1get_1inconsistent",
"_1gtk_1toggle_1button_1new",
@@ -1240,6 +1223,7 @@ char * OS_nativeFunctionNames[] = {
"_1gtk_1tree_1view_1column_1set_1title",
"_1gtk_1tree_1view_1column_1set_1visible",
"_1gtk_1tree_1view_1column_1set_1widget",
+ "_1gtk_1tree_1view_1convert_1widget_1to_1bin_1window_1coords",
"_1gtk_1tree_1view_1create_1row_1drag_1icon",
"_1gtk_1tree_1view_1expand_1row",
"_1gtk_1tree_1view_1get_1background_1area",
@@ -1269,7 +1253,6 @@ char * OS_nativeFunctionNames[] = {
"_1gtk_1tree_1view_1set_1model",
"_1gtk_1tree_1view_1set_1rules_1hint",
"_1gtk_1tree_1view_1set_1search_1column",
- "_1gtk_1tree_1view_1tree_1to_1widget_1coords",
"_1gtk_1tree_1view_1unset_1rows_1drag_1dest",
"_1gtk_1tree_1view_1widget_1to_1tree_1coords",
"_1gtk_1vbox_1new",
@@ -1305,6 +1288,7 @@ char * OS_nativeFunctionNames[] = {
"_1gtk_1widget_1get_1parent_1window",
"_1gtk_1widget_1get_1size_1request",
"_1gtk_1widget_1get_1style",
+ "_1gtk_1widget_1get_1tooltip_1text",
"_1gtk_1widget_1get_1toplevel",
"_1gtk_1widget_1grab_1focus",
"_1gtk_1widget_1hide",
@@ -1410,6 +1394,7 @@ char * OS_nativeFunctionNames[] = {
"_1pango_1attr_1underline_1color_1new",
"_1pango_1attr_1underline_1new",
"_1pango_1attr_1weight_1new",
+ "_1pango_1attribute_1copy",
"_1pango_1cairo_1context_1get_1font_1options",
"_1pango_1cairo_1context_1set_1font_1options",
"_1pango_1cairo_1create_1layout",
@@ -1710,16 +1695,6 @@ char * OS_nativeFunctionNames[] = {
"memmove__Lorg_eclipse_swt_internal_gtk_GtkColorSelectionDialog_2J",
#endif
#ifndef JNI64
- "memmove__Lorg_eclipse_swt_internal_gtk_GtkCombo_2I",
-#else
- "memmove__Lorg_eclipse_swt_internal_gtk_GtkCombo_2J",
-#endif
-#ifndef JNI64
- "memmove__Lorg_eclipse_swt_internal_gtk_GtkFileSelection_2I",
-#else
- "memmove__Lorg_eclipse_swt_internal_gtk_GtkFileSelection_2J",
-#endif
-#ifndef JNI64
"memmove__Lorg_eclipse_swt_internal_gtk_GtkFixed_2I",
#else
"memmove__Lorg_eclipse_swt_internal_gtk_GtkFixed_2J",
@@ -1796,6 +1771,7 @@ char * OS_nativeFunctionNames[] = {
#endif
"pangoLayoutNewProc_1CALLBACK",
"realpath",
+ "strcmp",
};
#define STATS_NATIVE(func) Java_org_eclipse_swt_tools_internal_NativeStats_##func
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
index 43d38d45f9..7e6d1d448e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2000, 2012 IBM Corporation and others. All rights reserved.
* The contents of this file are made available under the terms
* of the GNU Lesser General Public License (LGPL) Version 2.1 that
* accompanies this distribution (lgpl-v21.txt). The LGPL is also
@@ -57,6 +57,7 @@ typedef enum {
GTK_1SCROLLED_1WINDOW_1SCROLLBAR_1SPACING_FUNC,
GTK_1SCROLLED_1WINDOW_1VSCROLLBAR_FUNC,
GTK_1TEXTVIEW_1IM_1CONTEXT_FUNC,
+ GTK_1TOOLTIPS_1GET_1TIP_1TEXT_FUNC,
GTK_1TOOLTIPS_1SET_1ACTIVE_FUNC,
GTK_1TOOLTIPS_1TIP_1WINDOW_FUNC,
GTK_1WIDGET_1HEIGHT_FUNC,
@@ -110,8 +111,6 @@ typedef enum {
GtkCellRendererToggleClass_1sizeof_FUNC,
GtkCellRendererToggle_1sizeof_FUNC,
GtkColorSelectionDialog_1sizeof_FUNC,
- GtkCombo_1sizeof_FUNC,
- GtkFileSelection_1sizeof_FUNC,
GtkFixedClass_1sizeof_FUNC,
GtkFixed_1sizeof_FUNC,
GtkRequisition_1sizeof_FUNC,
@@ -175,7 +174,6 @@ typedef enum {
_1GTK_1WIDGET_1FLAGS_FUNC,
_1GTK_1WIDGET_1HAS_1DEFAULT_FUNC,
_1GTK_1WIDGET_1HAS_1FOCUS_FUNC,
- _1GTK_1WIDGET_1IS_1SENSITIVE_FUNC,
_1GTK_1WIDGET_1MAPPED_FUNC,
_1GTK_1WIDGET_1SENSITIVE_FUNC,
_1GTK_1WIDGET_1SET_1FLAGS_FUNC,
@@ -259,6 +257,7 @@ typedef enum {
_1g_1file_1icon_1get_1file_FUNC,
_1g_1file_1info_1get_1content_1type_FUNC,
_1g_1file_1info_1get_1modification_1time_FUNC,
+ _1g_1file_1new_1for_1commandline_1arg_FUNC,
_1g_1file_1new_1for_1path_FUNC,
_1g_1file_1new_1for_1uri_FUNC,
_1g_1file_1query_1info_FUNC,
@@ -398,6 +397,7 @@ typedef enum {
_1g_1strtod_FUNC,
_1g_1thread_1init_FUNC,
_1g_1thread_1supported_FUNC,
+ _1g_1timeout_1add_FUNC,
_1g_1type_1add_1interface_1static_FUNC,
_1g_1type_1class_1peek_FUNC,
_1g_1type_1class_1peek_1parent_FUNC,
@@ -439,6 +439,7 @@ typedef enum {
_1gdk_1cairo_1reset_1clip_FUNC,
_1gdk_1cairo_1set_1source_1color_FUNC,
_1gdk_1cairo_1set_1source_1window_FUNC,
+ _1gdk_1color_1free_FUNC,
_1gdk_1color_1white_FUNC,
_1gdk_1colormap_1alloc_1color_FUNC,
_1gdk_1colormap_1free_1colors_FUNC,
@@ -649,6 +650,7 @@ typedef enum {
_1gtk_1calendar_1select_1month_FUNC,
_1gtk_1calendar_1set_1display_1options_FUNC,
_1gtk_1cell_1layout_1clear_FUNC,
+ _1gtk_1cell_1layout_1get_1cells_FUNC,
_1gtk_1cell_1layout_1pack_1start_FUNC,
_1gtk_1cell_1layout_1set_1attributes_FUNC,
_1gtk_1cell_1renderer_1get_1size_FUNC,
@@ -681,10 +683,6 @@ typedef enum {
_1gtk_1combo_1box_1remove_1text_FUNC,
_1gtk_1combo_1box_1set_1active_FUNC,
_1gtk_1combo_1box_1set_1focus_1on_1click_FUNC,
- _1gtk_1combo_1disable_1activate_FUNC,
- _1gtk_1combo_1new_FUNC,
- _1gtk_1combo_1set_1case_1sensitive_FUNC,
- _1gtk_1combo_1set_1popdown_1strings_FUNC,
_1gtk_1container_1add_FUNC,
_1gtk_1container_1forall_FUNC,
_1gtk_1container_1get_1border_1width_FUNC,
@@ -764,12 +762,6 @@ typedef enum {
_1gtk_1file_1filter_1get_1name_FUNC,
_1gtk_1file_1filter_1new_FUNC,
_1gtk_1file_1filter_1set_1name_FUNC,
- _1gtk_1file_1selection_1get_1filename_FUNC,
- _1gtk_1file_1selection_1get_1selections_FUNC,
- _1gtk_1file_1selection_1hide_1fileop_1buttons_FUNC,
- _1gtk_1file_1selection_1new_FUNC,
- _1gtk_1file_1selection_1set_1filename_FUNC,
- _1gtk_1file_1selection_1set_1select_1multiple_FUNC,
_1gtk_1fixed_1move_FUNC,
_1gtk_1fixed_1new_FUNC,
_1gtk_1fixed_1set_1has_1window_FUNC,
@@ -839,12 +831,6 @@ typedef enum {
_1gtk_1label_1set_1text__J_3B_FUNC,
#endif
_1gtk_1label_1set_1text_1with_1mnemonic_FUNC,
- _1gtk_1list_1append_1items_FUNC,
- _1gtk_1list_1clear_1items_FUNC,
- _1gtk_1list_1insert_1items_FUNC,
- _1gtk_1list_1item_1new_1with_1label_FUNC,
- _1gtk_1list_1remove_1items_FUNC,
- _1gtk_1list_1select_1item_FUNC,
_1gtk_1list_1store_1append_FUNC,
_1gtk_1list_1store_1clear_FUNC,
_1gtk_1list_1store_1insert_FUNC,
@@ -875,8 +861,6 @@ typedef enum {
#else
_1gtk_1list_1store_1set__JJI_3BJ_FUNC,
#endif
- _1gtk_1list_1unselect_1all_FUNC,
- _1gtk_1list_1unselect_1item_FUNC,
_1gtk_1main_FUNC,
_1gtk_1main_1do_1event_FUNC,
_1gtk_1main_1iteration_FUNC,
@@ -909,6 +893,7 @@ typedef enum {
_1gtk_1notebook_1set_1show_1tabs_FUNC,
_1gtk_1notebook_1set_1tab_1pos_FUNC,
_1gtk_1object_1sink_FUNC,
+ _1gtk_1orientable_1set_1orientation_FUNC,
_1gtk_1page_1setup_1get_1bottom_1margin_FUNC,
_1gtk_1page_1setup_1get_1left_1margin_FUNC,
_1gtk_1page_1setup_1get_1orientation_FUNC,
@@ -1122,8 +1107,6 @@ typedef enum {
_1gtk_1text_1view_1set_1tabs_FUNC,
_1gtk_1text_1view_1set_1wrap_1mode_FUNC,
_1gtk_1text_1view_1window_1to_1buffer_1coords_FUNC,
- _1gtk_1timeout_1add_FUNC,
- _1gtk_1timeout_1remove_FUNC,
_1gtk_1toggle_1button_1get_1active_FUNC,
_1gtk_1toggle_1button_1get_1inconsistent_FUNC,
_1gtk_1toggle_1button_1new_FUNC,
@@ -1248,6 +1231,7 @@ typedef enum {
_1gtk_1tree_1view_1column_1set_1title_FUNC,
_1gtk_1tree_1view_1column_1set_1visible_FUNC,
_1gtk_1tree_1view_1column_1set_1widget_FUNC,
+ _1gtk_1tree_1view_1convert_1widget_1to_1bin_1window_1coords_FUNC,
_1gtk_1tree_1view_1create_1row_1drag_1icon_FUNC,
_1gtk_1tree_1view_1expand_1row_FUNC,
_1gtk_1tree_1view_1get_1background_1area_FUNC,
@@ -1277,7 +1261,6 @@ typedef enum {
_1gtk_1tree_1view_1set_1model_FUNC,
_1gtk_1tree_1view_1set_1rules_1hint_FUNC,
_1gtk_1tree_1view_1set_1search_1column_FUNC,
- _1gtk_1tree_1view_1tree_1to_1widget_1coords_FUNC,
_1gtk_1tree_1view_1unset_1rows_1drag_1dest_FUNC,
_1gtk_1tree_1view_1widget_1to_1tree_1coords_FUNC,
_1gtk_1vbox_1new_FUNC,
@@ -1313,6 +1296,7 @@ typedef enum {
_1gtk_1widget_1get_1parent_1window_FUNC,
_1gtk_1widget_1get_1size_1request_FUNC,
_1gtk_1widget_1get_1style_FUNC,
+ _1gtk_1widget_1get_1tooltip_1text_FUNC,
_1gtk_1widget_1get_1toplevel_FUNC,
_1gtk_1widget_1grab_1focus_FUNC,
_1gtk_1widget_1hide_FUNC,
@@ -1418,6 +1402,7 @@ typedef enum {
_1pango_1attr_1underline_1color_1new_FUNC,
_1pango_1attr_1underline_1new_FUNC,
_1pango_1attr_1weight_1new_FUNC,
+ _1pango_1attribute_1copy_FUNC,
_1pango_1cairo_1context_1get_1font_1options_FUNC,
_1pango_1cairo_1context_1set_1font_1options_FUNC,
_1pango_1cairo_1create_1layout_FUNC,
@@ -1718,16 +1703,6 @@ typedef enum {
memmove__Lorg_eclipse_swt_internal_gtk_GtkColorSelectionDialog_2J_FUNC,
#endif
#ifndef JNI64
- memmove__Lorg_eclipse_swt_internal_gtk_GtkCombo_2I_FUNC,
-#else
- memmove__Lorg_eclipse_swt_internal_gtk_GtkCombo_2J_FUNC,
-#endif
-#ifndef JNI64
- memmove__Lorg_eclipse_swt_internal_gtk_GtkFileSelection_2I_FUNC,
-#else
- memmove__Lorg_eclipse_swt_internal_gtk_GtkFileSelection_2J_FUNC,
-#endif
-#ifndef JNI64
memmove__Lorg_eclipse_swt_internal_gtk_GtkFixed_2I_FUNC,
#else
memmove__Lorg_eclipse_swt_internal_gtk_GtkFixed_2J_FUNC,
@@ -1804,4 +1779,5 @@ typedef enum {
#endif
pangoLayoutNewProc_1CALLBACK_FUNC,
realpath_FUNC,
+ strcmp_FUNC,
} OS_FUNCS;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.c
index 8c72e96604..f40d3a9bce 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.c
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2000, 2011 IBM Corporation and others. All rights reserved.
* The contents of this file are made available under the terms
* of the GNU Lesser General Public License (LGPL) Version 2.1 that
* accompanies this distribution (lgpl-v21.txt). The LGPL is also
@@ -1506,128 +1506,6 @@ void setGtkColorSelectionDialogFields(JNIEnv *env, jobject lpObject, GtkColorSel
}
#endif
-#ifndef NO_GtkCombo
-typedef struct GtkCombo_FID_CACHE {
- int cached;
- jclass clazz;
- jfieldID entry, list;
-} GtkCombo_FID_CACHE;
-
-GtkCombo_FID_CACHE GtkComboFc;
-
-void cacheGtkComboFields(JNIEnv *env, jobject lpObject)
-{
- if (GtkComboFc.cached) return;
- GtkComboFc.clazz = (*env)->GetObjectClass(env, lpObject);
- GtkComboFc.entry = (*env)->GetFieldID(env, GtkComboFc.clazz, "entry", I_J);
- GtkComboFc.list = (*env)->GetFieldID(env, GtkComboFc.clazz, "list", I_J);
- GtkComboFc.cached = 1;
-}
-
-GtkCombo *getGtkComboFields(JNIEnv *env, jobject lpObject, GtkCombo *lpStruct)
-{
- if (!GtkComboFc.cached) cacheGtkComboFields(env, lpObject);
- lpStruct->entry = (GtkWidget *)(*env)->GetIntLongField(env, lpObject, GtkComboFc.entry);
- lpStruct->list = (GtkWidget *)(*env)->GetIntLongField(env, lpObject, GtkComboFc.list);
- return lpStruct;
-}
-
-void setGtkComboFields(JNIEnv *env, jobject lpObject, GtkCombo *lpStruct)
-{
- if (!GtkComboFc.cached) cacheGtkComboFields(env, lpObject);
- (*env)->SetIntLongField(env, lpObject, GtkComboFc.entry, (jintLong)lpStruct->entry);
- (*env)->SetIntLongField(env, lpObject, GtkComboFc.list, (jintLong)lpStruct->list);
-}
-#endif
-
-#ifndef NO_GtkFileSelection
-typedef struct GtkFileSelection_FID_CACHE {
- int cached;
- jclass clazz;
- jfieldID dir_list, file_list, selection_entry, selection_text, main_vbox, ok_button, cancel_button, help_button, history_pulldown, history_menu, history_list, fileop_dialog, fileop_entry, fileop_file, cmpl_state, fileop_c_dir, fileop_del_file, fileop_ren_file, button_area, action_area;
-} GtkFileSelection_FID_CACHE;
-
-GtkFileSelection_FID_CACHE GtkFileSelectionFc;
-
-void cacheGtkFileSelectionFields(JNIEnv *env, jobject lpObject)
-{
- if (GtkFileSelectionFc.cached) return;
- GtkFileSelectionFc.clazz = (*env)->GetObjectClass(env, lpObject);
- GtkFileSelectionFc.dir_list = (*env)->GetFieldID(env, GtkFileSelectionFc.clazz, "dir_list", I_J);
- GtkFileSelectionFc.file_list = (*env)->GetFieldID(env, GtkFileSelectionFc.clazz, "file_list", I_J);
- GtkFileSelectionFc.selection_entry = (*env)->GetFieldID(env, GtkFileSelectionFc.clazz, "selection_entry", I_J);
- GtkFileSelectionFc.selection_text = (*env)->GetFieldID(env, GtkFileSelectionFc.clazz, "selection_text", I_J);
- GtkFileSelectionFc.main_vbox = (*env)->GetFieldID(env, GtkFileSelectionFc.clazz, "main_vbox", I_J);
- GtkFileSelectionFc.ok_button = (*env)->GetFieldID(env, GtkFileSelectionFc.clazz, "ok_button", I_J);
- GtkFileSelectionFc.cancel_button = (*env)->GetFieldID(env, GtkFileSelectionFc.clazz, "cancel_button", I_J);
- GtkFileSelectionFc.help_button = (*env)->GetFieldID(env, GtkFileSelectionFc.clazz, "help_button", I_J);
- GtkFileSelectionFc.history_pulldown = (*env)->GetFieldID(env, GtkFileSelectionFc.clazz, "history_pulldown", I_J);
- GtkFileSelectionFc.history_menu = (*env)->GetFieldID(env, GtkFileSelectionFc.clazz, "history_menu", I_J);
- GtkFileSelectionFc.history_list = (*env)->GetFieldID(env, GtkFileSelectionFc.clazz, "history_list", I_J);
- GtkFileSelectionFc.fileop_dialog = (*env)->GetFieldID(env, GtkFileSelectionFc.clazz, "fileop_dialog", I_J);
- GtkFileSelectionFc.fileop_entry = (*env)->GetFieldID(env, GtkFileSelectionFc.clazz, "fileop_entry", I_J);
- GtkFileSelectionFc.fileop_file = (*env)->GetFieldID(env, GtkFileSelectionFc.clazz, "fileop_file", I_J);
- GtkFileSelectionFc.cmpl_state = (*env)->GetFieldID(env, GtkFileSelectionFc.clazz, "cmpl_state", I_J);
- GtkFileSelectionFc.fileop_c_dir = (*env)->GetFieldID(env, GtkFileSelectionFc.clazz, "fileop_c_dir", I_J);
- GtkFileSelectionFc.fileop_del_file = (*env)->GetFieldID(env, GtkFileSelectionFc.clazz, "fileop_del_file", I_J);
- GtkFileSelectionFc.fileop_ren_file = (*env)->GetFieldID(env, GtkFileSelectionFc.clazz, "fileop_ren_file", I_J);
- GtkFileSelectionFc.button_area = (*env)->GetFieldID(env, GtkFileSelectionFc.clazz, "button_area", I_J);
- GtkFileSelectionFc.action_area = (*env)->GetFieldID(env, GtkFileSelectionFc.clazz, "action_area", I_J);
- GtkFileSelectionFc.cached = 1;
-}
-
-GtkFileSelection *getGtkFileSelectionFields(JNIEnv *env, jobject lpObject, GtkFileSelection *lpStruct)
-{
- if (!GtkFileSelectionFc.cached) cacheGtkFileSelectionFields(env, lpObject);
- lpStruct->dir_list = (GtkWidget *)(*env)->GetIntLongField(env, lpObject, GtkFileSelectionFc.dir_list);
- lpStruct->file_list = (GtkWidget *)(*env)->GetIntLongField(env, lpObject, GtkFileSelectionFc.file_list);
- lpStruct->selection_entry = (GtkWidget *)(*env)->GetIntLongField(env, lpObject, GtkFileSelectionFc.selection_entry);
- lpStruct->selection_text = (GtkWidget *)(*env)->GetIntLongField(env, lpObject, GtkFileSelectionFc.selection_text);
- lpStruct->main_vbox = (GtkWidget *)(*env)->GetIntLongField(env, lpObject, GtkFileSelectionFc.main_vbox);
- lpStruct->ok_button = (GtkWidget *)(*env)->GetIntLongField(env, lpObject, GtkFileSelectionFc.ok_button);
- lpStruct->cancel_button = (GtkWidget *)(*env)->GetIntLongField(env, lpObject, GtkFileSelectionFc.cancel_button);
- lpStruct->help_button = (GtkWidget *)(*env)->GetIntLongField(env, lpObject, GtkFileSelectionFc.help_button);
- lpStruct->history_pulldown = (GtkWidget *)(*env)->GetIntLongField(env, lpObject, GtkFileSelectionFc.history_pulldown);
- lpStruct->history_menu = (GtkWidget *)(*env)->GetIntLongField(env, lpObject, GtkFileSelectionFc.history_menu);
- lpStruct->history_list = (GList *)(*env)->GetIntLongField(env, lpObject, GtkFileSelectionFc.history_list);
- lpStruct->fileop_dialog = (GtkWidget *)(*env)->GetIntLongField(env, lpObject, GtkFileSelectionFc.fileop_dialog);
- lpStruct->fileop_entry = (GtkWidget *)(*env)->GetIntLongField(env, lpObject, GtkFileSelectionFc.fileop_entry);
- lpStruct->fileop_file = (gchar *)(*env)->GetIntLongField(env, lpObject, GtkFileSelectionFc.fileop_file);
- lpStruct->cmpl_state = (gpointer)(*env)->GetIntLongField(env, lpObject, GtkFileSelectionFc.cmpl_state);
- lpStruct->fileop_c_dir = (GtkWidget *)(*env)->GetIntLongField(env, lpObject, GtkFileSelectionFc.fileop_c_dir);
- lpStruct->fileop_del_file = (GtkWidget *)(*env)->GetIntLongField(env, lpObject, GtkFileSelectionFc.fileop_del_file);
- lpStruct->fileop_ren_file = (GtkWidget *)(*env)->GetIntLongField(env, lpObject, GtkFileSelectionFc.fileop_ren_file);
- lpStruct->button_area = (GtkWidget *)(*env)->GetIntLongField(env, lpObject, GtkFileSelectionFc.button_area);
- lpStruct->action_area = (GtkWidget *)(*env)->GetIntLongField(env, lpObject, GtkFileSelectionFc.action_area);
- return lpStruct;
-}
-
-void setGtkFileSelectionFields(JNIEnv *env, jobject lpObject, GtkFileSelection *lpStruct)
-{
- if (!GtkFileSelectionFc.cached) cacheGtkFileSelectionFields(env, lpObject);
- (*env)->SetIntLongField(env, lpObject, GtkFileSelectionFc.dir_list, (jintLong)lpStruct->dir_list);
- (*env)->SetIntLongField(env, lpObject, GtkFileSelectionFc.file_list, (jintLong)lpStruct->file_list);
- (*env)->SetIntLongField(env, lpObject, GtkFileSelectionFc.selection_entry, (jintLong)lpStruct->selection_entry);
- (*env)->SetIntLongField(env, lpObject, GtkFileSelectionFc.selection_text, (jintLong)lpStruct->selection_text);
- (*env)->SetIntLongField(env, lpObject, GtkFileSelectionFc.main_vbox, (jintLong)lpStruct->main_vbox);
- (*env)->SetIntLongField(env, lpObject, GtkFileSelectionFc.ok_button, (jintLong)lpStruct->ok_button);
- (*env)->SetIntLongField(env, lpObject, GtkFileSelectionFc.cancel_button, (jintLong)lpStruct->cancel_button);
- (*env)->SetIntLongField(env, lpObject, GtkFileSelectionFc.help_button, (jintLong)lpStruct->help_button);
- (*env)->SetIntLongField(env, lpObject, GtkFileSelectionFc.history_pulldown, (jintLong)lpStruct->history_pulldown);
- (*env)->SetIntLongField(env, lpObject, GtkFileSelectionFc.history_menu, (jintLong)lpStruct->history_menu);
- (*env)->SetIntLongField(env, lpObject, GtkFileSelectionFc.history_list, (jintLong)lpStruct->history_list);
- (*env)->SetIntLongField(env, lpObject, GtkFileSelectionFc.fileop_dialog, (jintLong)lpStruct->fileop_dialog);
- (*env)->SetIntLongField(env, lpObject, GtkFileSelectionFc.fileop_entry, (jintLong)lpStruct->fileop_entry);
- (*env)->SetIntLongField(env, lpObject, GtkFileSelectionFc.fileop_file, (jintLong)lpStruct->fileop_file);
- (*env)->SetIntLongField(env, lpObject, GtkFileSelectionFc.cmpl_state, (jintLong)lpStruct->cmpl_state);
- (*env)->SetIntLongField(env, lpObject, GtkFileSelectionFc.fileop_c_dir, (jintLong)lpStruct->fileop_c_dir);
- (*env)->SetIntLongField(env, lpObject, GtkFileSelectionFc.fileop_del_file, (jintLong)lpStruct->fileop_del_file);
- (*env)->SetIntLongField(env, lpObject, GtkFileSelectionFc.fileop_ren_file, (jintLong)lpStruct->fileop_ren_file);
- (*env)->SetIntLongField(env, lpObject, GtkFileSelectionFc.button_area, (jintLong)lpStruct->button_area);
- (*env)->SetIntLongField(env, lpObject, GtkFileSelectionFc.action_area, (jintLong)lpStruct->action_area);
-}
-#endif
-
#ifndef NO_GtkFixed
typedef struct GtkFixed_FID_CACHE {
int cached;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.h
index 6435b83221..eec80eb652 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.h
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2000, 2011 IBM Corporation and others. All rights reserved.
* The contents of this file are made available under the terms
* of the GNU Lesser General Public License (LGPL) Version 2.1 that
* accompanies this distribution (lgpl-v21.txt). The LGPL is also
@@ -363,30 +363,6 @@ void setGtkColorSelectionDialogFields(JNIEnv *env, jobject lpObject, GtkColorSel
#define GtkColorSelectionDialog_sizeof() 0
#endif
-#ifndef NO_GtkCombo
-void cacheGtkComboFields(JNIEnv *env, jobject lpObject);
-GtkCombo *getGtkComboFields(JNIEnv *env, jobject lpObject, GtkCombo *lpStruct);
-void setGtkComboFields(JNIEnv *env, jobject lpObject, GtkCombo *lpStruct);
-#define GtkCombo_sizeof() sizeof(GtkCombo)
-#else
-#define cacheGtkComboFields(a,b)
-#define getGtkComboFields(a,b,c) NULL
-#define setGtkComboFields(a,b,c)
-#define GtkCombo_sizeof() 0
-#endif
-
-#ifndef NO_GtkFileSelection
-void cacheGtkFileSelectionFields(JNIEnv *env, jobject lpObject);
-GtkFileSelection *getGtkFileSelectionFields(JNIEnv *env, jobject lpObject, GtkFileSelection *lpStruct);
-void setGtkFileSelectionFields(JNIEnv *env, jobject lpObject, GtkFileSelection *lpStruct);
-#define GtkFileSelection_sizeof() sizeof(GtkFileSelection)
-#else
-#define cacheGtkFileSelectionFields(a,b)
-#define getGtkFileSelectionFields(a,b,c) NULL
-#define setGtkFileSelectionFields(a,b,c)
-#define GtkFileSelection_sizeof() 0
-#endif
-
#ifndef NO_GtkFixed
void cacheGtkFixedFields(JNIEnv *env, jobject lpObject);
GtkFixed *getGtkFixedFields(JNIEnv *env, jobject lpObject, GtkFixed *lpStruct);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/accessibility/gtk/AtkActionIface.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/accessibility/gtk/AtkActionIface.java
index 94409fc72b..c40efa1861 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/accessibility/gtk/AtkActionIface.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/accessibility/gtk/AtkActionIface.java
@@ -21,11 +21,11 @@ public class AtkActionIface {
public int /*long*/ do_action;
/** @field cast=(gint (*)()) */
public int /*long*/ get_n_actions;
- /** @field cast=(G_CONST_RETURN gchar *(*)()) */
+ /** @field cast=(const gchar *(*)()) */
public int /*long*/ get_description;
- /** @field cast=(G_CONST_RETURN gchar *(*)()) */
+ /** @field cast=(const gchar *(*)()) */
public int /*long*/ get_name;
- /** @field cast=(G_CONST_RETURN gchar *(*)()) */
+ /** @field cast=(const gchar *(*)()) */
public int /*long*/ get_keybinding;
/** @field cast=(gboolean (*)()) */
public int /*long*/ set_description;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/accessibility/gtk/AtkObjectClass.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/accessibility/gtk/AtkObjectClass.java
index c631c29248..934e5b2e28 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/accessibility/gtk/AtkObjectClass.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/accessibility/gtk/AtkObjectClass.java
@@ -16,9 +16,9 @@ package org.eclipse.swt.internal.accessibility.gtk;
public class AtkObjectClass {
- /** @field cast=(G_CONST_RETURN gchar *(*)()) */
+ /** @field cast=(const gchar *(*)()) */
public int /*long*/ get_name;
- /** @field cast=(G_CONST_RETURN gchar *(*)()) */
+ /** @field cast=(const gchar *(*)()) */
public int /*long*/ get_description;
/** @field cast=(AtkObject *(*)()) */
public int /*long*/ get_parent;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/accessibility/gtk/AtkTableIface.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/accessibility/gtk/AtkTableIface.java
index 9cbc506c24..2c1d3c8479 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/accessibility/gtk/AtkTableIface.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/accessibility/gtk/AtkTableIface.java
@@ -34,11 +34,11 @@ public class AtkTableIface {
public int /*long*/ get_row_extent_at;
/** @field cast=(AtkObject* (*)()) */
public int /*long*/ get_caption;
- /** @field cast=(G_CONST_RETURN gchar* (*)()) */
+ /** @field cast=(const gchar* (*)()) */
public int /*long*/ get_column_description;
/** @field cast=(AtkObject* (*)()) */
public int /*long*/ get_column_header;
- /** @field cast=(G_CONST_RETURN gchar* (*)()) */
+ /** @field cast=(const gchar* (*)()) */
public int /*long*/ get_row_description;
/** @field cast=(AtkObject* (*)()) */
public int /*long*/ get_row_header;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCombo.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCombo.java
deleted file mode 100644
index d9e4a585c7..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCombo.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved.
- * The contents of this file are made available under the terms
- * of the GNU Lesser General Public License (LGPL) Version 2.1 that
- * accompanies this distribution (lgpl-v21.txt). The LGPL is also
- * available at http://www.gnu.org/licenses/lgpl.html. If the version
- * of the LGPL at http://www.gnu.org is different to the version of
- * the LGPL accompanying this distribution and there is any conflict
- * between the two license versions, the terms of the LGPL accompanying
- * this distribution shall govern.
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.internal.gtk;
-
-
-public class GtkCombo {
- /** @field cast=(GtkWidget *) */
- public int /*long*/ entry;
- /** @field cast=(GtkWidget *) */
- public int /*long*/ list;
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkFileSelection.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkFileSelection.java
deleted file mode 100644
index 8e0d8621e0..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkFileSelection.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved.
- * The contents of this file are made available under the terms
- * of the GNU Lesser General Public License (LGPL) Version 2.1 that
- * accompanies this distribution (lgpl-v21.txt). The LGPL is also
- * available at http://www.gnu.org/licenses/lgpl.html. If the version
- * of the LGPL at http://www.gnu.org is different to the version of
- * the LGPL accompanying this distribution and there is any conflict
- * between the two license versions, the terms of the LGPL accompanying
- * this distribution shall govern.
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.internal.gtk;
-
-
-public class GtkFileSelection {
- /** @field cast=(GtkWidget *) */
- public int /*long*/ dir_list;
- /** @field cast=(GtkWidget *) */
- public int /*long*/ file_list;
- /** @field cast=(GtkWidget *) */
- public int /*long*/ selection_entry;
- /** @field cast=(GtkWidget *) */
- public int /*long*/ selection_text;
- /** @field cast=(GtkWidget *) */
- public int /*long*/ main_vbox;
- /** @field cast=(GtkWidget *) */
- public int /*long*/ ok_button;
- /** @field cast=(GtkWidget *) */
- public int /*long*/ cancel_button;
- /** @field cast=(GtkWidget *) */
- public int /*long*/ help_button;
- /** @field cast=(GtkWidget *) */
- public int /*long*/ history_pulldown;
- /** @field cast=(GtkWidget *) */
- public int /*long*/ history_menu;
- /** @field cast=(GList *) */
- public int /*long*/ history_list;
- /** @field cast=(GtkWidget *) */
- public int /*long*/ fileop_dialog;
- /** @field cast=(GtkWidget *) */
- public int /*long*/ fileop_entry;
- /** @field cast=(gchar *) */
- public int /*long*/ fileop_file;
- /** @field cast=(gpointer) */
- public int /*long*/ cmpl_state; // gpointer
- /** @field cast=(GtkWidget *) */
- public int /*long*/ fileop_c_dir;
- /** @field cast=(GtkWidget *) */
- public int /*long*/ fileop_del_file;
- /** @field cast=(GtkWidget *) */
- public int /*long*/ fileop_ren_file;
- /** @field cast=(GtkWidget *) */
- public int /*long*/ button_area;
- /** @field cast=(GtkWidget *) */
- public int /*long*/ action_area;
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
index d0da503b28..fbf666d419 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
@@ -624,8 +624,6 @@ public static final native int GtkAdjustment_sizeof();
public static final native int GtkAllocation_sizeof();
public static final native int GtkBorder_sizeof();
public static final native int GtkColorSelectionDialog_sizeof();
-public static final native int GtkCombo_sizeof();
-public static final native int GtkFileSelection_sizeof();
public static final native int GtkFixed_sizeof();
public static final native int GtkFixedClass_sizeof();
public static final native int GtkRequisition_sizeof();
@@ -721,6 +719,10 @@ public static final native int /*long*/ GTK_TOOLTIPS_TIP_WINDOW(int /*long*/ wid
* @param data cast=(GtkTooltipsData *)
*/
public static final native void GTK_TOOLTIPS_SET_ACTIVE(int /*long*/ widget, int /*long*/ data);
+/**
+ * @param data cast=(GtkTooltipsData *)
+ */
+public static final native int /*long*/ GTK_TOOLTIPS_GET_TIP_TEXT(int /*long*/ data);
/** @param widget cast=(GtkWidget *) */
public static final native void GTK_WIDGET_SET_HEIGHT(int /*long*/ widget, int height);
/** @param widget cast=(GtkWidget *) */
@@ -1721,15 +1723,6 @@ public static final boolean GTK_WIDGET_HAS_FOCUS(int /*long*/ wid) {
lock.unlock();
}
}
-public static final native boolean _GTK_WIDGET_IS_SENSITIVE(int /*long*/ wid);
-public static final boolean GTK_WIDGET_IS_SENSITIVE(int /*long*/ wid) {
- lock.lock();
- try {
- return _GTK_WIDGET_IS_SENSITIVE(wid);
- } finally {
- lock.unlock();
- }
-}
public static final native boolean _GTK_WIDGET_MAPPED(int /*long*/ wid);
public static final boolean GTK_WIDGET_MAPPED(int /*long*/ wid) {
lock.lock();
@@ -2144,6 +2137,16 @@ public static final int /*long*/ g_file_new_for_path(byte[] fileName) {
}
}
/** @method flags=dynamic */
+public static final native int /*long*/ _g_file_new_for_commandline_arg(byte[] fileName);
+public static final int /*long*/ g_file_new_for_commandline_arg(byte[] fileName) {
+ lock.lock();
+ try {
+ return _g_file_new_for_commandline_arg(fileName);
+ } finally {
+ lock.unlock();
+ }
+}
+/** @method flags=dynamic */
public static final native int /*long*/ _g_file_new_for_uri(byte[] fileName);
public static final int /*long*/ g_file_new_for_uri(byte[] fileName) {
lock.lock();
@@ -3657,6 +3660,16 @@ public static final void gdk_cairo_set_source_color(int /*long*/ cairo, GdkColor
lock.unlock();
}
}
+/** @param color cast=(GdkColor *) */
+public static final native void _gdk_color_free(int /*long*/ color);
+public static final void gdk_color_free(int /*long*/ color) {
+ lock.lock();
+ try {
+ _gdk_color_free(color);
+ } finally {
+ lock.unlock();
+ }
+}
/**
* @method flags=dynamic
* @param window cast=(GdkWindow *)
@@ -6142,6 +6155,16 @@ public static final void gtk_cell_layout_clear(int /*long*/ cell_layout) {
lock.unlock();
}
}
+/** @method flags=dynamic */
+public static final native int /*long*/ _gtk_cell_layout_get_cells(int /*long*/ cell_layout);
+public static final int /*long*/ gtk_cell_layout_get_cells(int /*long*/ cell_layout) {
+ lock.lock();
+ try {
+ return _gtk_cell_layout_get_cells(cell_layout);
+ } finally {
+ lock.unlock();
+ }
+}
/** @method flags=no_gen */
public static final native void _gtk_cell_layout_set_attributes(int /*long*/ cell_layout, int /*long*/ cell, byte[] attribute, int column, int /*long*/ sentinel);
public static final void gtk_cell_layout_set_attributes(int /*long*/ cell_layout, int /*long*/ cell, byte[] attribute, int column, int /*long*/ sentinel) {
@@ -6399,38 +6422,6 @@ public static final void gtk_color_selection_set_has_palette(int /*long*/ colors
lock.unlock();
}
}
-/** @param combo cast=(GtkCombo *) */
-public static final native void _gtk_combo_disable_activate(int /*long*/ combo);
-public static final void gtk_combo_disable_activate(int /*long*/ combo) {
- lock.lock();
- try {
- _gtk_combo_disable_activate(combo);
- } finally {
- lock.unlock();
- }
-}
-public static final native int /*long*/ _gtk_combo_new();
-public static final int /*long*/ gtk_combo_new() {
- lock.lock();
- try {
- return _gtk_combo_new();
- } finally {
- lock.unlock();
- }
-}
-/**
- * @param combo cast=(GtkCombo *)
- * @param val cast=(gboolean)
- */
-public static final native void _gtk_combo_set_case_sensitive(int /*long*/ combo, boolean val);
-public static final void gtk_combo_set_case_sensitive(int /*long*/ combo, boolean val) {
- lock.lock();
- try {
- _gtk_combo_set_case_sensitive(combo, val);
- } finally {
- lock.unlock();
- }
-}
/** @method flags=dynamic */
public static final native void _gtk_combo_box_set_focus_on_click(int /*long*/ combo, boolean val);
public static final void gtk_combo_box_set_focus_on_click(int /*long*/ combo, boolean val) {
@@ -6441,19 +6432,6 @@ public static final void gtk_combo_box_set_focus_on_click(int /*long*/ combo, bo
lock.unlock();
}
}
-/**
- * @param combo cast=(GtkCombo *)
- * @param strings cast=(GList *)
- */
-public static final native void _gtk_combo_set_popdown_strings(int /*long*/ combo, int /*long*/ strings);
-public static final void gtk_combo_set_popdown_strings(int /*long*/ combo, int /*long*/ strings) {
- lock.lock();
- try {
- _gtk_combo_set_popdown_strings(combo, strings);
- } finally {
- lock.unlock();
- }
-}
/** @method flags=dynamic */
public static final native int /*long*/ _gtk_combo_box_entry_new_text();
public static final int /*long*/ gtk_combo_box_entry_new_text() {
@@ -7438,72 +7416,6 @@ public static final void gtk_file_filter_set_name(int /*long*/ filter, byte[] na
lock.unlock();
}
}
-/** @param filesel cast=(GtkFileSelection *) */
-public static final native int /*long*/ _gtk_file_selection_get_filename(int /*long*/ filesel);
-public static final int /*long*/ gtk_file_selection_get_filename(int /*long*/ filesel) {
- lock.lock();
- try {
- return _gtk_file_selection_get_filename(filesel);
- } finally {
- lock.unlock();
- }
-}
-/** @param filesel cast=(GtkFileSelection *) */
-public static final native int /*long*/ _gtk_file_selection_get_selections(int /*long*/ filesel);
-public static final int /*long*/ gtk_file_selection_get_selections(int /*long*/ filesel) {
- lock.lock();
- try {
- return _gtk_file_selection_get_selections(filesel);
- } finally {
- lock.unlock();
- }
-}
-/** @param filesel cast=(GtkFileSelection *) */
-public static final native void _gtk_file_selection_hide_fileop_buttons(int /*long*/ filesel);
-public static final void gtk_file_selection_hide_fileop_buttons(int /*long*/ filesel) {
- lock.lock();
- try {
- _gtk_file_selection_hide_fileop_buttons(filesel);
- } finally {
- lock.unlock();
- }
-}
-/** @param title cast=(const gchar *) */
-public static final native int /*long*/ _gtk_file_selection_new(byte[] title);
-public static final int /*long*/ gtk_file_selection_new(byte[] title) {
- lock.lock();
- try {
- return _gtk_file_selection_new(title);
- } finally {
- lock.unlock();
- }
-}
-/**
- * @param filesel cast=(GtkFileSelection *)
- * @param filename cast=(const gchar *)
- */
-public static final native void _gtk_file_selection_set_filename(int /*long*/ filesel, int /*long*/ filename);
-public static final void gtk_file_selection_set_filename(int /*long*/ filesel, int /*long*/ filename) {
- lock.lock();
- try {
- _gtk_file_selection_set_filename(filesel, filename);
- } finally {
- lock.unlock();
- }
-}
-/**
- * @param filesel cast=(GtkFileSelection *)
- * @param select_multiple cast=(gboolean)
- */
-public static final native void _gtk_file_selection_set_select_multiple(int /*long*/ filesel, boolean select_multiple);
-public static final void gtk_file_selection_set_select_multiple(int /*long*/ filesel, boolean select_multiple) {
- lock.lock();
- try {
- _gtk_file_selection_set_select_multiple(filesel, select_multiple);
- } finally {
- lock.unlock();
- }
-}
/**
* @param fixed cast=(GtkFixed *)
* @param widget cast=(GtkWidget *)
@@ -8207,95 +8119,6 @@ public static final void gtk_label_set_text_with_mnemonic(int /*long*/ label, by
}
}
/**
- * @param list cast=(GtkList *)
- * @param items cast=(GList *)
- */
-public static final native void _gtk_list_append_items(int /*long*/ list, int /*long*/ items);
-public static final void gtk_list_append_items(int /*long*/ list, int /*long*/ items) {
- lock.lock();
- try {
- _gtk_list_append_items(list, items);
- } finally {
- lock.unlock();
- }
-}
-/** @param list cast=(GtkList *) */
-public static final native void _gtk_list_clear_items(int /*long*/ list, int start, int end);
-public static final void gtk_list_clear_items(int /*long*/ list, int start, int end) {
- lock.lock();
- try {
- _gtk_list_clear_items(list, start, end);
- } finally {
- lock.unlock();
- }
-}
-/**
- * @param list cast=(GtkList *)
- * @param items cast=(GList *)
- */
-public static final native void _gtk_list_insert_items(int /*long*/ list, int /*long*/ items, int position);
-public static final void gtk_list_insert_items(int /*long*/ list, int /*long*/ items, int position) {
- lock.lock();
- try {
- _gtk_list_insert_items(list, items, position);
- } finally {
- lock.unlock();
- }
-}
-/** @param label cast=(const gchar *) */
-public static final native int /*long*/ _gtk_list_item_new_with_label(byte[] label);
-public static final int /*long*/ gtk_list_item_new_with_label(byte[] label) {
- lock.lock();
- try {
- return _gtk_list_item_new_with_label(label);
- } finally {
- lock.unlock();
- }
-}
-/**
- * @param list cast=(GtkList *)
- * @param items cast=(GList *)
- */
-public static final native void _gtk_list_remove_items(int /*long*/ list, int /*long*/ items);
-public static final void gtk_list_remove_items(int /*long*/ list, int /*long*/ items) {
- lock.lock();
- try {
- _gtk_list_remove_items(list, items);
- } finally {
- lock.unlock();
- }
-}
-/** @param list cast=(GtkList *) */
-public static final native void _gtk_list_select_item(int /*long*/ list, int item);
-public static final void gtk_list_select_item(int /*long*/ list, int item) {
- lock.lock();
- try {
- _gtk_list_select_item(list, item);
- } finally {
- lock.unlock();
- }
-}
-/** @param list cast=(GtkList *) */
-public static final native void _gtk_list_unselect_all(int /*long*/ list);
-public static final void gtk_list_unselect_all(int /*long*/ list) {
- lock.lock();
- try {
- _gtk_list_unselect_all(list);
- } finally {
- lock.unlock();
- }
-}
-/** @param list cast=(GtkList *) */
-public static final native void _gtk_list_unselect_item(int /*long*/ list, int item);
-public static final void gtk_list_unselect_item(int /*long*/ list, int item) {
- lock.lock();
- try {
- _gtk_list_unselect_item(list, item);
- } finally {
- lock.unlock();
- }
-}
-/**
* @param list_store cast=(GtkListStore *)
* @param iter cast=(GtkTreeIter *)
*/
@@ -8501,7 +8324,10 @@ public static final int /*long*/ gtk_menu_get_attach_widget(int /*long*/ menu) {
lock.unlock();
}
}
-/** @param menu_item cast=(GtkMenuItem *) */
+/**
+ * @method flags=dynamic
+ * @param menu_item cast=(GtkMenuItem *)
+ */
public static final native void _gtk_menu_item_remove_submenu(int /*long*/ menu_item);
public static final void gtk_menu_item_remove_submenu(int /*long*/ menu_item) {
lock.lock();
@@ -8791,6 +8617,20 @@ public static final void gtk_object_sink(int /*long*/ object) {
lock.unlock();
}
}
+/**
+ * @method flags=dynamic
+ * @param toolbar cast=(GtkOrientable *)
+ * @param orientation cast=(GtkOrientation)
+ */
+public static final native void _gtk_orientable_set_orientation(int /*long*/ orientable, int orientation);
+public static final void gtk_orientable_set_orientation(int /*long*/ orientable, int orientation) {
+ lock.lock();
+ try {
+ _gtk_orientable_set_orientation(orientable, orientation);
+ } finally {
+ lock.unlock();
+ }
+}
/** @method flags=dynamic */
public static final native int /*long*/ _gtk_page_setup_new ();
public static final int /*long*/ gtk_page_setup_new () {
@@ -11211,24 +11051,14 @@ public static final void gtk_text_view_window_to_buffer_coords(int /*long*/ text
}
/**
* @param interval cast=(guint32)
- * @param function cast=(GtkFunction)
+ * @param function cast=(GSourceFunc)
* @param data cast=(gpointer)
*/
-public static final native int _gtk_timeout_add(int interval, int /*long*/ function, int /*long*/ data);
-public static final int gtk_timeout_add(int interval, int /*long*/ function, int /*long*/ data) {
- lock.lock();
- try {
- return _gtk_timeout_add(interval, function, data);
- } finally {
- lock.unlock();
- }
-}
-/** @param timeout_handler_id cast=(guint) */
-public static final native void _gtk_timeout_remove(int timeout_handler_id);
-public static final void gtk_timeout_remove(int timeout_handler_id) {
+public static final native int _g_timeout_add(int interval, int /*long*/ function, int /*long*/ data);
+public static final int g_timeout_add(int interval, int /*long*/ function, int /*long*/ data) {
lock.lock();
try {
- _gtk_timeout_remove(timeout_handler_id);
+ return _g_timeout_add(interval, function, data);
} finally {
lock.unlock();
}
@@ -11327,6 +11157,7 @@ public static final int /*long*/ gtk_toolbar_new() {
}
}
/**
+ * @method flags=dynamic
* @param toolbar cast=(GtkToolbar *)
* @param orientation cast=(GtkOrientation)
*/
@@ -11389,10 +11220,7 @@ public static final void gtk_tooltips_force_window(int /*long*/ tooltips) {
}
}
/**
- * @param tooltips cast=(GtkTooltips *)
- * @param widget cast=(GtkWidget *)
- * @param tip_text cast=(const gchar *)
- * @param tip_private cast=(const gchar *)
+ * @method flags=dynamic
*/
public static final native void _gtk_tooltips_set_tip(int /*long*/ tooltips, int /*long*/ widget, byte[] tip_text, byte[] tip_private);
public static final void gtk_tooltips_set_tip(int /*long*/ tooltips, int /*long*/ widget, byte[] tip_text, byte[] tip_private) {
@@ -12026,7 +11854,10 @@ public static final void gtk_tree_view_column_clear(int /*long*/ tree_column) {
lock.unlock();
}
}
-/** @param tree_column cast=(GtkTreeViewColumn *) */
+/**
+ * @method flags=dynamic
+ * @param tree_column cast=(GtkTreeViewColumn *)
+ */
public static final native int /*long*/ _gtk_tree_view_column_get_cell_renderers(int /*long*/ tree_column);
public static final int /*long*/ gtk_tree_view_column_get_cell_renderers(int /*long*/ tree_column) {
lock.lock();
@@ -12178,7 +12009,7 @@ public static final void gtk_tree_view_column_set_alignment(int /*long*/ tree_co
* @param cell_renderer cast=(GtkCellRenderer *)
* @param func cast=(GtkTreeCellDataFunc)
* @param func_data cast=(gpointer)
- * @param destroy cast=(GtkDestroyNotify)
+ * @param destroy cast=(GDestroyNotify)
*/
public static final native void _gtk_tree_view_column_set_cell_data_func(int /*long*/ tree_column, int /*long*/ cell_renderer, int /*long*/ func, int /*long*/ func_data, int /*long*/ destroy);
public static final void gtk_tree_view_column_set_cell_data_func(int /*long*/ tree_column, int /*long*/ cell_renderer, int /*long*/ func, int /*long*/ func_data, int /*long*/ destroy) {
@@ -12685,22 +12516,6 @@ public static final void gtk_tree_view_set_search_column(int /*long*/ tree_view,
lock.unlock();
}
}
-/**
- * @param tree_view cast=(GtkTreeView *)
- * @param tx cast=(gint)
- * @param ty cast=(gint)
- * @param wx cast=(gint *)
- * @param wy cast=(gint *)
- */
-public static final native void _gtk_tree_view_tree_to_widget_coords(int /*long*/ tree_view, int tx, int ty, int[] wx, int[] wy);
-public static final void gtk_tree_view_tree_to_widget_coords(int /*long*/ tree_view, int tx, int ty, int[] wx, int[] wy) {
- lock.lock();
- try {
- _gtk_tree_view_tree_to_widget_coords(tree_view, tx, ty, wx, wy);
- } finally {
- lock.unlock();
- }
-}
/** @param tree_view cast=(GtkTreeView *) */
public static final native void _gtk_tree_view_unset_rows_drag_dest(int /*long*/ tree_view);
public static final void gtk_tree_view_unset_rows_drag_dest(int /*long*/ tree_view) {
@@ -12711,7 +12526,10 @@ public static final void gtk_tree_view_unset_rows_drag_dest(int /*long*/ tree_vi
lock.unlock();
}
}
-/** @param tree_view cast=(GtkTreeView *) */
+/**
+ * @method flags=dynamic
+ * @param tree_view cast=(GtkTreeView *)
+ */
public static final native void _gtk_tree_view_widget_to_tree_coords(int /*long*/ tree_view, int wx, int wy, int[] tx, int[] ty);
public static final void gtk_tree_view_widget_to_tree_coords(int /*long*/ tree_view, int wx, int wy, int[] tx, int[] ty) {
lock.lock();
@@ -12721,6 +12539,19 @@ public static final void gtk_tree_view_widget_to_tree_coords(int /*long*/ tree_v
lock.unlock();
}
}
+/**
+ * @method flags=dynamic
+ * @param tree_view cast=(GtkTreeView *)
+ */
+public static final native void _gtk_tree_view_convert_widget_to_bin_window_coords(int /*long*/ tree_view, int wx, int wy, int[] tx, int[] ty);
+public static final void gtk_tree_view_convert_widget_to_bin_window_coords(int /*long*/ tree_view, int wx, int wy, int[] tx, int[] ty) {
+ lock.lock();
+ try {
+ _gtk_tree_view_convert_widget_to_bin_window_coords(tree_view, wx, wy, tx, ty);
+ } finally {
+ lock.unlock();
+ }
+}
/**
* @param homogeneous cast=(gboolean)
* @param spacing cast=(gint)
@@ -13006,6 +12837,16 @@ public static final int /*long*/ gtk_widget_get_toplevel (int /*long*/ widget) {
lock.unlock();
}
}
+/** @method flags=dynamic */
+public static final native int /*long*/ _gtk_widget_get_tooltip_text (int /*long*/ widget);
+public static final int /*long*/ gtk_widget_get_tooltip_text (int /*long*/ widget) {
+ lock.lock();
+ try {
+ return _gtk_widget_get_tooltip_text(widget);
+ } finally {
+ lock.unlock();
+ }
+}
/** @param widget cast=(GtkWidget *) */
public static final native void _gtk_widget_grab_focus(int /*long*/ widget);
public static final void gtk_widget_grab_focus(int /*long*/ widget) {
@@ -14001,11 +13842,6 @@ public static final native void memmove(GtkColorSelectionDialog dest, int /*long
* @param dest cast=(void *),flags=no_in
* @param src cast=(const void *)
*/
-public static final native void memmove(GtkFileSelection dest, int /*long*/ src);
-/**
- * @param dest cast=(void *),flags=no_in
- * @param src cast=(const void *)
- */
public static final native void memmove(GdkEventProperty dest, int /*long*/ src);
/**
* @param dest cast=(void *),flags=no_in
@@ -14031,11 +13867,6 @@ public static final native void memmove(GtkTargetPair dest, int /*long*/ src, in
* @param dest cast=(void *),flags=no_in
* @param src cast=(const void *)
*/
-public static final native void memmove(GtkCombo dest, int /*long*/ src);
-/**
- * @param dest cast=(void *),flags=no_in
- * @param src cast=(const void *)
- */
public static final native void memmove(GtkAdjustment dest, int /*long*/ src);
/**
* @param dest cast=(void *),flags=no_in
@@ -14185,6 +14016,16 @@ public static final native void memmove(PangoLayoutRun dest, int /*long*/ src, i
* @param size cast=(size_t)
*/
public static final native void memmove(PangoLogAttr dest, int /*long*/ src, int /*long*/ size);
+/** @param attribute cast=(const PangoAttribute *) */
+public static final native int /*long*/ _pango_attribute_copy (int /*long*/ attribute);
+public static final int /*long*/ pango_attribute_copy (int /*long*/ attribute) {
+ lock.lock();
+ try {
+ return _pango_attribute_copy(attribute);
+ } finally {
+ lock.unlock();
+ }
+}
public static final native int /*long*/ _pango_attr_background_new (short red, short green, short blue);
public static final int /*long*/ pango_attr_background_new (short red, short green, short blue) {
lock.lock();
@@ -15409,4 +15250,9 @@ public static final int access (byte [] path, int amode) {
lock.unlock();
}
}
+/**
+ * @param s1 cast=(const char*)
+ * @param s2 cast=(const char*)
+ */
+public static final native int strcmp (int /*long*/ s1, byte [] s2);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c
index e5fd6e3c23..8f5cc01865 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c
@@ -4265,28 +4265,33 @@ fail:
#ifndef NO_GetDIBits
JNIEXPORT jint JNICALL OS_NATIVE(GetDIBits)
- (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jint arg2, jint arg3, jintLong arg4, jbyteArray arg5, jint arg6)
+ (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jint arg2, jint arg3, jbyteArray arg4, jbyteArray arg5, jint arg6)
{
+ jbyte *lparg4=NULL;
jbyte *lparg5=NULL;
jint rc = 0;
OS_NATIVE_ENTER(env, that, GetDIBits_FUNC);
#ifdef JNI_VERSION_1_2
if (IS_JNI_1_2) {
+ if (arg4) if ((lparg4 = (*env)->GetPrimitiveArrayCritical(env, arg4, NULL)) == NULL) goto fail;
if (arg5) if ((lparg5 = (*env)->GetPrimitiveArrayCritical(env, arg5, NULL)) == NULL) goto fail;
} else
#endif
{
+ if (arg4) if ((lparg4 = (*env)->GetByteArrayElements(env, arg4, NULL)) == NULL) goto fail;
if (arg5) if ((lparg5 = (*env)->GetByteArrayElements(env, arg5, NULL)) == NULL) goto fail;
}
- rc = (jint)GetDIBits((HDC)arg0, (HBITMAP)arg1, arg2, arg3, (LPVOID)arg4, (LPBITMAPINFO)lparg5, arg6);
+ rc = (jint)GetDIBits((HDC)arg0, (HBITMAP)arg1, arg2, arg3, (LPVOID)lparg4, (LPBITMAPINFO)lparg5, arg6);
fail:
#ifdef JNI_VERSION_1_2
if (IS_JNI_1_2) {
if (arg5 && lparg5) (*env)->ReleasePrimitiveArrayCritical(env, arg5, lparg5, 0);
+ if (arg4 && lparg4) (*env)->ReleasePrimitiveArrayCritical(env, arg4, lparg4, 0);
} else
#endif
{
if (arg5 && lparg5) (*env)->ReleaseByteArrayElements(env, arg5, lparg5, 0);
+ if (arg4 && lparg4) (*env)->ReleaseByteArrayElements(env, arg4, lparg4, 0);
}
OS_NATIVE_EXIT(env, that, GetDIBits_FUNC);
return rc;
@@ -6134,6 +6139,30 @@ fail:
}
#endif
+#ifndef NO_GetThemeBitmap
+JNIEXPORT jint JNICALL OS_NATIVE(GetThemeBitmap)
+ (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jint arg2, jint arg3, jint arg4, jintLongArray arg5)
+{
+ jintLong *lparg5=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, GetThemeBitmap_FUNC);
+ if (arg5) if ((lparg5 = (*env)->GetIntLongArrayElements(env, arg5, NULL)) == NULL) goto fail;
+/*
+ rc = (jint)GetThemeBitmap(arg0, arg1, arg2, arg3, arg4, lparg5);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, GetThemeBitmap)
+ if (fp) {
+ rc = (jint)((jint (CALLING_CONVENTION*)(jintLong, jint, jint, jint, jint, jintLong *))fp)(arg0, arg1, arg2, arg3, arg4, lparg5);
+ }
+ }
+fail:
+ if (arg5 && lparg5) (*env)->ReleaseIntLongArrayElements(env, arg5, lparg5, 0);
+ OS_NATIVE_EXIT(env, that, GetThemeBitmap_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_GetThemeColor
JNIEXPORT jint JNICALL OS_NATIVE(GetThemeColor)
(JNIEnv *env, jclass that, jintLong arg0, jint arg1, jint arg2, jint arg3, jintArray arg4)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.h b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.h
index decc12b8a7..966233be16 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.h
@@ -349,6 +349,7 @@
#define NO_GetTextCharset
#define NO_GetTextExtentPoint32A
#define NO_GetTextMetricsA
+#define NO_GetThemeBitmap
#define NO_GetThemeColor
#define NO_GetThemeTextExtent
#define NO_GetThemeInt
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.h b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.h
index 22ce0ec683..8a995a3efc 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.h
@@ -47,6 +47,7 @@
#define GetThemeMargins_LIB "uxtheme.dll"
#define GetThemeBackgroundContentRect_LIB "uxtheme.dll"
#define GetThemeBackgroundExtent_LIB "uxtheme.dll"
+#define GetThemeBitmap_LIB "uxtheme.dll"
#define GetThemeColor_LIB "uxtheme.dll"
#define GetThemePartSize_LIB "uxtheme.dll"
#define GetThemeMetric_LIB "uxtheme.dll"
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c
index e0932640d5..b788be6c62 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c
@@ -14,8 +14,8 @@
#ifdef NATIVE_STATS
-int OS_nativeFunctionCount = 1067;
-int OS_nativeFunctionCallCount[1067];
+int OS_nativeFunctionCount = 1068;
+int OS_nativeFunctionCallCount[1068];
char * OS_nativeFunctionNames[] = {
"ACCEL_1sizeof",
"ACTCTX_1sizeof",
@@ -462,6 +462,7 @@ char * OS_nativeFunctionNames[] = {
"GetTextMetricsW",
"GetThemeBackgroundContentRect",
"GetThemeBackgroundExtent",
+ "GetThemeBitmap",
"GetThemeColor",
"GetThemeInt",
"GetThemeMargins",
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h
index 617be7433d..55d743839b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h
@@ -470,6 +470,7 @@ typedef enum {
GetTextMetricsW_FUNC,
GetThemeBackgroundContentRect_FUNC,
GetThemeBackgroundExtent_FUNC,
+ GetThemeBitmap_FUNC,
GetThemeColor_FUNC,
GetThemeInt_FUNC,
GetThemeMargins_FUNC,
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java
index 468689c544..84e81097ab 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java
@@ -707,6 +707,9 @@ public class OS extends C {
public static final int FVIRTKEY = 0x1;
public static final int GBS_NORMAL = 1;
public static final int GBS_DISABLED = 2;
+ public static final int GBF_DIRECT = 0x00000001;
+ public static final int GBF_COPY = 0x00000002;
+ public static final int GBF_VALIDBITS = 0x00000003;
public static final int GCP_REORDER = 0x0002;
public static final int GCP_GLYPHSHAPE = 0x0010;
public static final int GCP_CLASSIN = 0x00080000;
@@ -1410,6 +1413,14 @@ public class OS extends C {
public static final int RBN_CHILDSIZE = RBN_FIRST - 8;
public static final int RBN_CHEVRONPUSHED = RBN_FIRST - 10;
public static final int RBN_HEIGHTCHANGE = 0xfffffcc1;
+ public static final int RBS_UNCHECKEDNORMAL = 1;
+ public static final int RBS_UNCHECKEDHOT = 2;
+ public static final int RBS_UNCHECKEDPRESSED = 3;
+ public static final int RBS_UNCHECKEDDISABLED = 4;
+ public static final int RBS_CHECKEDNORMAL = 5;
+ public static final int RBS_CHECKEDHOT = 6;
+ public static final int RBS_CHECKEDPRESSED = 7;
+ public static final int RBS_CHECKEDDISABLED = 8;
public static final int RBS_DBLCLKTOGGLE = 0x8000;
public static final int RBS_BANDBORDERS = 0x400;
public static final int RBS_VARHEIGHT = 0x200;
@@ -4321,10 +4332,10 @@ public static final native int GetDIBColorTable (int /*long*/ hdc, int uStartInd
/**
* @param hdc cast=(HDC)
* @param hbmp cast=(HBITMAP)
- * @param lpvBits cast=(LPVOID)
+ * @param lpvBits cast=(LPVOID),flags=critical
* @param lpbi cast=(LPBITMAPINFO),flags=critical
*/
-public static final native int GetDIBits (int /*long*/ hdc, int /*long*/ hbmp, int uStartScan, int cScanLines, int /*long*/ lpvBits, byte[] lpbi, int uUsage);
+public static final native int GetDIBits (int /*long*/ hdc, int /*long*/ hbmp, int uStartScan, int cScanLines, byte[] lpvBits, byte[] lpbi, int uUsage);
/** @param hDlg cast=(HWND) */
public static final native int /*long*/ GetDlgItem (int /*long*/ hDlg, int nIDDlgItem);
public static final native int GetDoubleClickTime ();
@@ -4422,6 +4433,8 @@ public static final native int GetMessageTime ();
*/
public static final native int GetMetaRgn (int /*long*/ hdc, int /*long*/ hrgn);
/** @method flags=dynamic */
+public static final native int GetThemeBitmap (int /*long*/ hTheme, int iPartId, int iStateId, int iPropId, int dwFlags, int /*long*/[] hBitmap);
+/** @method flags=dynamic */
public static final native int GetThemeColor (int /*long*/ hTheme, int iPartId, int iStateId, int iPropId, int[] pColor);
/** @method flags=dynamic */
public static final native int GetThemeTextExtent (int /*long*/ hTheme, int /*long*/ hdc, int iPartId, int iStateId, char[] pszText, int iCharCount, int dwTextFlags, RECT pBoundingRect, RECT pExtentRect);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java b/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
index d8fe8dd4ee..7957addae0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
@@ -462,6 +462,9 @@ public int /*long*/ internal_new_GC(GCData data) {
double printY = OS.gtk_page_setup_get_top_margin(pageSetup, OS.GTK_UNIT_POINTS);
Cairo.cairo_translate(cairo, printX, printY);
Cairo.cairo_scale(cairo, screenDPI.x / (float)dpi.x, screenDPI.y / (float)dpi.y);
+ double[] matrix = new double[6];
+ Cairo.cairo_get_matrix(cairo, matrix);
+ data.identity = matrix;
data.cairo = cairo;
isGCCreated = true;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Program/gtk/org/eclipse/swt/program/Program.java b/bundles/org.eclipse.swt/Eclipse SWT Program/gtk/org/eclipse/swt/program/Program.java
index 80efc6578f..1c67940b0e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Program/gtk/org/eclipse/swt/program/Program.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Program/gtk/org/eclipse/swt/program/Program.java
@@ -954,7 +954,7 @@ static boolean gio_isExecutable(String fileName) {
static boolean gio_launch(String fileName) {
boolean result = false;
byte[] fileNameBuffer = Converter.wcsToMbcs (null, fileName, true);
- int /*long*/ file = OS.g_file_new_for_path (fileNameBuffer);
+ int /*long*/ file = OS.g_file_new_for_commandline_arg (fileNameBuffer);
if (file != 0) {
int /*long*/ uri = OS.g_file_get_uri (file);
if (uri != 0) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.c b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.c
index a326248cef..a9dbb96488 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.c
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2011 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2009, 2012 IBM Corporation and others. All rights reserved.
* The contents of this file are made available under the terms
* of the GNU Lesser General Public License (LGPL) Version 2.1 that
* accompanies this distribution (lgpl-v21.txt). The LGPL is also
@@ -502,26 +502,6 @@ JNIEXPORT jintLong JNICALL WebKitGTK_NATIVE(_1JSValueMakeUndefined)
}
#endif
-#ifndef NO__1JSValueToBoolean
-JNIEXPORT jint JNICALL WebKitGTK_NATIVE(_1JSValueToBoolean)
- (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
-{
- jint rc = 0;
- WebKitGTK_NATIVE_ENTER(env, that, _1JSValueToBoolean_FUNC);
-/*
- rc = (jint)JSValueToBoolean(arg0, arg1);
-*/
- {
- WebKitGTK_LOAD_FUNCTION(fp, JSValueToBoolean)
- if (fp) {
- rc = (jint)((jint (CALLING_CONVENTION*)(jintLong, jintLong))fp)(arg0, arg1);
- }
- }
- WebKitGTK_NATIVE_EXIT(env, that, _1JSValueToBoolean_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO__1JSValueToNumber
JNIEXPORT jdouble JNICALL WebKitGTK_NATIVE(_1JSValueToNumber)
(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLongArray arg2)
@@ -681,6 +661,24 @@ JNIEXPORT jintLong JNICALL WebKitGTK_NATIVE(_1soup_1auth_1get_1scheme_1name)
}
#endif
+#ifndef NO__1soup_1cookie_1free
+JNIEXPORT void JNICALL WebKitGTK_NATIVE(_1soup_1cookie_1free)
+ (JNIEnv *env, jclass that, jintLong arg0)
+{
+ WebKitGTK_NATIVE_ENTER(env, that, _1soup_1cookie_1free_FUNC);
+/*
+ soup_cookie_free(arg0);
+*/
+ {
+ WebKitGTK_LOAD_FUNCTION(fp, soup_cookie_free)
+ if (fp) {
+ ((void (CALLING_CONVENTION*)(jintLong))fp)(arg0);
+ }
+ }
+ WebKitGTK_NATIVE_EXIT(env, that, _1soup_1cookie_1free_FUNC);
+}
+#endif
+
#ifndef NO__1soup_1cookie_1jar_1add_1cookie
JNIEXPORT void JNICALL WebKitGTK_NATIVE(_1soup_1cookie_1jar_1add_1cookie)
(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.h b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.h
index 72f6ac1163..0c95804f0c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.h
@@ -26,7 +26,7 @@
if (!initialized) { \
void* handle = dlopen("libwebkit-1.0.so.2", LOAD_FLAGS); /* webkitgtk 1.2.x lib */ \
if (!handle) { \
- handle = dlopen("libwebkitgtk-1.0.so.0", LOAD_FLAGS); /* webkitgtk 1.4.x lib */ \
+ handle = dlopen("libwebkitgtk-1.0.so.0", LOAD_FLAGS); /* webkitgtk >= 1.4.x lib */ \
} \
if (handle) { \
var = dlsym(handle, #name); \
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk_stats.c b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk_stats.c
index 7da07562ba..fc612e5722 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk_stats.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk_stats.c
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2011 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2009, 2012 IBM Corporation and others. All rights reserved.
* The contents of this file are made available under the terms
* of the GNU Lesser General Public License (LGPL) Version 2.1 that
* accompanies this distribution (lgpl-v21.txt). The LGPL is also
@@ -44,7 +44,6 @@ char * WebKitGTK_nativeFunctionNames[] = {
"_1JSValueMakeNumber",
"_1JSValueMakeString",
"_1JSValueMakeUndefined",
- "_1JSValueToBoolean",
"_1JSValueToNumber",
"_1JSValueToStringCopy",
"_1SoupCookie_1expires",
@@ -54,6 +53,7 @@ char * WebKitGTK_nativeFunctionNames[] = {
"_1soup_1auth_1authenticate",
"_1soup_1auth_1get_1host",
"_1soup_1auth_1get_1scheme_1name",
+ "_1soup_1cookie_1free",
"_1soup_1cookie_1jar_1add_1cookie",
"_1soup_1cookie_1jar_1all_1cookies",
"_1soup_1cookie_1jar_1delete_1cookie",
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk_stats.h b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk_stats.h
index f2210ece9d..4ec8c6d2c9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk_stats.h
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2011 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2009, 2012 IBM Corporation and others. All rights reserved.
* The contents of this file are made available under the terms
* of the GNU Lesser General Public License (LGPL) Version 2.1 that
* accompanies this distribution (lgpl-v21.txt). The LGPL is also
@@ -52,7 +52,6 @@ typedef enum {
_1JSValueMakeNumber_FUNC,
_1JSValueMakeString_FUNC,
_1JSValueMakeUndefined_FUNC,
- _1JSValueToBoolean_FUNC,
_1JSValueToNumber_FUNC,
_1JSValueToStringCopy_FUNC,
_1SoupCookie_1expires_FUNC,
@@ -62,6 +61,7 @@ typedef enum {
_1soup_1auth_1authenticate_FUNC,
_1soup_1auth_1get_1host_FUNC,
_1soup_1auth_1get_1scheme_1name_FUNC,
+ _1soup_1cookie_1free_FUNC,
_1soup_1cookie_1jar_1add_1cookie_FUNC,
_1soup_1cookie_1jar_1all_1cookies_FUNC,
_1soup_1cookie_1jar_1delete_1cookie_FUNC,
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java
index c473e5299c..e9485dafe9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java
@@ -33,7 +33,7 @@ class WebKit extends WebBrowser {
BrowserFunction eventFunction;
static int /*long*/ ExternalClass, PostString;
- static boolean HasDOMAPI, LibraryLoaded;
+ static boolean IsWebKitGTK14orNewer, LibraryLoaded;
static Hashtable WindowMappings = new Hashtable ();
static final String ABOUT_BLANK = "about:blank"; //$NON-NLS-1$
@@ -136,9 +136,10 @@ class WebKit extends WebBrowser {
/* indicates a session cookie */
WebKitGTK.soup_cookie_jar_delete_cookie (jar, cookie);
}
- OS.g_free (cookie);
+ WebKitGTK.soup_cookie_free (cookie);
current = OS.g_slist_next (current);
}
+ OS.g_slist_free (cookies);
}
};
@@ -224,7 +225,7 @@ static boolean IsInstalled () {
int major = WebKitGTK.webkit_major_version ();
int minor = WebKitGTK.webkit_minor_version ();
int micro = WebKitGTK.webkit_micro_version ();
- HasDOMAPI = major > 1 ||
+ IsWebKitGTK14orNewer = major > 1 ||
(major == 1 && minor > 4) ||
(major == 1 && minor == 4 && micro >= 0);
return major > MIN_VERSION[0] ||
@@ -584,7 +585,7 @@ public void create (Composite parent, int style) {
}
void addEventHandlers (int /*long*/ web_view, boolean top) {
- if (top && HasDOMAPI) {
+ if (top && IsWebKitGTK14orNewer) {
int /*long*/ domDocument = WebKitGTK.webkit_web_view_get_dom_document (web_view);
if (domDocument != 0) {
WindowMappings.put (new LONG (domDocument), new LONG (web_view));
@@ -1121,14 +1122,16 @@ boolean handleMouseEvent (String type, int screenX, int screenY, int detail, int
case 4: mouseEvent.stateMask |= SWT.BUTTON4; break;
case 5: mouseEvent.stateMask |= SWT.BUTTON5; break;
}
- browser.notifyListeners (mouseEvent.type, mouseEvent);
/*
- * Bug in WebKitGTK. Dragging an image quickly and repeatedly can cause
- * WebKitGTK to take the mouse grab indefinitely and lock up the display,
- * see https://bugs.webkit.org/show_bug.cgi?id=32840. The workaround is
- * to veto all drag attempts.
+ * Bug in WebKitGTK 1.2.x. Dragging an image quickly and repeatedly can
+ * cause WebKitGTK to take the mouse grab indefinitely and lock up the
+ * display, see https://bugs.webkit.org/show_bug.cgi?id=32840. The
+ * workaround is to veto all drag attempts if using WebKitGTK 1.2.x.
*/
- return false;
+ if (!IsWebKitGTK14orNewer) {
+ browser.notifyListeners (mouseEvent.type, mouseEvent);
+ return false;
+ }
}
browser.notifyListeners (mouseEvent.type, mouseEvent);
@@ -1957,7 +1960,7 @@ Object convertToJava (int /*long*/ ctx, int /*long*/ value) {
int type = WebKitGTK.JSValueGetType (ctx, value);
switch (type) {
case WebKitGTK.kJSTypeBoolean: {
- int result = WebKitGTK.JSValueToBoolean (ctx, value);
+ int result = (int)WebKitGTK.JSValueToNumber (ctx, value, null);
return new Boolean (result != 0);
}
case WebKitGTK.kJSTypeNumber: {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/internal/webkit/WebKitGTK.java b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/internal/webkit/WebKitGTK.java
index f9523d7da2..f6e83cb6f1 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/internal/webkit/WebKitGTK.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/internal/webkit/WebKitGTK.java
@@ -332,17 +332,6 @@ public static final int /*long*/ JSValueMakeUndefined (int /*long*/ ctx) {
}
/** @method flags=dynamic */
-public static final native int _JSValueToBoolean (int /*long*/ ctx, int /*long*/ value);
-public static final int JSValueToBoolean (int /*long*/ ctx, int /*long*/ value) {
- lock.lock();
- try {
- return _JSValueToBoolean (ctx, value);
- } finally {
- lock.unlock();
- }
-}
-
-/** @method flags=dynamic */
public static final native double _JSValueToNumber (int /*long*/ ctx, int /*long*/ value, int /*long*/[] exception);
public static final double JSValueToNumber (int /*long*/ ctx, int /*long*/ value, int /*long*/[] exception) {
lock.lock();
@@ -400,6 +389,17 @@ public static final int /*long*/ soup_auth_get_scheme_name (int /*long*/ auth) {
}
/** @method flags=dynamic */
+public static final native void _soup_cookie_free (int /*long*/ cookie);
+public static final void soup_cookie_free (int /*long*/ cookie) {
+ lock.lock();
+ try {
+ _soup_cookie_free (cookie);
+ } finally {
+ lock.unlock();
+ }
+}
+
+/** @method flags=dynamic */
public static final native void _soup_cookie_jar_add_cookie (int /*long*/ jar, int /*long*/ cookie);
public static final void soup_cookie_jar_add_cookie (int /*long*/ jar, int /*long*/ cookie) {
lock.lock();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/library/webkit_win32.cpp b/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/library/webkit_win32.cpp
index 321dea3991..443ac1ba82 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/library/webkit_win32.cpp
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/library/webkit_win32.cpp
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2009, 2012 IBM Corporation and others. All rights reserved.
* The contents of this file are made available under the terms
* of the GNU Lesser General Public License (LGPL) Version 2.1 that
* accompanies this distribution (lgpl-v21.txt). The LGPL is also
@@ -705,19 +705,6 @@ JNIEXPORT jintLong JNICALL WebKit_win32_NATIVE(JSValueMakeUndefined)
}
#endif
-#ifndef NO_JSValueToBoolean
-extern "C" JNIEXPORT jint JNICALL WebKit_win32_NATIVE(JSValueToBoolean)(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1);
-JNIEXPORT jint JNICALL WebKit_win32_NATIVE(JSValueToBoolean)
- (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
-{
- jint rc = 0;
- WebKit_win32_NATIVE_ENTER(env, that, JSValueToBoolean_FUNC);
- rc = (jint)JSValueToBoolean((JSContextRef)arg0, (JSValueRef)arg1);
- WebKit_win32_NATIVE_EXIT(env, that, JSValueToBoolean_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO_JSValueToNumber
extern "C" JNIEXPORT jdouble JNICALL WebKit_win32_NATIVE(JSValueToNumber)(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLongArray arg2);
JNIEXPORT jdouble JNICALL WebKit_win32_NATIVE(JSValueToNumber)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/library/webkit_win32_stats.cpp b/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/library/webkit_win32_stats.cpp
index a6fa7bcfa9..071ae7f66b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/library/webkit_win32_stats.cpp
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/library/webkit_win32_stats.cpp
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2009, 2012 IBM Corporation and others. All rights reserved.
* The contents of this file are made available under the terms
* of the GNU Lesser General Public License (LGPL) Version 2.1 that
* accompanies this distribution (lgpl-v21.txt). The LGPL is also
@@ -18,8 +18,8 @@
#ifdef NATIVE_STATS
-int WebKit_win32_nativeFunctionCount = 61;
-int WebKit_win32_nativeFunctionCallCount[61];
+int WebKit_win32_nativeFunctionCount = 60;
+int WebKit_win32_nativeFunctionCallCount[60];
char * WebKit_win32_nativeFunctionNames[] = {
"CFArrayGetCount",
"CFArrayGetValueAtIndex",
@@ -74,7 +74,6 @@ char * WebKit_win32_nativeFunctionNames[] = {
"JSValueMakeNumber",
"JSValueMakeString",
"JSValueMakeUndefined",
- "JSValueToBoolean",
"JSValueToNumber",
"JSValueToStringCopy",
"WebKitCreateInstance",
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/library/webkit_win32_stats.h b/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/library/webkit_win32_stats.h
index cbf2c86606..2ef83803bd 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/library/webkit_win32_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/library/webkit_win32_stats.h
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2009, 2012 IBM Corporation and others. All rights reserved.
* The contents of this file are made available under the terms
* of the GNU Lesser General Public License (LGPL) Version 2.1 that
* accompanies this distribution (lgpl-v21.txt). The LGPL is also
@@ -82,7 +82,6 @@ typedef enum {
JSValueMakeNumber_FUNC,
JSValueMakeString_FUNC,
JSValueMakeUndefined_FUNC,
- JSValueToBoolean_FUNC,
JSValueToNumber_FUNC,
JSValueToStringCopy_FUNC,
WebKitCreateInstance_FUNC,
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebKit.java b/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebKit.java
index 1bc1a4e3ba..0f7dd44c5e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebKit.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebKit.java
@@ -425,7 +425,7 @@ Object convertToJava (int /*long*/ ctx, int /*long*/ value) {
int type = WebKit_win32.JSValueGetType (ctx, value);
switch (type) {
case WebKit_win32.kJSTypeBoolean: {
- int result = WebKit_win32.JSValueToBoolean (ctx, value);
+ int result = (int)WebKit_win32.JSValueToNumber (ctx, value, null);
return new Boolean (result != 0);
}
case WebKit_win32.kJSTypeNumber: {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/internal/webkit/WebKit_win32.java b/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/internal/webkit/WebKit_win32.java
index aaa9c1c817..ea8732f37d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/internal/webkit/WebKit_win32.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/internal/webkit/WebKit_win32.java
@@ -318,11 +318,6 @@ public static final native int /*long*/ JSValueMakeUndefined (int /*long*/ ctx);
/**
* @param ctx cast=(JSContextRef)
* @param value cast=(JSValueRef)
- */
-public static final native int JSValueToBoolean (int /*long*/ ctx, int /*long*/ value);
-/**
- * @param ctx cast=(JSContextRef)
- * @param value cast=(JSValueRef)
* @param exception cast=(JSValueRef*)
*/
public static final native double JSValueToNumber (int /*long*/ ctx, int /*long*/ value, int /*long*/[] exception);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java
index ea28083156..c7e10d416c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java
@@ -1678,8 +1678,8 @@ public void drawText (String string, int x, int y, int flags) {
NSPoint pt = new NSPoint();
pt.x = x;
pt.y = y;
+ NSRange range = data.layoutManager.glyphRangeForTextContainer(data.textContainer);
if ((flags & SWT.DRAW_TRANSPARENT) == 0) {
- data.layoutManager.glyphRangeForTextContainer(data.textContainer);
NSRect rect = data.layoutManager.usedRectForTextContainer(data.textContainer);
rect.x = x;
rect.y = y;
@@ -1692,8 +1692,6 @@ public void drawText (String string, int x, int y, int flags) {
bg.setFill();
NSBezierPath.fillRect(rect);
}
- NSRange range = new NSRange();
- range.length = data.layoutManager.numberOfGlyphs();
data.layoutManager.drawGlyphsForGlyphRange(range, pt);
handle.restoreGraphicsState();
} finally {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Path.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Path.java
index 7a87377188..1afd744182 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Path.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Path.java
@@ -362,6 +362,7 @@ public void addString(String string, float x, float y, Font font) {
size.width = OS.MAX_TEXT_CONTAINER_SIZE;
size.height = OS.MAX_TEXT_CONTAINER_SIZE;
textContainer.initWithContainerSize(size);
+ textContainer.setLineFragmentPadding(0);
textStorage.addLayoutManager(layoutManager);
layoutManager.addTextContainer(textContainer);
NSRange range = new NSRange();
@@ -382,18 +383,22 @@ public void addString(String string, float x, float y, Font font) {
attrStr.release();
range = layoutManager.glyphRangeForTextContainer(textContainer);
if (range.length != 0) {
- int /*long*/ glyphs = OS.malloc(4 * range.length * 2);
- layoutManager.getGlyphs(glyphs, range);
+ int /*long*/ glyphs = OS.malloc((range.length + 1) * 4);
+ int /*long*/ count = layoutManager.getGlyphs(glyphs, range);
NSBezierPath path = NSBezierPath.bezierPath();
- NSPoint point = new NSPoint();
- path.moveToPoint(point);
- path.appendBezierPathWithGlyphs(glyphs, range.length, font.handle);
+ for (int i = 0; i < count; i++) {
+ NSPoint pt = layoutManager.locationForGlyphAtIndex(i);
+ NSRect lineFragmentRect = layoutManager.lineFragmentUsedRectForGlyphAtIndex(i, 0);
+ NSFont actualFont = new NSFont(textStorage.attribute(OS.NSFontAttributeName, layoutManager.characterIndexForGlyphAtIndex(i), 0));
+ pt.x = pt.x + x + lineFragmentRect.x;
+ pt.y = - pt.y - y - lineFragmentRect.y;
+ path.moveToPoint(pt);
+ path.appendBezierPathWithGlyphs(glyphs + (i * 4), 1, actualFont);
+ }
+ OS.free(glyphs);
NSAffineTransform transform = NSAffineTransform.transform();
transform.scaleXBy(1, -1);
- float /*double*/ baseline = layoutManager.defaultBaselineOffsetForFont(font.handle);
- transform.translateXBy(x, -(y + baseline));
path.transformUsingAffineTransform(transform);
- OS.free(glyphs);
handle.appendBezierPath(path);
}
textContainer.release();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
index ca0e428614..eb12628c08 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
@@ -146,12 +146,21 @@ int /*long*/ accessibilityActionDescription(int /*long*/ id, int /*long*/ sel, i
}
int /*long*/ accessibilityActionNames(int /*long*/ id, int /*long*/ sel) {
- if (handleIsAccessible(id) && accessible != null) {
- NSArray returnValue = accessible.internal_accessibilityActionNames(ACC.CHILDID_SELF);
- if (returnValue != null) return returnValue.id;
+ int /*long*/ returnValue = super.accessibilityActionNames(id, sel);
+ if (handleIsAccessible(id)) {
+ if (accessible != null) {
+ NSArray baseArray = accessible.internal_accessibilityActionNames(ACC.CHILDID_SELF);
+ if (baseArray != null) returnValue = baseArray.id;
+ }
+ if (hooks(SWT.MenuDetect) || (menu != null && !menu.isDisposed())) {
+ NSArray baseArray = new NSArray(returnValue);
+ NSMutableArray ourNames = NSMutableArray.arrayWithCapacity(baseArray.count() + 1);
+ ourNames.addObjectsFromArray(baseArray);
+ ourNames.addObject(OS.NSAccessibilityShowMenuAction);
+ returnValue = ourNames.id;
+ }
}
-
- return super.accessibilityActionNames(id, sel);
+ return returnValue;
}
int /*long*/ accessibilityAttributeNames(int /*long*/ id, int /*long*/ sel) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
index 1af38eb037..d0f387e635 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
@@ -3193,23 +3193,29 @@ public boolean post(Event event) {
mouseCursorPosition.x = nsCursorPosition.x;
mouseCursorPosition.y = (int) (primaryFrame.height - nsCursorPosition.y);
int eventType = 0;
- int button = event.button;
- switch (button) {
+ // SWT buttons are 1-based: 1,2,3,4,5; CG buttons are 0 based: 0,2,1,3,4
+ int cgButton;
+ switch (event.button) {
case 1:
eventType = (event.type == SWT.MouseDown ? OS.kCGEventLeftMouseDown : OS.kCGEventLeftMouseUp);
+ cgButton = 0;
break;
case 2:
+ eventType = (event.type == SWT.MouseDown ? OS.kCGEventOtherMouseDown : OS.kCGEventOtherMouseUp);
+ cgButton = 2;
+ break;
+ case 3:
eventType = (event.type == SWT.MouseDown ? OS.kCGEventRightMouseDown : OS.kCGEventRightMouseUp);
+ cgButton = 1;
break;
default:
eventType = (event.type == SWT.MouseDown ? OS.kCGEventOtherMouseDown : OS.kCGEventOtherMouseUp);
+ cgButton = event.button - 1;
break;
}
- // SWT buttons are 1-based; CG buttons are 0 based.
- button -= 1;
- if (button >= 0) {
- eventRef = OS.CGEventCreateMouseEvent(eventSource, eventType, mouseCursorPosition, button);
+ if (cgButton >= 0) {
+ eventRef = OS.CGEventCreateMouseEvent(eventSource, eventType, mouseCursorPosition, cgButton);
}
}
break;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java
index a5b5ebc45c..a3aa7a3cf6 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java
@@ -1641,7 +1641,7 @@ public void setEnabled (boolean enabled) {
checkWidget();
if (((state & DISABLED) == 0) == enabled) return;
super.setEnabled (enabled);
- if (enabled && window.isMainWindow()) {
+ if (enabled && window != null && window.isMainWindow()) {
if (!restoreFocus ()) traverseGroup (false);
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java
index a41397d752..ad7d0f29ea 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java
@@ -1123,6 +1123,7 @@ public void setText (String string) {
checkWidget();
if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
if ((style & SWT.SEPARATOR) != 0) return;
+ if (string.equals (getText ())) return;
super.setText (string);
NSButton widget = (NSButton)button;
if (parent.nsToolbar != null) {
@@ -1167,6 +1168,8 @@ public void setText (String string) {
*/
public void setToolTipText (String string) {
checkWidget();
+ if (string == null && toolTipText == null) return;
+ if (string != null && string.equals (toolTipText)) return;
toolTipText = string;
if (parent.nsToolbar != null) {
char[] chars = new char [toolTipText.length ()];
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TrayItem.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TrayItem.java
index f2c639f663..e09b7514d6 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TrayItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TrayItem.java
@@ -43,6 +43,7 @@ public class TrayItem extends Item {
boolean visible = true, highlight;
NSStatusItem item;
NSImageView view;
+ Image highlightImage;
/**
* Constructs a new instance of this class given its parent
@@ -168,6 +169,11 @@ void destroyWidget () {
releaseHandle ();
}
+public Image getHighlightImage () {
+ checkWidget();
+ return highlightImage;
+}
+
Point getLocation () {
NSRect rect = view.frame();
NSRect windowRect = view.window().frame();
@@ -264,6 +270,10 @@ void releaseWidget () {
super.releaseWidget ();
NSStatusBar statusBar = NSStatusBar.systemStatusBar();
statusBar.removeStatusItem(item);
+ if (toolTip != null) toolTip.item = null;
+ toolTip = null;
+ toolTipText = null;
+ highlightImage = null;
}
/**
@@ -335,31 +345,14 @@ public void setImage (Image image) {
checkWidget ();
if (image != null && image.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
super.setImage (image);
- float /*double*/ width = 0;
- if (image == null) {
- view.setImage (null);
- } else {
- /*
- * Feature in Cocoa. If the NSImage object being set into the view is
- * the same NSImage object that is already there then the new image is
- * not taken. This results in the view's image not changing even if the
- * NSImage object's content has changed since it was last set into the
- * view. The workaround is to temporarily set the view's image to null
- * so that the new image will then be taken.
- */
- NSImage current = view.image ();
- if (current != null && current.id == image.handle.id) {
- view.setImage (null);
- item.setLength (0);
- }
- view.setImage (image.handle);
- if (visible) {
- NSSize size = image.handle.size ();
- view.setFrameSize (size);
- width = OS.NSSquareStatusItemLength;
- }
- }
- item.setLength (width);
+ updateImage ();
+}
+
+public void setHighlightImage (Image image) {
+ checkWidget ();
+ if (image != null && image.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+ highlightImage = image;
+ updateImage ();
}
/**
@@ -440,8 +433,7 @@ public void setVisible (boolean visible) {
if (isDisposed ()) return;
}
this.visible = visible;
- float /*double*/ width = image != null && visible ? OS.NSSquareStatusItemLength : 0;
- item.setLength(width);
+ updateImage ();
if (!visible) sendEvent (SWT.Hide);
}
@@ -496,6 +488,7 @@ boolean shouldShowMenu (NSEvent event) {
void mouseDown(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) {
NSEvent nsEvent = new NSEvent(theEvent);
highlight = true;
+ updateImage();
view.setNeedsDisplay(true);
if (shouldShowMenu(nsEvent)) displayMenu();
}
@@ -503,7 +496,11 @@ void mouseDown(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) {
void mouseDragged(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) {
NSEvent nsEvent = new NSEvent(theEvent);
NSRect frame = view.frame();
+ boolean oldHighlight = highlight;
highlight = OS.NSPointInRect(nsEvent.locationInWindow(), frame);
+ if (oldHighlight != highlight) {
+ updateImage ();
+ }
view.setNeedsDisplay(true);
if (shouldShowMenu(nsEvent)) displayMenu();
}
@@ -514,8 +511,9 @@ void mouseUp(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) {
if (nsEvent.type() == OS.NSLeftMouseUp) {
sendSelectionEvent(nsEvent.clickCount() == 2 ? SWT.DefaultSelection : SWT.Selection);
}
+ highlight = false;
+ updateImage ();
}
- highlight = false;
view.setNeedsDisplay(true);
}
@@ -535,4 +533,32 @@ void drawRect(int /*long*/ id, int /*long*/ sel, NSRect rect) {
item.drawStatusBarBackgroundInRect(rect, highlight);
super.drawRect(id, sel, rect);
}
+
+void updateImage () {
+ float /*double*/ width = 0;
+ Image image = this.image;
+ if (highlight && highlightImage != null) image = highlightImage;
+ if (image == null) {
+ view.setImage (null);
+ } else {
+ /*
+ * Feature in Cocoa. If the NSImage object being set into the view is
+ * the same NSImage object that is already there then the new image is
+ * not taken. This results in the view's image not changing even if the
+ * NSImage object's content has changed since it was last set into the
+ * view. The workaround is to temporarily set the view's image to null
+ * so that the new image will then be taken.
+ */
+ NSImage current = view.image ();
+ if (current != null && current.id == image.handle.id) {
+ view.setImage (null);
+ item.setLength (0);
+ }
+ view.setImage (image.handle);
+ if (visible) {
+ width = OS.NSSquareStatusItemLength;
+ }
+ }
+ item.setLength (width);
+}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/library/make_common.mak b/bundles/org.eclipse.swt/Eclipse SWT/common/library/make_common.mak
index 66658d73fb..378d494c21 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/library/make_common.mak
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/library/make_common.mak
@@ -10,5 +10,5 @@
#*******************************************************************************
maj_ver=3
-min_ver=807
-comma_ver=3,8,0,7
+min_ver=818
+comma_ver=3,8,1,8
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java
index 7a9a4a427c..399bf07e82 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java
@@ -4139,7 +4139,24 @@ static String findErrorText (int code) {
public static String getMessage(String key) {
return Compatibility.getMessage(key);
}
-
+
+/**
+ * Returns the NLS'ed message for the given arguments.
+ *
+ * @param key the key to look up
+ * @param args the parameters to insert into the message
+ * @return the message for the given parameterized key
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the key or args are null</li>
+ * </ul>
+ *
+ * @since 3.8
+ */
+public static String getMessage(String key, Object[] args) {
+ return Compatibility.getMessage(key, args);
+}
+
/**
* Returns the SWT platform name.
* Examples: "win32", "motif", "gtk", "photon", "carbon", "cocoa", "wpf"
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageLoader.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageLoader.java
index 0feebe2873..e866835597 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageLoader.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageLoader.java
@@ -81,6 +81,22 @@ public class ImageLoader {
* The default is 1. A value of 0 means 'display repeatedly'
*/
public int repeatCount;
+
+ /**
+ * This is the compression used when saving jpeg and png files.
+ * <p>
+ * When saving jpeg files, the value is from 1 to 100,
+ * where 1 is very high compression but low quality, and 100 is
+ * no compression and high quality; default is 75.
+ * </p><p>
+ * When saving png files, the value is from 0 to 3, but they do not impact the quality
+ * because PNG is lossless compression. 0 is uncompressed, 1 is low compression and fast,
+ * 2 is default compression, and 3 is high compression but slow.
+ * </p>
+ *
+ * @since 3.8
+ */
+ public int compression;
/*
* the set of ImageLoader event listeners, created on demand
@@ -104,6 +120,7 @@ void reset() {
logicalScreenHeight = 0;
backgroundPixel = -1;
repeatCount = 1;
+ compression = -1;
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGFileFormat.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGFileFormat.java
index 967feb708d..af3722538c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGFileFormat.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGFileFormat.java
@@ -1768,6 +1768,7 @@ void unloadIntoByteStream(ImageLoader loader) {
}
quantizationTables = new int[4][];
JPEGQuantizationTable chromDQT = JPEGQuantizationTable.defaultChrominanceTable();
+ int encoderQFactor = loader.compression >= 1 && loader.compression <= 100 ? loader.compression : 75;
chromDQT.scaleBy(encoderQFactor);
int[] jpegDQTKeys = chromDQT.getQuantizationTablesKeys();
int[][] jpegDQTValues = chromDQT.getQuantizationTablesValues();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngEncoder.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngEncoder.java
index 28299db611..e90cdb175d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngEncoder.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngEncoder.java
@@ -29,6 +29,11 @@ final class PngEncoder extends Object {
static final byte TAG_IDAT[] = {(byte) 'I', (byte) 'D', (byte) 'A', (byte) 'T'};
static final byte TAG_IEND[] = {(byte) 'I', (byte) 'E', (byte) 'N', (byte) 'D'};
+ static final int NO_COMPRESSION = 0;
+ static final int BEST_SPEED = 1;
+ static final int BEST_COMPRESSION = 9;
+ static final int DEFAULT_COMPRESSION = -1;
+
ByteArrayOutputStream bytes = new ByteArrayOutputStream(1024);
PngChunk chunk;
@@ -232,8 +237,22 @@ void writeTransparency() {
void writeImageData() throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
- OutputStream os = Compatibility.newDeflaterOutputStream(baos);
- if (os == null) os = baos;
+ OutputStream os = null;
+ switch (loader.compression) {
+ case 0:
+ os = Compatibility.newDeflaterOutputStream(baos, NO_COMPRESSION);
+ break;
+ case 1:
+ os = Compatibility.newDeflaterOutputStream(baos, BEST_SPEED);
+ break;
+ case 3:
+ os = Compatibility.newDeflaterOutputStream(baos, BEST_COMPRESSION);
+ break;
+ default:
+ os = Compatibility.newDeflaterOutputStream(baos, DEFAULT_COMPRESSION);
+ break;
+ }
+ if (os == null) os = baos; // returns null for J2ME
if (colorType == 3) {
@@ -312,6 +331,7 @@ void writeImageData() throws IOException {
byte[] compressed = baos.toByteArray();
if (os == baos) {
+ /* Use PngDeflater for J2ME. */
PngDeflater deflater = new PngDeflater();
compressed = deflater.deflate(compressed);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/version.txt b/bundles/org.eclipse.swt/Eclipse SWT/common/version.txt
index 558406da33..e1eb9fc3d7 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/version.txt
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/version.txt
@@ -1 +1 @@
-version 3.807 \ No newline at end of file
+version 3.818 \ No newline at end of file
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common_j2me/org/eclipse/swt/internal/Compatibility.java b/bundles/org.eclipse.swt/Eclipse SWT/common_j2me/org/eclipse/swt/internal/Compatibility.java
index bf7a67914c..63228faa69 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common_j2me/org/eclipse/swt/internal/Compatibility.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common_j2me/org/eclipse/swt/internal/Compatibility.java
@@ -191,7 +191,7 @@ public static int pow2(int n) {
}
/**
- * Create an DeflaterOutputStream if such things are supported.
+ * Create a DeflaterOutputStream if such things are supported.
*
* @param stream the output stream
* @return a deflater stream or <code>null</code>
@@ -199,7 +199,7 @@ public static int pow2(int n) {
*
* @since 3.4
*/
-public static OutputStream newDeflaterOutputStream(OutputStream stream) throws IOException {
+public static OutputStream newDeflaterOutputStream(OutputStream stream, int level) throws IOException {
return null;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/Compatibility.java b/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/Compatibility.java
index 70eee2136f..cb473f01ca 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/Compatibility.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/Compatibility.java
@@ -15,6 +15,7 @@ import java.io.*;
import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
+import java.util.zip.Deflater;
import java.util.zip.InflaterInputStream;
import java.util.zip.DeflaterOutputStream;
@@ -159,7 +160,7 @@ public static int pow2(int n) {
}
/**
- * Create an DeflaterOutputStream if such things are supported.
+ * Create a DeflaterOutputStream if such things are supported.
*
* @param stream the output stream
* @return a deflater stream or <code>null</code>
@@ -167,8 +168,8 @@ public static int pow2(int n) {
*
* @since 3.4
*/
-public static OutputStream newDeflaterOutputStream(OutputStream stream) throws IOException {
- return new DeflaterOutputStream(stream);
+public static OutputStream newDeflaterOutputStream(OutputStream stream, int level) throws IOException {
+ return new DeflaterOutputStream(stream, new Deflater(level));
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages.properties b/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages.properties
index d212d17971..a5c0a0f9f4 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages.properties
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages.properties
@@ -65,6 +65,8 @@ SWT_Minimize=Minimize
SWT_Maximize=Maximize
SWT_Restore=Restore
SWT_ShowList=Show List
+SWT_Page_Mnemonic=Alt+{0}
+SWT_SwitchPage_Shortcut=Ctrl+PageDown
SWT_FileDownload=File Download
SWT_Download_Error=Error occurred, download not completed
SWT_Download_File=Download: {0}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
index 79b122a50c..09cb7b4d21 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
@@ -2879,6 +2879,9 @@ double[] identity() {
} else {
Cairo.cairo_matrix_init_identity(identity);
}
+ if (data.identity != null) {
+ Cairo.cairo_matrix_multiply(identity, data.identity, identity);
+ }
return identity;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GCData.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GCData.java
index d507acb51b..b42a96d37a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GCData.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GCData.java
@@ -54,7 +54,7 @@ public final class GCData {
public int /*long*/ cairo;
public double cairoXoffset, cairoYoffset;
public boolean disposeCairo;
- public double[] clippingTransform;
+ public double[] identity, clippingTransform;
public String string;
public int stringWidth = -1;
public int stringHeight = -1;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java
index 11adbc6364..60fe06088b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java
@@ -54,7 +54,7 @@ public final class TextLayout extends Resource {
int[] tabs;
StyleItem[] styles;
int stylesCount;
- int /*long*/ layout, context, attrList;
+ int /*long*/ layout, context, attrList, selAttrList;
int[] invalidOffsets;
static final char LTR_MARK = '\u200E', RTL_MARK = '\u200F', ZWS = '\u200B', ZWNBS = '\uFEFF';
@@ -85,9 +85,7 @@ public TextLayout (Device device) {
OS.pango_layout_set_font_description(layout, device.systemFont.handle);
OS.pango_layout_set_wrap(layout, OS.PANGO_WRAP_WORD_CHAR);
OS.pango_layout_set_tabs(layout, device.emptyTab);
- if (OS.GTK_VERSION >= OS.VERSION(2, 4, 0)) {
- OS.pango_layout_set_auto_dir(layout, false);
- }
+ OS.pango_layout_set_auto_dir(layout, false);
text = "";
wrapWidth = ascent = descent = -1;
styles = new StyleItem[2];
@@ -109,6 +107,7 @@ void computeRuns () {
if (stylesCount == 2 && styles[0].style == null && ascent == -1 && descent == -1 && segments == null) return;
int /*long*/ ptr = OS.pango_layout_get_text(layout);
attrList = OS.pango_attr_list_new();
+ selAttrList = OS.pango_attr_list_new();
PangoAttribute attribute = new PangoAttribute();
char[] chars = null;
int segementsLength = segmentsText.length();
@@ -136,12 +135,14 @@ void computeRuns () {
attribute.end_index = bytePos + offset + 3;
OS.memmove (attr, attribute, PangoAttribute.sizeof);
OS.pango_attr_list_insert(attrList, attr);
+ OS.pango_attr_list_insert(selAttrList, OS.pango_attribute_copy(attr));
attr = OS.pango_attr_shape_new (rect, rect);
OS.memmove (attribute, attr, PangoAttribute.sizeof);
attribute.start_index = bytePos + offset + 3;
attribute.end_index = bytePos + offset + 6;
OS.memmove (attr, attribute, PangoAttribute.sizeof);
OS.pango_attr_list_insert(attrList, attr);
+ OS.pango_attr_list_insert(selAttrList, OS.pango_attribute_copy(attr));
int pos = (int)/*64*/OS.g_utf16_pointer_to_offset(ptr, ptr + bytePos);
chars[pos + lineIndex * 2] = ZWS;
chars[pos + lineIndex * 2 + 1] = ZWNBS;
@@ -196,6 +197,7 @@ void computeRuns () {
attribute.end_index = byteEnd;
OS.memmove (attr, attribute, PangoAttribute.sizeof);
OS.pango_attr_list_insert(attrList, attr);
+ OS.pango_attr_list_insert(selAttrList, OS.pango_attribute_copy(attr));
}
if (style.underline) {
int underlineStyle = OS.PANGO_UNDERLINE_NONE;
@@ -208,9 +210,7 @@ void computeRuns () {
break;
case SWT.UNDERLINE_SQUIGGLE:
case SWT.UNDERLINE_ERROR:
- if (OS.GTK_VERSION >= OS.VERSION(2, 4, 0)) {
- underlineStyle = OS.PANGO_UNDERLINE_ERROR;
- }
+ underlineStyle = OS.PANGO_UNDERLINE_ERROR;
break;
case SWT.UNDERLINE_LINK: {
if (style.foreground == null) {
@@ -221,28 +221,46 @@ void computeRuns () {
OS.memmove (attr, attribute, PangoAttribute.sizeof);
OS.pango_attr_list_insert(attrList, attr);
}
- if (style.underlineColor == null) {
- underlineStyle = OS.PANGO_UNDERLINE_SINGLE;
- }
+ underlineStyle = OS.PANGO_UNDERLINE_SINGLE;
break;
}
}
- if (underlineStyle != OS.PANGO_UNDERLINE_NONE && style.underlineColor == null) {
- int /*long*/ attr = OS.pango_attr_underline_new(underlineStyle);
+ int /*long*/ attr = OS.pango_attr_underline_new(underlineStyle);
+ OS.memmove(attribute, attr, PangoAttribute.sizeof);
+ attribute.start_index = byteStart;
+ attribute.end_index = byteEnd;
+ OS.memmove(attr, attribute, PangoAttribute.sizeof);
+ OS.pango_attr_list_insert(attrList, attr);
+ OS.pango_attr_list_insert(selAttrList, OS.pango_attribute_copy(attr));
+ if (style.underlineColor != null) {
+ GdkColor fg = style.underlineColor.handle;
+ attr = OS.pango_attr_underline_color_new(fg.red, fg.green, fg.blue);
OS.memmove(attribute, attr, PangoAttribute.sizeof);
attribute.start_index = byteStart;
attribute.end_index = byteEnd;
OS.memmove(attr, attribute, PangoAttribute.sizeof);
OS.pango_attr_list_insert(attrList, attr);
+ OS.pango_attr_list_insert(selAttrList, OS.pango_attribute_copy(attr));
}
}
- if (style.strikeout && style.strikeoutColor == null) {
+ if (style.strikeout) {
int /*long*/ attr = OS.pango_attr_strikethrough_new(true);
OS.memmove(attribute, attr, PangoAttribute.sizeof);
attribute.start_index = byteStart;
attribute.end_index = byteEnd;
OS.memmove(attr, attribute, PangoAttribute.sizeof);
OS.pango_attr_list_insert(attrList, attr);
+ OS.pango_attr_list_insert(selAttrList, OS.pango_attribute_copy(attr));
+ if (style.strikeoutColor != null) {
+ GdkColor fg = style.strikeoutColor.handle;
+ attr = OS.pango_attr_strikethrough_color_new(fg.red, fg.green, fg.blue);
+ OS.memmove(attribute, attr, PangoAttribute.sizeof);
+ attribute.start_index = byteStart;
+ attribute.end_index = byteEnd;
+ OS.memmove(attr, attribute, PangoAttribute.sizeof);
+ OS.pango_attr_list_insert(attrList, attr);
+ OS.pango_attr_list_insert(selAttrList, OS.pango_attribute_copy(attr));
+ }
}
Color foreground = style.foreground;
if (foreground != null && !foreground.isDisposed()) {
@@ -276,6 +294,7 @@ void computeRuns () {
attribute.end_index = byteEnd;
OS.memmove (attr, attribute, PangoAttribute.sizeof);
OS.pango_attr_list_insert(attrList, attr);
+ OS.pango_attr_list_insert(selAttrList, OS.pango_attribute_copy(attr));
}
int rise = style.rise;
if (rise != 0) {
@@ -285,6 +304,7 @@ void computeRuns () {
attribute.end_index = byteEnd;
OS.memmove (attr, attribute, PangoAttribute.sizeof);
OS.pango_attr_list_insert(attrList, attr);
+ OS.pango_attr_list_insert(selAttrList, OS.pango_attribute_copy(attr));
}
}
OS.pango_layout_set_attributes(layout, attrList);
@@ -417,7 +437,7 @@ public void draw(GC gc, int x, int y, int selectionStart, int selectionEnd, Colo
int /*long*/ ptr = OS.pango_layout_get_text(layout);
int /*long*/ iter = OS.pango_layout_get_iter(layout);
if (selectionBackground == null) selectionBackground = device.getSystemColor(SWT.COLOR_LIST_SELECTION);
- if (cairo != 0 && OS.GTK_VERSION >= OS.VERSION(2, 8, 0)) {
+ if (cairo != 0) {
Cairo.cairo_save(cairo);
GdkColor color = selectionBackground.handle;
Cairo.cairo_set_source_rgba(cairo, (color.red & 0xFFFF) / (float)0xFFFF, (color.green & 0xFFFF) / (float)0xFFFF, (color.blue & 0xFFFF) / (float)0xFFFF, data.alpha / (float)0xFF);
@@ -455,8 +475,8 @@ public void draw(GC gc, int x, int y, int selectionStart, int selectionEnd, Colo
if (ascent != -1 && descent != -1) {
height = Math.max (height, ascent + descent);
}
- int width = (flags & SWT.FULL_SELECTION) != 0 ? 0x7fffffff : height / 3;
- if (cairo != 0 && OS.GTK_VERSION >= OS.VERSION(2, 8, 0)) {
+ int width = (flags & SWT.FULL_SELECTION) != 0 ? 0x7fff : height / 3;
+ if (cairo != 0) {
Cairo.cairo_rectangle(cairo, lineX, lineY, width, height);
Cairo.cairo_fill(cairo);
} else {
@@ -467,7 +487,7 @@ public void draw(GC gc, int x, int y, int selectionStart, int selectionEnd, Colo
} while (lineIndex < lineCount);
OS.pango_layout_iter_free(iter);
if (attrs[0] != 0) OS.g_free(attrs[0]);
- if (cairo != 0 && OS.GTK_VERSION >= OS.VERSION(2, 8, 0)) {
+ if (cairo != 0) {
Cairo.cairo_restore(cairo);
} else {
OS.gdk_gc_set_foreground(gc.handle, data.foreground);
@@ -475,7 +495,7 @@ public void draw(GC gc, int x, int y, int selectionStart, int selectionEnd, Colo
}
if (length == 0) return;
if (!hasSelection) {
- if (cairo != 0 && OS.GTK_VERSION >= OS.VERSION(2, 8, 0)) {
+ if (cairo != 0) {
if ((data.style & SWT.MIRRORED) != 0) {
Cairo.cairo_save(cairo);
Cairo.cairo_scale(cairo, -1, 1);
@@ -501,7 +521,7 @@ public void draw(GC gc, int x, int y, int selectionStart, int selectionEnd, Colo
if (selectionBackground == null) selectionBackground = device.getSystemColor(SWT.COLOR_LIST_SELECTION);
boolean fullSelection = selectionStart == 0 && selectionEnd == length - 1;
if (fullSelection) {
- if (cairo != 0 && OS.GTK_VERSION >= OS.VERSION(2, 8, 0)) {
+ if (cairo != 0) {
int /*long*/ ptr = OS.pango_layout_get_text(layout);
if ((data.style & SWT.MIRRORED) != 0) {
Cairo.cairo_save(cairo);
@@ -523,7 +543,7 @@ public void draw(GC gc, int x, int y, int selectionStart, int selectionEnd, Colo
int strlen = OS.strlen(ptr);
byteSelStart = Math.min(byteSelStart, strlen);
byteSelEnd = Math.min(byteSelEnd, strlen);
- if (cairo != 0 && OS.GTK_VERSION >= OS.VERSION(2, 8, 0)) {
+ if (cairo != 0) {
if ((data.style & SWT.MIRRORED) != 0) {
Cairo.cairo_save(cairo);
Cairo.cairo_scale(cairo, -1, 1);
@@ -573,7 +593,9 @@ void drawWithCairo(GC gc, int x, int y, int start, int end, boolean fullSelectio
}
Cairo.cairo_set_source_rgba(cairo, (fg.red & 0xFFFF) / (float)0xFFFF, (fg.green & 0xFFFF) / (float)0xFFFF, (fg.blue & 0xFFFF) / (float)0xFFFF, data.alpha / (float)0xFF);
Cairo.cairo_move_to(cairo, x, y);
+ OS.pango_layout_set_attributes(layout, selAttrList);
OS.pango_cairo_show_layout(cairo, layout);
+ OS.pango_layout_set_attributes(layout, attrList);
drawBorder(gc, x, y, fg);
Cairo.cairo_restore(cairo);
}
@@ -584,7 +606,7 @@ void drawBorder(GC gc, int x, int y, GdkColor selectionColor) {
int /*long*/ gdkGC = gc.handle;
int /*long*/ ptr = OS.pango_layout_get_text(layout);
GdkGCValues gcValues = null;
- if (cairo != 0 && OS.GTK_VERSION >= OS.VERSION(2, 8, 0)) {
+ if (cairo != 0) {
Cairo.cairo_save(cairo);
}
for (int i = 0; i < stylesCount - 1; i++) {
@@ -620,7 +642,7 @@ void drawBorder(GC gc, int x, int y, GdkColor selectionColor) {
case SWT.BORDER_DASH: dashes = width != 0 ? GC.LINE_DASH : GC.LINE_DASH_ZERO; break;
case SWT.BORDER_DOT: dashes = width != 0 ? GC.LINE_DOT : GC.LINE_DOT_ZERO; break;
}
- if (cairo != 0 && OS.GTK_VERSION >= OS.VERSION(2, 8, 0)) {
+ if (cairo != 0) {
Cairo.cairo_set_source_rgba(cairo, (color.red & 0xFFFF) / (float)0xFFFF, (color.green & 0xFFFF) / (float)0xFFFF, (color.blue & 0xFFFF) / (float)0xFFFF, data.alpha / (float)0xFF);
Cairo.cairo_set_line_width(cairo, width);
if (dashes != null) {
@@ -666,178 +688,13 @@ void drawBorder(GC gc, int x, int y, GdkColor selectionColor) {
OS.gdk_region_destroy(rgn);
}
}
-
- boolean drawUnderline = false;
- if (style.underline && style.underlineColor != null) drawUnderline = true;
- if (style.underline && (style.underlineStyle == SWT.UNDERLINE_ERROR || style.underlineStyle == SWT.UNDERLINE_SQUIGGLE)&& OS.GTK_VERSION < OS.VERSION(2, 4, 0)) drawUnderline = true;
- if (drawUnderline && !style.isAdherentUnderline(styles[i+1].style)) {
- int start = styles[i].start;
- for (int j = i; j > 0 && style.isAdherentUnderline(styles[j-1].style); j--) {
- start = styles[j - 1].start;
- }
- start = translateOffset(start);
- int end = translateOffset(styles[i+1].start - 1);
- int byteStart = (int)/*64*/(OS.g_utf16_offset_to_pointer(ptr, start) - ptr);
- int byteEnd = (int)/*64*/(OS.g_utf16_offset_to_pointer(ptr, end + 1) - ptr);
- int[] ranges = new int[]{byteStart, byteEnd};
- int /*long*/ rgn = OS.gdk_pango_layout_get_clip_region(layout, x, y, ranges, ranges.length / 2);
- if (rgn != 0) {
- int[] nRects = new int[1];
- int /*long*/[] rects = new int /*long*/[1];
- OS.gdk_region_get_rectangles(rgn, rects, nRects);
- GdkRectangle rect = new GdkRectangle();
- GdkColor color = null;
- if (color == null && style.underlineColor != null) color = style.underlineColor.handle;
- if (color == null && selectionColor != null) color = selectionColor;
- if (color == null && style.foreground != null) color = style.foreground.handle;
- if (color == null) color = data.foreground;
- if (cairo != 0 && OS.GTK_VERSION >= OS.VERSION(2, 8, 0)) {
- Cairo.cairo_set_source_rgba(cairo, (color.red & 0xFFFF) / (float)0xFFFF, (color.green & 0xFFFF) / (float)0xFFFF, (color.blue & 0xFFFF) / (float)0xFFFF, data.alpha / (float)0xFF);
- } else {
- if (gcValues == null) {
- gcValues = new GdkGCValues();
- OS.gdk_gc_get_values(gdkGC, gcValues);
- }
- OS.gdk_gc_set_foreground(gdkGC, color);
- }
- int underlinePosition = -1;
- int underlineThickness = 1;
- if (OS.GTK_VERSION >= OS.VERSION(2, 6, 0)) {
- Font font = style.font;
- if (font == null) font = this.font;
- if (font == null) font = device.systemFont;
- int /*long*/ lang = OS.pango_context_get_language(context);
- int /*long*/ metrics = OS.pango_context_get_metrics(context, font.handle, lang);
- underlinePosition = OS.PANGO_PIXELS(OS.pango_font_metrics_get_underline_position(metrics));
- underlineThickness = OS.PANGO_PIXELS(OS.pango_font_metrics_get_underline_thickness(metrics));
- OS.pango_font_metrics_unref(metrics);
- }
- for (int j=0; j<nRects[0]; j++) {
- OS.memmove(rect, rects[0] + (j * GdkRectangle.sizeof), GdkRectangle.sizeof);
- int offset = getOffset(rect.x - x, rect.y - y, null);
- int lineIndex = getLineIndex(offset);
- FontMetrics metrics = getLineMetrics(lineIndex);
- int underlineY = rect.y + metrics.ascent - underlinePosition - style.rise;
- switch (style.underlineStyle) {
- case SWT.UNDERLINE_SQUIGGLE:
- case SWT.UNDERLINE_ERROR: {
- int squigglyThickness = underlineThickness;
- int squigglyHeight = 2 * squigglyThickness;
- int squigglyY = Math.min(underlineY, rect.y + rect.height - squigglyHeight - 1);
- int[] points = computePolyline(rect.x, squigglyY, rect.x + rect.width, squigglyY + squigglyHeight);
- if (cairo != 0 && OS.GTK_VERSION >= OS.VERSION(2, 8, 0)) {
- Cairo.cairo_set_line_width(cairo, squigglyThickness);
- Cairo.cairo_set_line_cap(cairo, Cairo.CAIRO_LINE_CAP_BUTT);
- Cairo.cairo_set_line_join(cairo, Cairo.CAIRO_LINE_JOIN_MITER);
- if (points.length > 0) {
- double xOffset = 0.5, yOffset = 0.5;
- Cairo.cairo_move_to(cairo, points[0] + xOffset, points[1] + yOffset);
- for (int k = 2; k < points.length; k += 2) {
- Cairo.cairo_line_to(cairo, points[k] + xOffset, points[k + 1] + yOffset);
- }
- Cairo.cairo_stroke(cairo);
- }
- } else {
- OS.gdk_gc_set_line_attributes(gdkGC, squigglyThickness, OS.GDK_LINE_SOLID, OS.GDK_CAP_BUTT, OS.GDK_JOIN_MITER);
- OS.gdk_draw_lines(data.drawable, gdkGC, points, points.length / 2);
- }
- break;
- }
- case SWT.UNDERLINE_DOUBLE:
- if (cairo != 0 && OS.GTK_VERSION >= OS.VERSION(2, 8, 0)) {
- Cairo.cairo_rectangle(cairo, rect.x, underlineY + underlineThickness * 2, rect.width, underlineThickness);
- Cairo.cairo_fill(cairo);
- } else {
- OS.gdk_draw_rectangle(data.drawable, gdkGC, 1, rect.x, underlineY + underlineThickness * 2, rect.width, underlineThickness);
- }
- //FALLTHROUGH
- case SWT.UNDERLINE_LINK:
- case SWT.UNDERLINE_SINGLE:
- if (cairo != 0 && OS.GTK_VERSION >= OS.VERSION(2, 8, 0)) {
- Cairo.cairo_rectangle(cairo, rect.x, underlineY, rect.width, underlineThickness);
- Cairo.cairo_fill(cairo);
- } else {
- OS.gdk_draw_rectangle(data.drawable, gdkGC, 1, rect.x, underlineY, rect.width, underlineThickness);
- }
- break;
- }
- }
- if (rects[0] != 0) OS.g_free(rects[0]);
- OS.gdk_region_destroy(rgn);
- }
- }
-
- boolean drawStrikeout = false;
- if (style.strikeout && style.strikeoutColor != null) drawStrikeout = true;
- if (drawStrikeout && !style.isAdherentStrikeout(styles[i+1].style)) {
- int start = styles[i].start;
- for (int j = i; j > 0 && style.isAdherentStrikeout(styles[j-1].style); j--) {
- start = styles[j - 1].start;
- }
- start = translateOffset(start);
- int end = translateOffset(styles[i+1].start - 1);
- int byteStart = (int)/*64*/(OS.g_utf16_offset_to_pointer(ptr, start) - ptr);
- int byteEnd = (int)/*64*/(OS.g_utf16_offset_to_pointer(ptr, end + 1) - ptr);
- int[] ranges = new int[]{byteStart, byteEnd};
- int /*long*/ rgn = OS.gdk_pango_layout_get_clip_region(layout, x, y, ranges, ranges.length / 2);
- if (rgn != 0) {
- int[] nRects = new int[1];
- int /*long*/[] rects = new int /*long*/[1];
- OS.gdk_region_get_rectangles(rgn, rects, nRects);
- GdkRectangle rect = new GdkRectangle();
- GdkColor color = null;
- if (color == null && style.strikeoutColor != null) color = style.strikeoutColor.handle;
- if (color == null && selectionColor != null) color = selectionColor;
- if (color == null && style.foreground != null) color = style.foreground.handle;
- if (color == null) color = data.foreground;
- if (cairo != 0 && OS.GTK_VERSION >= OS.VERSION(2, 8, 0)) {
- Cairo.cairo_set_source_rgba(cairo, (color.red & 0xFFFF) / (float)0xFFFF, (color.green & 0xFFFF) / (float)0xFFFF, (color.blue & 0xFFFF) / (float)0xFFFF, data.alpha / (float)0xFF);
- } else {
- if (gcValues == null) {
- gcValues = new GdkGCValues();
- OS.gdk_gc_get_values(gdkGC, gcValues);
- }
- OS.gdk_gc_set_foreground(gdkGC, color);
- }
- int strikeoutPosition = -1;
- int strikeoutThickness = 1;
- if (OS.GTK_VERSION >= OS.VERSION(2, 6, 0)) {
- Font font = style.font;
- if (font == null) font = this.font;
- if (font == null) font = device.systemFont;
- int /*long*/ lang = OS.pango_context_get_language(context);
- int /*long*/ metrics = OS.pango_context_get_metrics(context, font.handle, lang);
- strikeoutPosition = OS.PANGO_PIXELS(OS.pango_font_metrics_get_strikethrough_position(metrics));
- strikeoutThickness = OS.PANGO_PIXELS(OS.pango_font_metrics_get_strikethrough_thickness(metrics));
- OS.pango_font_metrics_unref(metrics);
- }
- for (int j=0; j<nRects[0]; j++) {
- OS.memmove(rect, rects[0] + (j * GdkRectangle.sizeof), GdkRectangle.sizeof);
- int strikeoutY = rect.y + rect.height / 2 - style.rise;
- if (OS.GTK_VERSION >= OS.VERSION(2, 6, 0)) {
- int offset = getOffset(rect.x - x, rect.y - y, null);
- int lineIndex = getLineIndex(offset);
- FontMetrics metrics = getLineMetrics(lineIndex);
- strikeoutY = rect.y + metrics.ascent - strikeoutPosition - style.rise;
- }
- if (cairo != 0 && OS.GTK_VERSION >= OS.VERSION(2, 8, 0)) {
- Cairo.cairo_rectangle(cairo, rect.x, strikeoutY, rect.width, strikeoutThickness);
- Cairo.cairo_fill(cairo);
- } else {
- OS.gdk_draw_rectangle(data.drawable, gdkGC, 1, rect.x, strikeoutY, rect.width, strikeoutThickness);
- }
- }
- if (rects[0] != 0) OS.g_free(rects[0]);
- OS.gdk_region_destroy(rgn);
- }
- }
}
if (gcValues != null) {
int mask = OS.GDK_GC_FOREGROUND | OS.GDK_GC_LINE_WIDTH | OS.GDK_GC_LINE_STYLE | OS.GDK_GC_CAP_STYLE | OS.GDK_GC_JOIN_STYLE;
OS.gdk_gc_set_values(gdkGC, gcValues, mask);
data.state &= ~GC.LINE_STYLE;
}
- if (cairo != 0 && OS.GTK_VERSION >= OS.VERSION(2, 8, 0)) {
+ if (cairo != 0) {
Cairo.cairo_restore(cairo);
}
}
@@ -847,6 +704,10 @@ void freeRuns() {
OS.pango_layout_set_attributes(layout, 0);
OS.pango_attr_list_unref(attrList);
attrList = 0;
+ if (selAttrList != 0) {
+ OS.pango_attr_list_unref(selAttrList);
+ selAttrList = 0;
+ }
invalidOffsets = null;
}
@@ -1345,7 +1206,7 @@ int _getOffset (int offset, int movement, boolean forward) {
PangoLogAttr logAttr = new PangoLogAttr();
while (0 <= utf8Offset && utf8Offset <= utf8Length) {
OS.memmove(logAttr, attrs[0] + utf8Offset * PangoLogAttr.sizeof, PangoLogAttr.sizeof);
- boolean found = false;
+ boolean found = false, limit = false;
if (((movement & SWT.MOVEMENT_CLUSTER) != 0) && logAttr.is_cursor_position) found = true;
if ((movement & SWT.MOVEMENT_WORD) != 0) {
if (forward) {
@@ -1362,9 +1223,14 @@ int _getOffset (int offset, int movement, boolean forward) {
if (logAttr.is_word_end) found = true;
if (logAttr.is_sentence_start) found = true;
}
- if (found) {
+ if (forward) {
+ if (utf8Offset == utf8Length) limit = true;
+ } else {
+ if (utf8Offset == 0) limit = true;
+ }
+ if (found || limit) {
int testOffset = (int)/*64*/OS.g_utf8_offset_to_utf16_offset (ptr, utf8Offset);
- if (invalidOffsets != null) {
+ if (found && invalidOffsets != null) {
for (int i = 0; i < invalidOffsets.length; i++) {
if (testOffset == invalidOffsets[i]) {
found = false;
@@ -1372,7 +1238,7 @@ int _getOffset (int offset, int movement, boolean forward) {
}
}
}
- if (found) {
+ if (found || limit) {
offset = untranslateOffset(testOffset);
break;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
index 862ed982d0..33681fb533 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
@@ -503,7 +503,7 @@ int /*long*/ gtk_focus_out_event (int /*long*/ widget, int /*long*/ event) {
int /*long*/ result = super.gtk_focus_out_event (widget, event);
// widget could be disposed at this point
if (handle == 0) return 0;
- if ((style & SWT.PUSH) != 0 && !OS.GTK_WIDGET_HAS_DEFAULT (handle)) {
+ if ((style & SWT.PUSH) != 0) {
Decorations menuShell = menuShell ();
if (menuShell.defaultButton == this) {
menuShell.defaultButton = null;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
index 3582fac77e..c4b4978bd1 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
@@ -57,12 +57,12 @@ import org.eclipse.swt.events.*;
* @noextend This class is not intended to be subclassed by clients.
*/
public class Combo extends Composite {
- int /*long*/ buttonHandle, entryHandle, listHandle, textRenderer, cellHandle, popupHandle, menuHandle;
+ int /*long*/ buttonHandle, entryHandle, textRenderer, cellHandle, popupHandle, menuHandle;
int lastEventTime, visibleCount = 10;
int /*long*/ gdkEventKey = 0;
int fixStart = -1, fixEnd = -1;
String [] items = new String [0];
- boolean ignoreSelect, lockText, selectionAdded;
+ boolean selectionAdded;
int indexSelected;
/**
* the operating system limit for the number of characters
@@ -169,28 +169,9 @@ public void add (String string, int index) {
System.arraycopy (items, index, newItems, index + 1, items.length - index);
items = newItems;
byte [] buffer = Converter.wcsToMbcs (null, string, true);
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
- OS.gtk_combo_box_insert_text (handle, index, buffer);
- if ((style & SWT.RIGHT_TO_LEFT) != 0 && popupHandle != 0) {
- OS.gtk_container_forall (popupHandle, display.setDirectionProc, OS.GTK_TEXT_DIR_RTL);
- }
- } else {
- /*
- * Feature in GTK. When the list is empty and the first item
- * is added, the combo box selects that item replacing the
- * text in the entry field. The fix is to avoid this by
- * stopping the "delete" and "insert_text" signal emission.
- */
- ignoreSelect = lockText = true;
- int /*long*/ item = OS.gtk_list_item_new_with_label (buffer);
- int /*long*/ label = OS.gtk_bin_get_child (item);
- setForegroundColor (label, getForegroundColor ());
- OS.gtk_widget_modify_font (label, getFontDescription ());
- OS.gtk_widget_set_direction (label, OS.gtk_widget_get_direction (handle));
- OS.gtk_widget_show (item);
- int /*long*/ items = OS.g_list_append (0, item);
- OS.gtk_list_insert_items (listHandle, items, index);
- ignoreSelect = lockText = false;
+ OS.gtk_combo_box_insert_text (handle, index, buffer);
+ if ((style & SWT.RIGHT_TO_LEFT) != 0 && popupHandle != 0) {
+ OS.gtk_container_forall (popupHandle, display.setDirectionProc, OS.GTK_TEXT_DIR_RTL);
}
}
@@ -338,63 +319,29 @@ public void clearSelection () {
}
void clearText () {
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
- OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED);
- if ((style & SWT.READ_ONLY) != 0) {
- int index = OS.gtk_combo_box_get_active (handle);
- if (index != -1) {
- int /*long*/ modelHandle = OS.gtk_combo_box_get_model (handle);
- int /*long*/ [] ptr = new int /*long*/ [1];
- int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ());
- OS.gtk_tree_model_iter_nth_child (modelHandle, iter, 0, index);
- OS.gtk_tree_model_get (modelHandle, iter, 0, ptr, -1);
- OS.g_free (iter);
- if (ptr [0] != 0 && OS.strlen (ptr [0]) > 0) postEvent (SWT.Modify);
- OS.g_free (ptr [0]);
- }
- } else {
- OS.gtk_entry_set_text (entryHandle, new byte[1]);
+ OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED);
+ if ((style & SWT.READ_ONLY) != 0) {
+ int index = OS.gtk_combo_box_get_active (handle);
+ if (index != -1) {
+ int /*long*/ modelHandle = OS.gtk_combo_box_get_model (handle);
+ int /*long*/ [] ptr = new int /*long*/ [1];
+ int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ());
+ OS.gtk_tree_model_iter_nth_child (modelHandle, iter, 0, index);
+ OS.gtk_tree_model_get (modelHandle, iter, 0, ptr, -1);
+ OS.g_free (iter);
+ if (ptr [0] != 0 && OS.strlen (ptr [0]) > 0) postEvent (SWT.Modify);
+ OS.g_free (ptr [0]);
}
- OS.gtk_combo_box_set_active (handle, -1);
- OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED);
+ } else {
+ OS.gtk_entry_set_text (entryHandle, new byte[1]);
}
+ OS.gtk_combo_box_set_active (handle, -1);
+ OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED);
}
public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget ();
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
- return computeNativeSize (handle, wHint, hHint, changed);
- }
- if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0;
- if (hHint != SWT.DEFAULT && hHint < 0) hHint = 0;
- int[] w = new int [1], h = new int [1];
- OS.gtk_widget_realize (entryHandle);
- int /*long*/ layout = OS.gtk_entry_get_layout (entryHandle);
- OS.pango_layout_get_size (layout, w, h);
- int xborder = Display.INNER_BORDER, yborder = Display.INNER_BORDER;
- int /*long*/ style = OS.gtk_widget_get_style (entryHandle);
- xborder += OS.gtk_style_get_xthickness (style);
- yborder += OS.gtk_style_get_ythickness (style);
- int [] property = new int [1];
- OS.gtk_widget_style_get (entryHandle, OS.interior_focus, property, 0);
- if (property [0] == 0) {
- OS.gtk_widget_style_get (entryHandle, OS.focus_line_width, property, 0);
- xborder += property [0];
- yborder += property [0];
- }
- int width = OS.PANGO_PIXELS (w [0]) + xborder * 2;
- int height = OS.PANGO_PIXELS (h [0]) + yborder * 2;
-
- GtkRequisition arrowRequesition = new GtkRequisition ();
- OS.gtk_widget_size_request (buttonHandle, arrowRequesition);
- GtkRequisition listRequesition = new GtkRequisition ();
- int /*long*/ listParent = OS.gtk_widget_get_parent (listHandle);
- OS.gtk_widget_size_request (listParent != 0 ? listParent : listHandle, listRequesition);
-
- width = Math.max (listRequesition.width, width) + arrowRequesition.width + 4;
- width = wHint == SWT.DEFAULT ? width : wHint;
- height = hHint == SWT.DEFAULT ? height : hHint;
- return new Point (width, height);
+ return computeNativeSize (handle, wHint, hHint, changed);
}
/**
@@ -420,110 +367,60 @@ void createHandle (int index) {
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
OS.gtk_fixed_set_has_window (fixedHandle, true);
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
- int /*long*/ oldList = OS.gtk_window_list_toplevels ();
- if ((style & SWT.READ_ONLY) != 0) {
- handle = OS.gtk_combo_box_new_text ();
- if (handle == 0) error (SWT.ERROR_NO_HANDLES);
- cellHandle = OS.gtk_bin_get_child (handle);
- if (cellHandle == 0) error (SWT.ERROR_NO_HANDLES);
- } else {
- handle = OS.gtk_combo_box_entry_new_text ();
- if (handle == 0) error (SWT.ERROR_NO_HANDLES);
- entryHandle = OS.gtk_bin_get_child (handle);
- if (entryHandle == 0) error (SWT.ERROR_NO_HANDLES);
- }
- popupHandle = findPopupHandle (oldList);
- OS.gtk_container_add (fixedHandle, handle);
- textRenderer = OS.gtk_cell_renderer_text_new ();
- if (textRenderer == 0) error (SWT.ERROR_NO_HANDLES);
- /*
- * Feature in GTK. In order to make a read only combo box the same
- * height as an editable combo box the ypad must be set to 0. In
- * versions 2.4.x of GTK, a pad of 0 will clip some letters. The
- * fix is to set the pad to 1.
- */
- int pad = 0;
- if (OS.GTK_VERSION < OS.VERSION(2, 6, 0)) pad = 1;
- OS.g_object_set (textRenderer, OS.ypad, pad, 0);
- /*
- * Feature in GTK. In version 2.4.9 of GTK, a warning is issued
- * when a call to gtk_cell_layout_clear() is made. The fix is to hide
- * the warning.
- */
- boolean warnings = display.getWarnings ();
- display.setWarnings (false);
- OS.gtk_cell_layout_clear (handle);
- display.setWarnings (warnings);
- OS.gtk_cell_layout_pack_start (handle, textRenderer, true);
- OS.gtk_cell_layout_set_attributes (handle, textRenderer, OS.text, 0, 0);
- /*
- * Feature in GTK. Toggle button creation differs between GTK versions. The
- * fix is to call size_request() to force the creation of the button
- * for those versions of GTK that defer the creation.
- */
- if (OS.GTK_VERSION < OS.VERSION (2, 8, 0)) {
- OS.gtk_widget_size_request(handle, new GtkRequisition());
- }
- if (popupHandle != 0) findMenuHandle ();
- findButtonHandle ();
- /*
- * Feature in GTK. By default, read only combo boxes
- * process the RETURN key rather than allowing the
- * default button to process the key. The fix is to
- * clear the GTK_RECEIVES_DEFAULT flag.
- */
- if ((style & SWT.READ_ONLY) != 0 && buttonHandle != 0) {
- OS.GTK_WIDGET_UNSET_FLAGS (buttonHandle, OS.GTK_RECEIVES_DEFAULT);
- }
+ int /*long*/ oldList = OS.gtk_window_list_toplevels ();
+ if ((style & SWT.READ_ONLY) != 0) {
+ handle = OS.gtk_combo_box_new_text ();
+ if (handle == 0) error (SWT.ERROR_NO_HANDLES);
+ cellHandle = OS.gtk_bin_get_child (handle);
+ if (cellHandle == 0) error (SWT.ERROR_NO_HANDLES);
} else {
- handle = OS.gtk_combo_new ();
+ handle = OS.gtk_combo_box_entry_new_text ();
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_container_add (fixedHandle, handle);
- GtkCombo combo = new GtkCombo ();
- OS.memmove (combo, handle);
- entryHandle = combo.entry;
- listHandle = combo.list;
-
- if (OS.GTK_VERSION < OS.VERSION (2, 4, 0)) {
- int /*long*/ parentHandle = 0;
- int /*long*/ temp = listHandle;
- while ((temp = OS.gtk_widget_get_parent(temp)) != 0) {
- parentHandle = temp;
- }
- popupHandle = parentHandle;
- if (popupHandle != 0) {
- int /*long*/ modalGroup = getShell().modalGroup;
- if (modalGroup != 0) {
- OS.gtk_window_group_add_window (modalGroup, popupHandle);
- }
- }
- }
- /*
- * Feature in GTK. There is no API to query the arrow
- * handle from a combo box although it is possible to
- * get the list and text field. The arrow handle is needed
- * to hook events. The fix is to find the first child that is
- * not the entry or list and assume this is the arrow handle.
- */
- int /*long*/ list = OS.gtk_container_get_children (handle);
- if (list != 0) {
- int i = 0, count = OS.g_list_length (list);
- while (i<count) {
- int /*long*/ childHandle = OS.g_list_nth_data (list, i);
- if (childHandle != entryHandle && childHandle != listHandle) {
- buttonHandle = childHandle;
- break;
- }
- i++;
- }
- OS.g_list_free (list);
- }
-
- boolean editable = (style & SWT.READ_ONLY) == 0;
- OS.gtk_editable_set_editable (entryHandle, editable);
- OS.gtk_combo_disable_activate (handle);
- OS.gtk_combo_set_case_sensitive (handle, true);
+ entryHandle = OS.gtk_bin_get_child (handle);
+ if (entryHandle == 0) error (SWT.ERROR_NO_HANDLES);
+ }
+ popupHandle = findPopupHandle (oldList);
+ OS.gtk_container_add (fixedHandle, handle);
+ textRenderer = OS.gtk_cell_renderer_text_new ();
+ if (textRenderer == 0) error (SWT.ERROR_NO_HANDLES);
+ /*
+ * Feature in GTK. In order to make a read only combo box the same
+ * height as an editable combo box the ypad must be set to 0. In
+ * versions 2.4.x of GTK, a pad of 0 will clip some letters. The
+ * fix is to set the pad to 1.
+ */
+ int pad = 0;
+ if (OS.GTK_VERSION < OS.VERSION(2, 6, 0)) pad = 1;
+ OS.g_object_set (textRenderer, OS.ypad, pad, 0);
+ /*
+ * Feature in GTK. In version 2.4.9 of GTK, a warning is issued
+ * when a call to gtk_cell_layout_clear() is made. The fix is to hide
+ * the warning.
+ */
+ boolean warnings = display.getWarnings ();
+ display.setWarnings (false);
+ OS.gtk_cell_layout_clear (handle);
+ display.setWarnings (warnings);
+ OS.gtk_cell_layout_pack_start (handle, textRenderer, true);
+ OS.gtk_cell_layout_set_attributes (handle, textRenderer, OS.text, 0, 0);
+ /*
+ * Feature in GTK. Toggle button creation differs between GTK versions. The
+ * fix is to call size_request() to force the creation of the button
+ * for those versions of GTK that defer the creation.
+ */
+ if (OS.GTK_VERSION < OS.VERSION (2, 8, 0)) {
+ OS.gtk_widget_size_request(handle, new GtkRequisition());
+ }
+ if (popupHandle != 0) findMenuHandle ();
+ findButtonHandle ();
+ /*
+ * Feature in GTK. By default, read only combo boxes
+ * process the RETURN key rather than allowing the
+ * default button to process the key. The fix is to
+ * clear the GTK_RECEIVES_DEFAULT flag.
+ */
+ if ((style & SWT.READ_ONLY) != 0 && buttonHandle != 0) {
+ OS.GTK_WIDGET_UNSET_FLAGS (buttonHandle, OS.GTK_RECEIVES_DEFAULT);
}
}
@@ -550,7 +447,6 @@ void deregister () {
super.deregister ();
if (buttonHandle != 0) display.removeWidget (buttonHandle);
if (entryHandle != 0) display.removeWidget (entryHandle);
- if (listHandle != 0) display.removeWidget (listHandle);
if (popupHandle != 0) display.removeWidget (popupHandle);
if (menuHandle != 0) display.removeWidget (menuHandle);
int /*long*/ imContext = imContext ();
@@ -627,7 +523,7 @@ void findButtonHandle() {
void findMenuHandle() {
OS.gtk_container_forall (popupHandle, display.allChildrenProc, 0);
if (display.allChildren != 0) {
- int /*long*/ list = display.allChildren;
+ int /*long*/ list = display.allChildren;
while (list != 0) {
int /*long*/ widget = OS.g_list_data (list);
if (OS.G_OBJECT_TYPE (widget) == OS.GTK_TYPE_MENU ()) {
@@ -636,8 +532,8 @@ void findMenuHandle() {
}
list = OS.g_list_next (list);
}
- OS.g_list_free (display.allChildren);
- display.allChildren = 0;
+ OS.g_list_free (display.allChildren);
+ display.allChildren = 0;
}
}
@@ -679,9 +575,7 @@ int /*long*/ fontHandle () {
}
int /*long*/ focusHandle () {
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
- if ((style & SWT.READ_ONLY) != 0 && buttonHandle != 0) return buttonHandle;
- }
+ if ((style & SWT.READ_ONLY) != 0 && buttonHandle != 0) return buttonHandle;
if (entryHandle != 0) return entryHandle;
return super.focusHandle ();
}
@@ -689,15 +583,12 @@ int /*long*/ focusHandle () {
boolean hasFocus () {
if (super.hasFocus ()) return true;
if (entryHandle != 0 && OS.GTK_WIDGET_HAS_FOCUS (entryHandle)) return true;
- if (listHandle != 0 && OS.GTK_WIDGET_HAS_FOCUS (listHandle)) return true;
return false;
}
void hookEvents () {
super.hookEvents ();
- if (OS.GTK_VERSION >= OS.VERSION(2, 4, 0)) {
- OS.g_signal_connect_closure (handle, OS.changed, display.closures [CHANGED], true);
- }
+ OS.g_signal_connect_closure (handle, OS.changed, display.closures [CHANGED], true);
if (entryHandle != 0) {
OS.g_signal_connect_closure (entryHandle, OS.changed, display.closures [CHANGED], true);
@@ -708,7 +599,7 @@ void hookEvents () {
}
int eventMask = OS.GDK_POINTER_MOTION_MASK | OS.GDK_BUTTON_PRESS_MASK |
OS.GDK_BUTTON_RELEASE_MASK;
- int /*long*/ [] handles = new int /*long*/ [] {buttonHandle, entryHandle, listHandle, menuHandle};
+ int /*long*/ [] handles = new int /*long*/ [] {buttonHandle, entryHandle, menuHandle};
for (int i=0; i<handles.length; i++) {
int /*long*/ eventHandle = handles [i];
if (eventHandle != 0) {
@@ -764,22 +655,9 @@ int /*long*/ imContext () {
public void deselect (int index) {
checkWidget();
if (index < 0 || index >= items.length) return;
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
if (OS.gtk_combo_box_get_active (handle) == index) {
clearText ();
}
- } else {
- ignoreSelect = true;
- int /*long*/ children = OS.gtk_container_get_children (listHandle);
- int /*long*/ item = OS.g_list_nth_data (children, index);
- boolean selected = OS.GTK_WIDGET_STATE (item) == OS.GTK_STATE_SELECTED;
- if (selected) {
- OS.gtk_list_unselect_all (listHandle);
- OS.gtk_entry_set_text (entryHandle, new byte[1]);
- }
- OS.g_list_free (children);
- ignoreSelect = false;
- }
}
/**
@@ -798,14 +676,7 @@ public void deselect (int index) {
*/
public void deselectAll () {
checkWidget();
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
- clearText ();
- } else {
- ignoreSelect = true;
- OS.gtk_list_unselect_all (listHandle);
- OS.gtk_entry_set_text (entryHandle, new byte[1]);
- ignoreSelect = false;
- }
+ clearText ();
}
boolean dragDetect(int x, int y, boolean filter, boolean dragOnTimeout, boolean[] consume) {
@@ -926,7 +797,7 @@ public int getItemCount () {
*/
public int getItemHeight () {
checkWidget();
- return fontHeight (getFontDescription (), listHandle != 0 ? listHandle : handle);
+ return fontHeight (getFontDescription (), handle);
}
/**
@@ -973,10 +844,7 @@ public String [] getItems () {
*/
public boolean getListVisible () {
checkWidget ();
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
- return popupHandle != 0 && OS.GTK_WIDGET_VISIBLE (popupHandle);
- }
- return false;
+ return popupHandle != 0 && OS.GTK_WIDGET_VISIBLE (popupHandle);
}
String getNameText () {
@@ -1022,13 +890,8 @@ public Point getSelection () {
checkWidget ();
if ((style & SWT.READ_ONLY) != 0) {
int length = 0;
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
- int index = OS.gtk_combo_box_get_active (handle);
- if (index != -1) length = getItem (index).length ();
- } else {
- int /*long*/ str = OS.gtk_entry_get_text (entryHandle);
- if (str != 0) length = (int)/*64*/OS.g_utf16_strlen (str, -1);
- }
+ int index = OS.gtk_combo_box_get_active (handle);
+ if (index != -1) length = getItem (index).length ();
return new Point (0, length);
}
int [] start = new int [1];
@@ -1055,23 +918,7 @@ public Point getSelection () {
*/
public int getSelectionIndex () {
checkWidget();
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
- return OS.gtk_combo_box_get_active (handle);
- }
- int index = 0, result = -1;
- int /*long*/ children = OS.gtk_container_get_children (listHandle);
- int /*long*/ temp = children;
- while (temp != 0) {
- int /*long*/ item = OS.g_list_data (temp);
- if (OS.GTK_WIDGET_STATE (item) == OS.GTK_STATE_SELECTED) {
- result = index;
- break;
- }
- index++;
- temp = OS.g_list_next (temp);
- }
- OS.g_list_free (children);
- return result;
+ return OS.gtk_combo_box_get_active (handle);
}
/**
@@ -1181,53 +1028,35 @@ int /*long*/ gtk_button_press_event (int /*long*/ widget, int /*long*/ event) {
* the left mouse button event from being propagated. The fix is to
* send the mouse event from the event_after handler.
*/
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
- GdkEventButton gdkEvent = new GdkEventButton ();
- OS.memmove (gdkEvent, event, GdkEventButton.sizeof);
- if (gdkEvent.type == OS.GDK_BUTTON_PRESS && gdkEvent.button == 1) {
- return gtk_button_press_event(widget, event, false);
- }
+ GdkEventButton gdkEvent = new GdkEventButton ();
+ OS.memmove (gdkEvent, event, GdkEventButton.sizeof);
+ if (gdkEvent.type == OS.GDK_BUTTON_PRESS && gdkEvent.button == 1) {
+ return gtk_button_press_event(widget, event, false);
}
return super.gtk_button_press_event (widget, event);
}
int /*long*/ gtk_changed (int /*long*/ widget) {
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
- if (widget == handle) {
- if (entryHandle == 0) {
- sendEvent(SWT.Modify);
- if (isDisposed ()) return 0;
- }
- /*
- * Feature in GTK. GTK emits a changed signal whenever
- * the contents of a combo box are altered by typing or
- * by selecting an item in the list, but the event should
- * only be sent when the list is selected. The fix is to
- * only send out a selection event when there is a selected
- * item.
- *
- * NOTE: This code relies on GTK clearing the selected
- * item and not matching the item as the user types.
- */
- int index = OS.gtk_combo_box_get_active (handle);
- if (index != -1) sendSelectionEvent (SWT.Selection);
- indexSelected = -1;
- return 0;
- }
- } else {
- if (!ignoreSelect) {
- int /*long*/ ptr = OS.gtk_entry_get_text (entryHandle);
- int length = OS.strlen (ptr);
- byte [] buffer = new byte [length];
- OS.memmove (buffer, ptr, length);
- String text = new String (Converter.mbcsToWcs (null, buffer));
- for (int i = 0; i < items.length; i++) {
- if (items [i].equals (text)) {
- sendSelectionEvent (SWT.Selection);
- break;
- }
- }
+ if (widget == handle) {
+ if (entryHandle == 0) {
+ sendEvent(SWT.Modify);
+ if (isDisposed ()) return 0;
}
+ /*
+ * Feature in GTK. GTK emits a changed signal whenever
+ * the contents of a combo box are altered by typing or
+ * by selecting an item in the list, but the event should
+ * only be sent when the list is selected. The fix is to
+ * only send out a selection event when there is a selected
+ * item.
+ *
+ * NOTE: This code relies on GTK clearing the selected
+ * item and not matching the item as the user types.
+ */
+ int index = OS.gtk_combo_box_get_active (handle);
+ if (index != -1) sendSelectionEvent (SWT.Selection);
+ indexSelected = -1;
+ return 0;
}
/*
* Feature in GTK. When the user types, GTK positions
@@ -1295,11 +1124,6 @@ int /*long*/ gtk_commit (int /*long*/ imContext, int /*long*/ text) {
}
int /*long*/ gtk_delete_text (int /*long*/ widget, int /*long*/ start_pos, int /*long*/ end_pos) {
- if (lockText) {
- OS.gtk_list_unselect_item (listHandle, 0);
- OS.g_signal_stop_emission_by_name (entryHandle, OS.delete_text);
- return 0;
- }
if (!hooks (SWT.Verify) && !filters (SWT.Verify)) return 0;
int /*long*/ ptr = OS.gtk_entry_get_text (entryHandle);
if (end_pos == -1) end_pos = OS.g_utf8_strlen (ptr, -1);
@@ -1338,52 +1162,50 @@ int /*long*/ gtk_event_after (int /*long*/ widget, int /*long*/ gdkEvent) {
* user clicks on the drop down button focus is assigned to the text
* field.
*/
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
- GdkEvent event = new GdkEvent ();
- OS.memmove (event, gdkEvent, GdkEvent.sizeof);
- switch (event.type) {
- case OS.GDK_BUTTON_PRESS: {
- if (OS.GTK_VERSION < OS.VERSION (2, 8, 0) && !selectionAdded) {
- int /*long*/ grabHandle = OS.gtk_grab_get_current ();
- if (grabHandle != 0) {
- if (OS.G_OBJECT_TYPE (grabHandle) == OS.GTK_TYPE_MENU ()) {
- menuHandle = grabHandle;
- OS.g_signal_connect_closure_by_id (menuHandle, display.signalIds [BUTTON_RELEASE_EVENT], 0, display.closures [BUTTON_RELEASE_EVENT], false);
- OS.g_signal_connect_closure_by_id (menuHandle, display.signalIds [BUTTON_RELEASE_EVENT], 0, display.closures [BUTTON_RELEASE_EVENT_INVERSE], true);
- OS.g_signal_connect_closure (menuHandle, OS.selection_done, display.closures [SELECTION_DONE], false);
- display.addWidget (menuHandle, this);
- selectionAdded = true;
- }
+ GdkEvent event = new GdkEvent ();
+ OS.memmove (event, gdkEvent, GdkEvent.sizeof);
+ switch (event.type) {
+ case OS.GDK_BUTTON_PRESS: {
+ if (OS.GTK_VERSION < OS.VERSION (2, 8, 0) && !selectionAdded) {
+ int /*long*/ grabHandle = OS.gtk_grab_get_current ();
+ if (grabHandle != 0) {
+ if (OS.G_OBJECT_TYPE (grabHandle) == OS.GTK_TYPE_MENU ()) {
+ menuHandle = grabHandle;
+ OS.g_signal_connect_closure_by_id (menuHandle, display.signalIds [BUTTON_RELEASE_EVENT], 0, display.closures [BUTTON_RELEASE_EVENT], false);
+ OS.g_signal_connect_closure_by_id (menuHandle, display.signalIds [BUTTON_RELEASE_EVENT], 0, display.closures [BUTTON_RELEASE_EVENT_INVERSE], true);
+ OS.g_signal_connect_closure (menuHandle, OS.selection_done, display.closures [SELECTION_DONE], false);
+ display.addWidget (menuHandle, this);
+ selectionAdded = true;
}
}
- GdkEventButton gdkEventButton = new GdkEventButton ();
- OS.memmove (gdkEventButton, gdkEvent, GdkEventButton.sizeof);
- if (gdkEventButton.button == 1) {
- if (!sendMouseEvent (SWT.MouseDown, gdkEventButton.button, display.clickCount, 0, false, gdkEventButton.time, gdkEventButton.x_root, gdkEventButton.y_root, false, gdkEventButton.state)) {
- return 1;
- }
- if (OS.GTK_VERSION >= OS.VERSION (2, 6, 0)) {
- if ((style & SWT.READ_ONLY) == 0 && widget == buttonHandle) {
- OS.gtk_widget_grab_focus (entryHandle);
- }
+ }
+ GdkEventButton gdkEventButton = new GdkEventButton ();
+ OS.memmove (gdkEventButton, gdkEvent, GdkEventButton.sizeof);
+ if (gdkEventButton.button == 1) {
+ if (!sendMouseEvent (SWT.MouseDown, gdkEventButton.button, display.clickCount, 0, false, gdkEventButton.time, gdkEventButton.x_root, gdkEventButton.y_root, false, gdkEventButton.state)) {
+ return 1;
+ }
+ if (OS.GTK_VERSION >= OS.VERSION (2, 6, 0)) {
+ if ((style & SWT.READ_ONLY) == 0 && widget == buttonHandle) {
+ OS.gtk_widget_grab_focus (entryHandle);
}
}
- break;
}
- case OS.GDK_FOCUS_CHANGE: {
- if (OS.GTK_VERSION >= OS.VERSION (2, 6, 0)) {
- if ((style & SWT.READ_ONLY) == 0) {
- GdkEventFocus gdkEventFocus = new GdkEventFocus ();
- OS.memmove (gdkEventFocus, gdkEvent, GdkEventFocus.sizeof);
- if (gdkEventFocus.in != 0) {
- OS.gtk_combo_box_set_focus_on_click (handle, false);
- } else {
- OS.gtk_combo_box_set_focus_on_click (handle, true);
- }
+ break;
+ }
+ case OS.GDK_FOCUS_CHANGE: {
+ if (OS.GTK_VERSION >= OS.VERSION (2, 6, 0)) {
+ if ((style & SWT.READ_ONLY) == 0) {
+ GdkEventFocus gdkEventFocus = new GdkEventFocus ();
+ OS.memmove (gdkEventFocus, gdkEvent, GdkEventFocus.sizeof);
+ if (gdkEventFocus.in != 0) {
+ OS.gtk_combo_box_set_focus_on_click (handle, false);
+ } else {
+ OS.gtk_combo_box_set_focus_on_click (handle, true);
}
}
- break;
}
+ break;
}
}
return super.gtk_event_after(widget, gdkEvent);
@@ -1395,11 +1217,6 @@ int /*long*/ gtk_focus_out_event (int /*long*/ widget, int /*long*/ event) {
}
int /*long*/ gtk_insert_text (int /*long*/ widget, int /*long*/ new_text, int /*long*/ new_text_length, int /*long*/ position) {
- if (lockText) {
- OS.gtk_list_unselect_item (listHandle, 0);
- OS.g_signal_stop_emission_by_name (entryHandle, OS.insert_text);
- return 0;
- }
if (!hooks (SWT.Verify) && !filters (SWT.Verify)) return 0;
if (new_text == 0 || new_text_length == 0) return 0;
byte [] buffer = new byte [(int)/*64*/new_text_length];
@@ -1448,7 +1265,7 @@ int /*long*/ gtk_key_press_event (int /*long*/ widget, int /*long*/ event) {
}
if (gdkEventKey == -1) result = 1;
gdkEventKey = 0;
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0) && (style & SWT.READ_ONLY) == 0) {
+ if ((style & SWT.READ_ONLY) == 0) {
GdkEventKey keyEvent = new GdkEventKey ();
OS.memmove (keyEvent, event, GdkEventKey.sizeof);
int oldIndex = OS.gtk_combo_box_get_active (handle);
@@ -1560,10 +1377,8 @@ public int indexOf (String string, int start) {
}
boolean isFocusHandle(int widget) {
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
- if (buttonHandle != 0 && widget == buttonHandle) return true;
- if (entryHandle != 0 && widget == entryHandle) return true;
- }
+ if (buttonHandle != 0 && widget == buttonHandle) return true;
+ if (entryHandle != 0 && widget == entryHandle) return true;
return super.isFocusHandle (widget);
}
@@ -1571,9 +1386,7 @@ int /*long*/ paintWindow () {
int /*long*/ childHandle = entryHandle != 0 ? entryHandle : handle;
OS.gtk_widget_realize (childHandle);
int /*long*/ window = OS.GTK_WIDGET_WINDOW (childHandle);
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
- if ((style & SWT.READ_ONLY) != 0) return window;
- }
+ if ((style & SWT.READ_ONLY) != 0) return window;
int /*long*/ children = OS.gdk_window_get_children (window);
if (children != 0) window = OS.g_list_data (children);
OS.g_list_free (children);
@@ -1607,7 +1420,6 @@ void register () {
super.register ();
if (buttonHandle != 0) display.addWidget (buttonHandle, this);
if (entryHandle != 0) display.addWidget (entryHandle, this);
- if (listHandle != 0) display.addWidget (listHandle, this);
if (popupHandle != 0) display.addWidget (popupHandle, this);
if (menuHandle != 0) display.addWidget (menuHandle, this);
int /*long*/ imContext = imContext ();
@@ -1616,7 +1428,7 @@ void register () {
void releaseHandle () {
super.releaseHandle ();
- buttonHandle = entryHandle = listHandle = 0;
+ buttonHandle = entryHandle = 0;
}
void releaseWidget () {
@@ -1649,23 +1461,8 @@ public void remove (int index) {
System.arraycopy (oldItems, 0, newItems, 0, index);
System.arraycopy (oldItems, index + 1, newItems, index, oldItems.length - index - 1);
items = newItems;
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
- if (OS.gtk_combo_box_get_active (handle) == index) clearText ();
- OS.gtk_combo_box_remove_text (handle, index);
- } else {
- ignoreSelect = true;
- int /*long*/ children = OS.gtk_container_get_children (listHandle);
- int /*long*/ item = OS.g_list_nth_data (children, index);
- boolean selected = OS.GTK_WIDGET_STATE (item) == OS.GTK_STATE_SELECTED;
- int /*long*/ items = OS.g_list_append (0, item);
- OS.gtk_list_remove_items (listHandle, items);
- OS.g_list_free (items);
- OS.g_list_free (children);
- if (selected) {
- OS.gtk_entry_set_text (entryHandle, new byte[1]);
- }
- ignoreSelect = false;
- }
+ if (OS.gtk_combo_box_get_active (handle) == index) clearText ();
+ OS.gtk_combo_box_remove_text (handle, index);
}
/**
@@ -1695,29 +1492,10 @@ public void remove (int start, int end) {
System.arraycopy (oldItems, 0, newItems, 0, start);
System.arraycopy (oldItems, end + 1, newItems, start, oldItems.length - end - 1);
items = newItems;
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
- int index = OS.gtk_combo_box_get_active (handle);
- if (start <= index && index <= end) clearText();
- for (int i = end; i >= start; i--) {
- OS.gtk_combo_box_remove_text (handle, i);
- }
- } else {
- boolean selected = false;
- ignoreSelect = true;
- int /*long*/ items = 0;
- int /*long*/ children = OS.gtk_container_get_children (listHandle);
- for (int i = start; i <= end; i++) {
- int /*long*/ item = OS.g_list_nth_data (children, i);
- selected |= OS.GTK_WIDGET_STATE (item) == OS.GTK_STATE_SELECTED;
- items = OS.g_list_append (items, item);
- }
- OS.gtk_list_remove_items (listHandle, items);
- OS.g_list_free (items);
- OS.g_list_free (children);
- if (selected) {
- OS.gtk_entry_set_text (entryHandle, new byte[1]);
- }
- ignoreSelect = false;
+ int index = OS.gtk_combo_box_get_active (handle);
+ if (start <= index && index <= end) clearText();
+ for (int i = end; i >= start; i--) {
+ OS.gtk_combo_box_remove_text (handle, i);
}
}
@@ -1758,16 +1536,9 @@ public void removeAll () {
checkWidget();
int count = items.length;
items = new String[0];
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
- clearText ();
- for (int i = count - 1; i >= 0; i--) {
- OS.gtk_combo_box_remove_text (handle, i);
- }
- } else {
- ignoreSelect = true;
- OS.gtk_list_clear_items (listHandle, 0, -1);
- OS.gtk_entry_set_text (entryHandle, new byte[1]);
- ignoreSelect = false;
+ clearText ();
+ for (int i = count - 1; i >= 0; i--) {
+ OS.gtk_combo_box_remove_text (handle, i);
}
}
@@ -1861,35 +1632,24 @@ public void removeVerifyListener (VerifyListener listener) {
public void select (int index) {
checkWidget();
if (index < 0 || index >= items.length) return;
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
- OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED);
- OS.gtk_combo_box_set_active (handle, index);
- OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED);
- if ((style & SWT.READ_ONLY) != 0) {
- /*
- * Feature in GTK. Read Only combo boxes do not get a chance to send out a
- * Modify event in the gtk_changed callback. The fix is to send a Modify event
- * here.
- */
- sendEvent (SWT.Modify);
- }
- } else {
- ignoreSelect = true;
- OS.gtk_list_select_item (listHandle, index);
- ignoreSelect = false;
+ OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED);
+ OS.gtk_combo_box_set_active (handle, index);
+ OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED);
+ if ((style & SWT.READ_ONLY) != 0) {
+ /*
+ * Feature in GTK. Read Only combo boxes do not get a chance to send out a
+ * Modify event in the gtk_changed callback. The fix is to send a Modify event
+ * here.
+ */
+ sendEvent (SWT.Modify);
}
}
void setBackgroundColor (GdkColor color) {
super.setBackgroundColor (color);
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
- if (entryHandle != 0) OS.gtk_widget_modify_base (entryHandle, 0, color);
- if (cellHandle != 0) OS.g_object_set (cellHandle, OS.background_gdk, color, 0);
- OS.g_object_set (textRenderer, OS.background_gdk, color, 0);
- } else {
- OS.gtk_widget_modify_base (entryHandle, 0, color);
- if (listHandle != 0) OS.gtk_widget_modify_base (listHandle, 0, color);
- }
+ if (entryHandle != 0) OS.gtk_widget_modify_base (entryHandle, 0, color);
+ if (cellHandle != 0) OS.g_object_set (cellHandle, OS.background_gdk, color, 0);
+ OS.g_object_set (textRenderer, OS.background_gdk, color, 0);
}
int setBounds (int x, int y, int width, int height, boolean move, boolean resize) {
@@ -1900,58 +1660,26 @@ int setBounds (int x, int y, int width, int height, boolean move, boolean resize
void setFontDescription (int /*long*/ font) {
super.setFontDescription (font);
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
- if (entryHandle != 0) OS.gtk_widget_modify_font (entryHandle, font);
- OS.g_object_set (textRenderer, OS.font_desc, font, 0);
- if ((style & SWT.READ_ONLY) != 0) {
- /*
- * Bug in GTK. Setting the font can leave the combo box with an
- * invalid minimum size. The fix is to temporarily change the
- * selected item to force the combo box to resize.
- */
- int index = OS.gtk_combo_box_get_active (handle);
- OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED);
- OS.gtk_combo_box_set_active (handle, -1);
- OS.gtk_combo_box_set_active (handle, index);
- OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED);
- }
- } else {
- OS.gtk_widget_modify_font (entryHandle, font);
- if (listHandle != 0) {
- OS.gtk_widget_modify_font (listHandle, font);
- int /*long*/ itemsList = OS.gtk_container_get_children (listHandle);
- if (itemsList != 0) {
- int count = OS.g_list_length (itemsList);
- for (int i=count - 1; i>=0; i--) {
- int /*long*/ widget = OS.gtk_bin_get_child (OS.g_list_nth_data (itemsList, i));
- OS.gtk_widget_modify_font (widget, font);
- }
- OS.g_list_free (itemsList);
- }
- }
+ if (entryHandle != 0) OS.gtk_widget_modify_font (entryHandle, font);
+ OS.g_object_set (textRenderer, OS.font_desc, font, 0);
+ if ((style & SWT.READ_ONLY) != 0) {
+ /*
+ * Bug in GTK. Setting the font can leave the combo box with an
+ * invalid minimum size. The fix is to temporarily change the
+ * selected item to force the combo box to resize.
+ */
+ int index = OS.gtk_combo_box_get_active (handle);
+ OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED);
+ OS.gtk_combo_box_set_active (handle, -1);
+ OS.gtk_combo_box_set_active (handle, index);
+ OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED);
}
}
void setForegroundColor (GdkColor color) {
super.setForegroundColor (color);
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
- if (entryHandle != 0) setForegroundColor (entryHandle, color);
- OS.g_object_set (textRenderer, OS.foreground_gdk, color, 0);
- } else {
- setForegroundColor (entryHandle, color);
- if (listHandle != 0) {
- setForegroundColor (listHandle, color);
- int /*long*/ itemsList = OS.gtk_container_get_children (listHandle);
- if (itemsList != 0) {
- int count = OS.g_list_length (itemsList);
- for (int i=count - 1; i>=0; i--) {
- int /*long*/ widget = OS.gtk_bin_get_child (OS.g_list_nth_data (itemsList, i));
- setForegroundColor (widget, color);
- }
- OS.g_list_free (itemsList);
- }
- }
- }
+ if (entryHandle != 0) setForegroundColor (entryHandle, color);
+ OS.g_object_set (textRenderer, OS.foreground_gdk, color, 0);
}
/**
@@ -1978,20 +1706,10 @@ public void setItem (int index, String string) {
}
items [index] = string;
byte [] buffer = Converter.wcsToMbcs (null, string, true);
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
- OS.gtk_combo_box_remove_text (handle, index);
- OS.gtk_combo_box_insert_text (handle, index, buffer);
- if ((style & SWT.RIGHT_TO_LEFT) != 0 && popupHandle != 0) {
- OS.gtk_container_forall (popupHandle, display.setDirectionProc, OS.GTK_TEXT_DIR_RTL);
- }
- } else {
- ignoreSelect = true;
- int /*long*/ children = OS.gtk_container_get_children (listHandle);
- int /*long*/ item = OS.g_list_nth_data (children, index);
- int /*long*/ label = OS.gtk_bin_get_child (item);
- OS.gtk_label_set_text (label, buffer);
- OS.g_list_free (children);
- ignoreSelect = false;
+ OS.gtk_combo_box_remove_text (handle, index);
+ OS.gtk_combo_box_insert_text (handle, index, buffer);
+ if ((style & SWT.RIGHT_TO_LEFT) != 0 && popupHandle != 0) {
+ OS.gtk_container_forall (popupHandle, display.setDirectionProc, OS.GTK_TEXT_DIR_RTL);
}
}
@@ -2018,40 +1736,17 @@ public void setItems (String [] items) {
int count = this.items.length;
this.items = new String [items.length];
System.arraycopy (items, 0, this.items, 0, items.length);
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
- clearText ();
- for (int i = count - 1; i >= 0; i--) {
- OS.gtk_combo_box_remove_text (handle, i);
- }
- for (int i = 0; i < items.length; i++) {
- String string = items [i];
- byte [] buffer = Converter.wcsToMbcs (null, string, true);
- OS.gtk_combo_box_insert_text (handle, i, buffer);
- if ((style & SWT.RIGHT_TO_LEFT) != 0 && popupHandle != 0) {
- OS.gtk_container_forall (popupHandle, display.setDirectionProc, OS.GTK_TEXT_DIR_RTL);
- }
- }
- } else {
- lockText = ignoreSelect = true;
- OS.gtk_list_clear_items (listHandle, 0, -1);
- int /*long*/ font = getFontDescription ();
- GdkColor color = getForegroundColor ();
- int direction = OS.gtk_widget_get_direction (handle);
- int i = 0;
- while (i < items.length) {
- String string = items [i];
- byte [] buffer = Converter.wcsToMbcs (null, string, true);
- int /*long*/ item = OS.gtk_list_item_new_with_label (buffer);
- int /*long*/ label = OS.gtk_bin_get_child (item);
- setForegroundColor (label, color);
- OS.gtk_widget_modify_font (label, font);
- OS.gtk_widget_set_direction (label, direction);
- OS.gtk_container_add (listHandle, item);
- OS.gtk_widget_show (item);
- i++;
+ clearText ();
+ for (int i = count - 1; i >= 0; i--) {
+ OS.gtk_combo_box_remove_text (handle, i);
+ }
+ for (int i = 0; i < items.length; i++) {
+ String string = items [i];
+ byte [] buffer = Converter.wcsToMbcs (null, string, true);
+ OS.gtk_combo_box_insert_text (handle, i, buffer);
+ if ((style & SWT.RIGHT_TO_LEFT) != 0 && popupHandle != 0) {
+ OS.gtk_container_forall (popupHandle, display.setDirectionProc, OS.GTK_TEXT_DIR_RTL);
}
- lockText = ignoreSelect = false;
- OS.gtk_entry_set_text (entryHandle, new byte[1]);
}
}
@@ -2075,12 +1770,10 @@ public void setItems (String [] items) {
*/
public void setListVisible (boolean visible) {
checkWidget ();
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
- if (visible) {
- OS.gtk_combo_box_popup (handle);
- } else {
- OS.gtk_combo_box_popdown (handle);
- }
+ if (visible) {
+ OS.gtk_combo_box_popup (handle);
+ } else {
+ OS.gtk_combo_box_popdown (handle);
}
}
@@ -2088,22 +1781,9 @@ void setOrientation (boolean create) {
super.setOrientation (create);
if ((style & SWT.RIGHT_TO_LEFT) != 0 || !create) {
int dir = (style & SWT.RIGHT_TO_LEFT) != 0 ? OS.GTK_TEXT_DIR_RTL : OS.GTK_TEXT_DIR_LTR;
- if (listHandle != 0) OS.gtk_widget_set_direction (listHandle, dir);
if (entryHandle != 0) OS.gtk_widget_set_direction (entryHandle, dir);
if (cellHandle != 0) OS.gtk_widget_set_direction (cellHandle, dir);
if (!create) {
- if (listHandle != 0) {
- OS.gtk_widget_set_direction (listHandle, dir);
- int /*long*/ itemsList = OS.gtk_container_get_children (listHandle);
- if (itemsList != 0) {
- int count = OS.g_list_length (itemsList);
- for (int i=count - 1; i>=0; i--) {
- int /*long*/ widget = OS.gtk_bin_get_child (OS.g_list_nth_data (itemsList, i));
- OS.gtk_widget_set_direction (widget, dir);
- }
- OS.g_list_free (itemsList);
- }
- }
if (popupHandle != 0) OS.gtk_container_forall (popupHandle, display.setDirectionProc, dir);
}
}
@@ -2187,18 +1867,16 @@ public void setText (String string) {
if ((style & SWT.READ_ONLY) != 0) {
int index = indexOf (string);
if (index == -1) return;
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
- OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED);
- OS.gtk_combo_box_set_active (handle, index);
- OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED);
- /*
- * Feature in GTK. Read Only combo boxes do not get a chance to send out a
- * Modify event in the gtk_changed callback. The fix is to send a Modify event
- * here.
- */
- sendEvent (SWT.Modify);
- return;
- }
+ OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED);
+ OS.gtk_combo_box_set_active (handle, index);
+ OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED);
+ /*
+ * Feature in GTK. Read Only combo boxes do not get a chance to send out a
+ * Modify event in the gtk_changed callback. The fix is to send a Modify event
+ * here.
+ */
+ sendEvent (SWT.Modify);
+ return;
}
/*
* Feature in gtk. When text is set in gtk, separate events are fired for the deletion and
@@ -2211,16 +1889,12 @@ public void setText (String string) {
if (string == null) return;
}
byte [] buffer = Converter.wcsToMbcs (null, string, true);
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
- OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED);
- }
+ OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED);
OS.g_signal_handlers_block_matched (entryHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED);
OS.g_signal_handlers_block_matched (entryHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, DELETE_TEXT);
OS.g_signal_handlers_block_matched (entryHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, INSERT_TEXT);
OS.gtk_entry_set_text (entryHandle, buffer);
- if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
- OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED);
- }
+ OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED);
OS.g_signal_handlers_unblock_matched (entryHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED);
OS.g_signal_handlers_unblock_matched (entryHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, DELETE_TEXT);
OS.g_signal_handlers_unblock_matched (entryHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, INSERT_TEXT);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
index 07688d5c99..dcada53e7d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
@@ -3562,6 +3562,9 @@ void releaseWidget () {
cursor = null;
toolTipText = null;
layoutData = null;
+ if (accessible != null) {
+ accessible.internal_dispose_Accessible ();
+ }
accessible = null;
region = null;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java
index 92ac09fbcd..b6979e12a8 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java
@@ -115,12 +115,7 @@ public String getMessage () {
* </ul>
*/
public String open () {
- boolean useChooserDialog = OS.GTK_VERSION >= OS.VERSION (2, 4, 10);
- if (useChooserDialog) {
return openChooserDialog ();
- } else {
- return openClassicDialog ();
- }
}
String openChooserDialog () {
byte [] titleBytes = Converter.wcsToMbcs (null, title, true);
@@ -225,104 +220,6 @@ String openChooserDialog () {
OS.gtk_widget_destroy (handle);
return answer;
}
-String openClassicDialog () {
- byte [] titleBytes = Converter.wcsToMbcs (null, title, true);
- int /*long*/ handle = OS.gtk_file_selection_new (titleBytes);
- if (parent != null) {
- int /*long*/ shellHandle = parent.topHandle ();
- OS.gtk_window_set_transient_for (handle, shellHandle);
- int /*long*/ pixbufs = OS.gtk_window_get_icon_list (shellHandle);
- if (pixbufs != 0) {
- OS.gtk_window_set_icon_list (handle, pixbufs);
- OS.g_list_free (pixbufs);
- }
- }
- OS.gtk_window_set_modal (handle, true);
- String answer = null;
- if (filterPath != null) {
- String path = filterPath;
- if (path.length () > 0 && !path.endsWith (SEPARATOR)) {
- path += SEPARATOR;
- }
- int length = path.length ();
- char [] buffer = new char [length + 1];
- path.getChars (0, length, buffer, 0);
- int /*long*/ utf8Ptr = OS.g_utf16_to_utf8 (buffer, -1, null, null, null);
- int /*long*/ fileNamePtr = OS.g_filename_from_utf8 (utf8Ptr, -1, null, null, null);
- OS.gtk_file_selection_set_filename (handle, fileNamePtr);
- OS.g_free (utf8Ptr);
- OS.g_free (fileNamePtr);
- }
- GtkFileSelection selection = new GtkFileSelection ();
- OS.memmove (selection, handle);
- OS.gtk_file_selection_hide_fileop_buttons (handle);
- int /*long*/ fileListParent = OS.gtk_widget_get_parent (selection.file_list);
- OS.gtk_widget_hide (selection.file_list);
- OS.gtk_widget_hide (fileListParent);
- if (message.length () > 0) {
- byte [] buffer = Converter.wcsToMbcs (null, message, true);
- int /*long*/ labelHandle = OS.gtk_label_new (buffer);
- OS.gtk_label_set_line_wrap (labelHandle, true);
- OS.gtk_misc_set_alignment (labelHandle, 0.0f, 0.0f);
- OS.gtk_container_add (selection.main_vbox, labelHandle);
- OS.gtk_box_set_child_packing (
- selection.main_vbox, labelHandle, false, false, 0, OS.GTK_PACK_START);
- OS.gtk_widget_show (labelHandle);
- }
- Display display = parent != null ? parent.getDisplay (): Display.getCurrent ();
- display.addIdleProc ();
- Dialog oldModal = null;
- if (OS.gtk_window_get_modal (handle)) {
- oldModal = display.getModalDialog ();
- display.setModalDialog (this);
- }
- int signalId = 0;
- int /*long*/ hookId = 0;
- if ((style & SWT.RIGHT_TO_LEFT) != 0) {
- signalId = OS.g_signal_lookup (OS.map, OS.GTK_TYPE_WIDGET());
- hookId = OS.g_signal_add_emission_hook (signalId, 0, display.emissionProc, handle, 0);
- }
- int response = OS.gtk_dialog_run (handle);
- /*
- * This call to gdk_threads_leave() is a temporary work around
- * to avoid deadlocks when gdk_threads_init() is called by native
- * code outside of SWT (i.e AWT, etc). It ensures that the current
- * thread leaves the GTK lock acquired by the function above.
- */
- OS.gdk_threads_leave();
- if ((style & SWT.RIGHT_TO_LEFT) != 0) {
- OS.g_signal_remove_emission_hook (signalId, hookId);
- }
- if (OS.gtk_window_get_modal (handle)) {
- display.setModalDialog (oldModal);
- }
- if (response == OS.GTK_RESPONSE_OK) {
- int /*long*/ fileNamePtr = OS.gtk_file_selection_get_filename (handle);
- int /*long*/ utf8Ptr = OS.g_filename_to_utf8 (fileNamePtr, -1, null, null, null);
- if (utf8Ptr != 0) {
- int /*long*/ [] items_written = new int /*long*/ [1];
- int /*long*/ utf16Ptr = OS.g_utf8_to_utf16 (utf8Ptr, -1, null, items_written, null);
- if (utf16Ptr != 0) {
- int length = (int)/*64*/items_written [0];
- char [] buffer = new char [length];
- OS.memmove (buffer, utf16Ptr, length * 2);
- String osAnswer = new String (buffer);
- if (osAnswer != null) {
- /* remove trailing separator, unless root directory */
- if (!osAnswer.equals (SEPARATOR) && osAnswer.endsWith (SEPARATOR)) {
- osAnswer = osAnswer.substring (0, osAnswer.length () - 1);
- }
- answer = filterPath = osAnswer;
- }
- OS.g_free (utf16Ptr);
- }
- OS.g_free (utf8Ptr);
- }
- }
- display.removeIdleProc ();
- OS.gtk_widget_destroy (handle);
- return answer;
-}
/**
* Sets the path that the dialog will use to filter
* the directories it shows to the argument, which may
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
index 64dd3cd92d..2f05d62981 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
@@ -631,8 +631,8 @@ int /*long*/ allChildrenProc (int /*long*/ widget, int /*long*/ recurse) {
}
void addMouseHoverTimeout (int /*long*/ handle) {
- if (mouseHoverId != 0) OS.gtk_timeout_remove (mouseHoverId);
- mouseHoverId = OS.gtk_timeout_add (400, mouseHoverProc, handle);
+ if (mouseHoverId != 0) OS.g_source_remove (mouseHoverId);
+ mouseHoverId = OS.g_timeout_add (400, mouseHoverProc, handle);
mouseHoverHandle = handle;
}
@@ -3290,7 +3290,7 @@ void releaseDisplay () {
allChildrenProc = 0;
/* Dispose the caret callback */
- if (caretId != 0) OS.gtk_timeout_remove (caretId);
+ if (caretId != 0) OS.g_source_remove (caretId);
caretId = 0;
caretProc = 0;
caretCallback.dispose ();
@@ -3305,7 +3305,7 @@ void releaseDisplay () {
/* Dispose the timer callback */
if (timerIds != null) {
for (int i=0; i<timerIds.length; i++) {
- if (timerIds [i] != 0) OS.gtk_timeout_remove (timerIds [i]);
+ if (timerIds [i] != 0) OS.g_source_remove (timerIds [i]);
}
}
timerIds = null;
@@ -3318,7 +3318,7 @@ void releaseDisplay () {
windowTimerCallback = null;
/* Dispose mouse hover callback */
- if (mouseHoverId != 0) OS.gtk_timeout_remove (mouseHoverId);
+ if (mouseHoverId != 0) OS.g_source_remove (mouseHoverId);
mouseHoverId = 0;
mouseHoverHandle = mouseHoverProc = 0;
mouseHoverCallback.dispose ();
@@ -3485,7 +3485,7 @@ public void removeListener (int eventType, Listener listener) {
void removeMouseHoverTimeout (int /*long*/ handle) {
if (handle != mouseHoverHandle) return;
- if (mouseHoverId != 0) OS.gtk_timeout_remove (mouseHoverId);
+ if (mouseHoverId != 0) OS.g_source_remove (mouseHoverId);
mouseHoverId = 0;
mouseHoverHandle = 0;
}
@@ -4074,7 +4074,7 @@ public void timerExec (int milliseconds, Runnable runnable) {
index++;
}
if (index != timerList.length) {
- OS.gtk_timeout_remove (timerIds [index]);
+ OS.g_source_remove (timerIds [index]);
timerList [index] = null;
timerIds [index] = 0;
if (milliseconds < 0) return;
@@ -4094,7 +4094,7 @@ public void timerExec (int milliseconds, Runnable runnable) {
timerIds = newTimerIds;
}
}
- int timerId = OS.gtk_timeout_add (milliseconds, timerProc, index);
+ int timerId = OS.g_timeout_add (milliseconds, timerProc, index);
if (timerId != 0) {
timerIds [index] = timerId;
timerList [index] = runnable;
@@ -4121,7 +4121,7 @@ int /*long*/ caretProc (int /*long*/ clientData) {
if (currentCaret.blinkCaret()) {
int blinkRate = currentCaret.blinkRate;
if (blinkRate == 0) return 0;
- caretId = OS.gtk_timeout_add (blinkRate, caretProc, 0);
+ caretId = OS.g_timeout_add (blinkRate, caretProc, 0);
} else {
currentCaret = null;
}
@@ -4190,12 +4190,12 @@ void sendEvent (int eventType, Event event) {
}
void setCurrentCaret (Caret caret) {
- if (caretId != 0) OS.gtk_timeout_remove(caretId);
+ if (caretId != 0) OS.g_source_remove(caretId);
caretId = 0;
currentCaret = caret;
if (caret == null) return;
int blinkRate = currentCaret.blinkRate;
- caretId = OS.gtk_timeout_add (blinkRate, caretProc, 0);
+ caretId = OS.g_timeout_add (blinkRate, caretProc, 0);
}
int /*long*/ shellMapProc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FileDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FileDialog.java
index c20f9c59d1..0a0c755a20 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FileDialog.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FileDialog.java
@@ -215,91 +215,6 @@ String computeResultChooserDialog () {
return fullPath;
}
-String computeResultClassicDialog () {
- filterIndex = -1;
- GtkFileSelection selection = new GtkFileSelection ();
- OS.memmove (selection, handle);
- int /*long*/ entry = selection.selection_entry;
- int /*long*/ entryText = OS.gtk_entry_get_text (entry);
- int entryLength = OS.strlen (entryText);
- if (entryLength == 0) {
- int /*long*/ fileList = selection.file_list;
- int /*long*/ listSelection = OS.gtk_tree_view_get_selection (fileList);
- int /*long*/[] model = new int /*long*/[1];
- int /*long*/ selectedList = OS.gtk_tree_selection_get_selected_rows (listSelection, model);
- if (selectedList == 0) return null;
- int listLength = OS.g_list_length (selectedList);
- if (listLength == 0) {
- OS.g_list_free (selectedList);
- return null;
- }
- int /*long*/ path = OS.g_list_nth_data (selectedList, 0);
- int /*long*/ [] ptr = new int /*long*/[1];
- int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ());
- if (OS.gtk_tree_model_get_iter (model [0], iter, path)) {
- OS.gtk_tree_model_get (model [0], iter, 0, ptr, -1);
- }
- OS.g_free (iter);
- for (int i = 0; i < listLength; i++) {
- OS.gtk_tree_path_free (OS.g_list_nth_data (selectedList, i));
- }
- OS.g_list_free (selectedList);
- if (ptr [0] == 0) return null;
- int length = OS.strlen (ptr [0]);
- byte [] buffer = new byte [length];
- OS.memmove (buffer, ptr [0], length);
- OS.g_free (ptr [0]);
- OS.gtk_entry_set_text (entry, buffer);
- }
-
- int /*long*/ fileNamePtr = OS.gtk_file_selection_get_filename (handle);
- int /*long*/ utf8Ptr = OS.g_filename_to_utf8 (fileNamePtr, -1, null, null, null);
- int /*long*/ [] items_written = new int /*long*/ [1];
- int /*long*/ utf16Ptr = OS.g_utf8_to_utf16 (utf8Ptr, -1, null, items_written, null);
- entryLength = (int)/*64*/items_written [0];
- char [] buffer = new char [entryLength];
- OS.memmove (buffer, utf16Ptr, entryLength * 2);
- String osAnswer = new String (buffer);
- OS.g_free (utf16Ptr);
- OS.g_free (utf8Ptr);
-
- int separatorIndex = osAnswer.lastIndexOf (SEPARATOR);
- if (separatorIndex+1 == osAnswer.length ()) return null;
-
- String answer = fullPath = osAnswer;
- fileName = fullPath.substring (separatorIndex+1);
- filterPath = fullPath.substring (0, separatorIndex);
- if ((style & SWT.MULTI) == 0) {
- fileNames = new String[] {fileName};
- } else {
- int /*long*/ namesPtr = OS.gtk_file_selection_get_selections (handle);
- int /*long*/ namesPtr1 = namesPtr;
- int /*long*/ [] namePtr = new int /*long*/ [1];
- OS.memmove (namePtr, namesPtr1, OS.PTR_SIZEOF);
- int length = 0;
- while (namePtr[0] != 0) {
- length++;
- namesPtr1+=OS.PTR_SIZEOF;
- OS.memmove(namePtr, namesPtr1, OS.PTR_SIZEOF);
- }
- fileNames = new String [length];
- namePtr = new int /*long*/ [length];
- OS.memmove (namePtr, namesPtr, length * OS.PTR_SIZEOF);
- for (int i = 0; i < length; i++) {
- utf8Ptr = OS.g_filename_to_utf8 (namePtr [i], -1, null, null, null);
- items_written = new int /*long*/ [1];
- utf16Ptr = OS.g_utf8_to_utf16 (utf8Ptr, -1, null, items_written, null);
- buffer = new char [(int)/*64*/items_written [0]];
- OS.memmove (buffer, utf16Ptr, items_written [0] * 2);
- String name = new String (buffer);
- fileNames [i] = name.substring (name.lastIndexOf (SEPARATOR) + 1);
- OS.g_free (utf16Ptr);
- OS.g_free (utf8Ptr);
- }
- OS.g_strfreev (namesPtr);
- }
- return answer;
-}
/**
* Returns the path of the first file that was
* selected in the dialog relative to the filter path, or an
@@ -393,12 +308,7 @@ public boolean getOverwrite () {
* </ul>
*/
public String open () {
- boolean useChooserDialog = OS.GTK_VERSION >= OS.VERSION (2, 4, 10);
- if (useChooserDialog) {
return openChooserDialog ();
- } else {
- return openClassicDialog ();
- }
}
String openChooserDialog () {
byte [] titleBytes = Converter.wcsToMbcs (null, title, true);
@@ -461,55 +371,6 @@ String openChooserDialog () {
OS.gtk_widget_destroy (handle);
return answer;
}
-String openClassicDialog () {
- byte [] titleBytes = Converter.wcsToMbcs (null, title, true);
- handle = OS.gtk_file_selection_new (titleBytes);
- if (parent != null) {
- int /*long*/ shellHandle = parent.topHandle ();
- OS.gtk_window_set_transient_for (handle, shellHandle);
- int /*long*/ pixbufs = OS.gtk_window_get_icon_list (shellHandle);
- if (pixbufs != 0) {
- OS.gtk_window_set_icon_list (handle, pixbufs);
- OS.g_list_free (pixbufs);
- }
- }
- OS.gtk_window_set_modal (handle, true);
- presetClassicDialog ();
- Display display = parent != null ? parent.getDisplay (): Display.getCurrent ();
- display.addIdleProc ();
- String answer = null;
- Dialog oldModal = null;
- if (OS.gtk_window_get_modal (handle)) {
- oldModal = display.getModalDialog ();
- display.setModalDialog (this);
- }
- int signalId = 0;
- int /*long*/ hookId = 0;
- if ((style & SWT.RIGHT_TO_LEFT) != 0) {
- signalId = OS.g_signal_lookup (OS.map, OS.GTK_TYPE_WIDGET());
- hookId = OS.g_signal_add_emission_hook (signalId, 0, display.emissionProc, handle, 0);
- }
- int response = OS.gtk_dialog_run (handle);
- /*
- * This call to gdk_threads_leave() is a temporary work around
- * to avoid deadlocks when gdk_threads_init() is called by native
- * code outside of SWT (i.e AWT, etc). It ensures that the current
- * thread leaves the GTK lock acquired by the function above.
- */
- OS.gdk_threads_leave();
- if ((style & SWT.RIGHT_TO_LEFT) != 0) {
- OS.g_signal_remove_emission_hook (signalId, hookId);
- }
- if (OS.gtk_window_get_modal (handle)) {
- display.setModalDialog (oldModal);
- }
- if (response == OS.GTK_RESPONSE_OK) {
- answer = computeResultClassicDialog ();
- }
- display.removeIdleProc ();
- OS.gtk_widget_destroy (handle);
- return answer;
-}
void presetChooserDialog () {
/* MULTI is only valid if the native dialog's action is Open */
if ((style & (SWT.SAVE | SWT.MULTI)) == SWT.MULTI) {
@@ -619,41 +480,6 @@ void presetChooserDialog () {
fullPath = null;
fileNames = new String [0];
}
-void presetClassicDialog () {
- OS.gtk_file_selection_set_select_multiple(handle, (style & SWT.MULTI) != 0);
-
- /* Calculate the fully-specified file name and convert to bytes */
- StringBuffer stringBuffer = new StringBuffer ();
- if (filterPath == null) {
- filterPath = "";
- } else {
- if (filterPath.length () > 0) {
- stringBuffer.append (filterPath);
- if (filterPath.charAt (filterPath.length () - 1) != SEPARATOR) {
- stringBuffer.append (SEPARATOR);
- }
- }
- }
- if (fileName == null) {
- fileName = "";
- } else {
- stringBuffer.append (fileName);
- }
- fullPath = stringBuffer.toString ();
- int length = fullPath.length ();
- char [] buffer = new char [length + 1];
- fullPath.getChars (0, length, buffer, 0);
- int /*long*/ utf8Ptr = OS.g_utf16_to_utf8 (buffer, -1, null, null, null);
- int /*long*/ fileNamePtr = OS.g_filename_from_utf8 (utf8Ptr, -1, null, null, null);
- OS.gtk_file_selection_set_filename (handle, fileNamePtr);
- OS.g_free (utf8Ptr);
- OS.g_free (fileNamePtr);
-
- if (filterNames == null) filterNames = new String [0];
- if (filterExtensions == null) filterExtensions = new String [0];
- fullPath = null;
- fileNames = new String [0];
-}
/**
* Set the initial filename which the dialog will
* select by default when opened to the argument,
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java
index 996751d8b7..5edfc18fec 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java
@@ -623,8 +623,13 @@ public int getSelectionIndex () {
int /*long*/ indices = OS.gtk_tree_path_get_indices (data);
if (indices != 0) {
OS.memmove (index, indices, 4);
+ for (int j = i; j < count; j++) {
+ data = OS.g_list_nth_data (list, j);
+ OS.gtk_tree_path_free (data);
+ }
break;
}
+ OS.gtk_tree_path_free (data);
}
OS.g_list_free (list);
return index [0];
@@ -681,6 +686,7 @@ public int [] getSelectionIndices () {
treeSelection [length] = index [0];
length++;
}
+ OS.gtk_tree_path_free (data);
}
OS.g_list_free (list);
int [] result = new int [length];
@@ -1583,7 +1589,11 @@ public void showSelection () {
GdkRectangle cellRect = new GdkRectangle ();
OS.gtk_tree_view_get_cell_area (handle, path, 0, cellRect);
int[] tx = new int[1], ty = new int[1];
- OS.gtk_tree_view_widget_to_tree_coords(handle, cellRect.x, cellRect.y, tx, ty);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) {
+ OS.gtk_tree_view_convert_widget_to_bin_window_coords(handle, cellRect.x, cellRect.y, tx, ty);
+ } else {
+ OS.gtk_tree_view_widget_to_tree_coords(handle, cellRect.x, cellRect.y, tx, ty);
+ }
if (ty[0] < visibleRect.y ) {
OS.gtk_tree_view_scroll_to_cell (handle, path, 0, true, 0f, 0f);
OS.gtk_tree_view_scroll_to_point (handle, -1, ty[0]);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
index d0a81f5582..07599ce918 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
@@ -313,6 +313,7 @@ int /*long*/ getAccelGroup () {
}
if (menu == null) return 0;
Decorations shell = menu.parent;
+ if (shell == null) return 0;
return shell.menuBar == menu ? shell.accelGroup : 0;
}
@@ -772,7 +773,11 @@ public void setMenu (Menu menu) {
* to replace or GTK will destroy it.
*/
OS.g_object_ref (oldMenu.handle);
- OS.gtk_menu_item_remove_submenu (handle);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) {
+ OS.gtk_menu_item_set_submenu (handle, 0);
+ } else {
+ OS.gtk_menu_item_remove_submenu (handle);
+ }
}
if ((this.menu = menu) != null) {
menu.cascade = this;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java
index 7b4d23efef..811cecd5bf 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java
@@ -90,7 +90,7 @@ void createHandle (int index) {
int orientation = (style & SWT.VERTICAL) != 0 ? OS.GTK_PROGRESS_BOTTOM_TO_TOP : OS.GTK_PROGRESS_LEFT_TO_RIGHT;
OS.gtk_progress_bar_set_orientation (handle, orientation);
if ((style & SWT.INDETERMINATE) != 0) {
- timerId = OS.gtk_timeout_add (DELAY, display.windowTimerProc, handle);
+ timerId = OS.g_timeout_add (DELAY, display.windowTimerProc, handle);
}
}
@@ -176,7 +176,7 @@ int /*long*/ gtk_realize (int /*long*/ widget) {
void releaseWidget () {
super.releaseWidget ();
- if (timerId != 0) OS.gtk_timeout_remove (timerId);
+ if (timerId != 0) OS.g_source_remove (timerId);
timerId = 0;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java
index a8e5063d38..5d4ab3ab23 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java
@@ -450,9 +450,9 @@ public boolean getVisible () {
int [] hsp = new int [1], vsp = new int [1];
OS.gtk_scrolled_window_get_policy (scrolledHandle, hsp, vsp);
if ((style & SWT.HORIZONTAL) != 0) {
- return hsp [0] != OS.GTK_POLICY_NEVER;
+ return hsp [0] != OS.GTK_POLICY_NEVER && OS.GTK_WIDGET_VISIBLE(handle);
} else {
- return vsp [0] != OS.GTK_POLICY_NEVER;
+ return vsp [0] != OS.GTK_POLICY_NEVER && OS.GTK_WIDGET_VISIBLE(handle);
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
index d70bc90eef..af3cc3e3c3 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
@@ -2397,6 +2397,12 @@ void setToolTipText (int /*long*/ rootWidget, int /*long*/ tipWidget, String str
char [] chars = fixMnemonic (string, false);
buffer = Converter.wcsToMbcs (null, chars, true);
}
+ int /*long*/ oldTooltip = OS.gtk_widget_get_tooltip_text (rootWidget);
+ if (buffer == null && oldTooltip == 0) {
+ return;
+ } else if (buffer != null && oldTooltip != 0) {
+ if (OS.strcmp (oldTooltip, buffer) == 0) return;
+ }
OS.gtk_widget_set_tooltip_text (rootWidget, null);
/*
* Bug in GTK. In GTK 2.12, due to a miscalculation of window
@@ -2438,6 +2444,17 @@ void setToolTipText (int /*long*/ rootWidget, int /*long*/ tipWidget, String str
char [] chars = fixMnemonic (string, false);
buffer = Converter.wcsToMbcs (null, chars, true);
}
+ int /*long*/ tipData = OS.gtk_tooltips_data_get(tipWidget);
+ if (tipData != 0) {
+ int /*long*/ oldTooltip = OS.GTK_TOOLTIPS_GET_TIP_TEXT(tipData);
+ if (string == null && oldTooltip == 0) {
+ return;
+ } else if (string != null && oldTooltip != 0) {
+ if (buffer != null) {
+ if (OS.strcmp (oldTooltip, buffer) == 0) return;
+ }
+ }
+ }
if (tooltipsHandle == 0) {
tooltipsHandle = OS.gtk_tooltips_new ();
if (tooltipsHandle == 0) error (SWT.ERROR_NO_HANDLES);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
index f2b96c4811..968f7ba889 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
@@ -229,6 +229,7 @@ int /*long*/ cellDataProc (int /*long*/ tree_column, int /*long*/ cell, int /*lo
if (isPixbuf) {
OS.gtk_tree_model_get (tree_model, iter, modelIndex + CELL_PIXBUF, ptr, -1);
OS.g_object_set (cell, OS.pixbuf, ptr [0], 0);
+ OS.g_object_unref (ptr [0]);
} else {
OS.gtk_tree_model_get (tree_model, iter, modelIndex + CELL_TEXT, ptr, -1);
if (ptr [0] != 0) {
@@ -248,6 +249,7 @@ int /*long*/ cellDataProc (int /*long*/ tree_column, int /*long*/ cell, int /*lo
OS.gtk_tree_model_get (tree_model, iter, modelIndex + CELL_BACKGROUND, ptr, -1);
if (ptr [0] != 0) {
OS.g_object_set (cell, OS.cell_background_gdk, ptr [0], 0);
+ OS.gdk_color_free (ptr [0]);
}
}
}
@@ -256,11 +258,13 @@ int /*long*/ cellDataProc (int /*long*/ tree_column, int /*long*/ cell, int /*lo
OS.gtk_tree_model_get (tree_model, iter, modelIndex + CELL_FOREGROUND, ptr, -1);
if (ptr [0] != 0) {
OS.g_object_set (cell, OS.foreground_gdk, ptr [0], 0);
+ OS.gdk_color_free (ptr [0]);
}
ptr [0] = 0;
OS.gtk_tree_model_get (tree_model, iter, modelIndex + CELL_FONT, ptr, -1);
if (ptr [0] != 0) {
OS.g_object_set (cell, OS.font_desc, ptr [0], 0);
+ OS.pango_font_description_free (ptr [0]);
}
}
}
@@ -348,7 +352,12 @@ int calculateWidth (int /*long*/ column, int /*long*/ iter) {
int [] w = new int [1];
OS.gtk_widget_style_get(handle, OS.focus_line_width, w, 0);
width += 2 * w [0];
- int /*long*/ list = OS.gtk_tree_view_column_get_cell_renderers (column);
+ int /*long*/ list = 0;
+ if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) {
+ list = OS.gtk_cell_layout_get_cells(column);
+ } else {
+ list = OS.gtk_tree_view_column_get_cell_renderers (column);
+ }
if (list == 0) return 0;
int /*long*/ temp = list;
while (temp != 0) {
@@ -539,7 +548,17 @@ void createColumn (TableColumn column, int index) {
for (int j=0; j<modelLength; j++) {
OS.gtk_tree_model_get (oldModel, oldItem, j, ptr, -1);
OS.gtk_list_store_set (newModel, newItem, j, ptr [0], -1);
- if (types [j] == OS.G_TYPE_STRING ()) OS.g_free ((ptr [0]));
+ if (types [j] == OS.G_TYPE_STRING ()) {
+ OS.g_free ((ptr [0]));
+ } else if (ptr [0] != 0) {
+ if (types [j] == OS.GDK_TYPE_COLOR()) {
+ OS.gdk_color_free (ptr [0]);
+ } else if (types [j] == OS.GDK_TYPE_PIXBUF()) {
+ OS.g_object_unref (ptr [0]);
+ } else if (types [j] == OS.PANGO_TYPE_FONT_DESCRIPTION()) {
+ OS.pango_font_description_free (ptr [0]);
+ }
+ }
}
OS.gtk_list_store_remove (oldModel, oldItem);
OS.g_free (oldItem);
@@ -992,18 +1011,29 @@ void destroyItem (TableColumn column) {
for (int j=0; j<FIRST_COLUMN; j++) {
OS.gtk_tree_model_get (oldModel, oldItem, j, ptr, -1);
OS.gtk_list_store_set (newModel, newItem, j, ptr [0], -1);
+ if (ptr [0] != 0) {
+ if (j == FOREGROUND_COLUMN || j == BACKGROUND_COLUMN) {
+ OS.gdk_color_free (ptr [0]);
+ } else if (j == FONT_COLUMN) {
+ OS.pango_font_description_free (ptr [0]);
+ }
+ }
}
OS.gtk_tree_model_get (oldModel, oldItem, column.modelIndex + CELL_PIXBUF, ptr, -1);
OS.gtk_list_store_set (newModel, newItem, FIRST_COLUMN + CELL_PIXBUF, ptr [0], -1);
+ if (ptr [0] != 0) OS.g_object_unref (ptr [0]);
OS.gtk_tree_model_get (oldModel, oldItem, column.modelIndex + CELL_TEXT, ptr, -1);
OS.gtk_list_store_set (newModel, newItem, FIRST_COLUMN + CELL_TEXT, ptr [0], -1);
OS.g_free (ptr [0]);
OS.gtk_tree_model_get (oldModel, oldItem, column.modelIndex + CELL_FOREGROUND, ptr, -1);
OS.gtk_list_store_set (newModel, newItem, FIRST_COLUMN + CELL_FOREGROUND, ptr [0], -1);
+ if (ptr [0] != 0) OS.gdk_color_free (ptr [0]);
OS.gtk_tree_model_get (oldModel, oldItem, column.modelIndex + CELL_BACKGROUND, ptr, -1);
OS.gtk_list_store_set (newModel, newItem, FIRST_COLUMN + CELL_BACKGROUND, ptr [0], -1);
+ if (ptr [0] != 0) OS.gdk_color_free (ptr [0]);
OS.gtk_tree_model_get (oldModel, oldItem, column.modelIndex + CELL_FONT, ptr, -1);
OS.gtk_list_store_set (newModel, newItem, FIRST_COLUMN + CELL_FONT, ptr [0], -1);
+ if (ptr [0] != 0) OS.pango_font_description_free (ptr [0]);
OS.gtk_list_store_remove (oldModel, oldItem);
OS.g_free (oldItem);
item.handle = newItem;
@@ -1577,7 +1607,13 @@ public boolean getLinesVisible() {
}
int /*long*/ getPixbufRenderer (int /*long*/ column) {
- int /*long*/ list = OS.gtk_tree_view_column_get_cell_renderers (column);
+ int /*long*/ list = 0;
+ if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) {
+ list = OS.gtk_cell_layout_get_cells(column);
+ } else {
+ list = OS.gtk_tree_view_column_get_cell_renderers (column);
+ }
+
if (list == 0) return 0;
int count = OS.g_list_length (list);
int /*long*/ pixbufRenderer = 0;
@@ -1641,6 +1677,7 @@ public TableItem [] getSelection () {
treeSelection [length] = index [0];
length++;
}
+ OS.gtk_tree_path_free (data);
}
OS.g_list_free (list);
TableItem [] result = new TableItem [length];
@@ -1709,8 +1746,13 @@ public int getSelectionIndex () {
int /*long*/ indices = OS.gtk_tree_path_get_indices (data);
if (indices != 0) {
OS.memmove (index, indices, 4);
+ for (int j = i; j < count; j++) {
+ data = OS.g_list_nth_data (list, j);
+ OS.gtk_tree_path_free (data);
+ }
break;
}
+ OS.gtk_tree_path_free (data);
}
OS.g_list_free (list);
return index [0];
@@ -1766,6 +1808,7 @@ public int [] getSelectionIndices () {
treeSelection [length] = index [0];
length++;
}
+ OS.gtk_tree_path_free (data);
}
OS.g_list_free (list);
int [] result = new int [length];
@@ -1818,7 +1861,12 @@ public int getSortDirection () {
}
int /*long*/ getTextRenderer (int /*long*/ column) {
- int /*long*/ list = OS.gtk_tree_view_column_get_cell_renderers (column);
+ int /*long*/ list = 0;
+ if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) {
+ list = OS.gtk_cell_layout_get_cells(column);
+ } else {
+ list = OS.gtk_tree_view_column_get_cell_renderers (column);
+ }
if (list == 0) return 0;
int count = OS.g_list_length (list);
int /*long*/ textRenderer = 0;
@@ -2633,7 +2681,10 @@ int /*long*/ rendererRenderProc (int /*long*/ cell, int /*long*/ window, int /*l
int modelIndex = columnCount == 0 ? Table.FIRST_COLUMN : columns [columnIndex].modelIndex;
OS.gtk_tree_model_get (modelHandle, item.handle, modelIndex + Table.CELL_BACKGROUND, ptr, -1);
}
- if (ptr [0] != 0) drawState |= SWT.BACKGROUND;
+ if (ptr [0] != 0) {
+ drawState |= SWT.BACKGROUND;
+ OS.gdk_color_free (ptr [0]);
+ }
if ((flags & OS.GTK_CELL_RENDERER_SELECTED) != 0) drawState |= SWT.SELECTED;
if ((flags & OS.GTK_CELL_RENDERER_FOCUSED) != 0) drawState |= SWT.FOCUSED;
@@ -3576,7 +3627,11 @@ void showItem (int /*long*/ iter) {
GdkRectangle cellRect = new GdkRectangle ();
OS.gtk_tree_view_get_cell_area (handle, path, 0, cellRect);
int[] tx = new int[1], ty = new int[1];
- OS.gtk_tree_view_widget_to_tree_coords(handle, cellRect.x, cellRect.y, tx, ty);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) {
+ OS.gtk_tree_view_convert_widget_to_bin_window_coords(handle, cellRect.x, cellRect.y, tx, ty);
+ } else {
+ OS.gtk_tree_view_widget_to_tree_coords(handle, cellRect.x, cellRect.y, tx, ty);
+ }
if (ty[0] < visibleRect.y ) {
OS.gtk_tree_view_scroll_to_cell (handle, path, 0, true, 0f, 0f);
OS.gtk_tree_view_scroll_to_point (handle, -1, ty[0]);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
index 3307d505eb..7119af4343 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
@@ -132,6 +132,7 @@ Color _getBackground () {
if (ptr [0] == 0) return parent.getBackground ();
GdkColor gdkColor = new GdkColor ();
OS.memmove (gdkColor, ptr [0], GdkColor.sizeof);
+ OS.gdk_color_free (ptr [0]);
return Color.gtk_new (display, gdkColor);
}
@@ -144,6 +145,7 @@ Color _getBackground (int index) {
if (ptr [0] == 0) return _getBackground ();
GdkColor gdkColor = new GdkColor ();
OS.memmove (gdkColor, ptr [0], GdkColor.sizeof);
+ OS.gdk_color_free (ptr [0]);
return Color.gtk_new (display, gdkColor);
}
@@ -159,6 +161,7 @@ Color _getForeground () {
if (ptr [0] == 0) return parent.getForeground ();
GdkColor gdkColor = new GdkColor ();
OS.memmove (gdkColor, ptr [0], GdkColor.sizeof);
+ OS.gdk_color_free (ptr [0]);
return Color.gtk_new (display, gdkColor);
}
@@ -171,6 +174,7 @@ Color _getForeground (int index) {
if (ptr [0] == 0) return _getForeground ();
GdkColor gdkColor = new GdkColor ();
OS.memmove (gdkColor, ptr [0], GdkColor.sizeof);
+ OS.gdk_color_free (ptr [0]);
return Color.gtk_new (display, gdkColor);
}
@@ -183,6 +187,7 @@ Image _getImage (int index) {
if (ptr [0] == 0) return null;
ImageList imageList = parent.imageList;
int imageIndex = imageList.indexOf (ptr [0]);
+ OS.g_object_unref (ptr [0]);
if (imageIndex == -1) return null;
return imageList.get (imageIndex);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java
index 420ab48cae..3d30124842 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java
@@ -98,7 +98,11 @@ public ToolBar (Composite parent, int style) {
this.style |= SWT.HORIZONTAL;
}
int orientation = (style & SWT.VERTICAL) != 0 ? OS.GTK_ORIENTATION_VERTICAL : OS.GTK_ORIENTATION_HORIZONTAL;
- OS.gtk_toolbar_set_orientation (handle, orientation);
+ if (OS.GTK_VERSION < OS.VERSION (2, 16, 0)) {
+ OS.gtk_toolbar_set_orientation (handle, orientation);
+ } else {
+ OS.gtk_orientable_set_orientation(handle, orientation);
+ }
}
static int checkStyle (int style) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
index 681e6a5930..ed861249f2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
@@ -847,6 +847,7 @@ public void setDisabledImage (Image image) {
public void setEnabled (boolean enabled) {
checkWidget();
int /*long*/ topHandle = topHandle ();
+ if (OS.GTK_WIDGET_SENSITIVE (topHandle) == enabled) return;
OS.gtk_widget_set_sensitive (topHandle, enabled);
if (enabled) {
/*
@@ -1034,6 +1035,7 @@ public void setText (String string) {
checkWidget();
if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
if ((style & SWT.SEPARATOR) != 0) return;
+ if (string.equals(this.text)) return;
super.setText (string);
if (labelHandle == 0) return;
char [] chars = fixMnemonic (string);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java
index a3b3746401..919dcff28d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java
@@ -577,11 +577,12 @@ void register () {
void releaseWidget () {
super.releaseWidget ();
+ setVisible(false);
if (layoutText != 0) OS.g_object_unref (layoutText);
layoutText = 0;
if (layoutMessage != 0) OS.g_object_unref (layoutMessage);
layoutMessage = 0;
- if (timerId != 0) OS.gtk_timeout_remove(timerId);
+ if (timerId != 0) OS.g_source_remove(timerId);
timerId = 0;
text = null;
message = null;
@@ -782,7 +783,7 @@ public void setText (String string) {
*/
public void setVisible (boolean visible) {
checkWidget ();
- if (timerId != 0) OS.gtk_timeout_remove(timerId);
+ if (timerId != 0) OS.g_source_remove(timerId);
timerId = 0;
if (visible) {
if ((style & SWT.BALLOON) != 0) {
@@ -794,18 +795,27 @@ public void setVisible (boolean visible) {
if (text.length () > 0) string.append ("\n\n");
string.append (message);
byte [] buffer = Converter.wcsToMbcs (null, string.toString(), true);
- OS.gtk_tooltips_set_tip (handle, vboxHandle, buffer, null);
- int /*long*/ data = OS.gtk_tooltips_data_get (vboxHandle);
- OS.GTK_TOOLTIPS_SET_ACTIVE (handle, data);
- OS.gtk_tooltips_set_tip (handle, vboxHandle, buffer, null);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) {
+ OS.gtk_widget_set_tooltip_text(vboxHandle, buffer);
+ } else {
+ OS.gtk_tooltips_set_tip (handle, vboxHandle, buffer, null);
+ int /*long*/ data = OS.gtk_tooltips_data_get (vboxHandle);
+ OS.GTK_TOOLTIPS_SET_ACTIVE (handle, data);
+ OS.gtk_tooltips_set_tip (handle, vboxHandle, buffer, null);
+ }
}
- if (autohide) timerId = OS.gtk_timeout_add (DELAY, display.windowTimerProc, handle);
+ if (autohide) timerId = OS.g_timeout_add (DELAY, display.windowTimerProc, handle);
} else {
if ((style & SWT.BALLOON) != 0) {
OS.gtk_widget_hide (handle);
} else {
- int /*long*/ tipWindow = OS.GTK_TOOLTIPS_TIP_WINDOW (handle);
- OS.gtk_widget_hide (tipWindow);
+ int /*long*/ vboxHandle = parent.vboxHandle;
+ byte[] buffer = Converter.wcsToMbcs(null, "", true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) {
+ OS.gtk_widget_set_tooltip_text(vboxHandle, buffer);
+ } else {
+ OS.gtk_tooltips_set_tip(handle, vboxHandle, buffer, null);
+ }
}
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java
index b9558a4b83..44e4b82380 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java
@@ -43,6 +43,7 @@ public class TrayItem extends Item {
int /*long*/ imageHandle;
int /*long*/ tooltipsHandle;
ImageList imageList;
+ Image highlightImage;
/**
* Constructs a new instance of this class given its parent
@@ -220,6 +221,11 @@ public Tray getParent () {
return parent;
}
+public Image getHighlightImage () {
+ checkWidget ();
+ return highlightImage;
+}
+
/**
* Returns the receiver's tool tip, or null if it has
* not been set.
@@ -397,6 +403,7 @@ void releaseWidget () {
if (imageList != null) imageList.dispose ();
imageList = null;
toolTipText = null;
+ highlightImage = null;
}
/**
@@ -451,6 +458,12 @@ public void removeSelectionListener (SelectionListener listener) {
eventTable.unhook (SWT.DefaultSelection, listener);
}
+public void setHighlightImage (Image image) {
+ checkWidget ();
+ if (image != null && image.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+ highlightImage = image;
+}
+
/**
* Sets the receiver's image.
*
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
index b607552f4f..a0c060bbd1 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
@@ -274,6 +274,7 @@ int /*long*/ cellDataProc (int /*long*/ tree_column, int /*long*/ cell, int /*lo
ptr [0] = 0;
OS.gtk_tree_model_get (tree_model, iter, modelIndex + CELL_PIXBUF, ptr, -1);
OS.g_object_set (cell, OS.pixbuf, ptr[0], 0);
+ OS.g_object_unref (ptr [0]);
} else {
ptr [0] = 0;
OS.gtk_tree_model_get (tree_model, iter, modelIndex + CELL_TEXT, ptr, -1);
@@ -294,6 +295,7 @@ int /*long*/ cellDataProc (int /*long*/ tree_column, int /*long*/ cell, int /*lo
OS.gtk_tree_model_get (tree_model, iter, modelIndex + CELL_BACKGROUND, ptr, -1);
if (ptr [0] != 0) {
OS.g_object_set (cell, OS.cell_background_gdk, ptr[0], 0);
+ OS.gdk_color_free (ptr [0]);
}
}
}
@@ -302,11 +304,13 @@ int /*long*/ cellDataProc (int /*long*/ tree_column, int /*long*/ cell, int /*lo
OS.gtk_tree_model_get (tree_model, iter, modelIndex + CELL_FOREGROUND, ptr, -1);
if (ptr [0] != 0) {
OS.g_object_set (cell, OS.foreground_gdk, ptr[0], 0);
+ OS.gdk_color_free (ptr [0]);
}
ptr [0] = 0;
OS.gtk_tree_model_get (tree_model, iter, modelIndex + CELL_FONT, ptr, -1);
if (ptr [0] != 0) {
OS.g_object_set (cell, OS.font_desc, ptr[0], 0);
+ OS.pango_font_description_free (ptr [0]);
}
}
}
@@ -435,7 +439,12 @@ int calculateWidth (int /*long*/ column, int /*long*/ iter, boolean recurse) {
}
OS.gtk_widget_style_get(handle, OS.focus_line_width, w, 0);
width += 2 * w [0];
- int /*long*/ list = OS.gtk_tree_view_column_get_cell_renderers (column);
+ int /*long*/ list = 0;
+ if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) {
+ list = OS.gtk_cell_layout_get_cells(column);
+ } else {
+ list = OS.gtk_tree_view_column_get_cell_renderers (column);
+ }
if (list == 0) return 0;
int /*long*/ temp = list;
while (temp != 0) {
@@ -584,12 +593,32 @@ void copyModel (int /*long*/ oldModel, int oldStart, int /*long*/ newModel, int
for (int j = 0; j < FIRST_COLUMN; j++) {
OS.gtk_tree_model_get (oldModel, oldItem, j, ptr, -1);
OS.gtk_tree_store_set (newModel, newItem, j, ptr [0], -1);
- if (types [j] == OS.G_TYPE_STRING ()) OS.g_free ((ptr [0]));
+ if (types [j] == OS.G_TYPE_STRING ()) {
+ OS.g_free ((ptr [0]));
+ } else if (ptr[0] != 0) {
+ if (types[j] == OS.GDK_TYPE_COLOR()) {
+ OS.gdk_color_free(ptr[0]);
+ } else if (types[j] == OS.GDK_TYPE_PIXBUF()) {
+ OS.g_object_unref(ptr[0]);
+ } else if (types[j] == OS.PANGO_TYPE_FONT_DESCRIPTION()) {
+ OS.pango_font_description_free(ptr[0]);
+ }
+ }
}
for (int j= 0; j<modelLength - FIRST_COLUMN; j++) {
OS.gtk_tree_model_get (oldModel, oldItem, oldStart + j, ptr, -1);
OS.gtk_tree_store_set (newModel, newItem, newStart + j, ptr [0], -1);
- if (types [j] == OS.G_TYPE_STRING ()) OS.g_free ((ptr [0]));
+ if (types [j] == OS.G_TYPE_STRING ()) {
+ OS.g_free ((ptr [0]));
+ } else if (ptr[0] != 0) {
+ if (types[j] == OS.GDK_TYPE_COLOR()) {
+ OS.gdk_color_free(ptr[0]);
+ } else if (types[j] == OS.GDK_TYPE_PIXBUF()) {
+ OS.g_object_unref(ptr[0]);
+ } else if (types[j] == OS.PANGO_TYPE_FONT_DESCRIPTION()) {
+ OS.pango_font_description_free(ptr[0]);
+ }
+ }
}
}
} else {
@@ -1677,7 +1706,12 @@ public TreeItem getParentItem () {
}
int /*long*/ getPixbufRenderer (int /*long*/ column) {
- int /*long*/ list = OS.gtk_tree_view_column_get_cell_renderers (column);
+ int /*long*/ list = 0;
+ if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) {
+ list = OS.gtk_cell_layout_get_cells(column);
+ } else {
+ list = OS.gtk_tree_view_column_get_cell_renderers (column);
+ }
if (list == 0) return 0;
int count = OS.g_list_length (list);
int /*long*/ pixbufRenderer = 0;
@@ -1740,6 +1774,7 @@ public TreeItem[] getSelection () {
length++;
}
OS.g_free (iter);
+ OS.gtk_tree_path_free (data);
}
OS.g_list_free (list);
if (length < count) {
@@ -1817,7 +1852,12 @@ public int getSortDirection () {
}
int /*long*/ getTextRenderer (int /*long*/ column) {
- int /*long*/ list = OS.gtk_tree_view_column_get_cell_renderers (column);
+ int /*long*/ list = 0;
+ if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) {
+ list = OS.gtk_cell_layout_get_cells(column);
+ } else {
+ list = OS.gtk_tree_view_column_get_cell_renderers (column);
+ }
if (list == 0) return 0;
int count = OS.g_list_length (list);
int /*long*/ textRenderer = 0;
@@ -2631,7 +2671,10 @@ int /*long*/ rendererRenderProc (int /*long*/ cell, int /*long*/ window, int /*l
int modelIndex = columnCount == 0 ? Tree.FIRST_COLUMN : columns [columnIndex].modelIndex;
OS.gtk_tree_model_get (modelHandle, item.handle, modelIndex + Tree.CELL_BACKGROUND, ptr, -1);
}
- if (ptr [0] != 0) drawState |= SWT.BACKGROUND;
+ if (ptr [0] != 0) {
+ drawState |= SWT.BACKGROUND;
+ OS.gdk_color_free(ptr[0]);
+ }
if ((flags & OS.GTK_CELL_RENDERER_SELECTED) != 0) drawState |= SWT.SELECTED;
if ((flags & OS.GTK_CELL_RENDERER_FOCUSED) != 0) drawState |= SWT.FOCUSED;
@@ -3408,7 +3451,11 @@ void showItem (int /*long*/ path, boolean scroll) {
OS.gtk_tree_view_get_cell_area (handle, path, 0, cellRect);
boolean isHidden = cellRect.y == 0 && cellRect.height == 0;
int [] tx = new int [1], ty = new int [1];
- OS.gtk_tree_view_widget_to_tree_coords (handle, cellRect.x, cellRect.y, tx, ty);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) {
+ OS.gtk_tree_view_convert_widget_to_bin_window_coords(handle, cellRect.x, cellRect.y, tx, ty);
+ } else {
+ OS.gtk_tree_view_widget_to_tree_coords(handle, cellRect.x, cellRect.y, tx, ty);
+ }
GdkRectangle visibleRect = new GdkRectangle ();
OS.gtk_tree_view_get_visible_rect (handle, visibleRect);
if (!isHidden) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
index c40dea482d..68d8a81a5f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
@@ -217,6 +217,7 @@ Color _getBackground () {
if (ptr [0] == 0) return parent.getBackground ();
GdkColor gdkColor = new GdkColor ();
OS.memmove (gdkColor, ptr [0], GdkColor.sizeof);
+ OS.gdk_color_free (ptr [0]);
return Color.gtk_new (display, gdkColor);
}
@@ -229,6 +230,7 @@ Color _getBackground (int index) {
if (ptr [0] == 0) return _getBackground ();
GdkColor gdkColor = new GdkColor ();
OS.memmove (gdkColor, ptr [0], GdkColor.sizeof);
+ OS.gdk_color_free (ptr [0]);
return Color.gtk_new (display, gdkColor);
}
@@ -244,6 +246,7 @@ Color _getForeground () {
if (ptr [0] == 0) return parent.getForeground ();
GdkColor gdkColor = new GdkColor ();
OS.memmove (gdkColor, ptr [0], GdkColor.sizeof);
+ OS.gdk_color_free (ptr [0]);
return Color.gtk_new (display, gdkColor);
}
@@ -256,6 +259,7 @@ Color _getForeground (int index) {
if (ptr [0] == 0) return _getForeground ();
GdkColor gdkColor = new GdkColor ();
OS.memmove (gdkColor, ptr [0], GdkColor.sizeof);
+ OS.gdk_color_free (ptr [0]);
return Color.gtk_new (display, gdkColor);
}
@@ -268,6 +272,7 @@ Image _getImage (int index) {
if (ptr [0] == 0) return null;
ImageList imageList = parent.imageList;
int imageIndex = imageList.indexOf (ptr [0]);
+ OS.g_object_unref (ptr [0]);
if (imageIndex == -1) return null;
return imageList.get (imageIndex);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
index 46b5929d35..3b932a0f9c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
@@ -1551,7 +1551,7 @@ void drawBitmapTransparent(Image srcImage, int srcX, int srcY, int srcWidth, int
byte[] bmi = new byte[BITMAPINFOHEADER.sizeof + numColors * 4];
OS.MoveMemory(bmi, bmiHeader, BITMAPINFOHEADER.sizeof);
if (OS.IsWinCE) SWT.error(SWT.ERROR_NOT_IMPLEMENTED);
- OS.GetDIBits(srcHdc, srcImage.handle, 0, 0, 0, bmi, OS.DIB_RGB_COLORS);
+ OS.GetDIBits(srcHdc, srcImage.handle, 0, 0, null, bmi, OS.DIB_RGB_COLORS);
int offset = BITMAPINFOHEADER.sizeof + 4 * srcImage.transparentPixel;
transRed = bmi[offset + 2] & 0xFF;
transGreen = bmi[offset + 1] & 0xFF;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
index cef405f92f..a39b76ca48 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
@@ -1257,17 +1257,13 @@ public ImageData getImageData() {
int imageSize;
/* Call with null lpBits to get the image size */
if (OS.IsWinCE) SWT.error(SWT.ERROR_NOT_IMPLEMENTED);
- OS.GetDIBits(hBitmapDC, hBitmap, 0, height, 0, bmi, OS.DIB_RGB_COLORS);
+ OS.GetDIBits(hBitmapDC, hBitmap, 0, height, null, bmi, OS.DIB_RGB_COLORS);
OS.MoveMemory(bmiHeader, bmi, BITMAPINFOHEADER.sizeof);
imageSize = bmiHeader.biSizeImage;
byte[] data = new byte[imageSize];
/* Get the bitmap data */
- int /*long*/ hHeap = OS.GetProcessHeap();
- int /*long*/ lpvBits = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, imageSize);
- if (lpvBits == 0) SWT.error(SWT.ERROR_NO_HANDLES);
if (OS.IsWinCE) SWT.error(SWT.ERROR_NOT_IMPLEMENTED);
- OS.GetDIBits(hBitmapDC, hBitmap, 0, height, lpvBits, bmi, OS.DIB_RGB_COLORS);
- OS.MoveMemory(data, lpvBits, imageSize);
+ OS.GetDIBits(hBitmapDC, hBitmap, 0, height, data, bmi, OS.DIB_RGB_COLORS);
/* Calculate the palette */
PaletteData palette = null;
if (depth <= 8) {
@@ -1294,8 +1290,7 @@ public ImageData getImageData() {
/* Do the bottom half of the mask */
maskData = new byte[imageSize];
if (OS.IsWinCE) SWT.error(SWT.ERROR_NOT_IMPLEMENTED);
- OS.GetDIBits(hBitmapDC, hBitmap, height, height, lpvBits, bmi, OS.DIB_RGB_COLORS);
- OS.MoveMemory(maskData, lpvBits, imageSize);
+ OS.GetDIBits(hBitmapDC, hBitmap, height, height, maskData, bmi, OS.DIB_RGB_COLORS);
} else {
/* Do the entire mask */
/* Create the BITMAPINFO */
@@ -1316,16 +1311,12 @@ public ImageData getImageData() {
OS.SelectObject(hBitmapDC, info.hbmMask);
/* Call with null lpBits to get the image size */
if (OS.IsWinCE) SWT.error(SWT.ERROR_NOT_IMPLEMENTED);
- OS.GetDIBits(hBitmapDC, info.hbmMask, 0, height, 0, bmi, OS.DIB_RGB_COLORS);
+ OS.GetDIBits(hBitmapDC, info.hbmMask, 0, height, null, bmi, OS.DIB_RGB_COLORS);
OS.MoveMemory(bmiHeader, bmi, BITMAPINFOHEADER.sizeof);
imageSize = bmiHeader.biSizeImage;
maskData = new byte[imageSize];
- int /*long*/ lpvMaskBits = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, imageSize);
- if (lpvMaskBits == 0) SWT.error(SWT.ERROR_NO_HANDLES);
if (OS.IsWinCE) SWT.error(SWT.ERROR_NOT_IMPLEMENTED);
- OS.GetDIBits(hBitmapDC, info.hbmMask, 0, height, lpvMaskBits, bmi, OS.DIB_RGB_COLORS);
- OS.MoveMemory(maskData, lpvMaskBits, imageSize);
- OS.HeapFree(hHeap, 0, lpvMaskBits);
+ OS.GetDIBits(hBitmapDC, info.hbmMask, 0, height, maskData, bmi, OS.DIB_RGB_COLORS);
/* Loop to invert the mask */
for (int i = 0; i < maskData.length; i++) {
maskData[i] ^= -1;
@@ -1340,7 +1331,6 @@ public ImageData getImageData() {
maskData = ImageData.convertPad(maskData, width, height, 1, maskPad, 2);
}
/* Clean up */
- OS.HeapFree(hHeap, 0, lpvBits);
OS.SelectObject(hBitmapDC, hOldBitmap);
if (oldPalette != 0) {
OS.SelectPalette(hBitmapDC, oldPalette, false);
@@ -1445,7 +1435,7 @@ public ImageData getImageData() {
} else {
/* Call with null lpBits to get the image size */
if (OS.IsWinCE) SWT.error(SWT.ERROR_NOT_IMPLEMENTED);
- OS.GetDIBits(hBitmapDC, handle, 0, height, 0, bmi, OS.DIB_RGB_COLORS);
+ OS.GetDIBits(hBitmapDC, handle, 0, height, null, bmi, OS.DIB_RGB_COLORS);
OS.MoveMemory(bmiHeader, bmi, BITMAPINFOHEADER.sizeof);
imageSize = bmiHeader.biSizeImage;
}
@@ -1459,13 +1449,8 @@ public ImageData getImageData() {
OS.MoveMemory(data, bm.bmBits, imageSize);
}
} else {
- int /*long*/ hHeap = OS.GetProcessHeap();
- int /*long*/ lpvBits = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, imageSize);
- if (lpvBits == 0) SWT.error(SWT.ERROR_NO_HANDLES);
if (OS.IsWinCE) SWT.error(SWT.ERROR_NOT_IMPLEMENTED);
- OS.GetDIBits(hBitmapDC, handle, 0, height, lpvBits, bmi, OS.DIB_RGB_COLORS);
- OS.MoveMemory(data, lpvBits, imageSize);
- OS.HeapFree(hHeap, 0, lpvBits);
+ OS.GetDIBits(hBitmapDC, handle, 0, height, data, bmi, OS.DIB_RGB_COLORS);
}
/* Calculate the palette */
PaletteData palette = null;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
index dbd91a4403..41da159a65 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
@@ -2266,8 +2266,8 @@ public int getOffset (int x, int y, int[] trailing) {
int /*long*/ advances = run.justify != 0 ? run.justify : run.advances;
OS.ScriptXtoCP(xRun, cChars, cGlyphs, run.clusters, run.visAttrs, advances, run.analysis, piCP, piTrailing);
int offset = run.start + piCP[0];
- char ch = segmentsText.charAt(offset);
int length = segmentsText.length();
+ char ch = offset < length ? segmentsText.charAt(offset) : 0;
if (0xD800 <= ch && ch <= 0xDBFF) {
if (offset + 1 < length) {
ch = segmentsText.charAt(offset + 1);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Button.java
index b0612c48a8..4b44a64e42 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Button.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Button.java
@@ -1215,6 +1215,18 @@ LRESULT WM_GETDLGCODE (int /*long*/ wParam, int /*long*/ lParam) {
return result;
}
+LRESULT WM_GETOBJECT (int /*long*/ wParam, int /*long*/ lParam) {
+ /*
+ * Ensure that there is an accessible object created for this
+ * control because support for radio button position in group
+ * accessibility is implemented in the accessibility package.
+ */
+ if ((style & SWT.RADIO) != 0) {
+ if (accessible == null) accessible = new_Accessible (this);
+ }
+ return super.WM_GETOBJECT (wParam, lParam);
+}
+
LRESULT WM_KILLFOCUS (int /*long*/ wParam, int /*long*/ lParam) {
LRESULT result = super.WM_KILLFOCUS (wParam, lParam);
if ((style & SWT.PUSH) != 0 && getDefault ()) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java
index 17577c02f9..caa5188848 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java
@@ -303,8 +303,8 @@ void enableWidget (boolean enabled) {
Point point = offsets [i];
layout.setStyle (linkStyle, point.x, point.y);
}
- redraw ();
}
+ redraw ();
/*
* Feature in Windows. For some reason, setting
* LIS_ENABLED state using LM_SETITEM causes the
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java
index f73886d0bb..6faec077a5 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java
@@ -260,6 +260,15 @@ void _setVisible (boolean visible) {
} else {
OS.SendMessage (hwndParent, OS.WM_CANCELMODE, 0, 0);
}
+ /*
+ * Bug in Windows. After closing a popup menu, the accessibility focus
+ * is not returned to the focus control. This causes confusion for AT users.
+ * The fix is to explicitly set the accessibility focus back to the focus control.
+ */
+ int /*long*/ hFocus = OS.GetFocus();
+ if (hFocus != 0) {
+ OS.NotifyWinEvent (OS.EVENT_OBJECT_FOCUS, hFocus, OS.OBJID_CLIENT, 0);
+ }
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TabFolder.java
index 2f03875289..f469bcdd25 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TabFolder.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TabFolder.java
@@ -869,6 +869,16 @@ LRESULT WM_GETDLGCODE (int /*long*/ wParam, int /*long*/ lParam) {
return new LRESULT (OS.DLGC_BUTTON | OS.DLGC_WANTARROWS);
}
+LRESULT WM_GETOBJECT (int /*long*/ wParam, int /*long*/ lParam) {
+ /*
+ * Ensure that there is an accessible object created for this
+ * control because support for publishing the keyboard shortcut
+ * for page switching is implemented in the accessibility package.
+ */
+ if (accessible == null) accessible = new_Accessible (this);
+ return super.WM_GETOBJECT (wParam, lParam);
+}
+
LRESULT WM_KEYDOWN (int /*long*/ wParam, int /*long*/ lParam) {
LRESULT result = super.WM_KEYDOWN (wParam, lParam);
if (result != null) return result;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java
index 38f0451215..d91cfd0513 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java
@@ -310,8 +310,10 @@ public void addModifyListener (ModifyListener listener) {
* <p>
* <code>widgetSelected</code> is not called for texts.
* <code>widgetDefaultSelected</code> is typically called when ENTER is pressed in a single-line text,
- * or when ENTER is pressed in a search text. If the receiver has the <code>SWT.SEARCH | SWT.CANCEL</code> style
- * and the user cancels the search, the event object detail field contains the value <code>SWT.CANCEL</code>.
+ * or when ENTER is pressed in a search text. If the receiver has the <code>SWT.SEARCH | SWT.ICON_CANCEL</code> style
+ * and the user cancels the search, the event object detail field contains the value <code>SWT.ICON_CANCEL</code>.
+ * Likewise, if the receiver has the <code>SWT.ICON_SEARCH</code> style and the icon search is selected, the
+ * event object detail field contains the value <code>SWT.ICON_SEARCH</code>.
* </p>
*
* @param listener the listener which should be notified when the control is selected by the user
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TrayItem.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TrayItem.java
index c9e45d6ac7..a4ba1a0a61 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TrayItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TrayItem.java
@@ -39,7 +39,7 @@ import org.eclipse.swt.internal.win32.*;
public class TrayItem extends Item {
Tray parent;
int id;
- Image image2;
+ Image image2, highlightImage;
ToolTip toolTip;
String toolTipText;
boolean visible = true;
@@ -161,6 +161,24 @@ void destroyWidget () {
}
/**
+ * Returns the receiver's highlight image if it has one, or null
+ * if it does not.
+ *
+ * @return the receiver's highlight image
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.8
+ */
+public Image getHighlightImage () {
+ checkWidget ();
+ return highlightImage;
+}
+
+/**
* Returns the receiver's parent, which must be a <code>Tray</code>.
*
* @return the receiver's parent
@@ -320,6 +338,7 @@ void releaseWidget () {
toolTip = null;
if (image2 != null) image2.dispose ();
image2 = null;
+ highlightImage = null;
toolTipText = null;
NOTIFYICONDATA iconData = OS.IsUnicode ? (NOTIFYICONDATA) new NOTIFYICONDATAW () : new NOTIFYICONDATAA ();
iconData.cbSize = NOTIFYICONDATA.sizeof;
@@ -381,6 +400,27 @@ public void removeMenuDetectListener (MenuDetectListener listener) {
}
/**
+ * Sets the receiver's highlight image.
+ *
+ * @param image the new highlight image
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.8
+ */
+public void setHighlightImage (Image image) {
+ checkWidget ();
+ if (image != null && image.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+ highlightImage = image;
+}
+
+/**
* Sets the receiver's image.
*
* @param image the new image
diff --git a/bundles/org.eclipse.swt/buildSWT.xml b/bundles/org.eclipse.swt/buildSWT.xml
index ceefe341ff..9ac071bbd6 100644
--- a/bundles/org.eclipse.swt/buildSWT.xml
+++ b/bundles/org.eclipse.swt/buildSWT.xml
@@ -34,7 +34,7 @@
<property name="repo.src" value="../../../eclipse.platform.swt"/>
<property name="repo.bin" value="../../../eclipse.platform.swt.binaries"/>
- <property name="repo.common" value="../../../eclipse.platform.common"/>
+ <property name="repo.releng" value="../../../eclipse.platform.releng.maps"/>
<property name="src_common" value="'bundles/org.eclipse.swt/Eclipse SWT/common/library' 'bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library' 'bundles/org.eclipse.swt/Eclipse SWT PI/common/library'"/>
<property name="src_win32" value="${src_common} 'bundles/org.eclipse.swt/Eclipse SWT PI/win32/library' 'bundles/org.eclipse.swt/Eclipse SWT AWT/win32/library' 'bundles/org.eclipse.swt/Eclipse SWT OpenGL/win32/library' 'bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/library'"/>
@@ -50,7 +50,7 @@
<property name="file_make_common" value="bundles/org.eclipse.swt/Eclipse SWT/common/library/make_common.mak"/>
<property name="file_version" value="bundles/org.eclipse.swt/Eclipse SWT/common/version.txt"/>
<property name="file_build_notes" value="bundles/org.eclipse.swt/buildnotes_swt.html"/>
- <property name="file_swt_map" value="maps/org.eclipse.releng/maps/swt.map"/>
+ <property name="file_swt_map" value="org.eclipse.releng/maps/swt.map"/>
<target name="check_libraries" depends="get_version">
<antcall target="check_fragment_libraries">
@@ -591,7 +591,7 @@
<!-- Set swt_tag to the current tag in the swt map file -->
<target name="get_tag" unless="swt_tag">
- <loadfile property="swt_tag" srcfile="${repo.common}/${file_swt_map}">
+ <loadfile property="swt_tag" srcfile="${repo.releng}/${file_swt_map}">
<filterchain>
<tokenfilter delimoutput="">
<containsstring contains="plugin@org.eclipse.swt=GIT,tag="/>
@@ -715,15 +715,15 @@
<target name="update_swt_map" depends="get_new_tag">
<!-- update and commit map file -->
- <replaceregexp file="${repo.common}/${file_swt_map}" match="=v\d\d\d\d[a-z]?" replace="=v${swt_new_tag}" byline="true"/>
+ <replaceregexp file="${repo.releng}/${file_swt_map}" match="=v\d\d\d\d[a-z]?" replace="=v${swt_new_tag}" byline="true"/>
- <exec dir="${repo.common}" executable="git" failonerror="true">
+ <exec dir="${repo.releng}" executable="git" failonerror="true">
<arg line="add '${file_swt_map}'"/>
</exec>
- <exec dir="${repo.common}" executable="git" failonerror="true">
+ <exec dir="${repo.releng}" executable="git" failonerror="true">
<arg line="status"/>
</exec>
- <exec dir="${repo.common}" executable="git" failonerror="true">
+ <exec dir="${repo.releng}" executable="git" failonerror="true">
<arg line="commit -m 'SWT contribution v${swt_new_tag}'"/>
</exec>
</target>
@@ -1048,18 +1048,18 @@
<arg line="reset --hard origin/${TAG}"/>
</exec>
<antcall target="init_repo">
- <param name="repo" value="eclipse.platform.common"/>
- <param name="repo.exists" value="repo.common.exists"/>
+ <param name="repo" value="eclipse.platform.releng.maps"/>
+ <param name="repo.exists" value="repo.releng.exists"/>
</antcall>
- <exec dir="../../../../${TAG}/eclipse.platform.common" executable="git" failonerror="true">
+ <exec dir="../../../../${TAG}/eclipse.platform.releng.maps" executable="git" failonerror="true">
<arg line="fetch"/>
</exec>
- <exec dir="../../../../${TAG}/eclipse.platform.common" executable="git" failonerror="true">
+ <exec dir="../../../../${TAG}/eclipse.platform.releng.maps" executable="git" failonerror="true">
<arg line="reset --hard origin/${TAG}"/>
</exec>
</target>
- <target name="push_remote">
+ <target name="push_remote" depends="get_tag">
<exec dir="../../../../${TAG}/eclipse.platform.swt" executable="git" failonerror="true">
<arg line="fetch"/>
</exec>
@@ -1078,20 +1078,62 @@
<exec dir="../../../../${TAG}/eclipse.platform.swt.binaries" executable="git" failonerror="true">
<arg line="push origin ${TAG}"/>
</exec>
- <exec dir="../../../../${TAG}/eclipse.platform.common" executable="git" failonerror="true">
+ <exec dir="../../../../${TAG}/eclipse.platform.releng.maps" executable="git" failonerror="true">
<arg line="fetch"/>
</exec>
- <exec dir="../../../../${TAG}/eclipse.platform.common" executable="git" failonerror="true">
+ <exec dir="../../../../${TAG}/eclipse.platform.releng.maps" executable="git" failonerror="true">
<arg line="rebase origin/${TAG}"/>
</exec>
- <exec dir="../../../../${TAG}/eclipse.platform.common" executable="git" failonerror="true">
+ <exec dir="../../../../${TAG}/eclipse.platform.releng.maps" executable="git" failonerror="true">
<arg line="push origin ${TAG}"/>
</exec>
<exec dir="${repo.src}" executable="git" failonerror="true">
- <arg line="push --tags"/>
+ <arg line="push origin refs/tags/${swt_tag}"/>
</exec>
<exec dir="${repo.bin}" executable="git" failonerror="true">
- <arg line="push --tags"/>
+ <arg line="push origin refs/tags/${swt_tag}"/>
+ </exec>
+ </target>
+
+ <target name="push_integration">
+ <property name="TAG" value="master"/>
+ <!-- src -->
+ <exec dir="../../../../${TAG}/eclipse.platform.swt" executable="git" failonerror="true">
+ <arg line="checkout master"/>
+ </exec>
+ <exec dir="../../../../${TAG}/eclipse.platform.swt" executable="git" failonerror="true">
+ <arg line="reset --hard origin/${TAG}"/>
+ </exec>
+ <exec dir="../../../../${TAG}/eclipse.platform.swt" executable="git" failonerror="true">
+ <arg line="checkout integration"/>
+ </exec>
+ <exec dir="../../../../${TAG}/eclipse.platform.swt" executable="git" failonerror="true">
+ <arg line="merge master"/>
+ </exec>
+ <exec dir="../../../../${TAG}/eclipse.platform.swt" executable="git" failonerror="true">
+ <arg line="push origin integration"/>
+ </exec>
+ <exec dir="../../../../${TAG}/eclipse.platform.swt" executable="git" failonerror="true">
+ <arg line="checkout master"/>
+ </exec>
+ <!-- bin -->
+ <exec dir="../../../../${TAG}/eclipse.platform.swt.binaries" executable="git" failonerror="true">
+ <arg line="checkout master"/>
+ </exec>
+ <exec dir="../../../../${TAG}/eclipse.platform.swt.binaries" executable="git" failonerror="true">
+ <arg line="reset --hard origin/${TAG}"/>
+ </exec>
+ <exec dir="../../../../${TAG}/eclipse.platform.swt.binaries" executable="git" failonerror="true">
+ <arg line="checkout integration"/>
+ </exec>
+ <exec dir="../../../../${TAG}/eclipse.platform.swt.binaries" executable="git" failonerror="true">
+ <arg line="merge master"/>
+ </exec>
+ <exec dir="../../../../${TAG}/eclipse.platform.swt.binaries" executable="git" failonerror="true">
+ <arg line="push origin integration"/>
+ </exec>
+ <exec dir="../../../../${TAG}/eclipse.platform.swt.binaries" executable="git" failonerror="true">
+ <arg line="checkout master"/>
</exec>
</target>
diff --git a/bundles/org.eclipse.swt/buildnotes_swt.html b/bundles/org.eclipse.swt/buildnotes_swt.html
index 3803bb0d1f..e7e993021a 100644
--- a/bundles/org.eclipse.swt/buildnotes_swt.html
+++ b/bundles/org.eclipse.swt/buildnotes_swt.html
@@ -11,6 +11,114 @@
Eclipse Platform Build Notes<br>
SWT</h1>
+<h2>SWT Build 3818 - Tuesday January 17, 2012</h2>
+
+<blockquote>
+<a href=https://bugs.eclipse.org/bugs/buglist.cgi?bug_file_loc=;bug_file_loc_type=allwordssubstr;bug_id=;bugidtype=include;chfield=resolution;target_milestone=;chfieldfrom=2012-01-09+16%3A58%3A14+-0500;chfieldto=2012-01-16+23%3A13%3A09+%2B0000;chfieldvalue=FIXED;classification=Eclipse;component=SWT;email1=;email2=;emailtype1=substring;emailtype2=substring;field-1-0-0=classification;field-1-1-0=product;field-1-2-0=component;field0-0-0=noop;keywords=;keywords_type=allwords;long_desc=;long_desc_type=allwordssubstr;product=Platform;query_format=advanced;remaction=;short_desc=;short_desc_type=allwordssubstr;status_whiteboard=;status_whiteboard_type=allwordssubstr;type-1-0-0=anyexact;type-1-1-0=anyexact;type-1-2-0=anyexact;type0-0-0=noop;value-1-0-0=Eclipse;value-1-1-0=Platform;value-1-2-0=SWT;value0-0-0=;votes=;query_based_on=>Bugs fixed</a>
+</blockquote>
+
+<h2>SWT Build 3817b - Tuesday January 10, 2012</h2>
+
+<blockquote>
+<a href=https://bugs.eclipse.org/bugs/buglist.cgi?bug_file_loc=;bug_file_loc_type=allwordssubstr;bug_id=;bugidtype=include;chfield=resolution;target_milestone=;chfieldfrom=2011-12-22+12%3A30%3A26+-0500;chfieldto=2012-01-09+21%3A58%3A11+%2B0000;chfieldvalue=FIXED;classification=Eclipse;component=SWT;email1=;email2=;emailtype1=substring;emailtype2=substring;field-1-0-0=classification;field-1-1-0=product;field-1-2-0=component;field0-0-0=noop;keywords=;keywords_type=allwords;long_desc=;long_desc_type=allwordssubstr;product=Platform;query_format=advanced;remaction=;short_desc=;short_desc_type=allwordssubstr;status_whiteboard=;status_whiteboard_type=allwordssubstr;type-1-0-0=anyexact;type-1-1-0=anyexact;type-1-2-0=anyexact;type0-0-0=noop;value-1-0-0=Eclipse;value-1-1-0=Platform;value-1-2-0=SWT;value0-0-0=;votes=;query_based_on=>Bugs fixed</a>
+</blockquote>
+
+<h2>SWT Build 3817a - Friday December 23, 2011</h2>
+
+<blockquote>
+<a href=https://bugs.eclipse.org/bugs/buglist.cgi?bug_file_loc=;bug_file_loc_type=allwordssubstr;bug_id=;bugidtype=include;chfield=resolution;target_milestone=;chfieldfrom=2011-12-19+16%3A56%3A51+-0500;chfieldto=2011-12-22+17%3A30%3A24+%2B0000;chfieldvalue=FIXED;classification=Eclipse;component=SWT;email1=;email2=;emailtype1=substring;emailtype2=substring;field-1-0-0=classification;field-1-1-0=product;field-1-2-0=component;field0-0-0=noop;keywords=;keywords_type=allwords;long_desc=;long_desc_type=allwordssubstr;product=Platform;query_format=advanced;remaction=;short_desc=;short_desc_type=allwordssubstr;status_whiteboard=;status_whiteboard_type=allwordssubstr;type-1-0-0=anyexact;type-1-1-0=anyexact;type-1-2-0=anyexact;type0-0-0=noop;value-1-0-0=Eclipse;value-1-1-0=Platform;value-1-2-0=SWT;value0-0-0=;votes=;query_based_on=>Bugs fixed</a>
+</blockquote>
+
+<h2>SWT Build 3817 - Tuesday December 20, 2011</h2>
+
+<blockquote>
+<a href=https://bugs.eclipse.org/bugs/buglist.cgi?bug_file_loc=;bug_file_loc_type=allwordssubstr;bug_id=;bugidtype=include;chfield=resolution;target_milestone=;chfieldfrom=2011-12-12+17%3A07%3A57+-0500;chfieldto=2011-12-19+21%3A56%3A48+%2B0000;chfieldvalue=FIXED;classification=Eclipse;component=SWT;email1=;email2=;emailtype1=substring;emailtype2=substring;field-1-0-0=classification;field-1-1-0=product;field-1-2-0=component;field0-0-0=noop;keywords=;keywords_type=allwords;long_desc=;long_desc_type=allwordssubstr;product=Platform;query_format=advanced;remaction=;short_desc=;short_desc_type=allwordssubstr;status_whiteboard=;status_whiteboard_type=allwordssubstr;type-1-0-0=anyexact;type-1-1-0=anyexact;type-1-2-0=anyexact;type0-0-0=noop;value-1-0-0=Eclipse;value-1-1-0=Platform;value-1-2-0=SWT;value0-0-0=;votes=;query_based_on=>Bugs fixed</a>
+</blockquote>
+
+<h2>SWT Build 3816a - Tuesday December 13, 2011</h2>
+
+<blockquote>
+<a href=https://bugs.eclipse.org/bugs/buglist.cgi?bug_file_loc=;bug_file_loc_type=allwordssubstr;bug_id=;bugidtype=include;chfield=resolution;target_milestone=;chfieldfrom=2011-12-09+13%3A01%3A24+-0500;chfieldto=2011-12-12+22%3A07%3A55+%2B0000;chfieldvalue=FIXED;classification=Eclipse;component=SWT;email1=;email2=;emailtype1=substring;emailtype2=substring;field-1-0-0=classification;field-1-1-0=product;field-1-2-0=component;field0-0-0=noop;keywords=;keywords_type=allwords;long_desc=;long_desc_type=allwordssubstr;product=Platform;query_format=advanced;remaction=;short_desc=;short_desc_type=allwordssubstr;status_whiteboard=;status_whiteboard_type=allwordssubstr;type-1-0-0=anyexact;type-1-1-0=anyexact;type-1-2-0=anyexact;type0-0-0=noop;value-1-0-0=Eclipse;value-1-1-0=Platform;value-1-2-0=SWT;value0-0-0=;votes=;query_based_on=>Bugs fixed</a>
+</blockquote>
+
+<h2>SWT Build 3816 - Saturday December 10, 2011</h2>
+
+<blockquote>
+<a href=https://bugs.eclipse.org/bugs/buglist.cgi?bug_file_loc=;bug_file_loc_type=allwordssubstr;bug_id=;bugidtype=include;chfield=resolution;target_milestone=;chfieldfrom=2011-12-07+14%3A26%3A54+-0500;chfieldto=2011-12-09+18%3A01%3A21+%2B0000;chfieldvalue=FIXED;classification=Eclipse;component=SWT;email1=;email2=;emailtype1=substring;emailtype2=substring;field-1-0-0=classification;field-1-1-0=product;field-1-2-0=component;field0-0-0=noop;keywords=;keywords_type=allwords;long_desc=;long_desc_type=allwordssubstr;product=Platform;query_format=advanced;remaction=;short_desc=;short_desc_type=allwordssubstr;status_whiteboard=;status_whiteboard_type=allwordssubstr;type-1-0-0=anyexact;type-1-1-0=anyexact;type-1-2-0=anyexact;type0-0-0=noop;value-1-0-0=Eclipse;value-1-1-0=Platform;value-1-2-0=SWT;value0-0-0=;votes=;query_based_on=>Bugs fixed</a>
+</blockquote>
+
+<h2>SWT Build 3815 - Thursday December 08, 2011</h2>
+
+<blockquote>
+<a href=https://bugs.eclipse.org/bugs/buglist.cgi?bug_file_loc=;bug_file_loc_type=allwordssubstr;bug_id=;bugidtype=include;chfield=resolution;target_milestone=;chfieldfrom=2011-12-05+18%3A12%3A21+-0500;chfieldto=2011-12-07+19%3A26%3A51+%2B0000;chfieldvalue=FIXED;classification=Eclipse;component=SWT;email1=;email2=;emailtype1=substring;emailtype2=substring;field-1-0-0=classification;field-1-1-0=product;field-1-2-0=component;field0-0-0=noop;keywords=;keywords_type=allwords;long_desc=;long_desc_type=allwordssubstr;product=Platform;query_format=advanced;remaction=;short_desc=;short_desc_type=allwordssubstr;status_whiteboard=;status_whiteboard_type=allwordssubstr;type-1-0-0=anyexact;type-1-1-0=anyexact;type-1-2-0=anyexact;type0-0-0=noop;value-1-0-0=Eclipse;value-1-1-0=Platform;value-1-2-0=SWT;value0-0-0=;votes=;query_based_on=>Bugs fixed</a>
+</blockquote>
+
+<h2>SWT Build 3814 - Tuesday December 06, 2011</h2>
+
+<blockquote>
+<a href=https://bugs.eclipse.org/bugs/buglist.cgi?bug_file_loc=;bug_file_loc_type=allwordssubstr;bug_id=;bugidtype=include;chfield=resolution;target_milestone=;chfieldfrom=2011-12-01+17%3A22%3A01+-0500;chfieldto=2011-12-05+23%3A12%3A18+%2B0000;chfieldvalue=FIXED;classification=Eclipse;component=SWT;email1=;email2=;emailtype1=substring;emailtype2=substring;field-1-0-0=classification;field-1-1-0=product;field-1-2-0=component;field0-0-0=noop;keywords=;keywords_type=allwords;long_desc=;long_desc_type=allwordssubstr;product=Platform;query_format=advanced;remaction=;short_desc=;short_desc_type=allwordssubstr;status_whiteboard=;status_whiteboard_type=allwordssubstr;type-1-0-0=anyexact;type-1-1-0=anyexact;type-1-2-0=anyexact;type0-0-0=noop;value-1-0-0=Eclipse;value-1-1-0=Platform;value-1-2-0=SWT;value0-0-0=;votes=;query_based_on=>Bugs fixed</a>
+</blockquote>
+
+<h2>SWT Build 3813 - Friday December 02, 2011</h2>
+
+<blockquote>
+<a href=https://bugs.eclipse.org/bugs/buglist.cgi?bug_file_loc=;bug_file_loc_type=allwordssubstr;bug_id=;bugidtype=include;chfield=resolution;target_milestone=;chfieldfrom=2011-11-21+17%3A39%3A25+-0500;chfieldto=2011-12-01+22%3A21%3A58+%2B0000;chfieldvalue=FIXED;classification=Eclipse;component=SWT;email1=;email2=;emailtype1=substring;emailtype2=substring;field-1-0-0=classification;field-1-1-0=product;field-1-2-0=component;field0-0-0=noop;keywords=;keywords_type=allwords;long_desc=;long_desc_type=allwordssubstr;product=Platform;query_format=advanced;remaction=;short_desc=;short_desc_type=allwordssubstr;status_whiteboard=;status_whiteboard_type=allwordssubstr;type-1-0-0=anyexact;type-1-1-0=anyexact;type-1-2-0=anyexact;type0-0-0=noop;value-1-0-0=Eclipse;value-1-1-0=Platform;value-1-2-0=SWT;value0-0-0=;votes=;query_based_on=>Bugs fixed</a>
+</blockquote>
+
+<h2>SWT Build 3812c - Tuesday November 22, 2011</h2>
+
+<blockquote>
+<a href=https://bugs.eclipse.org/bugs/buglist.cgi?bug_file_loc=;bug_file_loc_type=allwordssubstr;bug_id=;bugidtype=include;chfield=resolution;target_milestone=;chfieldfrom=2011-11-18+11%3A53%3A29+-0500;chfieldto=2011-11-21+22%3A39%3A22+%2B0000;chfieldvalue=FIXED;classification=Eclipse;component=SWT;email1=;email2=;emailtype1=substring;emailtype2=substring;field-1-0-0=classification;field-1-1-0=product;field-1-2-0=component;field0-0-0=noop;keywords=;keywords_type=allwords;long_desc=;long_desc_type=allwordssubstr;product=Platform;query_format=advanced;remaction=;short_desc=;short_desc_type=allwordssubstr;status_whiteboard=;status_whiteboard_type=allwordssubstr;type-1-0-0=anyexact;type-1-1-0=anyexact;type-1-2-0=anyexact;type0-0-0=noop;value-1-0-0=Eclipse;value-1-1-0=Platform;value-1-2-0=SWT;value0-0-0=;votes=;query_based_on=>Bugs fixed</a>
+</blockquote>
+
+<h2>SWT Build 3812b - Saturday November 19, 2011</h2>
+
+<blockquote>
+<a href=https://bugs.eclipse.org/bugs/buglist.cgi?bug_file_loc=;bug_file_loc_type=allwordssubstr;bug_id=;bugidtype=include;chfield=resolution;target_milestone=;chfieldfrom=2011-11-18+11%3A18%3A25+-0500;chfieldto=2011-11-18+16%3A53%3A26+%2B0000;chfieldvalue=FIXED;classification=Eclipse;component=SWT;email1=;email2=;emailtype1=substring;emailtype2=substring;field-1-0-0=classification;field-1-1-0=product;field-1-2-0=component;field0-0-0=noop;keywords=;keywords_type=allwords;long_desc=;long_desc_type=allwordssubstr;product=Platform;query_format=advanced;remaction=;short_desc=;short_desc_type=allwordssubstr;status_whiteboard=;status_whiteboard_type=allwordssubstr;type-1-0-0=anyexact;type-1-1-0=anyexact;type-1-2-0=anyexact;type0-0-0=noop;value-1-0-0=Eclipse;value-1-1-0=Platform;value-1-2-0=SWT;value0-0-0=;votes=;query_based_on=>Bugs fixed</a>
+</blockquote>
+
+<h2>SWT Build 3812a - Saturday November 19, 2011</h2>
+
+<blockquote>
+<a href=https://bugs.eclipse.org/bugs/buglist.cgi?bug_file_loc=;bug_file_loc_type=allwordssubstr;bug_id=;bugidtype=include;chfield=resolution;target_milestone=;chfieldfrom=2011-11-14+16%3A56%3A31+-0500;chfieldto=2011-11-18+16%3A18%3A22+%2B0000;chfieldvalue=FIXED;classification=Eclipse;component=SWT;email1=;email2=;emailtype1=substring;emailtype2=substring;field-1-0-0=classification;field-1-1-0=product;field-1-2-0=component;field0-0-0=noop;keywords=;keywords_type=allwords;long_desc=;long_desc_type=allwordssubstr;product=Platform;query_format=advanced;remaction=;short_desc=;short_desc_type=allwordssubstr;status_whiteboard=;status_whiteboard_type=allwordssubstr;type-1-0-0=anyexact;type-1-1-0=anyexact;type-1-2-0=anyexact;type0-0-0=noop;value-1-0-0=Eclipse;value-1-1-0=Platform;value-1-2-0=SWT;value0-0-0=;votes=;query_based_on=>Bugs fixed</a>
+</blockquote>
+
+<h2>SWT Build 3811 - Tuesday November 15, 2011</h2>
+
+<blockquote>
+<a href=https://bugs.eclipse.org/bugs/buglist.cgi?bug_file_loc=;bug_file_loc_type=allwordssubstr;bug_id=;bugidtype=include;chfield=resolution;target_milestone=;chfieldfrom=2011-11-07+16%3A21%3A18+-0500;chfieldto=2011-11-14+21%3A56%3A28+%2B0000;chfieldvalue=FIXED;classification=Eclipse;component=SWT;email1=;email2=;emailtype1=substring;emailtype2=substring;field-1-0-0=classification;field-1-1-0=product;field-1-2-0=component;field0-0-0=noop;keywords=;keywords_type=allwords;long_desc=;long_desc_type=allwordssubstr;product=Platform;query_format=advanced;remaction=;short_desc=;short_desc_type=allwordssubstr;status_whiteboard=;status_whiteboard_type=allwordssubstr;type-1-0-0=anyexact;type-1-1-0=anyexact;type-1-2-0=anyexact;type0-0-0=noop;value-1-0-0=Eclipse;value-1-1-0=Platform;value-1-2-0=SWT;value0-0-0=;votes=;query_based_on=>Bugs fixed</a>
+</blockquote>
+
+<h2>SWT Build 3810b - Tuesday November 08, 2011</h2>
+
+<blockquote>
+<a href=https://bugs.eclipse.org/bugs/buglist.cgi?bug_file_loc=;bug_file_loc_type=allwordssubstr;bug_id=;bugidtype=include;chfield=resolution;target_milestone=;chfieldfrom=2011-10-31+16%3A27%3A38+-0400;chfieldto=2011-11-07+21%3A21%3A15+%2B0000;chfieldvalue=FIXED;classification=Eclipse;component=SWT;email1=;email2=;emailtype1=substring;emailtype2=substring;field-1-0-0=classification;field-1-1-0=product;field-1-2-0=component;field0-0-0=noop;keywords=;keywords_type=allwords;long_desc=;long_desc_type=allwordssubstr;product=Platform;query_format=advanced;remaction=;short_desc=;short_desc_type=allwordssubstr;status_whiteboard=;status_whiteboard_type=allwordssubstr;type-1-0-0=anyexact;type-1-1-0=anyexact;type-1-2-0=anyexact;type0-0-0=noop;value-1-0-0=Eclipse;value-1-1-0=Platform;value-1-2-0=SWT;value0-0-0=;votes=;query_based_on=>Bugs fixed</a>
+</blockquote>
+
+<h2>SWT Build 3810a - Tuesday November 01, 2011</h2>
+
+<blockquote>
+<a href=https://bugs.eclipse.org/bugs/buglist.cgi?bug_file_loc=;bug_file_loc_type=allwordssubstr;bug_id=;bugidtype=include;chfield=resolution;target_milestone=;chfieldfrom=2011-10-28+17%3A39%3A19+-0400;chfieldto=2011-10-31+20%3A27%3A35+%2B0000;chfieldvalue=FIXED;classification=Eclipse;component=SWT;email1=;email2=;emailtype1=substring;emailtype2=substring;field-1-0-0=classification;field-1-1-0=product;field-1-2-0=component;field0-0-0=noop;keywords=;keywords_type=allwords;long_desc=;long_desc_type=allwordssubstr;product=Platform;query_format=advanced;remaction=;short_desc=;short_desc_type=allwordssubstr;status_whiteboard=;status_whiteboard_type=allwordssubstr;type-1-0-0=anyexact;type-1-1-0=anyexact;type-1-2-0=anyexact;type0-0-0=noop;value-1-0-0=Eclipse;value-1-1-0=Platform;value-1-2-0=SWT;value0-0-0=;votes=;query_based_on=>Bugs fixed</a>
+</blockquote>
+
+<h2>SWT Build 3810 - Saturday October 29, 2011</h2>
+
+<blockquote>
+<a href=https://bugs.eclipse.org/bugs/buglist.cgi?bug_file_loc=;bug_file_loc_type=allwordssubstr;bug_id=;bugidtype=include;chfield=resolution;target_milestone=;chfieldfrom=2011-10-24+16%3A58%3A48+-0400;chfieldto=2011-10-28+21%3A39%3A17+%2B0000;chfieldvalue=FIXED;classification=Eclipse;component=SWT;email1=;email2=;emailtype1=substring;emailtype2=substring;field-1-0-0=classification;field-1-1-0=product;field-1-2-0=component;field0-0-0=noop;keywords=;keywords_type=allwords;long_desc=;long_desc_type=allwordssubstr;product=Platform;query_format=advanced;remaction=;short_desc=;short_desc_type=allwordssubstr;status_whiteboard=;status_whiteboard_type=allwordssubstr;type-1-0-0=anyexact;type-1-1-0=anyexact;type-1-2-0=anyexact;type0-0-0=noop;value-1-0-0=Eclipse;value-1-1-0=Platform;value-1-2-0=SWT;value0-0-0=;votes=;query_based_on=>Bugs fixed</a>
+</blockquote>
+
+<h2>SWT Build 3809 - Tuesday October 25, 2011</h2>
+
+<blockquote>
+<a href=https://bugs.eclipse.org/bugs/buglist.cgi?bug_file_loc=;bug_file_loc_type=allwordssubstr;bug_id=;bugidtype=include;chfield=resolution;target_milestone=;chfieldfrom=2011-10-24+09%3A19%3A19+-0400;chfieldto=2011-10-24+20%3A58%3A46+%2B0000;chfieldvalue=FIXED;classification=Eclipse;component=SWT;email1=;email2=;emailtype1=substring;emailtype2=substring;field-1-0-0=classification;field-1-1-0=product;field-1-2-0=component;field0-0-0=noop;keywords=;keywords_type=allwords;long_desc=;long_desc_type=allwordssubstr;product=Platform;query_format=advanced;remaction=;short_desc=;short_desc_type=allwordssubstr;status_whiteboard=;status_whiteboard_type=allwordssubstr;type-1-0-0=anyexact;type-1-1-0=anyexact;type-1-2-0=anyexact;type0-0-0=noop;value-1-0-0=Eclipse;value-1-1-0=Platform;value-1-2-0=SWT;value0-0-0=;votes=;query_based_on=>Bugs fixed</a>
+</blockquote>
+
+<h2>SWT Build 3808 - Tuesday October 25, 2011</h2>
+
+<blockquote>
+<a href=https://bugs.eclipse.org/bugs/buglist.cgi?bug_file_loc=;bug_file_loc_type=allwordssubstr;bug_id=;bugidtype=include;chfield=resolution;target_milestone=;chfieldfrom=2011-10-17+16%3A16%3A01+-0400;chfieldto=2011-10-24+13%3A19%3A16+%2B0000;chfieldvalue=FIXED;classification=Eclipse;component=SWT;email1=;email2=;emailtype1=substring;emailtype2=substring;field-1-0-0=classification;field-1-1-0=product;field-1-2-0=component;field0-0-0=noop;keywords=;keywords_type=allwords;long_desc=;long_desc_type=allwordssubstr;product=Platform;query_format=advanced;remaction=;short_desc=;short_desc_type=allwordssubstr;status_whiteboard=;status_whiteboard_type=allwordssubstr;type-1-0-0=anyexact;type-1-1-0=anyexact;type-1-2-0=anyexact;type0-0-0=noop;value-1-0-0=Eclipse;value-1-1-0=Platform;value-1-2-0=SWT;value0-0-0=;votes=;query_based_on=>Bugs fixed</a>
+</blockquote>
+
<h2>SWT Build 3807 - Tuesday October 18, 2011</h2>
<blockquote>
diff --git a/examples/org.eclipse.swt.examples/.classpath b/examples/org.eclipse.swt.examples/.classpath
index 065ac06e19..b7464f3ca2 100644
--- a/examples/org.eclipse.swt.examples/.classpath
+++ b/examples/org.eclipse.swt.examples/.classpath
@@ -2,6 +2,6 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/examples/org.eclipse.swt.examples/src/examples_control.properties b/examples/org.eclipse.swt.examples/src/examples_control.properties
index bebd27b75b..520fd4f69e 100644
--- a/examples/org.eclipse.swt.examples/src/examples_control.properties
+++ b/examples/org.eclipse.swt.examples/src/examples_control.properties
@@ -211,13 +211,13 @@ Strikeout = Strikeout
Fill_X = Horizontal Fill
Fill_Y = Vertical Fill
Pack_Columns = Pack Columns
-TabItem1_0 = Tab 0
-TabItem1_1 = Tab 1
-TabItem1_2 = Tab 2
+TabItem1_0 = Tab &0
+TabItem1_1 = Tab &1
+TabItem1_2 = Tab &2
TabItem_content = TabItem Content
-CTabItem1_0 = CTabItem 0
-CTabItem1_1 = CTabItem 1
-CTabItem1_2 = CTabItem 2 has a long name
+CTabItem1_0 = CTabItem &0
+CTabItem1_1 = CTabItem &1
+CTabItem1_2 = CTabItem &2 has a long name
CItem_Colors = CTabItem Colors
CTabItem_content = CTabItem Content
Set_Simple_Tabs = Simple Tabs
diff --git a/examples/org.eclipse.swt.examples/src/examples_images.properties b/examples/org.eclipse.swt.examples/src/examples_images.properties
index 268989cab1..69c1312582 100644
--- a/examples/org.eclipse.swt.examples/src/examples_images.properties
+++ b/examples/org.eclipse.swt.examples/src/examples_images.properties
@@ -24,6 +24,7 @@ Transparent = Transparent
Transparent_lc = transparent
Mask = Mask
Background = Background
+Save_group = Save
Animation = Animation
Previous = < &Previous
Next = &Next >
@@ -34,7 +35,7 @@ Type_index = Type: {0} [{1,number,integer} of {2,number,integer}]
Size_initial = Size:
Size_value = Size: {0,number,integer} x {1,number,integer}
Depth_initial = Depth:
-Depth_value = Depth: {0}
+Depth_value = Depth: {0} (Display: {1})
Transparent_pixel_initial = Transparent pixel:
Transparent_pixel_value = Transparent pixel: {0}
Time_to_load_initial = Time to load:
@@ -53,6 +54,7 @@ Delay_used = Delay: {0,number,integer} ms
Repeats_initial = Repeats:
Repeats_value = Repeats: {0,number,integer}
Repeats_forever = Repeats: {0,number,integer} (forever)
+Compression = Compression:
Palette_initial = Palette:
Palette_direct = Palette: Direct
Palette_value = Palette size: {0,number,integer}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java
index 88935d08c7..6973182a54 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java
@@ -31,8 +31,8 @@ public class ImageAnalyzer {
Label typeLabel, sizeLabel, depthLabel, transparentPixelLabel,
timeToLoadLabel, screenSizeLabel, backgroundPixelLabel,
locationLabel, disposalMethodLabel, delayTimeLabel,
- repeatCountLabel, paletteLabel, dataLabel, statusLabel;
- Combo backgroundCombo, scaleXCombo, scaleYCombo, alphaCombo;
+ repeatCountLabel, compressionRatioLabel, paletteLabel, dataLabel, statusLabel;
+ Combo backgroundCombo, imageTypeCombo, compressionCombo, scaleXCombo, scaleYCombo, alphaCombo;
Button incrementalCheck, transparentCheck, maskCheck, backgroundCheck;
Button previousButton, nextButton, animateButton;
StyledText dataText;
@@ -45,6 +45,7 @@ public class ImageAnalyzer {
int paletteWidth = 140; // recalculated and used as a width hint
int ix = 0, iy = 0, py = 0; // used to scroll the image and palette
+ int compression; // used to modify the compression ratio of the image
float xscale = 1, yscale = 1; // used to scale the image
int alpha = 255; // used to modify the alpha value of the image
boolean incremental = false; // used to incrementally display an image
@@ -71,8 +72,8 @@ public class ImageAnalyzer {
static final int ALPHA_X = 1;
static final int ALPHA_Y = 2;
static final String[] OPEN_FILTER_EXTENSIONS = new String[] {
- "*.bmp; *.gif; *.ico; *.jfif; *.jpeg; *.jpg; *.png; *.tif; *.tiff",
- "*.bmp", "*.gif", "*.ico", "*.jpg; *.jpeg; *.jfif", "*.png", "*.tif; *.tiff" };
+ "*.bmp;*.gif;*.ico;*.jfif;*.jpeg;*.jpg;*.png;*.tif;*.tiff",
+ "*.bmp", "*.gif", "*.ico", "*.jpg;*.jpeg;*.jfif", "*.png", "*.tif;*.tiff" };
static final String[] OPEN_FILTER_NAMES = new String[] {
bundle.getString("All_images") + " (bmp, gif, ico, jfif, jpeg, jpg, png, tif, tiff)",
"BMP (*.bmp)", "GIF (*.gif)", "ICO (*.ico)", "JPEG (*.jpg, *.jpeg, *.jfif)",
@@ -83,7 +84,6 @@ public class ImageAnalyzer {
"Uncompressed BMP (*.bmp)", "RLE Compressed BMP (*.bmp)", "GIF (*.gif)",
"ICO (*.ico)", "JPEG (*.jpg)", "PNG (*.png)",
"TIFF (*.tif)", "OS/2 BMP (*.bmp)" };
-
class TextPrompter extends Dialog {
String message = "";
String result = null;
@@ -260,6 +260,60 @@ public class ImageAnalyzer {
}
});
+ // Combo to change the compression ratio.
+ group = new Group(controls, SWT.NONE);
+ group.setLayout(new GridLayout(3, true));
+ group.setText(bundle.getString("Save_group"));
+ imageTypeCombo = new Combo(group, SWT.DROP_DOWN | SWT.READ_ONLY);
+ String[] types = {"JPEG", "PNG", "GIF", "ICO", "TIFF", "BMP"};
+ for (int i = 0; i < types.length; i++) {
+ imageTypeCombo.add(types[i]);
+ }
+ imageTypeCombo.select(imageTypeCombo.indexOf("JPEG"));
+ imageTypeCombo.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ int index = imageTypeCombo.getSelectionIndex();
+ switch(index) {
+ case 0:
+ compressionCombo.setEnabled(true);
+ compressionRatioLabel.setEnabled(true);
+ if (compressionCombo.getItemCount() == 100) break;
+ compressionCombo.removeAll();
+ for (int i = 0; i < 100; i++) {
+ compressionCombo.add(String.valueOf(i + 1));
+ }
+ compressionCombo.select(compressionCombo.indexOf("75"));
+ break;
+ case 1:
+ compressionCombo.setEnabled(true);
+ compressionRatioLabel.setEnabled(true);
+ if (compressionCombo.getItemCount() == 10) break;
+ compressionCombo.removeAll();
+ for (int i = 0; i < 4; i++) {
+ compressionCombo.add(String.valueOf(i));
+ }
+ compressionCombo.select(0);
+ break;
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ compressionCombo.setEnabled(false);
+ compressionRatioLabel.setEnabled(false);
+ break;
+ }
+ }
+ });
+ imageTypeCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ compressionRatioLabel = new Label(group, SWT.NONE);
+ compressionRatioLabel.setText(bundle.getString("Compression"));
+ compressionRatioLabel.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false));
+ compressionCombo = new Combo(group, SWT.DROP_DOWN | SWT.READ_ONLY);
+ for (int i = 0; i < 100; i++) {
+ compressionCombo.add(String.valueOf(i + 1));
+ }
+ compressionCombo.select(compressionCombo.indexOf("75"));
+ compressionCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
// Combo to change the x scale.
String[] values = {
"0.1", "0.2", "0.3", "0.4", "0.5", "0.6", "0.7", "0.8", "0.9", "1",
@@ -862,7 +916,7 @@ public class ImageAnalyzer {
lastPath = fileChooser.getFilterPath();
if (filename == null)
return;
-
+ showFileType(filename);
Cursor waitCursor = display.getSystemCursor(SWT.CURSOR_WAIT);
shell.setCursor(waitCursor);
imageCanvas.setCursor(waitCursor);
@@ -1040,8 +1094,9 @@ public class ImageAnalyzer {
try {
// Save the current image to the current file.
loader.data = new ImageData[] {imageData};
+ if (imageData.type == SWT.IMAGE_JPEG) loader.compression = compressionCombo.indexOf(compressionCombo.getText()) + 1;
+ if (imageData.type == SWT.IMAGE_PNG) loader.compression = compressionCombo.indexOf(compressionCombo.getText());
loader.save(fileName, imageData.type);
-
} catch (SWTException e) {
showErrorDialog(bundle.getString("Saving_lc"), fileName, e);
} catch (SWTError e) {
@@ -1065,10 +1120,30 @@ public class ImageAnalyzer {
if (nameStart > -1) {
name = name.substring(nameStart + 1);
}
- fileChooser.setFileName(name);
+ fileChooser.setFileName(name.substring(0, name.indexOf(".")) + "." + imageTypeCombo.getText().toLowerCase());
}
fileChooser.setFilterExtensions(SAVE_FILTER_EXTENSIONS);
fileChooser.setFilterNames(SAVE_FILTER_NAMES);
+ switch (imageTypeCombo.getSelectionIndex()) {
+ case 0:
+ fileChooser.setFilterIndex(4);
+ break;
+ case 1:
+ fileChooser.setFilterIndex(5);
+ break;
+ case 2:
+ fileChooser.setFilterIndex(2);
+ break;
+ case 3:
+ fileChooser.setFilterIndex(3);
+ break;
+ case 4:
+ fileChooser.setFilterIndex(6);
+ break;
+ case 5:
+ fileChooser.setFilterIndex(0);
+ break;
+ }
String filename = fileChooser.open();
lastPath = fileChooser.getFilterPath();
if (filename == null)
@@ -1118,6 +1193,7 @@ public class ImageAnalyzer {
}
if (!multi) loader.data = new ImageData[] {imageData};
+ loader.compression = compressionCombo.indexOf(compressionCombo.getText());
loader.save(filename, filetype);
/* Restore the previous transparency setting. */
@@ -1298,8 +1374,7 @@ public class ImageAnalyzer {
} else {
imageCanvas.setBackground(null);
}
- }
-
+ }
/*
* Called when the ScaleX combo selection changes.
*/
@@ -1725,7 +1800,8 @@ public class ImageAnalyzer {
new Integer(imageData.height)});
sizeLabel.setText(string);
- string = createMsg(bundle.getString("Depth_value"), new Integer(imageData.depth));
+ string = createMsg(bundle.getString("Depth_value"),
+ new Object[] {new Integer(imageData.depth), new Integer(display.getDepth())});
depthLabel.setText(string);
string = createMsg(bundle.getString("Transparent_pixel_value"), pixelInfo(imageData.transparentPixel));
@@ -2373,6 +2449,48 @@ public class ImageAnalyzer {
return SWT.IMAGE_UNDEFINED;
}
+ void showFileType(String filename) {
+ String ext = filename.substring(filename.lastIndexOf('.') + 1);
+ if (ext.equalsIgnoreCase("jpg") || ext.equalsIgnoreCase("jpeg") || ext.equalsIgnoreCase("jfif")) {
+ imageTypeCombo.select(0);
+ compressionCombo.setEnabled(true);
+ compressionRatioLabel.setEnabled(true);
+ if (compressionCombo.getItemCount() == 100) return;
+ compressionCombo.removeAll();
+ for (int i = 0; i < 100; i++) {
+ compressionCombo.add(String.valueOf(i + 1));
+ }
+ compressionCombo.select(compressionCombo.indexOf("75"));
+ return;
+ }
+ if (ext.equalsIgnoreCase("png")) {
+ imageTypeCombo.select(1);
+ compressionCombo.setEnabled(true);
+ compressionRatioLabel.setEnabled(true);
+ if (compressionCombo.getItemCount() == 10) return;
+ compressionCombo.removeAll();
+ for (int i = 0; i < 4; i++) {
+ compressionCombo.add(String.valueOf(i));
+ }
+ compressionCombo.select(0);
+ return;
+ }
+ if (ext.equalsIgnoreCase("bmp")) {
+ imageTypeCombo.select(5);
+ }
+ if (ext.equalsIgnoreCase("gif")) {
+ imageTypeCombo.select(2);
+ }
+ if (ext.equalsIgnoreCase("ico")) {
+ imageTypeCombo.select(3);
+ }
+ if (ext.equalsIgnoreCase("tif") || ext.equalsIgnoreCase("tiff")) {
+ imageTypeCombo.select(4);
+ }
+ compressionCombo.setEnabled(false);
+ compressionRatioLabel.setEnabled(false);
+ }
+
static String createMsg(String msg, Object[] args) {
MessageFormat formatter = new MessageFormat(msg);
return formatter.format(args);
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet143.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet143.java
index 314a925b06..b52865ac8b 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet143.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet143.java
@@ -28,6 +28,11 @@ public static void main(String[] args) {
Display display = new Display ();
Shell shell = new Shell (display);
Image image = new Image (display, 16, 16);
+ Image image2 = new Image (display, 16, 16);
+ GC gc = new GC(image2);
+ gc.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
+ gc.fillRectangle(image2.getBounds());
+ gc.dispose();
final Tray tray = display.getSystemTray ();
if (tray == null) {
System.out.println ("The system tray is not available");
@@ -70,7 +75,8 @@ public static void main(String[] args) {
menu.setVisible (true);
}
});
- item.setImage (image);
+ item.setImage (image2);
+ item.setHighlightImage (image);
}
shell.setBounds(50, 50, 300, 200);
shell.open ();
@@ -78,6 +84,7 @@ public static void main(String[] args) {
if (!display.readAndDispatch ()) display.sleep ();
}
image.dispose ();
+ image2.dispose ();
display.dispose ();
}
}
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet359.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet359.java
new file mode 100644
index 0000000000..10b289df9d
--- /dev/null
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet359.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2011 IBM Corporation and others.
+ * All rights reserved. This Example Content is intended to demonstrate
+ * usage of Eclipse technology. It is provided to you under the terms and
+ * conditions of the Eclipse Distribution License v1.0 which is available
+ * at http://www.eclipse.org/org/documents/edl-v10.php
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.snippets;
+
+/*
+ * Combo getCaretLocation and getCaretPosition example
+ *
+ * For a list of all SWT example snippets see
+ * http://www.eclipse.org/swt/snippets/
+ */
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+public class Snippet359 {
+ public static void main(String[] args) {
+ Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setLayout(new FillLayout());
+ final Combo combo = new Combo(shell, SWT.DROP_DOWN);
+ combo.addKeyListener(new KeyListener() {
+ public void keyReleased(KeyEvent e) {
+ if (e.keyCode == SWT.CR) {
+ combo.add(combo.getText());
+ }
+ }
+ public void keyPressed(KeyEvent e) {
+ System.out.println("caret position: " + combo.getCaretPosition());
+ System.out.println("caret location: " + combo.getCaretLocation());
+ }
+ });
+ shell.pack();
+ shell.open ();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch ()) display.sleep ();
+ }
+ display.dispose ();
+ }
+}
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet360.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet360.java
new file mode 100644
index 0000000000..e157154d56
--- /dev/null
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet360.java
@@ -0,0 +1,155 @@
+/*******************************************************************************
+ * Copyright (c) 2011 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.snippets;
+
+/*
+ * TreeCursor example snippet: navigate a Tree's cells with the arrow keys.
+ * Edit when user hits Return key. Exit edit mode by hitting Escape (cancels edit)
+ * or Return (applies edit to tree). Expand/Collapse with MOD1+Arrow keys.
+ *
+ * For a list of all SWT example snippets see
+ * http://www.eclipse.org/swt/snippets/
+ *
+ * @since 3.8
+ */
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.*;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.layout.*;
+import org.eclipse.swt.widgets.*;
+
+public class Snippet360 {
+
+public static void main(String[] args) {
+ Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setLayout(new GridLayout());
+
+ // create a a tree with 3 columns and fill with data
+ final Tree tree = new Tree(shell, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
+ tree.setLayoutData(new GridData(GridData.FILL_BOTH));
+ tree.setHeaderVisible(true);
+ TreeColumn column1 = new TreeColumn(tree, SWT.NONE);
+ TreeColumn column2 = new TreeColumn(tree, SWT.NONE);
+ TreeColumn column3 = new TreeColumn(tree, SWT.NONE);
+ for (int i = 0; i < 9; i++) {
+ TreeItem item = new TreeItem(tree, SWT.NONE);
+ item.setText(new String[] { "root " + i + " 0", "root " + i + " 1", "root " + i + " 2" });
+ for (int j = 0; j < 9; j++) {
+ TreeItem item2 = new TreeItem(item, SWT.NONE);
+ item2.setText(new String[] { "child " + j + " 0", "child " + j + " 1", "child " + j + " 2" });
+ TreeItem current = item2;
+ for (int k = 0; k < 5; k++) {
+ TreeItem item3 = new TreeItem(current, SWT.NONE);
+ item3.setText(new String[] { "descendent " + k + " 0", "descendent " + k + " 1", "descendent " + k + " 2" });
+ current = item3;
+ }
+ }
+ }
+ column1.setWidth(200);
+ column2.setWidth(100);
+ column3.setWidth(100);
+
+ // create a TreeCursor to navigate around the tree
+ final TreeCursor cursor = new TreeCursor(tree, SWT.NONE);
+ // create an editor to edit the cell when the user hits "ENTER"
+ // while over a cell in the tree
+ final ControlEditor editor = new ControlEditor(cursor);
+ editor.grabHorizontal = true;
+ editor.grabVertical = true;
+
+ cursor.addSelectionListener(new SelectionAdapter() {
+ // when the TreeEditor is over a cell, select the corresponding row
+ // in the tree
+ public void widgetSelected(SelectionEvent e) {
+ tree.setSelection(new TreeItem[] { cursor.getRow() });
+ }
+
+ // when the user hits "ENTER" in the TreeCursor, pop up a text
+ // editor so that they can change the text of the cell
+ public void widgetDefaultSelected(SelectionEvent e) {
+ final Text text = new Text(cursor, SWT.NONE);
+ TreeItem row = cursor.getRow();
+ int column = cursor.getColumn();
+ text.setText(row.getText(column));
+ text.addKeyListener(new KeyAdapter() {
+ public void keyPressed(KeyEvent e) {
+ // close the text editor and copy the data over
+ // when the user hits "ENTER"
+ if (e.character == SWT.CR) {
+ TreeItem row = cursor.getRow();
+ int column = cursor.getColumn();
+ row.setText(column, text.getText());
+ text.dispose();
+ }
+ // close the text editor when the user hits "ESC"
+ if (e.character == SWT.ESC) {
+ text.dispose();
+ }
+ }
+ });
+ editor.setEditor(text);
+ text.setFocus();
+ }
+ });
+ // Hide the TreeCursor when the user hits the "MOD1" or "MOD2" key.
+ // This allows the user to select multiple items in the tree.
+ cursor.addKeyListener(new KeyAdapter() {
+ public void keyPressed(KeyEvent e) {
+ if (e.keyCode == SWT.MOD1 || e.keyCode == SWT.MOD2
+ || (e.stateMask & SWT.MOD1) != 0
+ || (e.stateMask & SWT.MOD2) != 0) {
+ cursor.setVisible(false);
+ }
+ }
+ });
+ // Show the TreeCursor when the user releases the "MOD2" or "MOD1" key.
+ // This signals the end of the multiple selection task.
+ tree.addKeyListener(new KeyListener() {
+ public void keyReleased(KeyEvent e) {
+ if (e.keyCode == SWT.MOD1 && (e.stateMask & SWT.MOD2) != 0) return;
+ if (e.keyCode == SWT.MOD2 && (e.stateMask & SWT.MOD1) != 0) return;
+ if (e.keyCode != SWT.MOD1 && (e.stateMask & SWT.MOD1) != 0) return;
+ if (e.keyCode != SWT.MOD2 && (e.stateMask & SWT.MOD2) != 0) return;
+
+ TreeItem[] selection = tree.getSelection();
+ TreeItem row = (selection.length == 0) ? tree.getItem(tree.indexOf(tree.getTopItem())) : selection[0];
+ tree.showItem(row);
+ cursor.setSelection(row, cursor.getColumn());
+ cursor.setVisible(true);
+ cursor.setFocus();
+ }
+ public void keyPressed(KeyEvent e) {
+ switch (e.keyCode) {
+ case SWT.ARROW_LEFT:
+ case SWT.ARROW_RIGHT: {
+ if ((e.stateMask & SWT.MOD1) != 0) {
+ TreeItem[] selection = tree.getSelection();
+ if (selection.length > 0) {
+ selection[0].setExpanded(e.keyCode == SWT.ARROW_RIGHT);
+ }
+ break;
+ }
+ }
+ }
+ }
+ });
+
+ shell.pack();
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.dispose();
+}
+
+}
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet96.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet96.java
index 8e3ec0ba9a..ba85093a80 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet96.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet96.java
@@ -11,7 +11,7 @@
package org.eclipse.swt.snippets;
/*
- * TableCursor example snippet: navigate a table cells with arrow keys.
+ * TableCursor example snippet: navigate a Table's cells with the arrow keys.
* Edit when user hits Return key. Exit edit mode by hitting Escape (cancels edit)
* or Return (applies edit to table).
*
@@ -143,20 +143,15 @@ public static void main(String[] args) {
// This signals the end of the multiple selection task.
table.addKeyListener(new KeyAdapter() {
public void keyReleased(KeyEvent e) {
- if (e.keyCode == SWT.CONTROL && (e.stateMask & SWT.SHIFT) != 0)
- return;
- if (e.keyCode == SWT.SHIFT && (e.stateMask & SWT.CONTROL) != 0)
- return;
- if (e.keyCode != SWT.CONTROL
- && (e.stateMask & SWT.CONTROL) != 0)
- return;
- if (e.keyCode != SWT.SHIFT && (e.stateMask & SWT.SHIFT) != 0)
- return;
+ if (e.keyCode == SWT.CONTROL && (e.stateMask & SWT.SHIFT) != 0) return;
+ if (e.keyCode == SWT.SHIFT && (e.stateMask & SWT.CONTROL) != 0) return;
+ if (e.keyCode != SWT.CONTROL && (e.stateMask & SWT.CONTROL) != 0) return;
+ if (e.keyCode != SWT.SHIFT && (e.stateMask & SWT.SHIFT) != 0) return;
TableItem[] selection = table.getSelection();
TableItem row = (selection.length == 0) ? table.getItem(table.getTopIndex()) : selection[0];
table.showItem(row);
- cursor.setSelection(row, 0);
+ cursor.setSelection(row, cursor.getColumn());
cursor.setVisible(true);
cursor.setFocus();
}