summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnatoly Spektor <aspektor@redhat.com>2013-02-07 15:35:15 -0500
committerAnatoly Spektor <aspektor@redhat.com>2013-02-21 14:59:21 -0500
commit8ae5e6a289db17dab018baec79652b564534698c (patch)
tree9b2062cab26119d86df8fc7ae1f71ef0b1fdb9e3
parent7c8383f51b93f7d1d47653a4cf70e9ab97bfb48a (diff)
downloadeclipse.platform.swt-gtk3_textbox_clipped.tar.gz
eclipse.platform.swt-gtk3_textbox_clipped.tar.xz
eclipse.platform.swt-gtk3_textbox_clipped.zip
This patch solves clipping and wrong default sizing of GtkEntry in GTK3gtk3_textbox_clipped
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java13
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java3
5 files changed, 31 insertions, 3 deletions
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 21d7da2519..8a4a96fe87 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2000, 2013 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
@@ -9941,6 +9941,16 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1entry_1set_1visibility)
}
#endif
+#ifndef NO__1gtk_1entry_1set_1width_1chars
+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1entry_1set_1width_1chars)
+ (JNIEnv *env, jclass that, jintLong arg0, jint arg1)
+{
+ OS_NATIVE_ENTER(env, that, _1gtk_1entry_1set_1width_1chars_FUNC);
+ gtk_entry_set_width_chars((GtkEntry *)arg0, (gint)arg1);
+ OS_NATIVE_EXIT(env, that, _1gtk_1entry_1set_1width_1chars_FUNC);
+}
+#endif
+
#ifndef NO__1gtk_1entry_1text_1index_1to_1layout_1index
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1entry_1text_1index_1to_1layout_1index)
(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
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 6e2726097d..c25d3b75f1 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2000, 2013 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
@@ -741,6 +741,7 @@ char * OS_nativeFunctionNames[] = {
"_1gtk_1entry_1set_1placeholder_1text",
"_1gtk_1entry_1set_1text",
"_1gtk_1entry_1set_1visibility",
+ "_1gtk_1entry_1set_1width_1chars",
"_1gtk_1entry_1text_1index_1to_1layout_1index",
"_1gtk_1enumerate_1printers",
"_1gtk_1expander_1get_1expanded",
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 f69c3663d1..bcd682132c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2000, 2013 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
@@ -751,6 +751,7 @@ typedef enum {
_1gtk_1entry_1set_1placeholder_1text_FUNC,
_1gtk_1entry_1set_1text_FUNC,
_1gtk_1entry_1set_1visibility_FUNC,
+ _1gtk_1entry_1set_1width_1chars_FUNC,
_1gtk_1entry_1text_1index_1to_1layout_1index_FUNC,
_1gtk_1enumerate_1printers_FUNC,
_1gtk_1expander_1get_1expanded_FUNC,
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 f8a0c6ee9a..b09e0abdde 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
@@ -7078,6 +7078,19 @@ public static final long /*int*/ gtk_entry_get_inner_border (long /*int*/ entry)
lock.unlock();
}
}
+/**
+ * @param self cast=(GtkEntry *)
+ * @param n_chars cast=(gint)
+ */
+public static final native void _gtk_entry_set_width_chars (long /*int*/ self, int n_chars);
+public static final void gtk_entry_set_width_chars (long /*int*/ self, int n_chars) {
+ lock.lock();
+ try {
+ _gtk_entry_set_width_chars(self, n_chars);
+ } finally {
+ lock.unlock();
+ }
+}
/** @param entry cast=(GtkEntry *) */
public static final native char _gtk_entry_get_invisible_char(long /*int*/ entry);
public static final char gtk_entry_get_invisible_char(long /*int*/ entry) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java
index db9f4d1201..46cf274a2f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java
@@ -232,6 +232,9 @@ void createHandle (int index) {
}
if (OS.GTK3) {
imContext = OS.imContextLast();
+ if ((style & SWT.SINGLE) != 0) {
+ OS.gtk_entry_set_width_chars(handle, 6);
+ }
}
}