Bug 500280 - Move g_strdup binding to OS so it's with the rest of the
glib functions

Having this single glib function bidning in ATK is weird.

Change-Id: I8082c2638b239219c061cde996c9e0c16832bb2f
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java
index 0f24f24..e7bc04e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java
@@ -894,14 +894,14 @@
 				AtkAttribute attr = new AtkAttribute();
 				if (event.leftMargin != -1) {
 					long /*int*/ attrPtr = OS.g_malloc(AtkAttribute.sizeof);
-					attr.name = ATK.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_LEFT_MARGIN));
+					attr.name = OS.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_LEFT_MARGIN));
 					attr.value = getStringPtr (String.valueOf(event.leftMargin));
 					ATK.memmove(attrPtr, attr, AtkAttribute.sizeof);
 					parentResult = OS.g_slist_append(parentResult, attrPtr);
 				}
 				if (event.rightMargin != -1) {
 					long /*int*/ attrPtr = OS.g_malloc(AtkAttribute.sizeof);
-					attr.name = ATK.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_RIGHT_MARGIN));
+					attr.name = OS.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_RIGHT_MARGIN));
 					attr.value = getStringPtr (String.valueOf(event.rightMargin));
 					ATK.memmove(attrPtr, attr, AtkAttribute.sizeof);
 					parentResult = OS.g_slist_append(parentResult, attrPtr);
@@ -922,20 +922,20 @@
 				}
 				if (event.indent != -1) {
 					long /*int*/ attrPtr = OS.g_malloc(AtkAttribute.sizeof);
-					attr.name = ATK.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_INDENT));
+					attr.name = OS.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_INDENT));
 					attr.value = getStringPtr (String.valueOf(event.indent));
 					ATK.memmove(attrPtr, attr, AtkAttribute.sizeof);
 					parentResult = OS.g_slist_append(parentResult, attrPtr);
 				}
 				if (event.justify) {
 					long /*int*/ attrPtr = OS.g_malloc(AtkAttribute.sizeof);
-					attr.name = ATK.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_JUSTIFICATION));
+					attr.name = OS.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_JUSTIFICATION));
 					attr.value = getStringPtr ("fill"); //$NON-NLS-1$
 					ATK.memmove(attrPtr, attr, AtkAttribute.sizeof);
 					parentResult = OS.g_slist_append(parentResult, attrPtr);
 				} else if (event.alignment != -1) {
 					long /*int*/ attrPtr = OS.g_malloc(AtkAttribute.sizeof);
-					attr.name = ATK.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_JUSTIFICATION));
+					attr.name = OS.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_JUSTIFICATION));
 					String str = "left"; //$NON-NLS-1$
 					switch (event.alignment) {
 						case SWT.LEFT: str = "left"; break; //$NON-NLS-1$
@@ -2121,14 +2121,14 @@
 				if (style != null) {
 					if (style.rise != 0) {
 						long /*int*/ attrPtr = OS.g_malloc(AtkAttribute.sizeof);
-						attr.name = ATK.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_RISE));
+						attr.name = OS.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_RISE));
 						attr.value = getStringPtr (String.valueOf(style.rise));
 						ATK.memmove(attrPtr, attr, AtkAttribute.sizeof);
 						result = OS.g_slist_append(result, attrPtr);
 					}
 					if (style.underline) {
 						long /*int*/ attrPtr = OS.g_malloc(AtkAttribute.sizeof);
-						attr.name = ATK.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_UNDERLINE));
+						attr.name = OS.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_UNDERLINE));
 						String str = "none"; //$NON-NLS-1$
 						switch (style.underlineStyle) {
 							case SWT.UNDERLINE_DOUBLE: str = "double"; break; //$NON-NLS-1$
@@ -2142,7 +2142,7 @@
 					}
 					if (style.strikeout) {
 						long /*int*/ attrPtr = OS.g_malloc(AtkAttribute.sizeof);
-						attr.name = ATK.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_STRIKETHROUGH));
+						attr.name = OS.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_STRIKETHROUGH));
 						attr.value = getStringPtr ("1");
 						ATK.memmove(attrPtr, attr, AtkAttribute.sizeof);
 						result = OS.g_slist_append(result, attrPtr);
@@ -2152,37 +2152,37 @@
 						//TODO language and direction
 						long /*int*/ attrPtr;
 						attrPtr = OS.g_malloc(AtkAttribute.sizeof);
-						attr.name = ATK.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_FAMILY_NAME));
-						attr.value = ATK.g_strdup (OS.pango_font_description_get_family (font.handle));
+						attr.name = OS.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_FAMILY_NAME));
+						attr.value = OS.g_strdup (OS.pango_font_description_get_family (font.handle));
 						ATK.memmove(attrPtr, attr, AtkAttribute.sizeof);
 						result = OS.g_slist_append(result, attrPtr);
 
 						attrPtr = OS.g_malloc(AtkAttribute.sizeof);
