summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt
diff options
context:
space:
mode:
authorFelipe Heidrich <felipe_heidrich@ca.ibm.com>2011-12-05 12:19:10 -0500
committerFelipe Heidrich <felipe_heidrich@ca.ibm.com>2011-12-05 12:19:10 -0500
commit3396a784ab92d96b548bec583f27093ab78d5d14 (patch)
tree8bff15f6f2af5a35798e3aef967e35971fc3a8a1 /bundles/org.eclipse.swt
parent9eaccc1cb16d9d4692cc745cb6ccf9b2b5e4c1f8 (diff)
parent64d29b632ce5e80bcbbf72b8860873b3b0700575 (diff)
downloadeclipse.platform.swt-3396a784ab92d96b548bec583f27093ab78d5d14.tar.gz
eclipse.platform.swt-3396a784ab92d96b548bec583f27093ab78d5d14.tar.xz
eclipse.platform.swt-3396a784ab92d96b548bec583f27093ab78d5d14.zip
Merge branch 'master' into bug230854
Diffstat (limited to 'bundles/org.eclipse.swt')
-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 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/DefaultContent.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ST.java84
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java286
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextListener.java24
-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/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.java329
-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/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/os.c506
-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.h12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c46
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h42
-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/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.java350
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c99
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.h41
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.h3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.c79
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.h12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/DTTOPTS.java32
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java24
-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/org/eclipse/swt/browser/WebKit.java44
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.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/Text.java10
-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/version.txt2
-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.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java6
-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.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java28
-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.java27
-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.java14
-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/TableColumn.java3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TrayItem.java42
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeColumn.java3
-rw-r--r--bundles/org.eclipse.swt/buildSWT.xml128
-rw-r--r--bundles/org.eclipse.swt/buildnotes_swt.html72
92 files changed, 4093 insertions, 2420 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 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/DefaultContent.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/DefaultContent.java
index cd00023a27..d95bb65698 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/DefaultContent.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/DefaultContent.java
@@ -769,7 +769,7 @@ public void replaceTextRange(int start, int replaceLength, String newText){
// inform listeners
StyledTextEvent event = new StyledTextEvent(this);
- event.type = StyledText.TextChanging;
+ event.type = ST.TextChanging;
event.start = start;
event.replaceLineCount = lineCount(start, replaceLength);
event.text = newText;
@@ -784,7 +784,7 @@ public void replaceTextRange(int start, int replaceLength, String newText){
insert(start, newText);
// inform listeners
event = new StyledTextEvent(this);
- event.type = StyledText.TextChanged;
+ event.type = ST.TextChanged;
sendTextEvent(event);
}
/**
@@ -809,7 +809,7 @@ public void setText (String text){
expandExp = 1;
indexLines();
StyledTextEvent event = new StyledTextEvent(this);
- event.type = StyledText.TextSet;
+ event.type = ST.TextSet;
event.text = "";
sendTextEvent(event);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ST.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ST.java
index 77276975cc..771fcf8017 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ST.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ST.java
@@ -136,5 +136,89 @@ public class ST {
* @since 3.2
*/
public static final int BULLET_CUSTOM = 1 << 5;
+
+ /**
+ * The ExtendedModify event type (value is 3000).
+ *
+ * @since 3.8
+ */
+ public static final int ExtendedModify = 3000;
+
+ /**
+ * The LineGetBackground event type (value is 3001).
+ *
+ * @since 3.8
+ */
+ public static final int LineGetBackground = 3001;
+
+ /**
+ * The LineGetStyle event type (value is 3002).
+ *
+ * @since 3.8
+ */
+ public static final int LineGetStyle = 3002;
+
+ /**
+ * The TextChanging event type (value is 3003).
+ *
+ * @since 3.8
+ */
+ public static final int TextChanging = 3003;
+
+ /**
+ * The TextSet event type (value is 3004).
+ *
+ * @since 3.8
+ */
+ public static final int TextSet = 3004;
+
+ /**
+ * The VerifyKey event type (value is 3005).
+ *
+ * @since 3.8
+ */
+ public static final int VerifyKey = 3005;
+
+ /**
+ * The TextChanged event type (value is 3006).
+ *
+ * @since 3.8
+ */
+ public static final int TextChanged = 3006;
+
+ /**
+ * The LineGetSegments event type (value is 3007).
+ *
+ * @since 3.8
+ */
+ public static final int LineGetSegments = 3007;
+
+ /**
+ * The PaintObject event type (value is 3008).
+ *
+ * @since 3.8
+ */
+ public static final int PaintObject = 3008;
+
+ /**
+ * The WordNext event type (value is 3009).
+ *
+ * @since 3.8
+ */
+ public static final int WordNext = 3009;
+
+ /**
+ * The WordPrevious event type (value is 3010).
+ *
+ * @since 3.8
+ */
+ public static final int WordPrevious = 3010;
+
+ /**
+ * The CaretMoved event type (value is 3011).
+ *
+ * @since 3.8
+ */
+ public static final int CaretMoved = 3011;
}
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 250f2d7284..8001a64cdc 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
@@ -87,20 +87,6 @@ public class StyledText extends Canvas {
static final int DEFAULT_HEIGHT = 64;
static final int V_SCROLL_RATE = 50;
static final int H_SCROLL_RATE = 10;
-
- static final int ExtendedModify = 3000;
- static final int LineGetBackground = 3001;
- static final int LineGetStyle = 3002;
- static final int TextChanging = 3003;
- static final int TextSet = 3004;
- static final int VerifyKey = 3005;
- static final int TextChanged = 3006;
- static final int LineGetSegments = 3007;
- static final int PaintObject = 3008;
- static final int WordNext = 3009;
- static final int WordPrevious = 3010;
- static final int CaretMoved = 3011;
-
static final int PREVIOUS_OFFSET_TRAILING = 0;
static final int OFFSET_LEADING = 1;
@@ -112,6 +98,8 @@ public class StyledText extends Canvas {
TextChangeListener textChangeListener; // listener for TextChanging, TextChanged and TextSet events from StyledTextContent
int verticalScrollOffset = 0; // pixel based
int horizontalScrollOffset = 0; // pixel based
+ boolean alwaysShowScroll = true;
+ int ignoreResize = 0;
int topIndex = 0; // top visible line
int topIndexY;
int clientAreaHeight = 0; // the client area height. Needed to calculate content width for new visible lines during Resize callback
@@ -259,7 +247,7 @@ public class StyledText extends Canvas {
fontData = styledText.getFont().getFontData()[0];
tabLength = styledText.tabLength;
int lineCount = printerRenderer.lineCount;
- if (styledText.isListening(LineGetBackground) || (styledText.isBidi() && styledText.isListening(LineGetSegments)) || styledText.isListening(LineGetStyle)) {
+ if (styledText.isListening(ST.LineGetBackground) || (styledText.isBidi() && styledText.isListening(ST.LineGetSegments)) || styledText.isListening(ST.LineGetStyle)) {
StyledTextContent content = printerRenderer.content;
for (int i = 0; i < lineCount; i++) {
String line = content.getLine(i);
@@ -1295,7 +1283,7 @@ public void addExtendedModifyListener(ExtendedModifyListener extendedModifyListe
checkWidget();
if (extendedModifyListener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
StyledTextListener typedListener = new StyledTextListener(extendedModifyListener);
- addListener(ExtendedModify, typedListener);
+ addListener(ST.ExtendedModify, typedListener);
}
/**
* Adds a bidirectional segment listener.
@@ -1325,7 +1313,7 @@ public void addExtendedModifyListener(ExtendedModifyListener extendedModifyListe
public void addBidiSegmentListener(BidiSegmentListener listener) {
checkWidget();
if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
- addListener(LineGetSegments, new StyledTextListener(listener));
+ addListener(ST.LineGetSegments, new StyledTextListener(listener));
}
/**
* Adds a caret listener. CaretEvent is sent when the caret offset changes.
@@ -1344,7 +1332,7 @@ public void addBidiSegmentListener(BidiSegmentListener listener) {
public void addCaretListener(CaretListener listener) {
checkWidget();
if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
- addListener(CaretMoved, new StyledTextListener(listener));
+ addListener(ST.CaretMoved, new StyledTextListener(listener));
}
/**
* Adds a line background listener. A LineGetBackground event is sent by the
@@ -1362,10 +1350,10 @@ public void addCaretListener(CaretListener listener) {
public void addLineBackgroundListener(LineBackgroundListener listener) {
checkWidget();
if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
- if (!isListening(LineGetBackground)) {
+ if (!isListening(ST.LineGetBackground)) {
renderer.clearLineBackground(0, content.getLineCount());
}
- addListener(LineGetBackground, new StyledTextListener(listener));
+ addListener(ST.LineGetBackground, new StyledTextListener(listener));
}
/**
* Adds a line style listener. A LineGetStyle event is sent by the widget to
@@ -1383,11 +1371,11 @@ public void addLineBackgroundListener(LineBackgroundListener listener) {
public void addLineStyleListener(LineStyleListener listener) {
checkWidget();
if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
- if (!isListening(LineGetStyle)) {
+ if (!isListening(ST.LineGetStyle)) {
setStyleRanges(0, 0, null, null, true);
renderer.clearLineStyle(0, content.getLineCount());
}
- addListener(LineGetStyle, new StyledTextListener(listener));
+ addListener(ST.LineGetStyle, new StyledTextListener(listener));
setCaretLocation();
}
/**
@@ -1429,7 +1417,7 @@ public void addModifyListener(ModifyListener modifyListener) {
public void addPaintObjectListener(PaintObjectListener listener) {
checkWidget();
if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
- addListener(PaintObject, new StyledTextListener(listener));
+ addListener(ST.PaintObject, new StyledTextListener(listener));
}
/**
* Adds a selection listener. A Selection event is sent by the widget when the
@@ -1476,7 +1464,7 @@ public void addSelectionListener(SelectionListener listener) {
public void addVerifyKeyListener(VerifyKeyListener listener) {
checkWidget();
if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
- addListener(VerifyKey, new StyledTextListener(listener));
+ addListener(ST.VerifyKey, new StyledTextListener(listener));
}
/**
* Adds a verify listener. A Verify event is sent by the widget when the widget text
@@ -1521,8 +1509,8 @@ public void addVerifyListener(VerifyListener verifyListener) {
public void addWordMovementListener(MovementListener movementListener) {
checkWidget();
if (movementListener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
- addListener(WordNext, new StyledTextListener(movementListener));
- addListener(WordPrevious, new StyledTextListener(movementListener));
+ addListener(ST.WordNext, new StyledTextListener(movementListener));
+ addListener(ST.WordPrevious, new StyledTextListener(movementListener));
}
/**
* Appends a string to the text at the end of the widget.
@@ -1627,8 +1615,11 @@ void calculateTopIndex(int delta) {
}
}
if (topIndex != oldTopIndex || oldTopIndexY != topIndexY) {
+ int width = renderer.getWidth();
renderer.calculateClientArea();
- setScrollBars(false);
+ if (width != renderer.getWidth()) {
+ setScrollBars(false);
+ }
}
}
/**
@@ -1835,6 +1826,26 @@ public int getAlignment() {
checkWidget();
return alignment;
}
+/**
+ * Returns the Always Show Scrollbars flag. True if the scrollbars are
+ * always shown even if they are not required. False if the scrollbars are only
+ * visible when some part of the content needs to be scrolled to be seen.
+ * The H_SCROLL and V_SCROLL style bits are also required to enable scrollbars in the
+ * horizontal and vertical directions.
+ *
+ * @return the Always Show Scrollbars flag value
+ *
+ * @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 boolean getAlwaysShowScrollBars() {
+ checkWidget();
+ return alwaysShowScroll;
+}
int getAvailableHeightAbove(int height) {
int maxHeight = verticalScrollOffset;
if (maxHeight == -1) {
@@ -3936,7 +3947,7 @@ public Color getLineBackground(int index) {
if (index < 0 || index > content.getLineCount()) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
- return isListening(LineGetBackground) ? null : renderer.getLineBackground(index, null);
+ return isListening(ST.LineGetBackground) ? null : renderer.getLineBackground(index, null);
}
/**
* Returns the bullet of the line at the given index.
@@ -3960,7 +3971,7 @@ public Bullet getLineBullet(int index) {
if (index < 0 || index > content.getLineCount()) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
- return isListening(LineGetStyle) ? null : renderer.getLineBullet(index, null);
+ return isListening(ST.LineGetStyle) ? null : renderer.getLineBullet(index, null);
}
/**
* Returns the line background data for the given line or null if
@@ -3972,7 +3983,7 @@ public Bullet getLineBullet(int index) {
* @return line background data for the given line.
*/
StyledTextEvent getLineBackgroundData(int lineOffset, String line) {
- return sendLineEvent(LineGetBackground, lineOffset, line);
+ return sendLineEvent(ST.LineGetBackground, lineOffset, line);
}
/**
* Gets the number of text lines.
@@ -4091,7 +4102,7 @@ public int getLineIndent(int index) {
if (index < 0 || index > content.getLineCount()) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
- return isListening(LineGetStyle) ? 0 : renderer.getLineIndent(index, indent);
+ return isListening(ST.LineGetStyle) ? 0 : renderer.getLineIndent(index, indent);
}
/**
* Returns whether the line at the given index is justified.
@@ -4117,7 +4128,7 @@ public boolean getLineJustify(int index) {
if (index < 0 || index > content.getLineCount()) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
- return isListening(LineGetStyle) ? false : renderer.getLineJustify(index, justify);
+ return isListening(ST.LineGetStyle) ? false : renderer.getLineJustify(index, justify);
}
/**
* Returns the line spacing of the widget.
@@ -4151,7 +4162,7 @@ public int getLineSpacing() {
* line start and end after line end
*/
StyledTextEvent getLineStyleData(int lineOffset, String line) {
- return sendLineEvent(LineGetStyle, lineOffset, line);
+ return sendLineEvent(ST.LineGetStyle, lineOffset, line);
}
/**
* Returns the top pixel, relative to the client area, of a given line.
@@ -4246,7 +4257,7 @@ public int[] getLineTabStops(int index) {
if (index < 0 || index > content.getLineCount()) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
- if (isListening(LineGetStyle)) return null;
+ if (isListening(ST.LineGetStyle)) return null;
int[] tabs = renderer.getLineTabStops(index, null);
if (tabs == null) tabs = this.tabs;
if (tabs == null) return new int [] {renderer.tabWidth};
@@ -4278,7 +4289,7 @@ public int getLineWrapIndent(int index) {
if (index < 0 || index > content.getLineCount()) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
- return isListening(LineGetStyle) ? 0 : renderer.getLineWrapIndent(index, wrapIndent);
+ return isListening(ST.LineGetStyle) ? 0 : renderer.getLineWrapIndent(index, wrapIndent);
}
/**
* Returns the left margin.
@@ -4539,7 +4550,7 @@ String getPlatformDelimitedText(TextWriter writer) {
*/
public int[] getRanges() {
checkWidget();
- if (!isListening(LineGetStyle)) {
+ if (!isListening(ST.LineGetStyle)) {
int[] ranges = renderer.getRanges(0, content.getCharCount());
if (ranges != null) return ranges;
}
@@ -4581,7 +4592,7 @@ public int[] getRanges(int start, int length) {
if (start > end || start < 0 || end > contentLength) {
SWT.error(SWT.ERROR_INVALID_RANGE);
}
- if (!isListening(LineGetStyle)) {
+ if (!isListening(ST.LineGetStyle)) {
int[] ranges = renderer.getRanges(start, length);
if (ranges != null) return ranges;
}
@@ -4756,12 +4767,12 @@ public String getSelectionText() {
}
StyledTextEvent getBidiSegments(int lineOffset, String line) {
if (!isBidi()) return null;
- if (!isListening(LineGetSegments)) {
+ if (!isListening(ST.LineGetSegments)) {
StyledTextEvent event = new StyledTextEvent(content);
event.segments = getBidiSegmentsCompatibility(line, lineOffset);
return event;
}
- StyledTextEvent event = sendLineEvent(LineGetSegments, lineOffset, line);
+ StyledTextEvent event = sendLineEvent(ST.LineGetSegments, lineOffset, line);
if (event == null || event.segments == null || event.segments.length == 0) return null;
int lineLength = line.length();
int[] segments = event.segments;
@@ -4875,7 +4886,7 @@ public StyleRange getStyleRangeAtOffset(int offset) {
if (offset < 0 || offset >= getCharCount()) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
- if (!isListening(LineGetStyle)) {
+ if (!isListening(ST.LineGetStyle)) {
StyleRange[] ranges = renderer.getStyleRanges(offset, 1, true);
if (ranges != null) return ranges[0];
}
@@ -5022,7 +5033,7 @@ public StyleRange[] getStyleRanges(int start, int length, boolean includeRanges)
if (start > end || start < 0 || end > contentLength) {
SWT.error(SWT.ERROR_INVALID_RANGE);
}
- if (!isListening(LineGetStyle)) {
+ if (!isListening(ST.LineGetStyle)) {
StyleRange[] ranges = renderer.getStyleRanges(start, length, includeRanges);
if (ranges != null) return ranges;
}
@@ -5336,7 +5347,7 @@ int getWordNext (int offset, int movement, boolean ignoreListener) {
}
}
if (ignoreListener) return newOffset;
- return sendWordBoundaryEvent(WordNext, movement, offset, newOffset, lineText, lineOffset);
+ return sendWordBoundaryEvent(ST.WordNext, movement, offset, newOffset, lineText, lineOffset);
}
int getWordPrevious(int offset, int movement) {
return getWordPrevious(offset, movement, false);
@@ -5365,7 +5376,7 @@ int getWordPrevious(int offset, int movement, boolean ignoreListener) {
}
}
if (ignoreListener) return newOffset;
- return sendWordBoundaryEvent(WordPrevious, movement, offset, newOffset, lineText, lineOffset);
+ return sendWordBoundaryEvent(ST.WordPrevious, movement, offset, newOffset, lineText, lineOffset);
}
/**
* Returns whether the widget wraps lines.
@@ -5933,7 +5944,7 @@ void handleKeyDown(Event event) {
verifyEvent.keyLocation = event.keyLocation;
verifyEvent.stateMask = event.stateMask;
verifyEvent.doit = true;
- notifyListeners(VerifyKey, verifyEvent);
+ notifyListeners(ST.VerifyKey, verifyEvent);
if (verifyEvent.doit) {
if ((event.stateMask & SWT.MODIFIER_MASK) == SWT.CTRL && event.keyCode == SWT.SHIFT && isBidiCaret()) {
newOrientation = event.keyLocation == SWT.LEFT ? SWT.LEFT_TO_RIGHT : SWT.RIGHT_TO_LEFT;
@@ -6119,19 +6130,9 @@ void handleResize(Event event) {
Rectangle clientArea = getClientArea();
clientAreaHeight = clientArea.height;
clientAreaWidth = clientArea.width;
- /* 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);
- }
- }
+ if (!alwaysShowScroll && ignoreResize != 0) return;
+
+ redrawMargins(oldHeight, oldWidth);
if (wordWrap) {
if (oldWidth != clientAreaWidth) {
renderer.reset(0, content.getLineCount());
@@ -6708,7 +6709,7 @@ void initializeAccessible() {
public void getTextAttributes(AccessibleTextAttributeEvent e) {
StyledText st = StyledText.this;
int contentLength = st.getCharCount();
- if (!isListening(LineGetStyle) && st.renderer.styleCount == 0) {
+ if (!isListening(ST.LineGetStyle) && st.renderer.styleCount == 0) {
e.start = 0;
e.end = contentLength;
e.textStyle = new TextStyle(st.getFont(), st.foreground, st.background);
@@ -7149,7 +7150,7 @@ void modifyContent(Event event, boolean updateCaret) {
if (event.doit) {
StyledTextEvent styledTextEvent = null;
int replacedLength = event.end - event.start;
- if (isListening(ExtendedModify)) {
+ if (isListening(ST.ExtendedModify)) {
styledTextEvent = new StyledTextEvent(content);
styledTextEvent.start = event.start;
styledTextEvent.end = event.start + event.text.length();
@@ -7186,13 +7187,13 @@ void modifyContent(Event event, boolean updateCaret) {
showCaret();
}
notifyListeners(SWT.Modify, event);
- if (isListening(ExtendedModify)) {
- notifyListeners(ExtendedModify, styledTextEvent);
+ if (isListening(ST.ExtendedModify)) {
+ notifyListeners(ST.ExtendedModify, styledTextEvent);
}
}
}
void paintObject(GC gc, int x, int y, int ascent, int descent, StyleRange style, Bullet bullet, int bulletIndex) {
- if (isListening(PaintObject)) {
+ if (isListening(ST.PaintObject)) {
StyledTextEvent event = new StyledTextEvent (content) ;
event.gc = gc;
event.x = x;
@@ -7202,7 +7203,7 @@ void paintObject(GC gc, int x, int y, int ascent, int descent, StyleRange style,
event.style = style;
event.bullet = bullet;
event.bulletIndex = bulletIndex;
- notifyListeners(PaintObject, event);
+ notifyListeners(ST.PaintObject, event);
}
}
/**
@@ -7420,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.
*
@@ -7475,7 +7491,7 @@ public void redrawRange(int start, int length, boolean clearBackground) {
public void removeBidiSegmentListener(BidiSegmentListener listener) {
checkWidget();
if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
- removeListener(LineGetSegments, listener);
+ removeListener(ST.LineGetSegments, listener);
}
/**
* Removes the specified caret listener.
@@ -7495,7 +7511,7 @@ public void removeBidiSegmentListener(BidiSegmentListener listener) {
public void removeCaretListener(CaretListener listener) {
checkWidget();
if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
- removeListener(CaretMoved, listener);
+ removeListener(ST.CaretMoved, listener);
}
/**
* Removes the specified extended modify listener.
@@ -7513,7 +7529,7 @@ public void removeCaretListener(CaretListener listener) {
public void removeExtendedModifyListener(ExtendedModifyListener extendedModifyListener) {
checkWidget();
if (extendedModifyListener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
- removeListener(ExtendedModify, extendedModifyListener);
+ removeListener(ST.ExtendedModify, extendedModifyListener);
}
/**
* Removes the specified line background listener.
@@ -7531,7 +7547,7 @@ public void removeExtendedModifyListener(ExtendedModifyListener extendedModifyLi
public void removeLineBackgroundListener(LineBackgroundListener listener) {
checkWidget();
if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
- removeListener(LineGetBackground, listener);
+ removeListener(ST.LineGetBackground, listener);
}
/**
* Removes the specified line style listener.
@@ -7549,7 +7565,7 @@ public void removeLineBackgroundListener(LineBackgroundListener listener) {
public void removeLineStyleListener(LineStyleListener listener) {
checkWidget();
if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
- removeListener(LineGetStyle, listener);
+ removeListener(ST.LineGetStyle, listener);
setCaretLocation();
}
/**
@@ -7587,7 +7603,7 @@ public void removeModifyListener(ModifyListener modifyListener) {
public void removePaintObjectListener(PaintObjectListener listener) {
checkWidget();
if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
- removeListener(PaintObject, listener);
+ removeListener(ST.PaintObject, listener);
}
/**
* Removes the listener from the collection of listeners who will
@@ -7644,7 +7660,7 @@ public void removeVerifyListener(VerifyListener verifyListener) {
*/
public void removeVerifyKeyListener(VerifyKeyListener listener) {
if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
- removeListener(VerifyKey, listener);
+ removeListener(ST.VerifyKey, listener);
}
/**
* Removes the specified word movement listener.
@@ -7669,8 +7685,8 @@ public void removeVerifyKeyListener(VerifyKeyListener listener) {
public void removeWordMovementListener(MovementListener listener) {
checkWidget();
if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
- removeListener(WordNext, listener);
- removeListener(WordPrevious, listener);
+ removeListener(ST.WordNext, listener);
+ removeListener(ST.WordPrevious, listener);
}
/**
* Replaces the styles in the given range with new styles. This method
@@ -7708,7 +7724,7 @@ public void removeWordMovementListener(MovementListener listener) {
*/
public void replaceStyleRanges(int start, int length, StyleRange[] ranges) {
checkWidget();
- if (isListening(LineGetStyle)) return;
+ if (isListening(ST.LineGetStyle)) return;
if (ranges == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
setStyleRanges(start, length, null, ranges, false);
}
@@ -8154,6 +8170,28 @@ public void setAlignment(int alignment) {
super.redraw();
}
/**
+ * Set the Always Show Scrollbars flag. True if the scrollbars are
+ * always shown even if they are not required. False if the scrollbars are only
+ * visible when some part of the content needs to be scrolled to be seen.
+ * The H_SCROLL and V_SCROLL style bits are also required to enable scrollbars in the
+ * horizontal and vertical directions.
+ *
+ * @param show true to show the scrollbars even when not required, false to show scrollbars only when required
+ *
+ * @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 setAlwaysShowScrollBars(boolean show) {
+ checkWidget();
+ if (show == alwaysShowScroll) return;
+ alwaysShowScroll = show;
+ setScrollBars(true);
+}
+/**
* @see Control#setBackground(Color)
*/
public void setBackground(Color color) {
@@ -8448,10 +8486,10 @@ public void setCaretOffset(int offset) {
void setCaretOffset(int offset, int alignment) {
if (caretOffset != offset) {
caretOffset = offset;
- if (isListening(CaretMoved)) {
+ if (isListening(ST.CaretMoved)) {
StyledTextEvent event = new StyledTextEvent(content);
event.end = caretOffset;
- notifyListeners(CaretMoved, event);
+ notifyListeners(ST.CaretMoved, event);
}
}
if (alignment != SWT.DEFAULT) {
@@ -8834,7 +8872,7 @@ public void setLeftMargin (int leftMargin) {
*/
public void setLineAlignment(int startLine, int lineCount, int alignment) {
checkWidget();
- if (isListening(LineGetStyle)) return;
+ if (isListening(ST.LineGetStyle)) return;
if (startLine < 0 || startLine + lineCount > content.getLineCount()) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
@@ -8885,7 +8923,7 @@ public void setLineAlignment(int startLine, int lineCount, int alignment) {
*/
public void setLineBackground(int startLine, int lineCount, Color background) {
checkWidget();
- if (isListening(LineGetBackground)) return;
+ if (isListening(ST.LineGetBackground)) return;
if (startLine < 0 || startLine + lineCount > content.getLineCount()) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
@@ -8930,7 +8968,7 @@ public void setLineBackground(int startLine, int lineCount, Color background) {
*/
public void setLineBullet(int startLine, int lineCount, Bullet bullet) {
checkWidget();
- if (isListening(LineGetStyle)) return;
+ if (isListening(ST.LineGetStyle)) return;
if (startLine < 0 || startLine + lineCount > content.getLineCount()) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
@@ -8984,7 +9022,7 @@ void setVariableLineHeight () {
*/
public void setLineIndent(int startLine, int lineCount, int indent) {
checkWidget();
- if (isListening(LineGetStyle)) return;
+ if (isListening(ST.LineGetStyle)) return;
if (startLine < 0 || startLine + lineCount > content.getLineCount()) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
@@ -9033,7 +9071,7 @@ public void setLineIndent(int startLine, int lineCount, int indent) {
*/
public void setLineJustify(int startLine, int lineCount, boolean justify) {
checkWidget();
- if (isListening(LineGetStyle)) return;
+ if (isListening(ST.LineGetStyle)) return;
if (startLine < 0 || startLine + lineCount > content.getLineCount()) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
@@ -9100,7 +9138,7 @@ public void setLineSpacing(int lineSpacing) {
*/
public void setLineTabStops(int startLine, int lineCount, int[] tabStops) {
checkWidget();
- if (isListening(LineGetStyle)) return;
+ if (isListening(ST.LineGetStyle)) return;
if (startLine < 0 || startLine + lineCount > content.getLineCount()) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
@@ -9157,7 +9195,7 @@ public void setLineTabStops(int startLine, int lineCount, int[] tabStops) {
*/
public void setLineWrapIndent(int startLine, int lineCount, int wrapIndent) {
checkWidget();
- if (isListening(LineGetStyle)) return;
+ if (isListening(ST.LineGetStyle)) return;
if (startLine < 0 || startLine + lineCount > content.getLineCount()) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
@@ -9271,6 +9309,17 @@ public void setRightMargin (int rightMargin) {
checkWidget();
setMargins(leftMargin, topMargin, rightMargin, bottomMargin);
}
+void setScrollBar(ScrollBar bar, int clientArea, int maximum, int margin) {
+ int inactive = 1;
+ if (clientArea < maximum) {
+ bar.setMaximum(maximum - margin);
+ bar.setThumb(clientArea - margin);
+ bar.setPageIncrement(clientArea - margin);
+ if (!alwaysShowScroll) bar.setVisible(true);
+ } else if (bar.getThumb() != inactive || bar.getMaximum() != inactive) {
+ bar.setValues(bar.getSelection(), bar.getMinimum(), inactive, inactive, bar.getIncrement(), inactive);
+ }
+}
/**
* Adjusts the maximum and the page size of the scroll bars to
* reflect content width/length changes.
@@ -9278,49 +9327,32 @@ public void setRightMargin (int rightMargin) {
* @param vertical indicates if the vertical scrollbar also needs to be set
*/
void setScrollBars(boolean vertical) {
- int inactive = 1;
- if (vertical || !isFixedLineHeight()) {
- ScrollBar verticalBar = getVerticalBar();
- if (verticalBar != null) {
- int maximum = renderer.getHeight();
- // only set the real values if the scroll bar can be used
- // (ie. because the thumb size is less than the scroll maximum)
- // avoids flashing on Motif, fixes 1G7RE1J and 1G5SE92
- if (clientAreaHeight < maximum) {
- verticalBar.setMaximum(maximum - topMargin - bottomMargin);
- verticalBar.setThumb(clientAreaHeight - topMargin - bottomMargin);
- verticalBar.setPageIncrement(clientAreaHeight - topMargin - bottomMargin);
- } else if (verticalBar.getThumb() != inactive || verticalBar.getMaximum() != inactive) {
- verticalBar.setValues(
- verticalBar.getSelection(),
- verticalBar.getMinimum(),
- inactive,
- inactive,
- verticalBar.getIncrement(),
- inactive);
+ ignoreResize++;
+ 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);
+ }
+ if (verticalBar != null) {
+ setScrollBar(verticalBar, clientAreaHeight, renderer.getHeight(), topMargin + bottomMargin);
+ }
+ if (horizontalBar != null) {
+ 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);
}
}
}
- ScrollBar horizontalBar = getHorizontalBar();
- if (horizontalBar != null && horizontalBar.getVisible()) {
- int maximum = renderer.getWidth();
- // only set the real values if the scroll bar can be used
- // (ie. because the thumb size is less than the scroll maximum)
- // avoids flashing on Motif, fixes 1G7RE1J and 1G5SE92
- if (clientAreaWidth < maximum) {
- horizontalBar.setMaximum(maximum - leftMargin - rightMargin);
- horizontalBar.setThumb(clientAreaWidth - leftMargin - rightMargin);
- horizontalBar.setPageIncrement(clientAreaWidth - leftMargin - rightMargin);
- } else if (horizontalBar.getThumb() != inactive || horizontalBar.getMaximum() != inactive) {
- horizontalBar.setValues(
- horizontalBar.getSelection(),
- horizontalBar.getMinimum(),
- inactive,
- inactive,
- horizontalBar.getIncrement(),
- inactive);
- }
+ if (!alwaysShowScroll) {
+ redrawMargins(oldHeight, oldWidth);
}
+ ignoreResize--;
}
/**
* Sets the selection to the given position and scrolls it into view. Equivalent to setSelection(start,start).
@@ -9553,7 +9585,7 @@ public void setSelectionRange(int start, int length) {
*/
public void setStyleRange(StyleRange range) {
checkWidget();
- if (isListening(LineGetStyle)) return;
+ if (isListening(ST.LineGetStyle)) return;
if (range != null) {
if (range.isUnstyled()) {
setStyleRanges(range.start, range.length, null, null, false);
@@ -9601,7 +9633,7 @@ public void setStyleRange(StyleRange range) {
*/
public void setStyleRanges(int start, int length, int[] ranges, StyleRange[] styles) {
checkWidget();
- if (isListening(LineGetStyle)) return;
+ if (isListening(ST.LineGetStyle)) return;
if (ranges == null || styles == null) {
setStyleRanges(start, length, null, null, false);
} else {
@@ -9643,7 +9675,7 @@ public void setStyleRanges(int start, int length, int[] ranges, StyleRange[] sty
*/
public void setStyleRanges(int[] ranges, StyleRange[] styles) {
checkWidget();
- if (isListening(LineGetStyle)) return;
+ if (isListening(ST.LineGetStyle)) return;
if (ranges == null || styles == null) {
setStyleRanges(0, 0, null, null, true);
} else {
@@ -9769,7 +9801,7 @@ void setStyleRanges(int start, int length, int[] ranges, StyleRange[] styles, bo
*/
public void setStyleRanges(StyleRange[] ranges) {
checkWidget();
- if (isListening(LineGetStyle)) return;
+ if (isListening(ST.LineGetStyle)) return;
if (ranges == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
setStyleRanges(0, 0, null, ranges, true);
}
@@ -9865,7 +9897,7 @@ public void setText(String text) {
notifyListeners(SWT.Verify, event);
if (event.doit) {
StyledTextEvent styledTextEvent = null;
- if (isListening(ExtendedModify)) {
+ if (isListening(ST.ExtendedModify)) {
styledTextEvent = new StyledTextEvent(content);
styledTextEvent.start = event.start;
styledTextEvent.end = event.start + event.text.length();
@@ -9874,7 +9906,7 @@ public void setText(String text) {
content.setText(event.text);
notifyListeners(SWT.Modify, event);
if (styledTextEvent != null) {
- notifyListeners(ExtendedModify, styledTextEvent);
+ notifyListeners(ST.ExtendedModify, styledTextEvent);
}
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextListener.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextListener.java
index d9f026b5dd..3403000c55 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextListener.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextListener.java
@@ -28,22 +28,22 @@ StyledTextListener(SWTEventListener listener) {
public void handleEvent(Event e) {
switch (e.type) {
- case StyledText.ExtendedModify:
+ case ST.ExtendedModify:
ExtendedModifyEvent extendedModifyEvent = new ExtendedModifyEvent((StyledTextEvent) e);
((ExtendedModifyListener) eventListener).modifyText(extendedModifyEvent);
break;
- case StyledText.LineGetBackground:
+ case ST.LineGetBackground:
LineBackgroundEvent lineBgEvent = new LineBackgroundEvent((StyledTextEvent) e);
((LineBackgroundListener) eventListener).lineGetBackground(lineBgEvent);
((StyledTextEvent) e).lineBackground = lineBgEvent.lineBackground;
break;
- case StyledText.LineGetSegments:
+ case ST.LineGetSegments:
BidiSegmentEvent segmentEvent = new BidiSegmentEvent((StyledTextEvent) e);
((BidiSegmentListener) eventListener).lineGetSegments(segmentEvent);
((StyledTextEvent) e).segments = segmentEvent.segments;
((StyledTextEvent) e).segmentsChars = segmentEvent.segmentsChars;
break;
- case StyledText.LineGetStyle:
+ case ST.LineGetStyle:
LineStyleEvent lineStyleEvent = new LineStyleEvent((StyledTextEvent) e);
((LineStyleListener) eventListener).lineGetStyle(lineStyleEvent);
((StyledTextEvent) e).ranges = lineStyleEvent.ranges;
@@ -56,42 +56,42 @@ public void handleEvent(Event e) {
((StyledTextEvent) e).bulletIndex = lineStyleEvent.bulletIndex;
((StyledTextEvent) e).tabStops = lineStyleEvent.tabStops;
break;
- case StyledText.PaintObject:
+ case ST.PaintObject:
PaintObjectEvent paintObjectEvent = new PaintObjectEvent((StyledTextEvent) e);
((PaintObjectListener) eventListener).paintObject(paintObjectEvent);
break;
- case StyledText.VerifyKey:
+ case ST.VerifyKey:
VerifyEvent verifyEvent = new VerifyEvent(e);
((VerifyKeyListener) eventListener).verifyKey(verifyEvent);
e.doit = verifyEvent.doit;
break;
- case StyledText.TextChanged: {
+ case ST.TextChanged: {
TextChangedEvent textChangedEvent = new TextChangedEvent((StyledTextContent) e.data);
((TextChangeListener) eventListener).textChanged(textChangedEvent);
break;
}
- case StyledText.TextChanging:
+ case ST.TextChanging:
TextChangingEvent textChangingEvent = new TextChangingEvent((StyledTextContent) e.data, (StyledTextEvent) e);
((TextChangeListener) eventListener).textChanging(textChangingEvent);
break;
- case StyledText.TextSet: {
+ case ST.TextSet: {
TextChangedEvent textChangedEvent = new TextChangedEvent((StyledTextContent) e.data);
((TextChangeListener) eventListener).textSet(textChangedEvent);
break;
}
- case StyledText.WordNext: {
+ case ST.WordNext: {
MovementEvent wordBoundaryEvent = new MovementEvent((StyledTextEvent) e);
((MovementListener) eventListener).getNextOffset(wordBoundaryEvent);
((StyledTextEvent) e).end = wordBoundaryEvent.newOffset;
break;
}
- case StyledText.WordPrevious: {
+ case ST.WordPrevious: {
MovementEvent wordBoundaryEvent = new MovementEvent((StyledTextEvent) e);
((MovementListener) eventListener).getPreviousOffset(wordBoundaryEvent);
((StyledTextEvent) e).end = wordBoundaryEvent.newOffset;
break;
}
- case StyledText.CaretMoved: {
+ case ST.CaretMoved: {
CaretEvent caretEvent = new CaretEvent((StyledTextEvent) e);
((CaretListener) eventListener).caretMoved(caretEvent);
((StyledTextEvent) e).end = caretEvent.caretOffset;
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/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 150635f476..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;
@@ -83,7 +83,8 @@ class Mozilla extends WebBrowser {
static final char SEPARATOR_OS = System.getProperty ("file.separator").charAt (0); //$NON-NLS-1$
static final String ABOUT_BLANK = "about:blank"; //$NON-NLS-1$
static final String DISPOSE_LISTENER_HOOKED = "org.eclipse.swt.browser.Mozilla.disposeListenerHooked"; //$NON-NLS-1$
- static final String HEADER_CONTENTTYPE = "Content-Type"; //$NON-NLS-1
+ static final String HEADER_CONTENTLENGTH = "content-length"; //$NON-NLS-1
+ static final String HEADER_CONTENTTYPE = "content-type"; //$NON-NLS-1
static final String MIMETYPE_FORMURLENCODED = "application/x-www-form-urlencoded"; //$NON-NLS-1$
static final String PREFIX_JAVASCRIPT = "javascript:"; //$NON-NLS-1$
static final String PREFERENCE_CHARSET = "intl.charset.default"; //$NON-NLS-1$
@@ -953,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;
@@ -2513,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);
@@ -2592,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);
@@ -2781,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];
@@ -2813,18 +3019,35 @@ 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 ());
if (rc != XPCOM.NS_OK) error (rc);
- rc = postDataStream.SetAddContentLength (1);
- if (rc != XPCOM.NS_OK) error (rc);
- byte[] name = MozillaDelegate.wcsToMbcs (null, HEADER_CONTENTTYPE, true);
- byte[] value = MozillaDelegate.wcsToMbcs (null, MIMETYPE_FORMURLENCODED, true);
- rc = postDataStream.AddHeader (name, value);
+
+ boolean foundLength = false;
+ boolean foundType = false;
+ if (headers != null) {
+ for (int i = 0; i < headers.length; i++) {
+ int index = headers[i].indexOf (':');
+ if (index != -1) {
+ String name = headers[i].substring (0, index).trim ().toLowerCase ();
+ if (name.equals (HEADER_CONTENTLENGTH)) {
+ foundLength = true;
+ } else if (name.equals (HEADER_CONTENTTYPE)) {
+ foundType = true;
+ }
+ }
+ }
+ }
+ rc = postDataStream.SetAddContentLength (foundLength ? 0 : 1);
if (rc != XPCOM.NS_OK) error (rc);
+ if (!foundType) {
+ byte[] name = MozillaDelegate.wcsToMbcs (null, HEADER_CONTENTTYPE, true);
+ byte[] value = MozillaDelegate.wcsToMbcs (null, MIMETYPE_FORMURLENCODED, true);
+ rc = postDataStream.AddHeader (name, value);
+ if (rc != XPCOM.NS_OK) error (rc);
+ }
}
result[0] = 0;
}
@@ -3182,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);
@@ -3214,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
@@ -3954,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$
@@ -4616,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/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 a046f47012..0a90e38082 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 = 806;
+ static int MINOR_VERSION = 813;
/**
* 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 9984aef06c..a5180bf18d 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 = 806;
+ static int MINOR_VERSION = 813;
/**
* SWT revision number (must be >= 0)
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 61bbdce18f..2f8f9fc3f1 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
@@ -891,30 +891,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 +1659,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 +3035,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 +4436,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)
@@ -7830,6 +7830,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)
@@ -8311,48 +8331,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)
@@ -9522,76 +9500,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)
@@ -10400,72 +10308,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)
@@ -10634,26 +10476,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)
@@ -10739,7 +10561,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
@@ -11010,6 +10840,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)
@@ -14262,28 +14110,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)
@@ -14384,7 +14210,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
@@ -14470,7 +14304,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);
@@ -15204,7 +15046,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;
}
@@ -15365,7 +15215,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
@@ -15484,6 +15334,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)
@@ -15840,23 +15715,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)
@@ -15876,7 +15734,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);
@@ -16211,6 +16077,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)
@@ -17420,6 +17306,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)
@@ -19733,48 +19631,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)
@@ -20161,3 +20017,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 daaf74c241..7481ac06d3 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
@@ -158,6 +165,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
@@ -186,6 +194,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
@@ -280,6 +289,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
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 2c78396ae2..f34c147bdc 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
@@ -18,8 +18,8 @@
#ifdef NATIVE_STATS
-int OS_nativeFunctionCount = 1397;
-int OS_nativeFunctionCallCount[1397];
+int OS_nativeFunctionCount = 1379;
+int OS_nativeFunctionCallCount[1379];
char * OS_nativeFunctionNames[] = {
#ifndef JNI64
"Call__IIII",
@@ -102,8 +102,6 @@ char * OS_nativeFunctionNames[] = {
"GtkCellRendererToggleClass_1sizeof",
"GtkCellRendererToggle_1sizeof",
"GtkColorSelectionDialog_1sizeof",
- "GtkCombo_1sizeof",
- "GtkFileSelection_1sizeof",
"GtkFixedClass_1sizeof",
"GtkFixed_1sizeof",
"GtkRequisition_1sizeof",
@@ -167,7 +165,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 +248,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 +388,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",
@@ -639,6 +638,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",
@@ -671,10 +671,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",
@@ -754,12 +750,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",
@@ -829,12 +819,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",
@@ -865,8 +849,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",
@@ -899,6 +881,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",
@@ -1112,8 +1095,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",
@@ -1238,6 +1219,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",
@@ -1267,7 +1249,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",
@@ -1303,6 +1284,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",
@@ -1408,6 +1390,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",
@@ -1708,16 +1691,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",
@@ -1794,6 +1767,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 67de14abc2..972785aef8 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
@@ -110,8 +110,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 +173,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 +256,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 +396,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,
@@ -647,6 +646,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,
@@ -679,10 +679,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,
@@ -762,12 +758,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,
@@ -837,12 +827,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,
@@ -873,8 +857,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,
@@ -907,6 +889,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,
@@ -1120,8 +1103,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,
@@ -1246,6 +1227,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,
@@ -1275,7 +1257,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,
@@ -1311,6 +1292,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,
@@ -1416,6 +1398,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,
@@ -1716,16 +1699,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,
@@ -1802,4 +1775,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/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 ab5291b029..f6e1494ba8 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
@@ -611,8 +611,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();
@@ -1708,15 +1706,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();
@@ -2131,6 +2120,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();
@@ -6102,6 +6101,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) {
@@ -6359,38 +6368,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) {
@@ -6401,19 +6378,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() {
@@ -7398,72 +7362,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 *)
@@ -8167,95 +8065,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 *)
*/
@@ -8461,7 +8270,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();
@@ -8751,6 +8563,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 () {
@@ -11171,24 +10997,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();
}
@@ -11287,6 +11103,7 @@ public static final int /*long*/ gtk_toolbar_new() {
}
}
/**
+ * @method flags=dynamic
* @param toolbar cast=(GtkToolbar *)
* @param orientation cast=(GtkOrientation)
*/
@@ -11349,10 +11166,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) {
@@ -11986,7 +11800,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();
@@ -12138,7 +11955,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) {
@@ -12645,22 +12462,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) {
@@ -12671,7 +12472,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();
@@ -12681,6 +12485,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)
@@ -12966,6 +12783,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) {
@@ -13961,11 +13788,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
@@ -13991,11 +13813,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
@@ -14145,6 +13962,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();
@@ -15369,4 +15196,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 c31a1c7739..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
@@ -2044,6 +2044,18 @@ JNIEXPORT jint JNICALL OS_NATIVE(DROPFILES_1sizeof)
}
#endif
+#ifndef NO_DTTOPTS_1sizeof
+JNIEXPORT jint JNICALL OS_NATIVE(DTTOPTS_1sizeof)
+ (JNIEnv *env, jclass that)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, DTTOPTS_1sizeof_FUNC);
+ rc = (jint)DTTOPTS_sizeof();
+ OS_NATIVE_EXIT(env, that, DTTOPTS_1sizeof_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_DWM_1BLURBEHIND_1sizeof
JNIEXPORT jint JNICALL OS_NATIVE(DWM_1BLURBEHIND_1sizeof)
(JNIEnv *env, jclass that)
@@ -2692,6 +2704,36 @@ fail:
}
#endif
+#ifndef NO_DrawThemeTextEx
+JNIEXPORT jint JNICALL OS_NATIVE(DrawThemeTextEx)
+ (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jint arg2, jint arg3, jcharArray arg4, jint arg5, jint arg6, jobject arg7, jobject arg8)
+{
+ jchar *lparg4=NULL;
+ RECT _arg7, *lparg7=NULL;
+ DTTOPTS _arg8, *lparg8=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, DrawThemeTextEx_FUNC);
+ if (arg4) if ((lparg4 = (*env)->GetCharArrayElements(env, arg4, NULL)) == NULL) goto fail;
+ if (arg7) if ((lparg7 = getRECTFields(env, arg7, &_arg7)) == NULL) goto fail;
+ if (arg8) if ((lparg8 = getDTTOPTSFields(env, arg8, &_arg8)) == NULL) goto fail;
+/*
+ rc = (jint)DrawThemeTextEx(arg0, arg1, arg2, arg3, lparg4, arg5, arg6, lparg7, lparg8);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, DrawThemeTextEx)
+ if (fp) {
+ rc = (jint)((jint (CALLING_CONVENTION*)(jintLong, jintLong, jint, jint, jchar *, jint, jint, RECT *, DTTOPTS *))fp)(arg0, arg1, arg2, arg3, lparg4, arg5, arg6, lparg7, lparg8);
+ }
+ }
+fail:
+ if (arg8 && lparg8) setDTTOPTSFields(env, arg8, lparg8);
+ if (arg7 && lparg7) setRECTFields(env, arg7, lparg7);
+ if (arg4 && lparg4) (*env)->ReleaseCharArrayElements(env, arg4, lparg4, 0);
+ OS_NATIVE_EXIT(env, that, DrawThemeTextEx_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_DuplicateHandle
JNIEXPORT jboolean JNICALL OS_NATIVE(DuplicateHandle)
(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2, jintLongArray arg3, jint arg4, jboolean arg5, jint arg6)
@@ -2756,6 +2798,30 @@ fail:
}
#endif
+#ifndef NO_DwmIsCompositionEnabled
+JNIEXPORT jint JNICALL OS_NATIVE(DwmIsCompositionEnabled)
+ (JNIEnv *env, jclass that, jbooleanArray arg0)
+{
+ jboolean *lparg0=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, DwmIsCompositionEnabled_FUNC);
+ if (arg0) if ((lparg0 = (*env)->GetBooleanArrayElements(env, arg0, NULL)) == NULL) goto fail;
+/*
+ rc = (jint)DwmIsCompositionEnabled(lparg0);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, DwmIsCompositionEnabled)
+ if (fp) {
+ rc = (jint)((jint (CALLING_CONVENTION*)(jboolean *))fp)(lparg0);
+ }
+ }
+fail:
+ if (arg0 && lparg0) (*env)->ReleaseBooleanArrayElements(env, arg0, lparg0, 0);
+ OS_NATIVE_EXIT(env, that, DwmIsCompositionEnabled_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_EMREXTCREATEFONTINDIRECTW_1sizeof
JNIEXPORT jint JNICALL OS_NATIVE(EMREXTCREATEFONTINDIRECTW_1sizeof)
(JNIEnv *env, jclass that)
@@ -4199,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;
@@ -6068,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 0f44973263..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
@@ -74,6 +74,7 @@
#define NO_DEVMODEW
#define NO_DOCINFO
#define NO_DWM_BLURBEHIND
+#define NO_DTTOPTS
#define NO_EMR
#define NO_EMREXTCREATEFONTINDIRECTW
#define NO_EXTLOGFONTW
@@ -244,9 +245,11 @@
#define NO_DrawThemeIcon
#define NO_DrawThemeParentBackground
#define NO_DrawThemeText
+#define NO_DrawThemeTextEx
#define NO_DuplicateHandle
#define NO_DwmEnableBlurBehindWindow
#define NO_DwmExtendFrameIntoClientArea
+#define NO_DTTOPTS_1sizeof
#define NO_EnableScrollBar
#define NO_EndBufferedPaint
#define NO_EndDoc
@@ -346,6 +349,7 @@
#define NO_GetTextCharset
#define NO_GetTextExtentPoint32A
#define NO_GetTextMetricsA
+#define NO_GetThemeBitmap
#define NO_GetThemeColor
#define NO_GetThemeTextExtent
#define NO_GetThemeInt
@@ -712,6 +716,43 @@ typedef struct _DWM_BLURBEHIND {
} DWM_BLURBEHIND, *PDWM_BLURBEHIND;
#endif
+#ifndef _WIN32_WCE
+#ifndef DTT_CALLBACK_PROC
+typedef
+int
+(WINAPI *DTT_CALLBACK_PROC)
+(
+ __in HDC hdc,
+ __inout_ecount(cchText) LPWSTR pszText,
+ __in int cchText,
+ __inout LPRECT prc,
+ __in UINT dwFlags,
+ __in LPARAM lParam);
+#endif
+
+#ifndef _DTTOPTS
+typedef struct _DTTOPTS
+{
+ DWORD dwSize;
+ DWORD dwFlags;
+ COLORREF crText;
+ COLORREF crBorder;
+ COLORREF crShadow;
+ int iTextShadowType;
+ POINT ptShadowOffset;
+ int iBorderSize;
+ int iFontPropId;
+ int iColorPropId;
+ int iStateId;
+ BOOL fApplyOverlay;
+ int iGlowSize;
+ DTT_CALLBACK_PROC pfnDrawTextCallback;
+ LPARAM lParam;
+} DTTOPTS, *PDTTOPTS;
+#endif
+#endif /* _WIN32_WCE */
+
+
#if (_WIN32_IE <= 0x0600)
typedef struct tagTVITEMCHANGE {
NMHDR hdr;
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 a57a384fdc..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
@@ -38,13 +38,16 @@
#define DrawThemeIcon_LIB "uxtheme.dll"
#define DrawThemeParentBackground_LIB "uxtheme.dll"
#define DrawThemeText_LIB "uxtheme.dll"
+#define DrawThemeTextEx_LIB "uxtheme.dll"
#define DwmEnableBlurBehindWindow_LIB "dwmapi.dll"
#define DwmExtendFrameIntoClientArea_LIB "dwmapi.dll"
+#define DwmIsCompositionEnabled_LIB "dwmapi.dll"
#define GetGestureInfo_LIB "user32.dll"
#define GetThemeInt_LIB "uxtheme.dll"
#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 0accdd13d2..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 = 1064;
-int OS_nativeFunctionCallCount[1064];
+int OS_nativeFunctionCount = 1068;
+int OS_nativeFunctionCallCount[1068];
char * OS_nativeFunctionNames[] = {
"ACCEL_1sizeof",
"ACTCTX_1sizeof",
@@ -166,6 +166,7 @@ char * OS_nativeFunctionNames[] = {
"DPtoLP",
"DRAWITEMSTRUCT_1sizeof",
"DROPFILES_1sizeof",
+ "DTTOPTS_1sizeof",
"DWM_1BLURBEHIND_1sizeof",
"DefFrameProcA",
"DefFrameProcW",
@@ -207,9 +208,11 @@ char * OS_nativeFunctionNames[] = {
"DrawThemeIcon",
"DrawThemeParentBackground",
"DrawThemeText",
+ "DrawThemeTextEx",
"DuplicateHandle",
"DwmEnableBlurBehindWindow",
"DwmExtendFrameIntoClientArea",
+ "DwmIsCompositionEnabled",
"EMREXTCREATEFONTINDIRECTW_1sizeof",
"EMR_1sizeof",
"EXTLOGFONTW_1sizeof",
@@ -459,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 158eee7e48..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
@@ -174,6 +174,7 @@ typedef enum {
DPtoLP_FUNC,
DRAWITEMSTRUCT_1sizeof_FUNC,
DROPFILES_1sizeof_FUNC,
+ DTTOPTS_1sizeof_FUNC,
DWM_1BLURBEHIND_1sizeof_FUNC,
DefFrameProcA_FUNC,
DefFrameProcW_FUNC,
@@ -215,9 +216,11 @@ typedef enum {
DrawThemeIcon_FUNC,
DrawThemeParentBackground_FUNC,
DrawThemeText_FUNC,
+ DrawThemeTextEx_FUNC,
DuplicateHandle_FUNC,
DwmEnableBlurBehindWindow_FUNC,
DwmExtendFrameIntoClientArea_FUNC,
+ DwmIsCompositionEnabled_FUNC,
EMREXTCREATEFONTINDIRECTW_1sizeof_FUNC,
EMR_1sizeof_FUNC,
EXTLOGFONTW_1sizeof_FUNC,
@@ -467,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/library/os_structs.c b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.c
index 3e2d07c17b..d97d093d86 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.c
@@ -1807,6 +1807,85 @@ void setDROPFILESFields(JNIEnv *env, jobject lpObject, DROPFILES *lpStruct)
}
#endif
+#ifndef NO_DTTOPTS
+typedef struct DTTOPTS_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID dwSize, dwFlags, crText, crBorder, crShadow, iTextShadowType, ptShadowOffset, iBorderSize, iFontPropId, iColorPropId, iStateId, fApplyOverlay, iGlowSize, pfnDrawTextCallback, lParam;
+} DTTOPTS_FID_CACHE;
+
+DTTOPTS_FID_CACHE DTTOPTSFc;
+
+void cacheDTTOPTSFields(JNIEnv *env, jobject lpObject)
+{
+ if (DTTOPTSFc.cached) return;
+ DTTOPTSFc.clazz = (*env)->GetObjectClass(env, lpObject);
+ DTTOPTSFc.dwSize = (*env)->GetFieldID(env, DTTOPTSFc.clazz, "dwSize", "I");
+ DTTOPTSFc.dwFlags = (*env)->GetFieldID(env, DTTOPTSFc.clazz, "dwFlags", "I");
+ DTTOPTSFc.crText = (*env)->GetFieldID(env, DTTOPTSFc.clazz, "crText", I_J);
+ DTTOPTSFc.crBorder = (*env)->GetFieldID(env, DTTOPTSFc.clazz, "crBorder", I_J);
+ DTTOPTSFc.crShadow = (*env)->GetFieldID(env, DTTOPTSFc.clazz, "crShadow", I_J);
+ DTTOPTSFc.iTextShadowType = (*env)->GetFieldID(env, DTTOPTSFc.clazz, "iTextShadowType", "I");
+ DTTOPTSFc.ptShadowOffset = (*env)->GetFieldID(env, DTTOPTSFc.clazz, "ptShadowOffset", "Lorg/eclipse/swt/internal/win32/POINT;");
+ DTTOPTSFc.iBorderSize = (*env)->GetFieldID(env, DTTOPTSFc.clazz, "iBorderSize", "I");
+ DTTOPTSFc.iFontPropId = (*env)->GetFieldID(env, DTTOPTSFc.clazz, "iFontPropId", "I");
+ DTTOPTSFc.iColorPropId = (*env)->GetFieldID(env, DTTOPTSFc.clazz, "iColorPropId", "I");
+ DTTOPTSFc.iStateId = (*env)->GetFieldID(env, DTTOPTSFc.clazz, "iStateId", "I");
+ DTTOPTSFc.fApplyOverlay = (*env)->GetFieldID(env, DTTOPTSFc.clazz, "fApplyOverlay", "Z");
+ DTTOPTSFc.iGlowSize = (*env)->GetFieldID(env, DTTOPTSFc.clazz, "iGlowSize", "I");
+ DTTOPTSFc.pfnDrawTextCallback = (*env)->GetFieldID(env, DTTOPTSFc.clazz, "pfnDrawTextCallback", I_J);
+ DTTOPTSFc.lParam = (*env)->GetFieldID(env, DTTOPTSFc.clazz, "lParam", I_J);
+ DTTOPTSFc.cached = 1;
+}
+
+DTTOPTS *getDTTOPTSFields(JNIEnv *env, jobject lpObject, DTTOPTS *lpStruct)
+{
+ if (!DTTOPTSFc.cached) cacheDTTOPTSFields(env, lpObject);
+ lpStruct->dwSize = (*env)->GetIntField(env, lpObject, DTTOPTSFc.dwSize);
+ lpStruct->dwFlags = (*env)->GetIntField(env, lpObject, DTTOPTSFc.dwFlags);
+ lpStruct->crText = (*env)->GetIntLongField(env, lpObject, DTTOPTSFc.crText);
+ lpStruct->crBorder = (*env)->GetIntLongField(env, lpObject, DTTOPTSFc.crBorder);
+ lpStruct->crShadow = (*env)->GetIntLongField(env, lpObject, DTTOPTSFc.crShadow);
+ lpStruct->iTextShadowType = (*env)->GetIntField(env, lpObject, DTTOPTSFc.iTextShadowType);
+ {
+ jobject lpObject1 = (*env)->GetObjectField(env, lpObject, DTTOPTSFc.ptShadowOffset);
+ if (lpObject1 != NULL) getPOINTFields(env, lpObject1, &lpStruct->ptShadowOffset);
+ }
+ lpStruct->iBorderSize = (*env)->GetIntField(env, lpObject, DTTOPTSFc.iBorderSize);
+ lpStruct->iFontPropId = (*env)->GetIntField(env, lpObject, DTTOPTSFc.iFontPropId);
+ lpStruct->iColorPropId = (*env)->GetIntField(env, lpObject, DTTOPTSFc.iColorPropId);
+ lpStruct->iStateId = (*env)->GetIntField(env, lpObject, DTTOPTSFc.iStateId);
+ lpStruct->fApplyOverlay = (*env)->GetBooleanField(env, lpObject, DTTOPTSFc.fApplyOverlay);
+ lpStruct->iGlowSize = (*env)->GetIntField(env, lpObject, DTTOPTSFc.iGlowSize);
+ lpStruct->pfnDrawTextCallback = (DTT_CALLBACK_PROC)(*env)->GetIntLongField(env, lpObject, DTTOPTSFc.pfnDrawTextCallback);
+ lpStruct->lParam = (*env)->GetIntLongField(env, lpObject, DTTOPTSFc.lParam);
+ return lpStruct;
+}
+
+void setDTTOPTSFields(JNIEnv *env, jobject lpObject, DTTOPTS *lpStruct)
+{
+ if (!DTTOPTSFc.cached) cacheDTTOPTSFields(env, lpObject);
+ (*env)->SetIntField(env, lpObject, DTTOPTSFc.dwSize, (jint)lpStruct->dwSize);
+ (*env)->SetIntField(env, lpObject, DTTOPTSFc.dwFlags, (jint)lpStruct->dwFlags);
+ (*env)->SetIntLongField(env, lpObject, DTTOPTSFc.crText, (jintLong)lpStruct->crText);
+ (*env)->SetIntLongField(env, lpObject, DTTOPTSFc.crBorder, (jintLong)lpStruct->crBorder);
+ (*env)->SetIntLongField(env, lpObject, DTTOPTSFc.crShadow, (jintLong)lpStruct->crShadow);
+ (*env)->SetIntField(env, lpObject, DTTOPTSFc.iTextShadowType, (jint)lpStruct->iTextShadowType);
+ {
+ jobject lpObject1 = (*env)->GetObjectField(env, lpObject, DTTOPTSFc.ptShadowOffset);
+ if (lpObject1 != NULL) setPOINTFields(env, lpObject1, &lpStruct->ptShadowOffset);
+ }
+ (*env)->SetIntField(env, lpObject, DTTOPTSFc.iBorderSize, (jint)lpStruct->iBorderSize);
+ (*env)->SetIntField(env, lpObject, DTTOPTSFc.iFontPropId, (jint)lpStruct->iFontPropId);
+ (*env)->SetIntField(env, lpObject, DTTOPTSFc.iColorPropId, (jint)lpStruct->iColorPropId);
+ (*env)->SetIntField(env, lpObject, DTTOPTSFc.iStateId, (jint)lpStruct->iStateId);
+ (*env)->SetBooleanField(env, lpObject, DTTOPTSFc.fApplyOverlay, (jboolean)lpStruct->fApplyOverlay);
+ (*env)->SetIntField(env, lpObject, DTTOPTSFc.iGlowSize, (jint)lpStruct->iGlowSize);
+ (*env)->SetIntLongField(env, lpObject, DTTOPTSFc.pfnDrawTextCallback, (jintLong)lpStruct->pfnDrawTextCallback);
+ (*env)->SetIntLongField(env, lpObject, DTTOPTSFc.lParam, (jintLong)lpStruct->lParam);
+}
+#endif
+
#ifndef NO_DWM_BLURBEHIND
typedef struct DWM_BLURBEHIND_FID_CACHE {
int cached;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.h b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.h
index aa120cbb01..2028c725ea 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_structs.h
@@ -383,6 +383,18 @@ void setDROPFILESFields(JNIEnv *env, jobject lpObject, DROPFILES *lpStruct);
#define DROPFILES_sizeof() 0
#endif
+#ifndef NO_DTTOPTS
+void cacheDTTOPTSFields(JNIEnv *env, jobject lpObject);
+DTTOPTS *getDTTOPTSFields(JNIEnv *env, jobject lpObject, DTTOPTS *lpStruct);
+void setDTTOPTSFields(JNIEnv *env, jobject lpObject, DTTOPTS *lpStruct);
+#define DTTOPTS_sizeof() sizeof(DTTOPTS)
+#else
+#define cacheDTTOPTSFields(a,b)
+#define getDTTOPTSFields(a,b,c) NULL
+#define setDTTOPTSFields(a,b,c)
+#define DTTOPTS_sizeof() 0
+#endif
+
#ifndef NO_DWM_BLURBEHIND
void cacheDWM_BLURBEHINDFields(JNIEnv *env, jobject lpObject);
DWM_BLURBEHIND *getDWM_BLURBEHINDFields(JNIEnv *env, jobject lpObject, DWM_BLURBEHIND *lpStruct);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/DTTOPTS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/DTTOPTS.java
new file mode 100644
index 0000000000..224d91df4e
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/DTTOPTS.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * 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.internal.win32;
+
+
+public class DTTOPTS {
+ public int dwSize;
+ public int dwFlags;
+ public int /*long*/ crText;
+ public int /*long*/ crBorder;
+ public int /*long*/ crShadow;
+ public int iTextShadowType;
+ public POINT ptShadowOffset;
+ public int iBorderSize;
+ public int iFontPropId;
+ public int iColorPropId;
+ public int iStateId;
+ public boolean fApplyOverlay;
+ public int iGlowSize;
+ /** @field cast=(DTT_CALLBACK_PROC) */
+ public int /*long*/ pfnDrawTextCallback;
+ public int /*long*/ lParam;
+ public static final int sizeof = OS.DTTOPTS_sizeof ();
+} \ No newline at end of file
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 20105dc294..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;
@@ -2267,6 +2278,7 @@ public static final native int DOCHOSTUIINFO_sizeof ();
public static final native int DOCINFO_sizeof ();
public static final native int DRAWITEMSTRUCT_sizeof ();
public static final native int DROPFILES_sizeof ();
+public static final native int DTTOPTS_sizeof ();
public static final native int DWM_BLURBEHIND_sizeof ();
public static final native int EMR_sizeof ();
public static final native int EMREXTCREATEFONTINDIRECTW_sizeof ();
@@ -4026,6 +4038,8 @@ public static final native int DrawThemeIcon (int /*long*/ hTheme, int /*long*/
public static final native int DrawThemeParentBackground (int /*long*/ hwnd, int /*long*/ hdc, RECT prc);
/** @method flags=dynamic */
public static final native int DrawThemeText (int /*long*/ hTheme, int /*long*/ hdc, int iPartId, int iStateId, char[] pszText, int iCharCount, int dwTextFlags, int dwTextFlags2, RECT pRect);
+/** @method flags=dynamic */
+public static final native int DrawThemeTextEx (int /*long*/ hTheme, int /*long*/ hdc, int iPartId, int iStateId, char[] pszText, int iCharCount, int dwFlags, RECT pRect, DTTOPTS pOptions);
/**
* @method flags=dynamic
* @param hWnd cast=(HWND)
@@ -4035,7 +4049,9 @@ public static final native int DwmEnableBlurBehindWindow (int /*long*/ hWnd, DWM
* @method flags=dynamic
* @param hWnd cast=(HWND)
*/
-public static final native int DwmExtendFrameIntoClientArea (int /*long*/ hWnd, MARGINS pMarInset);
+public static final native int DwmExtendFrameIntoClientArea (int /*long*/ hWnd, MARGINS pMarInset);
+/** @method flags=dynamic */
+public static final native int DwmIsCompositionEnabled (boolean[] pfEnabled);
/** @param hdc cast=(HDC) */
public static final native boolean Ellipse (int /*long*/ hdc, int nLeftRect, int nTopRect, int nRightRect, int nBottomRect);
/** @param hMenu cast=(HMENU) */
@@ -4316,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 ();
@@ -4417,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 0b79f2d4d3..b43afa6277 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
@@ -457,6 +457,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/org/eclipse/swt/browser/WebKit.java b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java
index 952c776dc1..221499827b 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,14 +33,15 @@ 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$
static final String CHARSET_UTF8 = "UTF-8"; //$NON-NLS-1$
static final String CLASSNAME_EXTERNAL = "External"; //$NON-NLS-1$
- static final String ENCODING_FORM = "Content-Type: application/x-www-form-urlencoded"; //$NON-NLS-1$
static final String FUNCTIONNAME_CALLJAVA = "callJava"; //$NON-NLS-1$
+ static final String HEADER_CONTENTTYPE = "content-type"; //$NON-NLS-1$
+ static final String MIMETYPE_FORMURLENCODED = "application/x-www-form-urlencoded"; //$NON-NLS-1$
static final String OBJECTNAME_EXTERNAL = "external"; //$NON-NLS-1$
static final String PROPERTY_LENGTH = "length"; //$NON-NLS-1$
static final String PROPERTY_PROXYHOST = "network.proxy_host"; //$NON-NLS-1$
@@ -223,7 +224,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] ||
@@ -583,7 +584,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));
@@ -1120,14 +1121,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);
@@ -1748,10 +1751,23 @@ int /*long*/ webkit_resource_request_starting (int /*long*/ web_view, int /*long
WebKitGTK.soup_message_body_flatten (body);
if (headers == null) headers = new String[0];
- String[] temp = new String[headers.length + 1];
- System.arraycopy (headers, 0, temp, 0, headers.length);
- temp[headers.length] = ENCODING_FORM;
- headers = temp;
+ boolean found = false;
+ for (int i = 0; i < headers.length; i++) {
+ int index = headers[i].indexOf (':');
+ if (index != -1) {
+ String name = headers[i].substring (0, index).trim ().toLowerCase ();
+ if (name.equals (HEADER_CONTENTTYPE)) {
+ found = true;
+ break;
+ }
+ }
+ }
+ if (!found) {
+ String[] temp = new String[headers.length + 1];
+ System.arraycopy (headers, 0, temp, 0, headers.length);
+ temp[headers.length] = HEADER_CONTENTTYPE + ':' + MIMETYPE_FORMURLENCODED;
+ headers = temp;
+ }
postData = null;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.java
index 67b803549e..406bc49794 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.java
@@ -595,6 +595,27 @@ boolean dragDetect(int x, int y, boolean filter, boolean[] consume) {
return super.dragDetect(x, y, filter, consume);
}
+public int getCaretPosition() {
+ checkWidget();
+ return selectionRange != null ? (int)/*64*/selectionRange.location : 0;
+}
+
+public Point getCaretLocation() {
+ checkWidget();
+ NSTextView widget = null;
+ if (this.hasFocus()) {
+ widget = new NSTextView(view.window().fieldEditor(true, view));
+ }
+ if (widget == null) return new Point (0, 0);
+ NSLayoutManager layoutManager = widget.layoutManager();
+ NSTextContainer container = widget.textContainer();
+ NSRange range = widget.selectedRange();
+ int /*long*/ [] rectCount = new int /*long*/ [1];
+ int /*long*/ pArray = layoutManager.rectArrayForCharacterRange(range, range, container, rectCount);
+ NSRect rect = new NSRect();
+ if (rectCount[0] > 0) OS.memmove(rect, pArray, NSRect.sizeof);
+ return new Point((int)rect.x, (int)rect.y);
+}
int getCharCount() {
NSString str;
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/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Text.java
index 3ea2fb46d2..82c66ce803 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Text.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Text.java
@@ -702,11 +702,15 @@ boolean acceptsFirstResponder(int /*long*/ id, int /*long*/ sel) {
*/
public Point getCaretLocation () {
checkWidget ();
+ NSTextView widget = null;
if ((style & SWT.SINGLE) != 0) {
- //TODO - caret location for single text
- return new Point (0, 0);
+ if (this.hasFocus()) {
+ widget = new NSTextView(view.window().fieldEditor(true, view));
+ }
+ } else {
+ widget = (NSTextView) view;
}
- NSTextView widget = (NSTextView)view;
+ if (widget == null) return new Point (0, 0);
NSLayoutManager layoutManager = widget.layoutManager();
NSTextContainer container = widget.textContainer();
NSRange range = widget.selectedRange();
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 0afe8d43b3..3ffb9a17d1 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=806
-comma_ver=3,8,0,6
+min_ver=813
+comma_ver=3,8,1,3
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 402e3e120e..16c287e1f6 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
@@ -4157,7 +4157,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/version.txt b/bundles/org.eclipse.swt/Eclipse SWT/common/version.txt
index fcce443aaa..ef99a11a3b 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.806 \ No newline at end of file
+version 3.813 \ No newline at end of file
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 cd51b3b4fd..08e999ad0c 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
@@ -2792,6 +2792,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 00399444ad..28047f9f4c 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
@@ -3525,6 +3525,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 cc31c365dd..878c232d17 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
@@ -630,8 +630,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;
}
@@ -3347,7 +3347,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 ();
@@ -3362,7 +3362,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;
@@ -3375,7 +3375,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 ();
@@ -3542,7 +3542,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;
}
@@ -4131,7 +4131,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;
@@ -4151,7 +4151,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;
@@ -4178,7 +4178,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;
}
@@ -4247,12 +4247,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..c382a04297 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
@@ -1583,7 +1583,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..8be098e77a 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
@@ -772,7 +772,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..c3685a47c6 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 (string == null && oldTooltip == 0) {
+ return;
+ } else if (string != 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
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 771173ef41..7b38bd8312 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
@@ -348,7 +348,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) {
@@ -1577,7 +1582,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;
@@ -1818,7 +1829,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;
@@ -3576,7 +3592,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/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 ebc7219de2..4d58088f3d 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
@@ -576,11 +576,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;
@@ -781,7 +782,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) {
@@ -793,18 +794,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 513622771a..7715436e4e 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
@@ -435,7 +435,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) {
@@ -1677,7 +1682,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;
@@ -1817,7 +1827,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;
@@ -3408,7 +3423,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/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 3688135061..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);
@@ -2604,6 +2604,18 @@ StyleItem[] itemize () {
scriptState.uBidiLevel = 1;
scriptState.fArabicNumContext = true;
}
+
+ /*
+ * In the version of Usp10.h that SWT is compiled the fReserved field is declared
+ * as a bitfield size 8. In newer versions of the Uniscribe, the first bit of fReserved
+ * was used to implement the fMergeNeutralItems feature which can be used to increase
+ * performance by reducing the number of SCRIPT_ITEM returned by ScriptItemize.
+ *
+ * Note: This code is wrong on a big endian machine.
+ */
+ if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) {
+ scriptControl.fReserved = 0x1;
+ }
OS.ScriptApplyDigitSubstitution(null, scriptControl, scriptState);
int /*long*/ hHeap = OS.GetProcessHeap();
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/TableColumn.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TableColumn.java
index 8f77963cb0..130fc8d2de 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TableColumn.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TableColumn.java
@@ -805,8 +805,9 @@ public void setText (String string) {
* mnemonic characters and replace doubled mnemonics
* with spaces.
*/
+ boolean replace = !OS.IsWinCE && OS.WIN32_VERSION <= OS.VERSION (4, 10);
int /*long*/ hHeap = OS.GetProcessHeap ();
- TCHAR buffer = new TCHAR (parent.getCodePage (), fixMnemonic (string, true), true);
+ TCHAR buffer = new TCHAR (parent.getCodePage (), fixMnemonic (string, replace), true);
int byteCount = buffer.length () * TCHAR.sizeof;
int /*long*/ pszText = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount);
OS.MoveMemory (pszText, buffer, byteCount);
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/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeColumn.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeColumn.java
index 42a43f8106..8e76cb9d5c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeColumn.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeColumn.java
@@ -659,8 +659,9 @@ public void setText (String string) {
* mnemonic characters and replace doubled mnemonics
* with spaces.
*/
+ boolean replace = !OS.IsWinCE && OS.WIN32_VERSION <= OS.VERSION (4, 10);
int /*long*/ hHeap = OS.GetProcessHeap ();
- TCHAR buffer = new TCHAR (parent.getCodePage (), fixMnemonic (string, true), true);
+ TCHAR buffer = new TCHAR (parent.getCodePage (), fixMnemonic (string, replace), true);
int byteCount = buffer.length () * TCHAR.sizeof;
int /*long*/ pszText = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount);
OS.MoveMemory (pszText, buffer, byteCount);
diff --git a/bundles/org.eclipse.swt/buildSWT.xml b/bundles/org.eclipse.swt/buildSWT.xml
index 1e2c9b01d8..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.releng" value="../../../eclipse.platform.releng"/>
+ <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,6 +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="org.eclipse.releng/maps/swt.map"/>
<target name="check_libraries" depends="get_version">
<antcall target="check_fragment_libraries">
@@ -588,28 +589,9 @@
<replace file="${repo.src}/${file_build_notes}" token="${match_line}" value="${match_line}${body}"/>
</target>
- <target name="cvs_tag">
- <condition property="CVS_TAG" value="" else="-r${TAG}">
- <equals arg1="${TAG}" arg2="master"/>
- </condition>
- </target>
-
<!-- Set swt_tag to the current tag in the swt map file -->
- <target name="get_tag" unless="swt_tag" depends="cvs_tag">
- <property name="tmpdir" value="${tmphome}"/>
- <!--property name="map" value="${repo.releng}/bundles/org.eclipse.releng/maps/swt.map"/-->
- <property name="map" value="org.eclipse.releng/maps/swt.map"/>
- <property name="cvsRsh" value="plink"/>
- <property name="cvsRoot" value=":ext:fheidric@dev.eclipse.org:/cvsroot/eclipse"/>
- <cvs cvsRoot="${cvsRoot}" cvsrsh="${cvsRsh}" failonerror="true" dest="${tmpdir}">
- <commandline>
- <argument value="checkout"/>
- <argument line="${CVS_TAG}"/>
- <argument value="${map}"/>
- </commandline>
- </cvs>
-
- <loadfile property="swt_tag" srcfile="${tmpdir}/${map}">
+ <target name="get_tag" unless="swt_tag">
+ <loadfile property="swt_tag" srcfile="${repo.releng}/${file_swt_map}">
<filterchain>
<tokenfilter delimoutput="">
<containsstring contains="plugin@org.eclipse.swt=GIT,tag="/>
@@ -731,30 +713,19 @@
<antcall target="update_swt_map"/>
</target>
- <target name="update_swt_map" depends="cvs_tag">
- <property name="tmpdir" value="${tmphome}"/>
- <property name="cvsRsh" value="plink"/>
- <property name="cvsRoot" value=":ext:fheidric@dev.eclipse.org:/cvsroot/eclipse"/>
- <!-- download the map file -->
- <property name="map" value="org.eclipse.releng/maps/swt.map"/>
- <cvs cvsRoot="${cvsRoot}" cvsrsh="${cvsRsh}" failonerror="true" dest="${tmpdir}">
- <commandline>
- <argument value="checkout"/>
- <argument line="${CVS_TAG}"/>
- <argument value="${map}"/>
- </commandline>
- </cvs>
-
+ <target name="update_swt_map" depends="get_new_tag">
<!-- update and commit map file -->
- <replaceregexp file="${tmpdir}/${map}" match="=v\d\d\d\d[a-z]?" replace="=v${swt_new_tag}" byline="true"/>
- <cvs cvsRoot="${cvsRoot}" cvsrsh="${cvsRsh}" failonerror="true" dest="${tmpdir}">
- <commandline>
- <argument value="commit"/>
- <argument value="-m"/>
- <argument value="'new version v${swt_new_tag}'"/>
- <argument value="${map}"/>
- </commandline>
- </cvs>
+ <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.releng}" executable="git" failonerror="true">
+ <arg line="add '${file_swt_map}'"/>
+ </exec>
+ <exec dir="${repo.releng}" executable="git" failonerror="true">
+ <arg line="status"/>
+ </exec>
+ <exec dir="${repo.releng}" executable="git" failonerror="true">
+ <arg line="commit -m 'SWT contribution v${swt_new_tag}'"/>
+ </exec>
</target>
<target name="check_sha1_file" unless="natives_changed">
@@ -1076,9 +1047,19 @@
<exec dir="../../../../${TAG}/eclipse.platform.swt.binaries" executable="git" failonerror="true" timeout="900000">
<arg line="reset --hard origin/${TAG}"/>
</exec>
+ <antcall target="init_repo">
+ <param name="repo" value="eclipse.platform.releng.maps"/>
+ <param name="repo.exists" value="repo.releng.exists"/>
+ </antcall>
+ <exec dir="../../../../${TAG}/eclipse.platform.releng.maps" executable="git" failonerror="true">
+ <arg line="fetch"/>
+ </exec>
+ <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>
@@ -1097,11 +1078,62 @@
<exec dir="../../../../${TAG}/eclipse.platform.swt.binaries" executable="git" failonerror="true">
<arg line="push origin ${TAG}"/>
</exec>
+ <exec dir="../../../../${TAG}/eclipse.platform.releng.maps" executable="git" failonerror="true">
+ <arg line="fetch"/>
+ </exec>
+ <exec dir="../../../../${TAG}/eclipse.platform.releng.maps" executable="git" failonerror="true">
+ <arg line="rebase origin/${TAG}"/>
+ </exec>
+ <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 5d913ef11c..a8a2b9fcb7 100644
--- a/bundles/org.eclipse.swt/buildnotes_swt.html
+++ b/bundles/org.eclipse.swt/buildnotes_swt.html
@@ -11,6 +11,78 @@
Eclipse Platform Build Notes<br>
SWT</h1>
+<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>
+<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-07+17%3A25%3A00+-0400;chfieldto=2011-10-17+20%3A15%3A59+%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 3806a - Saturday October 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-03+17%3A22%3A24+-0400;chfieldto=2011-10-07+21%3A24%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 3806 - Tuesday October 04, 2011</h2>
<blockquote>