-						attr.name = ATK.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_SIZE));
+						attr.name = OS.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_SIZE));
 						attr.value = getStringPtr (String.valueOf (OS.pango_font_description_get_size(font.handle) / OS.PANGO_SCALE));
 						ATK.memmove(attrPtr, attr, AtkAttribute.sizeof);
 						result = OS.g_slist_append(result, attrPtr);
 
 						attrPtr = OS.g_malloc(AtkAttribute.sizeof);
-						attr.name = ATK.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_STYLE));
-						attr.value = ATK.g_strdup (ATK.atk_text_attribute_get_value(ATK.ATK_TEXT_ATTR_STYLE, OS.pango_font_description_get_style(font.handle)));
+						attr.name = OS.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_STYLE));
+						attr.value = OS.g_strdup (ATK.atk_text_attribute_get_value(ATK.ATK_TEXT_ATTR_STYLE, OS.pango_font_description_get_style(font.handle)));
 						ATK.memmove(attrPtr, attr, AtkAttribute.sizeof);
 						result = OS.g_slist_append(result, attrPtr);
 
 						attrPtr = OS.g_malloc(AtkAttribute.sizeof);
-						attr.name = ATK.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_VARIANT));
-						attr.value = ATK.g_strdup (ATK.atk_text_attribute_get_value(ATK.ATK_TEXT_ATTR_VARIANT, OS.pango_font_description_get_variant(font.handle)));
+						attr.name = OS.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_VARIANT));
+						attr.value = OS.g_strdup (ATK.atk_text_attribute_get_value(ATK.ATK_TEXT_ATTR_VARIANT, OS.pango_font_description_get_variant(font.handle)));
 						ATK.memmove(attrPtr, attr, AtkAttribute.sizeof);
 						result = OS.g_slist_append(result, attrPtr);
 
 						attrPtr = OS.g_malloc(AtkAttribute.sizeof);
-						attr.name = ATK.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_STRETCH));
-						attr.value = ATK.g_strdup (ATK.atk_text_attribute_get_value(ATK.ATK_TEXT_ATTR_STRETCH, OS.pango_font_description_get_stretch(font.handle)));
+						attr.name = OS.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_STRETCH));
+						attr.value = OS.g_strdup (ATK.atk_text_attribute_get_value(ATK.ATK_TEXT_ATTR_STRETCH, OS.pango_font_description_get_stretch(font.handle)));
 						ATK.memmove(attrPtr, attr, AtkAttribute.sizeof);
 						result = OS.g_slist_append(result, attrPtr);
 
 						attrPtr = OS.g_malloc(AtkAttribute.sizeof);
-						attr.name = ATK.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_WEIGHT));
+						attr.name = OS.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_WEIGHT));
 						attr.value = getStringPtr (String.valueOf (OS.pango_font_description_get_weight(font.handle)));
 						ATK.memmove(attrPtr, attr, AtkAttribute.sizeof);
 						result = OS.g_slist_append(result, attrPtr);
@@ -2190,7 +2190,7 @@
 					Color color = style.foreground;
 					if (color != null && !color.isDisposed()) {
 						long /*int*/ attrPtr = OS.g_malloc(AtkAttribute.sizeof);
-						attr.name = ATK.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_FG_COLOR));
+						attr.name = OS.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_FG_COLOR));
 						attr.value = getStringPtr ((color.handle.red & 0xFFFF) + "," + (color.handle.blue & 0xFFFF) + "," + (color.handle.blue & 0xFFFF)); //$NON-NLS-1$ //$NON-NLS-2$
 						ATK.memmove(attrPtr, attr, AtkAttribute.sizeof);
 						result = OS.g_slist_append(result, attrPtr);
@@ -2198,7 +2198,7 @@
 					color = style.background;
 					if (color != null && !color.isDisposed()) {
 						long /*int*/ attrPtr = OS.g_malloc(AtkAttribute.sizeof);
-						attr.name = ATK.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_BG_COLOR));
+						attr.name = OS.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_BG_COLOR));
 						attr.value = getStringPtr ((color.handle.red & 0xFFFF) + "," + (color.handle.blue & 0xFFFF) + "," + (color.handle.blue & 0xFFFF)); //$NON-NLS-1$ //$NON-NLS-2$
 						ATK.memmove(attrPtr, attr, AtkAttribute.sizeof);
 						result = OS.g_slist_append(result, attrPtr);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/atk.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/atk.c
index 9e30697..b6e2100 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/atk.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/atk.c
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2000, 2016 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
@@ -527,18 +527,6 @@
 }
 #endif
 
-#ifndef NO_g_1strdup
-JNIEXPORT jintLong JNICALL ATK_NATIVE(g_1strdup)
-	(JNIEnv *env, jclass that, jintLong arg0)
-{
-	jintLong rc = 0;
-	ATK_NATIVE_ENTER(env, that, g_1strdup_FUNC);
-	rc = (jintLong)g_strdup((char *)arg0);
-	ATK_NATIVE_EXIT(env, that, g_1strdup_FUNC);
-	return rc;
-}
-#endif
-
 #if (!defined(NO_memmove__ILorg_eclipse_swt_internal_accessibility_gtk_AtkActionIface_2) && !defined(JNI64)) || (!defined(NO_memmove__JLorg_eclipse_swt_internal_accessibility_gtk_AtkActionIface_2) && defined(JNI64))
 #ifndef JNI64
 JNIEXPORT void JNICALL ATK_NATIVE(memmove__ILorg_eclipse_swt_internal_accessibility_gtk_AtkActionIface_2)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/atk_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/atk_stats.c
index 37db362..376b063 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/atk_stats.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/atk_stats.c
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2000, 2016 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
@@ -73,7 +73,6 @@
 #else
 	"_1call__JJJJJJ",
 #endif
-	"g_1strdup",
 #ifndef JNI64
 	"memmove__ILorg_eclipse_swt_internal_accessibility_gtk_AtkActionIface_2",
 #else
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/atk_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/atk_stats.h
index c283d2f..7574d6a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/atk_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/atk_stats.h
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2000, 2016 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
@@ -83,7 +83,6 @@
 #else
 	_1call__JJJJJJ_FUNC,
 #endif
-	g_1strdup_FUNC,
 #ifndef JNI64
 	memmove__ILorg_eclipse_swt_internal_accessibility_gtk_AtkActionIface_2_FUNC,
 #else
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 e256ff9..cb7806c 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
@@ -21455,6 +21455,18 @@
 }
 #endif
 
+#ifndef NO_g_1strdup
+JNIEXPORT jintLong JNICALL OS_NATIVE(g_1strdup)
+	(JNIEnv *env, jclass that, jintLong arg0)
+{
+	jintLong rc = 0;
+	OS_NATIVE_ENTER(env, that, g_1strdup_FUNC);
+	rc = (jintLong)g_strdup((char *)arg0);
+	OS_NATIVE_EXIT(env, that, g_1strdup_FUNC);
+	return rc;
+}
+#endif
+
 #ifndef NO_g_1value_1get_1double
 JNIEXPORT jdouble JNICALL OS_NATIVE(g_1value_1get_1double)
 	(JNIEnv *env, jclass that, jintLong arg0)
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 4240d79..d57a6b2 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
@@ -1606,6 +1606,7 @@
 	"_1swt_1fixed_1restack",
 	"_1ubuntu_1menu_1proxy_1get",
 	"g_1main_1context_1wakeup",
+	"g_1strdup",
 	"g_1value_1get_1double",
 	"g_1value_1get_1float",
 	"g_1value_1get_1int",
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 7b221bb..1a36cdd 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
@@ -1616,6 +1616,7 @@
 	_1swt_1fixed_1restack_FUNC,
 	_1ubuntu_1menu_1proxy_1get_FUNC,
 	g_1main_1context_1wakeup_FUNC,
+	g_1strdup_FUNC,
 	g_1value_1get_1double_FUNC,
 	g_1value_1get_1float_FUNC,
 	g_1value_1get_1int_FUNC,
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/accessibility/gtk/ATK.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/accessibility/gtk/ATK.java
index a745b49..98291ed 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/accessibility/gtk/ATK.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/accessibility/gtk/ATK.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2000, 2016 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
@@ -15,8 +15,8 @@
 package org.eclipse.swt.internal.accessibility.gtk;
 
 
-import org.eclipse.swt.internal.Library;
-import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.internal.*;
+import org.eclipse.swt.internal.gtk.*;
 
 public class ATK extends OS {
 	static {
@@ -439,8 +439,6 @@
 		lock.unlock();
 	}
 }
-/** @param str cast=(char *) */
-public static final native long /*int*/ g_strdup (long /*int*/ str);
 public static final native void memmove (AtkActionIface dest, long /*int*/ src);
 public static final native void memmove (AtkComponentIface dest, long /*int*/ src);
 public static final native void memmove (AtkEditableTextIface dest, long /*int*/ src);
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 93ad219..4c1b57f 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
@@ -3363,6 +3363,8 @@
 		lock.unlock();
 	}
 }
+/** @param str cast=(char *) */
+public static final native long /*int*/ g_strdup (long /*int*/ str);
 /**
  * @param instance_type cast=(GType)
  * @param interface_type cast=(GType)