diff options
author | Alexander Kurtakov | 2017-09-27 07:04:14 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2017-09-27 07:05:09 +0000 |
commit | 5b8fa75d1f7bd7eb02164c4992685338c6ecbba4 (patch) | |
tree | 4bc9e70b68c730f6767003fe5f4d093cc222f171 | |
parent | 47ed256369174cc1874b1b50f12e79d3168b22c9 (diff) | |
download | eclipse.platform.swt-5b8fa75d1f7bd7eb02164c4992685338c6ecbba4.tar.gz eclipse.platform.swt-5b8fa75d1f7bd7eb02164c4992685338c6ecbba4.tar.xz eclipse.platform.swt-5b8fa75d1f7bd7eb02164c4992685338c6ecbba4.zip |
Bug 525255 - Enable indirect static usage warnings
Enable the warning and cover gtk port.
Change-Id: I4cf0318d7aafa92bce24f832875a0a891fa079db
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
49 files changed, 477 insertions, 377 deletions
diff --git a/bundles/org.eclipse.swt/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.swt/.settings/org.eclipse.jdt.core.prefs index 76c544f674..f0ce081d8a 100644 --- a/bundles/org.eclipse.swt/.settings/org.eclipse.jdt.core.prefs +++ b/bundles/org.eclipse.swt/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,15 @@ eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullable.secondary= +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.8 @@ -7,14 +17,40 @@ org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.doc.comment.support=enabled +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public @@ -23,4 +59,65 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled +org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning org.eclipse.jdt.core.compiler.source=1.8 diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleFactory.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleFactory.java index 211a826f89..49a2d55293 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleFactory.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -304,9 +304,9 @@ class AccessibleFactory { static String getTypeName (long /*int*/ type) { long /*int*/ typeName = OS.g_type_name (type); - int widgetTypeNameLength = OS.strlen (typeName); + int widgetTypeNameLength = C.strlen (typeName); byte[] buffer = new byte [widgetTypeNameLength]; - OS.memmove (buffer, typeName, widgetTypeNameLength); + C.memmove (buffer, typeName, widgetTypeNameLength); return new String(Converter.mbcsToWcs(buffer)); } @@ -336,7 +336,7 @@ class AccessibleFactory { } long /*int*/ widgetType = OS.G_OBJECT_TYPE (widget); long /*int*/ parentType = getParentType (widgetType); - if (parentType == 0) parentType = ATK.GTK_TYPE_ACCESSIBLE(); + if (parentType == 0) parentType = OS.GTK_TYPE_ACCESSIBLE(); long /*int*/ type = getType (getTypeName(widgetType), accessible, parentType, ACC.CHILDID_SELF); AccessibleObject object = new AccessibleObject (type, widget, accessible, false); accessible.accessibleObject = object; @@ -345,7 +345,7 @@ class AccessibleFactory { } static AccessibleObject createChildAccessible (Accessible accessible, int childId) { - long /*int*/ childType = getType (CHILD_TYPENAME, accessible, ATK.GTK_TYPE_ACCESSIBLE(), childId); + long /*int*/ childType = getType (CHILD_TYPENAME, accessible, OS.GTK_TYPE_ACCESSIBLE(), childId); return new AccessibleObject(childType, 0, accessible, true); } 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 a400981d1b..75d6c9868e 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -63,7 +63,7 @@ class AccessibleObject { // this functionality needs to be implemented. Currently objects are // created but aren't linked to the parent in a meaningful way. widget = accessible.getControlHandle(); - atkHandle = ATK.g_object_new (OS.swt_fixed_accessible_get_type(), 0); + atkHandle = OS.g_object_new (OS.swt_fixed_accessible_get_type(), 0); ATK.atk_object_initialize (atkHandle, widget); OS.swt_fixed_accessible_register_accessible(atkHandle, false, 0); } @@ -73,7 +73,7 @@ class AccessibleObject { atkHandle = OS.gtk_widget_get_accessible(widget); } } else { - atkHandle = ATK.g_object_new (type, 0); + atkHandle = OS.g_object_new (type, 0); ATK.atk_object_initialize (atkHandle, widget); } this.accessible = accessible; @@ -90,9 +90,9 @@ class AccessibleObject { } static AtkActionIface getActionIface (long /*int*/ atkObject) { - if (ATK.g_type_is_a (OS.g_type_parent (OS.G_OBJECT_TYPE (atkObject)), ATK.ATK_TYPE_ACTION())) { + if (OS.g_type_is_a (OS.g_type_parent (OS.G_OBJECT_TYPE (atkObject)), ATK.ATK_TYPE_ACTION())) { AtkActionIface iface = new AtkActionIface (); - ATK.memmove (iface, ATK.g_type_interface_peek_parent (ATK.ATK_ACTION_GET_IFACE (atkObject))); + ATK.memmove (iface, OS.g_type_interface_peek_parent (ATK.ATK_ACTION_GET_IFACE (atkObject))); return iface; } return null; @@ -263,9 +263,9 @@ class AccessibleObject { } static AtkComponentIface getComponentIface (long /*int*/ atkObject) { - if (ATK.g_type_is_a (OS.g_type_parent (OS.G_OBJECT_TYPE (atkObject)), ATK.ATK_TYPE_COMPONENT())) { + if (OS.g_type_is_a (OS.g_type_parent (OS.G_OBJECT_TYPE (atkObject)), ATK.ATK_TYPE_COMPONENT())) { AtkComponentIface iface = new AtkComponentIface (); - ATK.memmove (iface, ATK.g_type_interface_peek_parent (ATK.ATK_COMPONENT_GET_IFACE (atkObject))); + ATK.memmove (iface, OS.g_type_interface_peek_parent (ATK.ATK_COMPONENT_GET_IFACE (atkObject))); return iface; } return null; @@ -274,13 +274,13 @@ class AccessibleObject { static long /*int*/ atkComponent_get_extents (long /*int*/ atkObject, long /*int*/ x, long /*int*/ y, long /*int*/ width, long /*int*/ height, long /*int*/ coord_type) { if (DEBUG) print ("-->atkComponent_get_extents: " + atkObject); AccessibleObject object = getAccessibleObject (atkObject); - OS.memmove (x, new int[] {0}, 4); - OS.memmove (y, new int[] {0}, 4); - OS.memmove (width, new int[] {0}, 4); - OS.memmove (height, new int[] {0}, 4); + C.memmove (x, new int[] {0}, 4); + C.memmove (y, new int[] {0}, 4); + C.memmove (width, new int[] {0}, 4); + C.memmove (height, new int[] {0}, 4); AtkComponentIface iface = getComponentIface (atkObject); if (iface != null && iface.get_extents != 0) { - ATK.call (iface.get_extents, atkObject, x, y, width, height, coord_type); + OS.call (iface.get_extents, atkObject, x, y, width, height, coord_type); } if (object != null) { Accessible accessible = object.accessible; @@ -289,10 +289,10 @@ class AccessibleObject { if (length > 0) { int[] parentX = new int [1], parentY = new int [1]; int[] parentWidth = new int [1], parentHeight = new int [1]; - OS.memmove (parentX, x, 4); - OS.memmove (parentY, y, 4); - OS.memmove (parentWidth, width, 4); - OS.memmove (parentHeight, height, 4); + C.memmove (parentX, x, 4); + C.memmove (parentY, y, 4); + C.memmove (parentWidth, width, 4); + C.memmove (parentHeight, height, 4); AccessibleControlEvent event = new AccessibleControlEvent (accessible); event.childID = object.id; event.x = parentX [0]; event.y = parentY [0]; @@ -311,10 +311,10 @@ class AccessibleObject { event.x -= topWindowX [0]; event.y -= topWindowY [0]; } - OS.memmove (x, new int[] {event.x}, 4); - OS.memmove (y, new int[] {event.y}, 4); - OS.memmove (width, new int[] {event.width}, 4); - OS.memmove (height, new int[] {event.height}, 4); + C.memmove (x, new int[] {event.x}, 4); + C.memmove (y, new int[] {event.y}, 4); + C.memmove (width, new int[] {event.width}, 4); + C.memmove (height, new int[] {event.height}, 4); if (DEBUG) print("--->" + event.x + "," + event.y + "," + event.width + "x" + event.height); } } @@ -324,11 +324,11 @@ class AccessibleObject { static long /*int*/ atkComponent_get_position (long /*int*/ atkObject, long /*int*/ x, long /*int*/ y, long /*int*/ coord_type) { if (DEBUG) print ("-->atkComponent_get_position, object: " + atkObject + " x: " + x + " y: " + y + " coord: " + coord_type); AccessibleObject object = getAccessibleObject (atkObject); - OS.memmove (x, new int[] {0}, 4); - OS.memmove (y, new int[] {0}, 4); + C.memmove (x, new int[] {0}, 4); + C.memmove (y, new int[] {0}, 4); AtkComponentIface iface = getComponentIface (atkObject); if (iface != null && iface.get_position != 0) { - ATK.call (iface.get_position, atkObject, x, y, coord_type); + OS.call (iface.get_position, atkObject, x, y, coord_type); } if (object != null) { Accessible accessible = object.accessible; @@ -336,8 +336,8 @@ class AccessibleObject { int length = size(listeners); if (length > 0) { int[] parentX = new int [1], parentY = new int [1]; - OS.memmove (parentX, x, 4); - OS.memmove (parentY, y, 4); + C.memmove (parentX, x, 4); + C.memmove (parentY, y, 4); AccessibleControlEvent event = new AccessibleControlEvent (accessible); event.childID = object.id; event.x = parentX [0]; event.y = parentY [0]; @@ -355,8 +355,8 @@ class AccessibleObject { event.x -= topWindowX [0]; event.y -= topWindowY [0]; } - OS.memmove (x, new int[] {event.x}, 4); - OS.memmove (y, new int[] {event.y}, 4); + C.memmove (x, new int[] {event.x}, 4); + C.memmove (y, new int[] {event.y}, 4); } } return 0; @@ -365,11 +365,11 @@ class AccessibleObject { static long /*int*/ atkComponent_get_size (long /*int*/ atkObject, long /*int*/ width, long /*int*/ height, long /*int*/ coord_type) { if (DEBUG) print ("-->atkComponent_get_size"); AccessibleObject object = getAccessibleObject (atkObject); - OS.memmove (width, new int[] {0}, 4); - OS.memmove (height, new int[] {0}, 4); + C.memmove (width, new int[] {0}, 4); + C.memmove (height, new int[] {0}, 4); AtkComponentIface iface = getComponentIface (atkObject); if (iface != null && iface.get_size != 0) { - ATK.call (iface.get_size, atkObject, width, height, coord_type); + OS.call (iface.get_size, atkObject, width, height, coord_type); } if (object != null) { Accessible accessible = object.accessible; @@ -377,8 +377,8 @@ class AccessibleObject { int length = size(listeners); if (length > 0) { int[] parentWidth = new int [1], parentHeight = new int [1]; - OS.memmove (parentWidth, width, 4); - OS.memmove (parentHeight, height, 4); + C.memmove (parentWidth, width, 4); + C.memmove (parentHeight, height, 4); AccessibleControlEvent event = new AccessibleControlEvent (accessible); event.childID = object.id; event.width = parentWidth [0]; event.height = parentHeight [0]; @@ -386,8 +386,8 @@ class AccessibleObject { AccessibleControlListener listener = listeners.get (i); listener.getLocation (event); } - OS.memmove (width, new int[] {event.width}, 4); - OS.memmove (height, new int[] {event.height}, 4); + C.memmove (width, new int[] {event.width}, 4); + C.memmove (height, new int[] {event.height}, 4); } } return 0; @@ -425,16 +425,16 @@ class AccessibleObject { long /*int*/ parentResult = 0; AtkComponentIface iface = getComponentIface (atkObject); if (iface != null && iface.ref_accessible_at_point != 0) { - parentResult = ATK.call (iface.ref_accessible_at_point, atkObject, x, y, coord_type); + parentResult = OS.call (iface.ref_accessible_at_point, atkObject, x, y, coord_type); } return parentResult; } static AtkEditableTextIface getEditableTextIface (long /*int*/ atkObject) { - if (ATK.g_type_is_a (OS.g_type_parent (OS.G_OBJECT_TYPE (atkObject)), ATK.ATK_TYPE_EDITABLE_TEXT())) { + if (OS.g_type_is_a (OS.g_type_parent (OS.G_OBJECT_TYPE (atkObject)), ATK.ATK_TYPE_EDITABLE_TEXT())) { AtkEditableTextIface iface = new AtkEditableTextIface (); - ATK.memmove (iface, ATK.g_type_interface_peek_parent (ATK.ATK_EDITABLE_TEXT_GET_IFACE (atkObject))); + ATK.memmove (iface, OS.g_type_interface_peek_parent (ATK.ATK_EDITABLE_TEXT_GET_IFACE (atkObject))); return iface; } return null; @@ -583,7 +583,7 @@ class AccessibleObject { long /*int*/ parentResult = 0; AtkEditableTextIface iface = getEditableTextIface (atkObject); if (iface != null && iface.set_run_attributes != 0) { - parentResult = ATK.call (iface.set_run_attributes, atkObject, attrib_set, start_offset, end_offset); + parentResult = OS.call (iface.set_run_attributes, atkObject, attrib_set, start_offset, end_offset); } return parentResult; } @@ -645,7 +645,7 @@ class AccessibleObject { if (length > 0) { AccessibleEditableTextEvent event = new AccessibleEditableTextEvent(accessible); int[] pos = new int [1]; - OS.memmove (pos, position, OS.PTR_SIZEOF); + C.memmove (pos, position, C.PTR_SIZEOF); event.start = event.end = pos[0]; event.string = getString (string); for (int i = 0; i < length; i++) { @@ -658,7 +658,7 @@ class AccessibleObject { long /*int*/ parentResult = 0; AtkEditableTextIface iface = getEditableTextIface (atkObject); if (iface != null && iface.insert_text != 0) { - parentResult = ATK.call (iface.insert_text, atkObject, string, string_length, position); + parentResult = OS.call (iface.insert_text, atkObject, string, string_length, position); } return parentResult; } @@ -772,9 +772,9 @@ class AccessibleObject { } static AtkHypertextIface getHypertextIface (long /*int*/ atkObject) { - if (ATK.g_type_is_a (OS.g_type_parent (OS.G_OBJECT_TYPE (atkObject)), ATK.ATK_TYPE_HYPERTEXT())) { + if (OS.g_type_is_a (OS.g_type_parent (OS.G_OBJECT_TYPE (atkObject)), ATK.ATK_TYPE_HYPERTEXT())) { AtkHypertextIface iface = new AtkHypertextIface (); - ATK.memmove (iface, ATK.g_type_interface_peek_parent (ATK.ATK_HYPERTEXT_GET_IFACE (atkObject))); + ATK.memmove (iface, OS.g_type_interface_peek_parent (ATK.ATK_HYPERTEXT_GET_IFACE (atkObject))); return iface; } return null; @@ -871,7 +871,7 @@ class AccessibleObject { long /*int*/ type = OS.GTK3 ? OS.swt_fixed_accessible_get_type() : OS.G_OBJECT_TYPE (atkObject); if (type != 0) { long /*int*/ parentType = OS.g_type_parent (type); - if (parentType != 0) ATK.memmove (objectClass, ATK.g_type_class_peek (parentType)); + if (parentType != 0) ATK.memmove (objectClass, OS.g_type_class_peek (parentType)); } return objectClass; } @@ -1409,9 +1409,9 @@ class AccessibleObject { } static AtkSelectionIface getSelectionIface (long /*int*/ atkObject) { - if (ATK.g_type_is_a (OS.g_type_parent (OS.G_OBJECT_TYPE (atkObject)), ATK.ATK_TYPE_SELECTION())) { + if (OS.g_type_is_a (OS.g_type_parent (OS.G_OBJECT_TYPE (atkObject)), ATK.ATK_TYPE_SELECTION())) { AtkSelectionIface iface = new AtkSelectionIface (); - ATK.memmove (iface, ATK.g_type_interface_peek_parent (ATK.ATK_SELECTION_GET_IFACE (atkObject))); + ATK.memmove (iface, OS.g_type_interface_peek_parent (ATK.ATK_SELECTION_GET_IFACE (atkObject))); return iface; } return null; @@ -1477,9 +1477,9 @@ class AccessibleObject { } static AtkTableIface getTableIface (long /*int*/ atkObject) { - if (ATK.g_type_is_a (OS.g_type_parent (OS.G_OBJECT_TYPE (atkObject)), ATK.ATK_TYPE_TABLE())) { + if (OS.g_type_is_a (OS.g_type_parent (OS.G_OBJECT_TYPE (atkObject)), ATK.ATK_TYPE_TABLE())) { AtkTableIface iface = new AtkTableIface (); - ATK.memmove (iface, ATK.g_type_interface_peek_parent (ATK.ATK_TABLE_GET_IFACE (atkObject))); + ATK.memmove (iface, OS.g_type_interface_peek_parent (ATK.ATK_TABLE_GET_IFACE (atkObject))); return iface; } return null; @@ -1908,8 +1908,8 @@ class AccessibleObject { } int count = event.selected != null ? event.selected.length : 0; long /*int*/ result = OS.g_malloc(count * 4); - if (event.selected != null) OS.memmove(result, event.selected, count * 4); - if (selected != 0) OS.memmove(selected, new long /*int*/[]{result}, C.PTR_SIZEOF); + if (event.selected != null) C.memmove(result, event.selected, count * 4); + if (selected != 0) C.memmove(selected, new long /*int*/[]{result}, C.PTR_SIZEOF); return count; } } @@ -1936,8 +1936,8 @@ class AccessibleObject { } int count = event.selected != null ? event.selected.length : 0; long /*int*/ result = OS.g_malloc(count * 4); - if (event.selected != null) OS.memmove(result, event.selected, count * 4); - if (selected != 0) OS.memmove(selected, new long /*int*/[]{result}, C.PTR_SIZEOF); + if (event.selected != null) C.memmove(result, event.selected, count * 4); + if (selected != 0) C.memmove(selected, new long /*int*/[]{result}, C.PTR_SIZEOF); return count; } } @@ -2141,9 +2141,9 @@ class AccessibleObject { } static AtkTextIface getTextIface (long /*int*/ atkObject) { - if (ATK.g_type_is_a (OS.g_type_parent (OS.G_OBJECT_TYPE (atkObject)), ATK.ATK_TYPE_TEXT())) { + if (OS.g_type_is_a (OS.g_type_parent (OS.G_OBJECT_TYPE (atkObject)), ATK.ATK_TYPE_TEXT())) { AtkTextIface iface = new AtkTextIface (); - ATK.memmove (iface, ATK.g_type_interface_peek_parent (ATK.ATK_TEXT_GET_IFACE (atkObject))); + ATK.memmove (iface, OS.g_type_interface_peek_parent (ATK.ATK_TEXT_GET_IFACE (atkObject))); return iface; } return null; @@ -2170,31 +2170,31 @@ class AccessibleObject { event.x -= topWindowX [0]; event.y -= topWindowY [0]; } - OS.memmove (x, new int[]{event.x}, 4); - OS.memmove (y, new int[]{event.y}, 4); - OS.memmove (width, new int[]{event.width}, 4); - OS.memmove (height, new int[]{event.height}, 4); + C.memmove (x, new int[]{event.x}, 4); + C.memmove (y, new int[]{event.y}, 4); + C.memmove (width, new int[]{event.width}, 4); + C.memmove (height, new int[]{event.height}, 4); return 0; } } AtkTextIface iface = getTextIface (atkObject); if (iface != null && iface.get_character_extents != 0) { - ATK.call (iface.get_character_extents, atkObject, offset, x, y, width, height, coords); + OS.call (iface.get_character_extents, atkObject, offset, x, y, width, height, coords); } return 0; } static String getString (long /*int*/ strPtr) { - int length = OS.strlen (strPtr); + int length = C.strlen (strPtr); byte [] buffer = new byte [length]; - OS.memmove (buffer, strPtr, length); + C.memmove (buffer, strPtr, length); return new String (Converter.mbcsToWcs (buffer)); } static long /*int*/ getStringPtr (String str) { byte [] buffer = Converter.wcsToMbcs(str != null ? str : "", true); long /*int*/ ptr = OS.g_malloc(buffer.length); - OS.memmove(ptr, buffer, buffer.length); + C.memmove(ptr, buffer, buffer.length); return ptr; } @@ -2249,8 +2249,8 @@ class AccessibleObject { AccessibleAttributeListener listener = listeners.get(i); listener.getTextAttributes(event); } - OS.memmove (start_offset, new int []{event.start}, 4); - OS.memmove (end_offset, new int []{event.end}, 4); + C.memmove (start_offset, new int []{event.start}, 4); + C.memmove (end_offset, new int []{event.end}, 4); TextStyle style = event.textStyle; long /*int*/ result = 0; AtkAttribute attr = new AtkAttribute(); @@ -2364,7 +2364,7 @@ class AccessibleObject { long /*int*/ parentResult = 0; AtkTextIface iface = getTextIface (atkObject); if (iface != null && iface.get_run_attributes != 0) { - parentResult = ATK.call (iface.get_run_attributes, atkObject, offset, start_offset, end_offset); + parentResult = OS.call (iface.get_run_attributes, atkObject, offset, start_offset, end_offset); } return parentResult; } @@ -2396,7 +2396,7 @@ class AccessibleObject { long /*int*/ parentResult = 0; AtkTextIface iface = getTextIface (atkObject); if (iface != null && iface.get_offset_at_point != 0) { - parentResult = ATK.call (iface.get_offset_at_point, atkObject, x, y, coords); + parentResult = OS.call (iface.get_offset_at_point, atkObject, x, y, coords); } return parentResult; } @@ -2498,7 +2498,7 @@ class AccessibleObject { long /*int*/ parentResult = 0; AtkTextIface iface = getTextIface (atkObject); if (iface != null && iface.set_selection != 0) { - parentResult = ATK.call (iface.set_selection, atkObject, selection_num, start_offset, end_offset); + parentResult = OS.call (iface.set_selection, atkObject, selection_num, start_offset, end_offset); } return parentResult; } @@ -2560,7 +2560,7 @@ class AccessibleObject { } int [] ranges = event.ranges; int size = ranges == null ? 1 : ranges.length / 2; - long /*int*/ result = OS.malloc(size * AtkTextRange.sizeof); + long /*int*/ result = C.malloc(size * AtkTextRange.sizeof); AtkTextRange range = new AtkTextRange(); for (int j = 0, end = (ranges != null ? ranges.length / 2 : 1); j < end; j++) { if (ranges != null) { @@ -2693,17 +2693,17 @@ class AccessibleObject { if (DEBUG) print ("-->atkText_get_selection"); AccessibleObject object = getAccessibleObject (atkObject); long /*int*/ parentResult = 0; - OS.memmove (start_offset, new int[] {0}, 4); - OS.memmove (end_offset, new int[] {0}, 4); + C.memmove (start_offset, new int[] {0}, 4); + C.memmove (end_offset, new int[] {0}, 4); AtkTextIface iface = getTextIface (atkObject); if (iface != null && iface.get_selection != 0) { - parentResult = ATK.call (iface.get_selection, atkObject, selection_num, start_offset, end_offset); + parentResult = OS.call (iface.get_selection, atkObject, selection_num, start_offset, end_offset); } if (object != null) { int[] parentStart = new int [1]; int[] parentEnd = new int [1]; - OS.memmove (parentStart, start_offset, 4); - OS.memmove (parentEnd, end_offset, 4); + C.memmove (parentStart, start_offset, 4); + C.memmove (parentEnd, end_offset, 4); Accessible accessible = object.accessible; List<AccessibleTextExtendedListener> listeners = accessible.accessibleTextExtendedListeners; int length = size(listeners); @@ -2718,8 +2718,8 @@ class AccessibleObject { } parentStart [0] = event.start; parentEnd [0] = event.end; - OS.memmove (start_offset, parentStart, 4); - OS.memmove (end_offset, parentEnd, 4); + C.memmove (start_offset, parentStart, 4); + C.memmove (end_offset, parentEnd, 4); event.count = event.index = 0; event.type = ACC.TEXT_BOUNDARY_ALL; for (int i = 0; i < length; i++) { @@ -2741,8 +2741,8 @@ class AccessibleObject { AccessibleTextListener listener = listeners2.get(i); listener.getSelectionRange (event); } - OS.memmove (start_offset, new int[] {event.offset}, 4); - OS.memmove (end_offset, new int[] {event.offset + event.length}, 4); + C.memmove (start_offset, new int[] {event.offset}, 4); + C.memmove (end_offset, new int[] {event.offset + event.length}, 4); if (parentResult != 0) OS.g_free(parentResult); String text = object.getText(); if (text != null && text.length () > event.offset && text.length() >= event.offset + event.length) { @@ -2868,8 +2868,8 @@ class AccessibleObject { } break; } - OS.memmove (start_offset, new int[] {event.start}, 4); - OS.memmove (end_offset, new int[] {event.end}, 4); + C.memmove (start_offset, new int[] {event.start}, 4); + C.memmove (end_offset, new int[] {event.end}, 4); return getStringPtr (event.result); } int offset = (int)/*64*/offset_value; @@ -3030,8 +3030,8 @@ class AccessibleObject { break; } } - OS.memmove (start_offset, new int[] {startBounds}, 4); - OS.memmove (end_offset, new int[] {endBounds}, 4); + C.memmove (start_offset, new int[] {startBounds}, 4); + C.memmove (end_offset, new int[] {endBounds}, 4); text = text.substring (startBounds, endBounds); return getStringPtr (text); } @@ -3116,8 +3116,8 @@ class AccessibleObject { } break; } - OS.memmove (start_offset, new int[] {event.start}, 4); - OS.memmove (end_offset, new int[] {event.end}, 4); + C.memmove (start_offset, new int[] {event.start}, 4); + C.memmove (end_offset, new int[] {event.end}, 4); return getStringPtr (event.result); } int offset = (int)/*64*/offset_value; @@ -3221,8 +3221,8 @@ class AccessibleObject { endBounds = nextIndexOfChar (text, "\n", lineEnd1 + 1); } } - OS.memmove (start_offset, new int[] {startBounds}, 4); - OS.memmove (end_offset, new int[] {endBounds}, 4); + C.memmove (start_offset, new int[] {startBounds}, 4); + C.memmove (end_offset, new int[] {endBounds}, 4); text = text.substring (startBounds, endBounds); return getStringPtr (text); } @@ -3261,8 +3261,8 @@ class AccessibleObject { AccessibleTextExtendedListener listener = listeners.get(i); listener.getText(event); } - OS.memmove (start_offset, new int[] {event.start}, 4); - OS.memmove (end_offset, new int[] {event.end}, 4); + C.memmove (start_offset, new int[] {event.start}, 4); + C.memmove (end_offset, new int[] {event.end}, 4); switch ((int)/*64*/boundary_type) { case ATK.ATK_TEXT_BOUNDARY_WORD_START: case ATK.ATK_TEXT_BOUNDARY_SENTENCE_START: @@ -3417,8 +3417,8 @@ class AccessibleObject { break; } } - OS.memmove (start_offset, new int[] {startBounds}, 4); - OS.memmove (end_offset, new int[] {endBounds}, 4); + C.memmove (start_offset, new int[] {startBounds}, 4); + C.memmove (end_offset, new int[] {endBounds}, 4); text = text.substring (startBounds, endBounds); return getStringPtr (text); } @@ -3458,9 +3458,9 @@ class AccessibleObject { } static AtkValueIface getValueIface (long /*int*/ atkObject) { - if (ATK.g_type_is_a (OS.g_type_parent (OS.G_OBJECT_TYPE (atkObject)), ATK.ATK_TYPE_VALUE())) { + if (OS.g_type_is_a (OS.g_type_parent (OS.G_OBJECT_TYPE (atkObject)), ATK.ATK_TYPE_VALUE())) { AtkValueIface iface = new AtkValueIface (); - ATK.memmove (iface, ATK.g_type_interface_peek_parent (ATK.ATK_VALUE_GET_IFACE (atkObject))); + ATK.memmove (iface, OS.g_type_interface_peek_parent (ATK.ATK_VALUE_GET_IFACE (atkObject))); return iface; } return null; @@ -3631,10 +3631,10 @@ class AccessibleObject { * the map of AccessibleObjects, though. */ if (!OS.GTK3) { - long /*int*/ superType = ATK.g_type_class_peek_parent (ATK.G_OBJECT_GET_CLASS (atkObject)); - long /*int*/ gObjectClass = ATK.G_OBJECT_CLASS (superType); + long /*int*/ superType = OS.g_type_class_peek_parent (OS.G_OBJECT_GET_CLASS (atkObject)); + long /*int*/ gObjectClass = OS.G_OBJECT_CLASS (superType); GObjectClass objectClassStruct = new GObjectClass (); - ATK.memmove (objectClassStruct, gObjectClass); + OS.memmove (objectClassStruct, gObjectClass); ATK.call (objectClassStruct.finalize, atkObject); } AccessibleObject object = AccessibleObjects.get (new LONG (atkObject)); @@ -3672,7 +3672,7 @@ class AccessibleObject { widget = OS.gtk_accessible_get_widget(object.atkHandle); } if (widget == 0) return; - long /*int*/ topLevel = ATK.gtk_widget_get_toplevel (widget); + long /*int*/ topLevel = OS.gtk_widget_get_toplevel (widget); long /*int*/ window = OS.gtk_widget_get_window (topLevel); OS.gdk_window_get_origin (window, x, y); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/ByteArrayTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/ByteArrayTransfer.java index 26d97c607c..c4fe5e7a9d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/ByteArrayTransfer.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/ByteArrayTransfer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.swt.dnd; +import org.eclipse.swt.internal.*; import org.eclipse.swt.internal.gtk.*; /** @@ -160,7 +161,7 @@ protected void javaToNative (Object object, TransferData transferData) { if (buffer.length == 0) return; long /*int*/ pValue = OS.g_malloc(buffer.length); if (pValue == 0) return; - OS.memmove(pValue, buffer, buffer.length); + C.memmove(pValue, buffer, buffer.length); transferData.length = buffer.length; transferData.format = 8; transferData.pValue = pValue; @@ -183,7 +184,7 @@ protected Object nativeToJava(TransferData transferData) { int size = transferData.format * transferData.length / 8; if (size == 0) return null; byte[] buffer = new byte[size]; - OS.memmove(buffer, transferData.pValue, size); + C.memmove(buffer, transferData.pValue, size); return buffer; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/Clipboard.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/Clipboard.java index 82b750fe75..c8f2cb8598 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/Clipboard.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/Clipboard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -564,8 +564,8 @@ public String[] getAvailableTypeNames() { if (pName == 0) { continue; } - byte[] buffer = new byte [OS.strlen(pName)]; - OS.memmove (buffer, pName, buffer.length); + byte[] buffer = new byte [C.strlen(pName)]; + C.memmove (buffer, pName, buffer.length); OS.g_free (pName); result[count++] = "GTKCLIPBOARD "+new String (Converter.mbcsToWcs (buffer)); } @@ -574,8 +574,8 @@ public String[] getAvailableTypeNames() { if (pName == 0) { continue; } - byte[] buffer = new byte [OS.strlen(pName)]; - OS.memmove (buffer, pName, buffer.length); + byte[] buffer = new byte [C.strlen(pName)]; + C.memmove (buffer, pName, buffer.length); OS.g_free (pName); result[count++] = "GTKPRIMARYCLIPBOARD "+new String (Converter.mbcsToWcs (buffer)); } @@ -604,7 +604,7 @@ private int[] getAvailablePrimaryTypes() { long /*int*/ data = OS.gtk_selection_data_get_data(selection_data); if (length != 0) { types = new int[length * 8 / format]; - OS.memmove(types, data, length); + C.memmove(types, data, length); } } finally { OS.gtk_selection_data_free(selection_data); @@ -629,7 +629,7 @@ private int[] getAvailableClipboardTypes () { long /*int*/ data = OS.gtk_selection_data_get_data(selection_data); if (length != 0) { types = new int[length * 8 / format]; - OS.memmove(types, data, length); + C.memmove(types, data, length); } } finally { OS.gtk_selection_data_free(selection_data); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/ClipboardProxy.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/ClipboardProxy.java index 5798fdb912..f9c5e2ac21 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/ClipboardProxy.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/ClipboardProxy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -141,7 +141,7 @@ boolean setData(Clipboard owner, Object[] data, Transfer[] dataTypes, int clipbo entry.info = typeIds[j]; byte[] buffer = Converter.wcsToMbcs(typeNames[j], true); long /*int*/ pName = OS.g_malloc(buffer.length); - OS.memmove(pName, buffer, buffer.length); + C.memmove(pName, buffer, buffer.length); entry.target = pName; GtkTargetEntry[] tmp = new GtkTargetEntry [entries.length + 1]; System.arraycopy(entries, 0, tmp, 0, entries.length); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DragSource.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DragSource.java index 569d57e906..da257d127f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DragSource.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DragSource.java @@ -648,7 +648,7 @@ public void setTransfer(Transfer... transferAgents){ GtkTargetEntry entry = new GtkTargetEntry(); byte[] buffer = Converter.wcsToMbcs(typeNames[j], true); entry.target = OS.g_malloc(buffer.length); - OS.memmove(entry.target, buffer, buffer.length); + C.memmove(entry.target, buffer, buffer.length); entry.info = typeIds[j]; GtkTargetEntry[] newTargets = new GtkTargetEntry[targets.length + 1]; System.arraycopy(targets, 0, newTargets, 0, targets.length); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DropTarget.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DropTarget.java index bb2fa81f56..c780a732fd 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DropTarget.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DropTarget.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -686,7 +686,7 @@ public void setTransfer(Transfer... transferAgents){ GtkTargetEntry entry = new GtkTargetEntry(); byte[] buffer = Converter.wcsToMbcs(typeNames[j], true); entry.target = OS.g_malloc(buffer.length); - OS.memmove(entry.target, buffer, buffer.length); + C.memmove(entry.target, buffer, buffer.length); entry.info = typeIds[j]; GtkTargetEntry[] newTargets = new GtkTargetEntry[targets.length + 1]; System.arraycopy(targets, 0, newTargets, 0, targets.length); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/FileTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/FileTransfer.java index 68e6378ea5..f1190b8428 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/FileTransfer.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/FileTransfer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.swt.dnd; +import org.eclipse.swt.internal.*; import org.eclipse.swt.internal.gtk.*; /** @@ -95,9 +96,9 @@ public void javaToNative(Object object, TransferData transferData) { long /*int*/ uriPtr = OS.g_filename_to_uri(localePtr, 0, error); OS.g_free(localePtr); if (error[0] != 0 || uriPtr == 0) continue; - length = OS.strlen(uriPtr); + length = C.strlen(uriPtr); byte[] temp = new byte[length]; - OS.memmove (temp, uriPtr, length); + C.memmove (temp, uriPtr, length); OS.g_free(uriPtr); int newLength = (buffer.length > 0) ? buffer.length+separator.length+temp.length : temp.length; byte[] newBuffer = new byte[newLength]; @@ -113,8 +114,8 @@ public void javaToNative(Object object, TransferData transferData) { } if (buffer.length == 0) return; long /*int*/ ptr = OS.g_malloc(buffer.length+1); - OS.memset(ptr, '\0', buffer.length+1); - OS.memmove(ptr, buffer, buffer.length); + C.memset(ptr, '\0', buffer.length+1); + C.memmove(ptr, buffer, buffer.length); transferData.pValue = ptr; transferData.length = buffer.length; transferData.format = 8; @@ -136,7 +137,7 @@ public Object nativeToJava(TransferData transferData) { if ( !isSupportedType(transferData) || transferData.pValue == 0 || transferData.length <= 0 ) return null; int length = transferData.length; byte[] temp = new byte[length]; - OS.memmove(temp, transferData.pValue, length); + C.memmove(temp, transferData.pValue, length); boolean gnomeList = transferData.type == GNOME_LIST_ID; int sepLength = gnomeList ? 1 : 2; long /*int*/[] files = new long /*int*/[0]; @@ -150,7 +151,7 @@ public Object nativeToJava(TransferData transferData) { long /*int*/ file = OS.g_malloc(size + 1); byte[] fileBuffer = new byte[size + 1]; System.arraycopy(temp, offset, fileBuffer, 0, size); - OS.memmove(file, fileBuffer, size + 1); + C.memmove(file, fileBuffer, size + 1); long /*int*/[] newFiles = new long /*int*/[files.length + 1]; System.arraycopy(files, 0, newFiles, 0, files.length); newFiles[files.length] = file; @@ -164,7 +165,7 @@ public Object nativeToJava(TransferData transferData) { long /*int*/ file = OS.g_malloc(size + 1); byte[] fileBuffer = new byte[size + 1]; System.arraycopy(temp, offset, fileBuffer, 0, size); - OS.memmove(file, fileBuffer, size + 1); + C.memmove(file, fileBuffer, size + 1); long /*int*/[] newFiles = new long /*int*/[files.length + 1]; System.arraycopy(files, 0, newFiles, 0, files.length); newFiles[files.length] = file; @@ -186,7 +187,7 @@ public Object nativeToJava(TransferData transferData) { if (utf16Ptr == 0) continue; length = (int)/*64*/items_written[0]; char[] buffer = new char[length]; - OS.memmove(buffer, utf16Ptr, length * 2); + C.memmove(buffer, utf16Ptr, length * 2); OS.g_free(utf16Ptr); String name = new String(buffer); String[] newFileNames = new String[fileNames.length + 1]; diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/HTMLTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/HTMLTransfer.java index c17d7c75ed..38436f60ee 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/HTMLTransfer.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/HTMLTransfer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -67,7 +67,7 @@ public void javaToNative (Object object, TransferData transferData){ int byteCount = utf8.length; long /*int*/ pValue = OS.g_malloc(byteCount); if (pValue == 0) return; - OS.memmove(pValue, utf8, byteCount); + C.memmove(pValue, utf8, byteCount); transferData.length = byteCount; transferData.format = 8; transferData.pValue = pValue; @@ -91,16 +91,16 @@ public Object nativeToJava(TransferData transferData){ int size = (transferData.format * transferData.length / 8) / 2 * 2; if (size <= 0) return null; char[] bom = new char[1]; // look for a Byte Order Mark - if (size > 1) OS.memmove (bom, transferData.pValue, 2); + if (size > 1) C.memmove (bom, transferData.pValue, 2); String string; if (bom[0] == '\ufeff' || bom[0] == '\ufffe') { // utf16 char[] chars = new char [size/2]; - OS.memmove (chars, transferData.pValue, size); + C.memmove (chars, transferData.pValue, size); string = new String (chars); } else { byte[] utf8 = new byte[size]; - OS.memmove(utf8, transferData.pValue, size); + C.memmove(utf8, transferData.pValue, size); // convert utf8 byte array to a unicode string char [] unicode = org.eclipse.swt.internal.Converter.mbcsToWcs (utf8); string = new String (unicode); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/RTFTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/RTFTransfer.java index 4ca9e8e4fc..4ea14b6073 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/RTFTransfer.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/RTFTransfer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -68,7 +68,7 @@ public void javaToNative (Object object, TransferData transferData){ byte [] buffer = Converter.wcsToMbcs (string, true); long /*int*/ pValue = OS.g_malloc(buffer.length); if (pValue == 0) return; - OS.memmove(pValue, buffer, buffer.length); + C.memmove(pValue, buffer, buffer.length); transferData.length = buffer.length - 1; transferData.format = 8; transferData.pValue = pValue; @@ -91,7 +91,7 @@ public Object nativeToJava(TransferData transferData){ int size = transferData.format * transferData.length / 8; if (size == 0) return null; byte[] buffer = new byte[size]; - OS.memmove(buffer, transferData.pValue, size); + C.memmove(buffer, transferData.pValue, size); char [] chars = Converter.mbcsToWcs (buffer); String string = new String (chars); int end = string.indexOf('\0'); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDropTargetEffect.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDropTargetEffect.java index a7470282ce..baa03a90f6 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDropTargetEffect.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDropTargetEffect.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -143,7 +143,7 @@ public class TableDropTargetEffect extends DropTargetEffect { long /*int*/ indices = OS.gtk_tree_path_get_indices (path[0]); if (indices != 0) { int[] temp = new int[1]; - OS.memmove (temp, indices, 4); + C.memmove (temp, indices, 4); index = temp[0]; } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TextTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TextTransfer.java index 3f804ff711..5da8f52e7c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TextTransfer.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TextTransfer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -88,7 +88,7 @@ public void javaToNative (Object object, TransferData transferData) { if (transferData.type == UTF8_STRING_ID) { long /*int*/ pValue = OS.g_malloc(utf8.length); if (pValue == 0) return; - OS.memmove(pValue, utf8, utf8.length); + C.memmove(pValue, utf8, utf8.length); transferData.type = UTF8_STRING_ID; transferData.format = 8; transferData.length = utf8.length - 1; @@ -100,7 +100,7 @@ public void javaToNative (Object object, TransferData transferData) { if (string_target == 0) return; transferData.type = STRING_ID; transferData.format = 8; - transferData.length = OS.strlen(string_target); + transferData.length = C.strlen(string_target); transferData.pValue = string_target; transferData.result = 1; } @@ -122,10 +122,10 @@ public Object nativeToJava(TransferData transferData){ int count = OS.gdk_text_property_to_utf8_list_for_display(OS.gdk_display_get_default(), transferData.type, transferData.format, transferData.pValue, transferData.length, list); if (count == 0) return null; long /*int*/[] ptr = new long /*int*/[1]; - OS.memmove(ptr, list[0], OS.PTR_SIZEOF); - int length = OS.strlen(ptr[0]); + C.memmove(ptr, list[0], C.PTR_SIZEOF); + int length = C.strlen(ptr[0]); byte[] utf8 = new byte[length]; - OS.memmove(utf8, ptr[0], length); + C.memmove(utf8, ptr[0], length); OS.g_strfreev(list[0]); // convert utf8 byte array to a unicode string char [] unicode = Converter.mbcsToWcs (utf8); 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 5bfde4d3b9..9d75676c10 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -157,7 +157,7 @@ public class TreeDropTargetEffect extends DropTargetEffect { if (indices != 0) { int depth = OS.gtk_tree_path_get_depth(path[0]); int[] temp = new int[depth]; - OS.memmove (temp, indices, temp.length * 4); + C.memmove (temp, indices, temp.length * 4); index = temp[temp.length - 1]; } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/URLTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/URLTransfer.java index baed576105..b5a991676b 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/URLTransfer.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/URLTransfer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 IBM Corporation and others. + * Copyright (c) 2007, 2017 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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.swt.dnd; +import org.eclipse.swt.internal.*; import org.eclipse.swt.internal.gtk.*; /** @@ -69,7 +70,7 @@ public void javaToNative (Object object, TransferData transferData){ int byteCount = chars.length*2; long /*int*/ pValue = OS.g_malloc(byteCount); if (pValue == 0) return; - OS.memmove(pValue, chars, byteCount); + C.memmove(pValue, chars, byteCount); transferData.length = byteCount; transferData.format = 8; transferData.pValue = pValue; @@ -93,7 +94,7 @@ public Object nativeToJava(TransferData transferData){ int size = (transferData.format * transferData.length / 8) / 2 * 2; if (size <= 0) return null; char[] chars = new char [size/2]; - OS.memmove (chars, transferData.pValue, size); + C.memmove (chars, transferData.pValue, size); String string = new String (chars); int end = string.indexOf('\0'); return (end == -1) ? string : string.substring(0, end); 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 82c780fd2d..1ca20754b5 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 @@ -63,10 +63,10 @@ public class OS extends C { IsAIX = isAIX; IsSunOS = isSunOS; IsLinux = isLinux; IsHPUX = isHPUX; IsWin32 = isWin32; byte[] buffer = new byte[4]; - long /*int*/ ptr = OS.malloc(4); - OS.memmove(ptr, new int[]{1}, 4); - OS.memmove(buffer, ptr, 1); - OS.free(ptr); + long /*int*/ ptr = C.malloc(4); + C.memmove(ptr, new int[]{1}, 4); + C.memmove(buffer, ptr, 1); + C.free(ptr); BIG_ENDIAN = buffer[0] == 0; } @@ -75,7 +75,7 @@ public class OS extends C { if (!OS.IsWin32) { // only applicable for X11 but OS.isX11() is not available yet String scalingProperty = "GDK_SCALE"; - OS.setenv(ascii(scalingProperty), ascii("1"), 1); + C.setenv(ascii(scalingProperty), ascii("1"), 1); } String propertyName = "SWT_GTK3"; String gtk3 = getEnvironmentalVariable (propertyName); @@ -116,11 +116,11 @@ public class OS extends C { public static String getEnvironmentalVariable (String envVarName) { String envVarValue = null; - long /*int*/ ptr = OS.getenv(ascii(envVarName)); + long /*int*/ ptr = C.getenv(ascii(envVarName)); if (ptr != 0) { - int length = OS.strlen(ptr); + int length = C.strlen(ptr); byte[] buffer = new byte[length]; - OS.memmove(buffer, ptr, length); + C.memmove(buffer, ptr, length); char[] convertedChar = new char[buffer.length]; for (int i = 0; i < buffer.length; i++) { convertedChar[i]=(char)buffer[i]; @@ -16436,12 +16436,12 @@ public static final byte [] getThemeNameBytes() { if (ptr [0] == 0) { return buffer; } - length = OS.strlen (ptr [0]); + length = C.strlen (ptr [0]); if (length == 0) { return buffer; } buffer = new byte [length]; - OS.memmove (buffer, ptr [0], length); + C.memmove (buffer, ptr [0], length); OS.g_free (ptr [0]); return buffer; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/PrintDialog.java b/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/PrintDialog.java index 5c70da3999..8808376a0a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/PrintDialog.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/PrintDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -427,7 +427,7 @@ public PrinterData open() { int length = num_ranges[0]; int min = Integer.MAX_VALUE, max = 0; for (int i = 0; i < length; i++) { - OS.memmove(pageRange, page_ranges + i * pageRange.length * 4, pageRange.length * 4); + C.memmove(pageRange, page_ranges + i * pageRange.length * 4, pageRange.length * 4); min = Math.min(min, pageRange[0] + 1); max = Math.max(max, pageRange[1] + 1); } @@ -445,9 +445,9 @@ public PrinterData open() { data.printToFile = Printer.GTK_FILE_BACKEND.equals(data.driver); // TODO: GTK_FILE_BACKEND is not GTK API (see gtk bug 345590) if (data.printToFile) { long /*int*/ address = OS.gtk_print_settings_get(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI); - int length = OS.strlen (address); + int length = C.strlen (address); byte [] buffer = new byte [length]; - OS.memmove (buffer, address, length); + C.memmove (buffer, address, length); data.fileName = new String (Converter.mbcsToWcs (buffer)); } @@ -495,12 +495,12 @@ public PrinterData open() { } long /*int*/ GtkPrintSettingsFunc (long /*int*/ key, long /*int*/ value, long /*int*/ data) { - int length = OS.strlen (key); + int length = C.strlen (key); byte [] keyBuffer = new byte [length]; - OS.memmove (keyBuffer, key, length); - length = OS.strlen (value); + C.memmove (keyBuffer, key, length); + length = C.strlen (value); byte [] valueBuffer = new byte [length]; - OS.memmove (valueBuffer, value, length); + C.memmove (valueBuffer, value, length); store(keyBuffer, valueBuffer); return 0; } @@ -518,9 +518,9 @@ void store(String key, boolean value) { } void storeBytes(String key, long /*int*/ value) { - int length = OS.strlen (value); + int length = C.strlen (value); byte [] valueBuffer = new byte [length]; - OS.memmove (valueBuffer, value, length); + C.memmove (valueBuffer, value, length); store(key.getBytes(), valueBuffer); } 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 615784a453..6c4d5c1349 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 @@ -194,15 +194,15 @@ static long /*int*/ GtkPrinterFunc_FindNamedPrinter (long /*int*/ printer, long static PrinterData printerDataFromGtkPrinter(long /*int*/ printer) { long /*int*/ backend = OS.gtk_printer_get_backend(printer); long /*int*/ address = OS.G_OBJECT_TYPE_NAME(backend); - int length = OS.strlen (address); + int length = C.strlen (address); byte [] buffer = new byte [length]; - OS.memmove (buffer, address, length); + C.memmove (buffer, address, length); String backendType = new String (Converter.mbcsToWcs (buffer)); address = OS.gtk_printer_get_name (printer); - length = OS.strlen (address); + length = C.strlen (address); buffer = new byte [length]; - OS.memmove (buffer, address, length); + C.memmove (buffer, address, length); String name = new String (Converter.mbcsToWcs (buffer)); return new PrinterData (backendType, name); @@ -273,9 +273,9 @@ static byte [] uriFromFilename(String filename) { long /*int*/ uriPtr = OS.g_filename_to_uri(localePtr, 0, error); OS.g_free(localePtr); if (error[0] != 0 || uriPtr == 0) return null; - length = OS.strlen(uriPtr); + length = C.strlen(uriPtr); byte[] uri = new byte[length + 1]; - OS.memmove (uri, uriPtr, length); + C.memmove (uri, uriPtr, length); OS.g_free(uriPtr); return uri; } 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 795d063ea6..2273f0bd19 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -160,7 +160,7 @@ public ImageData getImageData() { int width = OS.gdk_pixbuf_get_width(pixbuf); boolean hasAlpha = OS.gdk_pixbuf_get_has_alpha(pixbuf); byte[] srcData = new byte[stride * height]; - OS.memmove(srcData, pixels, srcData.length); + C.memmove(srcData, pixels, srcData.length); OS.g_object_unref(pixbuf); if (hasAlpha) { PaletteData palette = new PaletteData(0xFF000000, 0xFF0000, 0xFF00); @@ -270,19 +270,19 @@ static Program gio_getProgram (Display display, long /*int*/ application) { byte[] buffer; long /*int*/ applicationName = OS.g_app_info_get_name (application); if (applicationName != 0) { - length = OS.strlen (applicationName); + length = C.strlen (applicationName); if (length > 0) { buffer = new byte [length]; - OS.memmove (buffer, applicationName, length); + C.memmove (buffer, applicationName, length); program.name = new String (Converter.mbcsToWcs (buffer)); } } long /*int*/ applicationCommand = OS.g_app_info_get_executable (application); if (applicationCommand != 0) { - length = OS.strlen (applicationCommand); + length = C.strlen (applicationCommand); if (length > 0) { buffer = new byte [length]; - OS.memmove (buffer, applicationCommand, length); + C.memmove (buffer, applicationCommand, length); program.command = new String (Converter.mbcsToWcs (buffer)); } } @@ -291,10 +291,10 @@ static Program gio_getProgram (Display display, long /*int*/ application) { if (icon != 0) { long /*int*/ icon_name = OS.g_icon_to_string(icon); if (icon_name != 0) { - length = OS.strlen(icon_name); + length = C.strlen(icon_name); if (length > 0) { buffer = new byte[length]; - OS.memmove(buffer, icon_name, length); + C.memmove(buffer, icon_name, length); program.iconPath = new String(Converter.mbcsToWcs(buffer)); } OS.g_free(icon_name); 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 08912350ed..977ced6ee6 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 @@ -224,7 +224,7 @@ class WebKit extends WebBrowser { long /*int*/ cookies = WebKitGTK.soup_cookie_jar_get_cookies (jar, uri, 0); WebKitGTK.soup_uri_free (uri); if (cookies == 0) return; - int length = OS.strlen (cookies); + int length = C.strlen (cookies); bytes = new byte[length]; C.memmove (bytes, cookies, length); OS.g_free (cookies); @@ -392,9 +392,9 @@ class WebKit extends WebBrowser { } static String getString (long /*int*/ strPtr) { - int length = OS.strlen (strPtr); + int length = C.strlen (strPtr); byte [] buffer = new byte [length]; - OS.memmove (buffer, strPtr, length); + C.memmove (buffer, strPtr, length); return new String (Converter.mbcsToWcs (buffer)); } @@ -613,7 +613,7 @@ long /*int*/ sessionProc (long /*int*/ session, long /*int*/ msg, long /*int*/ a long /*int*/ uriString = WebKitGTK.soup_uri_to_string (uri, 0); int length = C.strlen (uriString); byte[] bytes = new byte[length]; - OS.memmove (bytes, uriString, length); + C.memmove (bytes, uriString, length); OS.g_free (uriString); String location = new String (Converter.mbcsToWcs (bytes)); @@ -754,7 +754,7 @@ public void create (Composite parent, int style) { JSClassDefinition jsClassDefinition = new JSClassDefinition (); byte[] bytes = Converter.wcsToMbcs (CLASSNAME_EXTERNAL, true); jsClassDefinition.className = C.malloc (bytes.length); - OS.memmove (jsClassDefinition.className, bytes, bytes.length); + C.memmove (jsClassDefinition.className, bytes, bytes.length); jsClassDefinition.hasProperty = JSObjectHasPropertyProc.getAddress (); jsClassDefinition.getProperty = JSObjectGetPropertyProc.getAddress (); @@ -1397,9 +1397,9 @@ public String getText () { if (data == 0) return ""; //$NON-NLS-1$ long /*int*/ encoding = WebKitGTK.webkit_web_data_source_get_encoding (source); - int length = OS.strlen (encoding); + int length = C.strlen (encoding); byte[] bytes = new byte [length]; - OS.memmove (bytes, encoding, length); + C.memmove (bytes, encoding, length); String encodingString = new String (Converter.mbcsToWcs (bytes)); length = OS.GString_len (data); @@ -1422,9 +1422,9 @@ public String getUrl () { /* WebKit auto-navigates to about:blank at startup */ if (uri == 0) return ABOUT_BLANK; - int length = OS.strlen (uri); + int length = C.strlen (uri); byte[] bytes = new byte[length]; - OS.memmove (bytes, uri, length); + C.memmove (bytes, uri, length); String url = new String (Converter.mbcsToWcs (bytes)); /* @@ -1808,9 +1808,9 @@ boolean handleMouseEvent (String type, int screenX, int screenY, int detail, int } long /*int*/ handleLoadCommitted (long /*int*/ uri, boolean top) { - int length = OS.strlen (uri); + int length = C.strlen (uri); byte[] bytes = new byte[length]; - OS.memmove (bytes, uri, length); + C.memmove (bytes, uri, length); String url = new String (Converter.mbcsToWcs (bytes)); /* * If the URI indicates that the page is being rendered from memory @@ -1910,9 +1910,9 @@ private void fireProgressCompletedEvent(){ * (Webkit2 equivalent is webkit_load_changed()) */ long /*int*/ handleLoadFinished (long /*int*/ uri, boolean top) { - int length = OS.strlen (uri); + int length = C.strlen (uri); byte[] bytes = new byte[length]; - OS.memmove (bytes, uri, length); + C.memmove (bytes, uri, length); String url = new String (Converter.mbcsToWcs (bytes)); /* * If the URI indicates that the page is being rendered from memory @@ -2035,14 +2035,14 @@ void openDownloadWindow (final long /*int*/ webkitDownload) { shell.setLayout (gridLayout); long /*int*/ name = WebKitGTK.webkit_download_get_suggested_filename (webkitDownload); - int length = OS.strlen (name); + int length = C.strlen (name); byte[] bytes = new byte[length]; - OS.memmove (bytes, name, length); + C.memmove (bytes, name, length); String nameString = new String (Converter.mbcsToWcs (bytes)); long /*int*/ url = WebKitGTK.webkit_download_get_uri (webkitDownload); - length = OS.strlen (url); + length = C.strlen (url); bytes = new byte[length]; - OS.memmove (bytes, url, length); + C.memmove (bytes, url, length); String urlString = new String (Converter.mbcsToWcs (bytes)); msg = Compatibility.getMessage ("SWT_Download_Location", new Object[] {nameString, urlString}); //$NON-NLS-1$ Label nameLabel = new Label (shell, SWT.WRAP); @@ -2313,9 +2313,9 @@ long /*int*/ webkit_create_web_view (long /*int*/ web_view, long /*int*/ frame) long /*int*/ webkit_download_requested (long /*int*/ web_view, long /*int*/ download) { long /*int*/ name = WebKitGTK.webkit_download_get_suggested_filename (download); - int length = OS.strlen (name); + int length = C.strlen (name); byte[] bytes = new byte[length]; - OS.memmove (bytes, name, length); + C.memmove (bytes, name, length); final String nameString = new String (Converter.mbcsToWcs (bytes)); final long /*int*/ request = WebKitGTK.webkit_download_get_network_request (download); @@ -2376,9 +2376,9 @@ long /*int*/ webkit_mouse_target_changed (long /*int*/ web_view, long /*int*/ hi */ long /*int*/ webkit_hovering_over_link (long /*int*/ web_view, long /*int*/ title, long /*int*/ uri) { if (uri != 0) { - int length = OS.strlen (uri); + int length = C.strlen (uri); byte[] bytes = new byte[length]; - OS.memmove (bytes, uri, length); + C.memmove (bytes, uri, length); String text = new String (Converter.mbcsToWcs (bytes)); StatusTextEvent event = new StatusTextEvent (browser); event.display = browser.getDisplay (); @@ -2421,9 +2421,9 @@ long /*int*/ webkit_navigation_policy_decision_requested (long /*int*/ web_view, } long /*int*/ uri = WebKitGTK.webkit_network_request_get_uri (request); - int length = OS.strlen (uri); + int length = C.strlen (uri); byte[] bytes = new byte[length]; - OS.memmove (bytes, uri, length); + C.memmove (bytes, uri, length); String url = new String (Converter.mbcsToWcs (bytes)); /* @@ -2646,9 +2646,9 @@ long /*int*/ webkit_notify_title (long /*int*/ web_view, long /*int*/ pspec) { if (title == 0) { titleString = ""; //$NON-NLS-1$ } else { - int length = OS.strlen (title); + int length = C.strlen (title); byte[] bytes = new byte[length]; - OS.memmove (bytes, title, length); + C.memmove (bytes, title, length); titleString = new String (Converter.mbcsToWcs (bytes)); } TitleEvent event = new TitleEvent (browser); @@ -2803,9 +2803,9 @@ long /*int*/ webkit_resource_request_starting (long /*int*/ web_view, long /*int * status bar now only changes when you hover you mouse over it. */ long /*int*/ webkit_status_bar_text_changed (long /*int*/ web_view, long /*int*/ text) { - int length = OS.strlen (text); + int length = C.strlen (text); byte[] bytes = new byte[length]; - OS.memmove (bytes, text, length); + C.memmove (bytes, text, length); StatusTextEvent statusText = new StatusTextEvent (browser); statusText.display = browser.getDisplay (); statusText.widget = browser; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Cursor.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Cursor.java index cd3cea4fe6..c0ec9d94bc 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Cursor.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Cursor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -367,7 +367,7 @@ public Cursor(Device device, ImageData source, int hotspotX, int hotspotY) { } } } - OS.memmove(data, buffer, stride * height); + C.memmove(data, buffer, stride * height); handle = OS.gdk_cursor_new_from_pixbuf(display, pixbuf, hotspotX, hotspotY); OS.g_object_unref(pixbuf); } else { @@ -502,7 +502,7 @@ long /*int*/ createCursor(byte[] sourceData, byte[] maskData, int width, int hei if (pixbuf == 0) SWT.error(SWT.ERROR_NO_HANDLES); int stride = OS.gdk_pixbuf_get_rowstride(pixbuf); long /*int*/ pixels = OS.gdk_pixbuf_get_pixels(pixbuf); - OS.memmove(pixels, data, stride * height); + C.memmove(pixels, data, stride * height); long /*int*/ cursor = OS.gdk_cursor_new_from_pixbuf(OS.gdk_display_get_default(), pixbuf, hotspotX, hotspotY); OS.g_object_unref(pixbuf); return cursor; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java index 32adc3569f..4fcb25df82 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -428,20 +428,20 @@ public FontData[] getFontList (String faceName, boolean scalable) { int nFds = 0; FontData[] fds = new FontData[faceName != null ? 4 : n_families[0]]; for (int i=0; i<n_families[0]; i++) { - OS.memmove(family, families[0] + i * OS.PTR_SIZEOF, OS.PTR_SIZEOF); + C.memmove(family, families[0] + i * C.PTR_SIZEOF, C.PTR_SIZEOF); boolean match = true; if (faceName != null) { long /*int*/ familyName = OS.pango_font_family_get_name(family[0]); - int length = OS.strlen(familyName); + int length = C.strlen(familyName); byte[] buffer = new byte[length]; - OS.memmove(buffer, familyName, length); + C.memmove(buffer, familyName, length); String name = new String(Converter.mbcsToWcs(buffer)); match = faceName.equalsIgnoreCase(name); } if (match) { OS.pango_font_family_list_faces(family[0], faces, n_faces); for (int j=0; j<n_faces[0]; j++) { - OS.memmove(face, faces[0] + j * OS.PTR_SIZEOF, OS.PTR_SIZEOF); + C.memmove(face, faces[0] + j * C.PTR_SIZEOF, C.PTR_SIZEOF); long /*int*/ fontDesc = OS.pango_font_face_describe(face[0]); Font font = Font.gtk_new(this, fontDesc); FontData data = font.getFontData()[0]; @@ -573,7 +573,7 @@ protected void init () { DPIUtil.setDeviceZoom (scaleFactor); //TODO: Remove; temporary code only - boolean fixAIX = OS.IsAIX && OS.PTR_SIZEOF == 8; + boolean fixAIX = OS.IsAIX && C.PTR_SIZEOF == 8; if (debug || fixAIX) { if (xDisplay != 0) { @@ -973,7 +973,7 @@ static long /*int*/ XErrorProc (long /*int*/ xDisplay, long /*int*/ xErrorEvent) new SWTError ().printStackTrace (); } //TODO: Remove; temporary code only - boolean fixAIX = OS.IsAIX && OS.PTR_SIZEOF == 8; + boolean fixAIX = OS.IsAIX && C.PTR_SIZEOF == 8; if (!fixAIX) OS.Call (XErrorProc, xDisplay, xErrorEvent); } } else { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Font.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Font.java index e2e99e15b1..6c1bf75f78 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Font.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Font.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -189,9 +189,9 @@ public FontData[] getFontData() { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); long /*int*/ family = OS.pango_font_description_get_family(handle); - int length = OS.strlen(family); + int length = C.strlen(family); byte[] buffer = new byte[length]; - OS.memmove(buffer, family, length); + C.memmove(buffer, family, length); String name = new String(Converter.mbcsToWcs(buffer)); float height = (float)OS.pango_font_description_get_size(handle) / OS.PANGO_SCALE; Point dpi = device.dpi, screenDPI = device.getScreenDPI(); @@ -203,9 +203,9 @@ public FontData[] getFontData() { if (pangoStyle == OS.PANGO_STYLE_OBLIQUE) style |= SWT.ROMAN; if (pangoWeight >= OS.PANGO_WEIGHT_BOLD) style |= SWT.BOLD; long /*int*/ fontString = OS.pango_font_description_to_string (handle); - length = OS.strlen (fontString); + length = C.strlen (fontString); buffer = new byte [length + 1]; - OS.memmove (buffer, fontString, length); + C.memmove (buffer, fontString, length); OS.g_free (fontString); FontData data = new FontData(name, size, style); data.string = buffer; 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 5339794a5a..0a8d71d3d3 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 @@ -2811,9 +2811,9 @@ static void setCairoFont(long /*int*/ cairo, Font font) { static void setCairoFont(long /*int*/ cairo, long /*int*/ font) { long /*int*/ family = OS.pango_font_description_get_family(font); - int length = OS.strlen(family); + int length = C.strlen(family); byte[] buffer = new byte[length + 1]; - OS.memmove(buffer, family, length); + C.memmove(buffer, family, length); //TODO - convert font height from pango to cairo double height = OS.PANGO_PIXELS(OS.pango_font_description_get_size(font)) * 96 / 72; int pangoStyle = OS.pango_font_description_get_style(font); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java index 2ec5ab14a2..ee212f88b1 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java @@ -321,7 +321,7 @@ public Image(Device device, Image srcImage, int flag) { int oneBlue = oneRGB.blue; byte[] line = new byte[stride]; for (int y=0; y<height; y++) { - OS.memmove(line, data + (y * stride), stride); + C.memmove(line, data + (y * stride), stride); for (int x=0, offset=0; x<width; x++, offset += 4) { int a = line[offset + oa] & 0xFF; int r = line[offset + or] & 0xFF; @@ -355,14 +355,14 @@ public Image(Device device, Image srcImage, int flag) { line[offset + og] = (byte)g; line[offset + ob] = (byte)b; } - OS.memmove(data + (y * stride), line, stride); + C.memmove(data + (y * stride), line, stride); } break; } case SWT.IMAGE_GRAY: { byte[] line = new byte[stride]; for (int y=0; y<height; y++) { - OS.memmove(line, data + (y * stride), stride); + C.memmove(line, data + (y * stride), stride); for (int x=0, offset = 0; x<width; x++, offset += 4) { int a = line[offset + oa] & 0xFF; int r = line[offset + or] & 0xFF; @@ -381,7 +381,7 @@ public Image(Device device, Image srcImage, int flag) { } line[offset+or] = line[offset+og] = line[offset+ob] = (byte)intensity; } - OS.memmove(data + (y * stride), line, stride); + C.memmove(data + (y * stride), line, stride); } break; } @@ -825,7 +825,7 @@ void createFromPixbuf(int type, long /*int*/ pixbuf) { if (hasAlpha) { alphaData = new byte[width * height]; for (int y = 0, alphaOffset = 0; y < height; y++) { - OS.memmove(line, pixels + (y * stride), stride); + C.memmove(line, pixels + (y * stride), stride); for (int x = 0, offset = 0; x < width; x++, offset += 4) { int a = line[offset + 3] & 0xFF; int r = ((line[offset + 0] & 0xFF) * a) + 128; @@ -840,12 +840,12 @@ void createFromPixbuf(int type, long /*int*/ pixbuf) { line[offset + ob] = (byte)b; alphaData[alphaOffset++] = (byte)a; } - OS.memmove(data + (y * stride), line, stride); + C.memmove(data + (y * stride), line, stride); } } else { byte[] cairoLine = new byte[cairoStride]; for (int y = 0; y < height; y++) { - OS.memmove(line, pixels + (y * stride), stride); + C.memmove(line, pixels + (y * stride), stride); for (int x = 0, offset = 0, cairoOffset = 0; x < width; x++, offset += 3, cairoOffset += 4) { int r = line[offset + 0] & 0xFF; int g = line[offset + 1] & 0xFF; @@ -854,7 +854,7 @@ void createFromPixbuf(int type, long /*int*/ pixbuf) { cairoLine[cairoOffset + og] = (byte)g; cairoLine[cairoOffset + ob] = (byte)b; } - OS.memmove(data + (y * cairoStride), cairoLine, cairoStride); + C.memmove(data + (y * cairoStride), cairoLine, cairoStride); } } Cairo.cairo_surface_mark_dirty(surface); @@ -881,7 +881,7 @@ void createMask() { tb = (transparentPixel >> 0) & 0xFF; } byte[] srcData = new byte[stride * height]; - OS.memmove(srcData, surfaceData, srcData.length); + C.memmove(srcData, surfaceData, srcData.length); int offset = 0; for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++, offset += 4) { @@ -900,7 +900,7 @@ void createMask() { srcData[offset + ob] = (byte)b; } } - OS.memmove(surfaceData, srcData, srcData.length); + C.memmove(surfaceData, srcData, srcData.length); } void createSurface() { @@ -937,8 +937,8 @@ void createSurface() { byte[] maskLine = new byte[maskStride]; long /*int*/ offset = pixels, maskOffset = maskPixels; for (int y=0; y<height; y++) { - OS.memmove(line, offset, stride); - OS.memmove(maskLine, maskOffset, maskStride); + C.memmove(line, offset, stride); + C.memmove(maskLine, maskOffset, maskStride); for (int x=0, offset1=0; x<width; x++, offset1 += 4) { if (maskLine[x * 3] == 0) { line[offset1 + 0] = line[offset1 + 1] = line[offset1 + 2] = line[offset1 + 3] = 0; @@ -952,7 +952,7 @@ void createSurface() { line[offset1 + ob] = b; } } - OS.memmove(offset, line, stride); + C.memmove(offset, line, stride); offset += stride; maskOffset += maskStride; } @@ -960,7 +960,7 @@ void createSurface() { } else if (alpha != -1) { long /*int*/ offset = pixels; for (int y=0; y<height; y++) { - OS.memmove(line, offset, stride); + C.memmove(line, offset, stride); for (int x=0, offset1=0; x<width; x++, offset1 += 4) { /* pre-multiplied alpha */ int r = ((line[offset1 + 0] & 0xFF) * alpha) + 128; @@ -974,13 +974,13 @@ void createSurface() { line[offset1 + og] = (byte)g; line[offset1 + ob] = (byte)b; } - OS.memmove(offset, line, stride); + C.memmove(offset, line, stride); offset += stride; } } else if (alphaData != null) { long /*int*/ offset = pixels; for (int y = 0; y < h [0]; y++) { - OS.memmove (line, offset, stride); + C.memmove (line, offset, stride); for (int x=0, offset1=0; x<width; x++, offset1 += 4) { int alpha = alphaData [y*w [0]+x] & 0xFF; /* pre-multiplied alpha */ @@ -995,13 +995,13 @@ void createSurface() { line[offset1 + og] = (byte)g; line[offset1 + ob] = (byte)b; } - OS.memmove (offset, line, stride); + C.memmove (offset, line, stride); offset += stride; } } else { long /*int*/ offset = pixels; for (int y = 0; y < h [0]; y++) { - OS.memmove (line, offset, stride); + C.memmove (line, offset, stride); for (int x=0, offset1=0; x<width; x++, offset1 += 4) { byte r = line[offset1 + 0]; byte g = line[offset1 + 1]; @@ -1011,13 +1011,13 @@ void createSurface() { line[offset1 + og] = g; line[offset1 + ob] = b; } - OS.memmove (offset, line, stride); + C.memmove (offset, line, stride); offset += stride; } } surface = Cairo.cairo_image_surface_create(Cairo.CAIRO_FORMAT_ARGB32, width, height); long /*int*/ data = Cairo.cairo_image_surface_get_data(surface); - OS.memmove(data, pixels, stride * height); + C.memmove(data, pixels, stride * height); Cairo.cairo_surface_mark_dirty(surface); OS.g_object_unref(pixbuf); } else { @@ -1199,7 +1199,7 @@ public ImageData getImageDataAtCurrentZoom () { oa = 3; or = 2; og = 1; ob = 0; } byte[] srcData = new byte[stride * height]; - OS.memmove(srcData, surfaceData, srcData.length); + C.memmove(srcData, surfaceData, srcData.length); PaletteData palette = new PaletteData(0xFF0000, 0xFF00, 0xFF); ImageData data = new ImageData(width, height, 32, palette, 4, srcData); if (hasAlpha) { @@ -1519,7 +1519,7 @@ void init(ImageData image) { } } } - OS.memmove(data, buffer, stride * height); + C.memmove(data, buffer, stride * height); Cairo.cairo_surface_mark_dirty(surface); } 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 928baef7e7..b790a26176 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 @@ -179,7 +179,7 @@ void computeRuns () { } } } - int strlen = OS.strlen(ptr); + int strlen = C.strlen(ptr); Font defaultFont = font != null ? font : device.systemFont; for (int i = 0; i < stylesCount - 1; i++) { StyleItem styleItem = styles[i]; @@ -577,7 +577,7 @@ void drawInPixels(GC gc, int x, int y, int selectionStart, int selectionEnd, Col Cairo.cairo_scale(cairo, -1, 1); Cairo.cairo_translate(cairo, -2 * x - width(), 0); } - drawWithCairo(gc, x, y, 0, OS.strlen(ptr), fullSelection, selectionForeground, selectionBackground); + drawWithCairo(gc, x, y, 0, C.strlen(ptr), fullSelection, selectionForeground, selectionBackground); if ((data.style & SWT.MIRRORED) != 0) { Cairo.cairo_restore(cairo); } @@ -585,7 +585,7 @@ void drawInPixels(GC gc, int x, int y, int selectionStart, int selectionEnd, Col long /*int*/ ptr = OS.pango_layout_get_text(layout); int byteSelStart = (int)/*64*/(OS.g_utf16_offset_to_pointer(ptr, selectionStart) - ptr); int byteSelEnd = (int)/*64*/(OS.g_utf16_offset_to_pointer(ptr, selectionEnd + 1) - ptr); - int strlen = OS.strlen(ptr); + int strlen = C.strlen(ptr); byteSelStart = Math.min(byteSelStart, strlen); byteSelEnd = Math.min(byteSelEnd, strlen); if ((data.style & SWT.MIRRORED) != 0) { @@ -841,7 +841,7 @@ Rectangle getBoundsInPixels(int start, int end) { long /*int*/ ptr = OS.pango_layout_get_text(layout); 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 strlen = OS.strlen(ptr); + int strlen = C.strlen(ptr); byteStart = Math.min(byteStart, strlen); byteEnd = Math.min(byteEnd, strlen); int[] ranges = new int[]{byteStart, byteEnd}; @@ -984,7 +984,7 @@ public int getLevel(int offset) { PangoLayoutRun run = new PangoLayoutRun(); long /*int*/ ptr = OS.pango_layout_get_text(layout); long /*int*/ byteOffset = OS.g_utf16_offset_to_pointer(ptr, offset) - ptr; - int strlen = OS.strlen(ptr); + int strlen = C.strlen(ptr); byteOffset = Math.min(byteOffset, strlen); do { long /*int*/ runPtr = OS.pango_layout_iter_get_run(iter); @@ -1082,7 +1082,7 @@ public int getLineIndex(int offset) { int line = 0; long /*int*/ ptr = OS.pango_layout_get_text(layout); long /*int*/ byteOffset = OS.g_utf16_offset_to_pointer(ptr,offset) - ptr; - int strlen = OS.strlen(ptr); + int strlen = C.strlen(ptr); byteOffset = Math.min(byteOffset, strlen); long /*int*/ iter = OS.pango_layout_get_iter(layout); if (iter == 0) SWT.error(SWT.ERROR_NO_HANDLES); @@ -1193,7 +1193,7 @@ Point getLocationInPixels(int offset, boolean trailing) { offset = translateOffset(offset); long /*int*/ ptr = OS.pango_layout_get_text(layout); int byteOffset = (int)/*64*/(OS.g_utf16_offset_to_pointer(ptr, offset) - ptr); - int strlen = OS.strlen(ptr); + int strlen = C.strlen(ptr); byteOffset = Math.min(byteOffset, strlen); PangoRectangle pos = new PangoRectangle(); OS.pango_layout_index_to_pos(layout, byteOffset, pos); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/Converter.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/Converter.java index 8e1ff2f3ae..8dc389540c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/Converter.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/Converter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -57,7 +57,7 @@ public static char [] mbcsToWcs (byte [] buffer) { if (ptr == 0) return EmptyCharArray; int length = (int)/*64*/items_written [0]; char [] chars = new char [length]; - OS.memmove (chars, ptr, length * 2); + C.memmove (chars, ptr, length * 2); OS.g_free (ptr); return chars; } @@ -96,9 +96,9 @@ public static byte [] wcsToMbcs (String string, boolean terminate) { * @return a Java String object. */ public static String cCharPtrToJavaString(long /*int*/ cCharPtr, boolean freecCharPtr) { - int length = OS.strlen (cCharPtr); + int length = C.strlen (cCharPtr); byte[] buffer = new byte [length]; - OS.memmove (buffer, cCharPtr, length); + C.memmove (buffer, cCharPtr, length); if (freecCharPtr) { OS.g_free (cCharPtr); } @@ -125,7 +125,7 @@ public static byte [] wcsToMbcs (char [] chars, boolean terminate) { if (ptr == 0) return terminate ? NullByteArray : EmptyByteArray; int written = (int)/*64*/items_written [0]; byte [] bytes = new byte [written + (terminate ? 1 : 0)]; - OS.memmove (bytes, ptr, written); + C.memmove (bytes, ptr, written); OS.g_free (ptr); return bytes; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/ImageList.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/ImageList.java index 9a0e2a674b..ea88e4dbba 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/ImageList.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/ImageList.java @@ -66,7 +66,7 @@ public static long /*int*/ createPixbuf(Image image) { long /*int*/ surfaceData = Cairo.cairo_image_surface_get_data(surface); if (hasAlpha) { for (int y = 0; y < height; y++) { - OS.memmove (line, surfaceData + (y * stride), stride); + C.memmove (line, surfaceData + (y * stride), stride); for (int x = 0, offset = 0; x < width; x++, offset += 4) { int a = line[offset + oa] & 0xFF; int r = line[offset + or] & 0xFF; @@ -79,13 +79,13 @@ public static long /*int*/ createPixbuf(Image image) { line[offset + 2] = (byte)(((b * 0xFF) + a / 2) / a); } } - OS.memmove (pixels + (y * stride), line, stride); + C.memmove (pixels + (y * stride), line, stride); } } else { int cairoStride = Cairo.cairo_image_surface_get_stride(surface); byte[] cairoLine = new byte[cairoStride]; for (int y = 0; y < height; y++) { - OS.memmove (cairoLine, surfaceData + (y * cairoStride), cairoStride); + C.memmove (cairoLine, surfaceData + (y * cairoStride), cairoStride); for (int x = 0, offset = 0, cairoOffset = 0; x < width; x++, offset += 3, cairoOffset += 4) { byte r = cairoLine[cairoOffset + or]; byte g = cairoLine[cairoOffset + og]; @@ -94,7 +94,7 @@ public static long /*int*/ createPixbuf(Image image) { line[offset + 1] = g; line[offset + 2] = b; } - OS.memmove (pixels + (y * stride), line, stride); + C.memmove (pixels + (y * stride), line, stride); } } Cairo.cairo_surface_destroy(surface); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java index 415d59ff8a..88101b5b67 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -205,10 +205,10 @@ public RGB open () { } } long /*int*/ strPtr = OS.gtk_color_selection_palette_to_string(gdkColors, rgbs.length); - int length = OS.strlen (strPtr); + int length = C.strlen (strPtr); buffer = new byte [length]; - OS.memmove (buffer, strPtr, length); + C.memmove (buffer, strPtr, length); String paletteString = new String (Converter.mbcsToWcs (buffer)); buffer = Converter.wcsToMbcs (paletteString, true); OS.g_free (gdkColors); @@ -272,9 +272,9 @@ public RGB open () { long /*int*/ [] ptr = new long /*int*/ [1]; OS.g_object_get (settings, OS.gtk_color_palette, ptr, 0); if (ptr [0] != 0) { - int length = OS.strlen (ptr [0]); + int length = C.strlen (ptr [0]); buffer = new byte [length]; - OS.memmove (buffer, ptr [0], length); + C.memmove (buffer, ptr [0], length); OS.g_free (ptr [0]); String [] gdkColorStrings = null; if (length > 0) { 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 401664dd25..fa90f997ec 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 @@ -383,7 +383,7 @@ void clearText () { 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); + if (ptr [0] != 0 && C.strlen (ptr [0]) > 0) postEvent (SWT.Modify); OS.g_free (ptr [0]); } } else { @@ -1129,9 +1129,9 @@ public String getText () { if (entryHandle != 0) { long /*int*/ str = OS.gtk_entry_get_text (entryHandle); if (str == 0) return ""; - int length = OS.strlen (str); + int length = C.strlen (str); byte [] buffer = new byte [length]; - OS.memmove (buffer, str, length); + C.memmove (buffer, str, length); return new String (Converter.mbcsToWcs (buffer)); } else { int index = OS.gtk_combo_box_get_active (handle); @@ -1293,10 +1293,10 @@ long /*int*/ gtk_changed (long /*int*/ widget) { long /*int*/ gtk_commit (long /*int*/ imContext, long /*int*/ text) { if (text == 0) return 0; if (!OS.gtk_editable_get_editable (entryHandle)) return 0; - int length = OS.strlen (text); + int length = C.strlen (text); if (length == 0) return 0; byte [] buffer = new byte [length]; - OS.memmove (buffer, text, length); + C.memmove (buffer, text, length); char [] chars = Converter.mbcsToWcs (buffer); char [] newChars = sendIMKeyEvent (SWT.KeyDown, null, chars); if (newChars == null) return 0; @@ -1420,10 +1420,10 @@ long /*int*/ gtk_insert_text (long /*int*/ widget, long /*int*/ new_text, long / 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]; - OS.memmove (buffer, new_text, buffer.length); + C.memmove (buffer, new_text, buffer.length); String oldText = new String (Converter.mbcsToWcs (buffer)); int [] pos = new int [1]; - OS.memmove (pos, position, 4); + C.memmove (pos, position, 4); long /*int*/ ptr = OS.gtk_entry_get_text (entryHandle); if (pos [0] == -1) pos [0] = (int)/*64*/OS.g_utf8_strlen (ptr, -1); int start = (int)/*64*/OS.g_utf8_offset_to_utf16_offset (ptr, pos [0]); @@ -1450,7 +1450,7 @@ long /*int*/ gtk_insert_text (long /*int*/ widget, long /*int*/ new_text, long / fixStart = newStart [0]; fixEnd = newEnd [0]; } - OS.memmove (position, pos, 4); + C.memmove (position, pos, 4); OS.g_signal_stop_emission_by_name (entryHandle, OS.insert_text); } return 0; @@ -2346,7 +2346,7 @@ boolean translateTraversal (GdkEventKey keyEvent) { long /*int*/ [] preeditString = new long /*int*/ [1]; OS.gtk_im_context_get_preedit_string (imContext, preeditString, null, null); if (preeditString [0] != 0) { - int length = OS.strlen (preeditString [0]); + int length = C.strlen (preeditString [0]); OS.g_free (preeditString [0]); if (length != 0) return false; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java index aad4f885c2..cd141d50e9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java @@ -1207,8 +1207,8 @@ void moveAbove (long /*int*/ child, long /*int*/ sibling) { long /*int*/ [] widget = new long /*int*/ [1]; long /*int*/ childData = 0, childLink = 0, siblingLink = 0, temp = children; while (temp != 0) { - OS.memmove (data, temp, OS.PTR_SIZEOF); - OS.memmove (widget, data [0], OS.PTR_SIZEOF); + C.memmove (data, temp, C.PTR_SIZEOF); + C.memmove (widget, data [0], C.PTR_SIZEOF); if (child == widget [0]) { childLink = temp; childData = data [0]; @@ -1252,8 +1252,8 @@ void moveBelow (long /*int*/ child, long /*int*/ sibling) { long /*int*/ [] widget = new long /*int*/ [1]; long /*int*/ childData = 0, childLink = 0, siblingLink = 0, temp = children; while (temp != 0) { - OS.memmove (data, temp, OS.PTR_SIZEOF); - OS.memmove (widget, data [0], OS.PTR_SIZEOF); + C.memmove (data, temp, C.PTR_SIZEOF); + C.memmove (widget, data [0], C.PTR_SIZEOF); if (child == widget [0]) { childLink = temp; childData = data [0]; 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 4ea3384a3a..8eb2682430 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 @@ -3332,10 +3332,10 @@ long /*int*/ gtk_button_release_event (long /*int*/ widget, long /*int*/ event) @Override long /*int*/ gtk_commit (long /*int*/ imcontext, long /*int*/ text) { if (text == 0) return 0; - int length = OS.strlen (text); + int length = C.strlen (text); if (length == 0) return 0; byte [] buffer = new byte [length]; - OS.memmove (buffer, text, length); + C.memmove (buffer, text, length); char [] chars = Converter.mbcsToWcs (buffer); sendIMKeyEvent (SWT.KeyDown, null, chars); return 0; @@ -4561,7 +4561,7 @@ void setBackgroundGdkColor (long /*int*/ handle, GdkColor color) { if (pixmapName != null) { byte[] buffer = Converter.wcsToMbcs (pixmapName, true); ptr = OS.g_malloc (buffer.length); - OS.memmove (ptr, buffer, buffer.length); + C.memmove (ptr, buffer, buffer.length); } OS.gtk_rc_style_set_bg_pixmap_name (style, index, ptr); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java index 717bffd051..e4baa0fc7d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java @@ -2033,9 +2033,9 @@ String getText () { if (textEntryHandle != 0) { long /*int*/ str = OS.gtk_entry_get_text (textEntryHandle); if (str == 0) return ""; - int length = OS.strlen (str); + int length = C.strlen (str); byte [] buffer = new byte [length]; - OS.memmove (buffer, str, length); + C.memmove (buffer, str, length); return new String (Converter.mbcsToWcs (buffer)); } return ""; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Decorations.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Decorations.java index 0419e351ad..7b1c55e45c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Decorations.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Decorations.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -188,7 +188,7 @@ void _setImages (Image [] images) { long /*int*/ [] data = new long /*int*/ [1]; long /*int*/ temp = pixbufs; while (temp != 0) { - OS.memmove (data, temp, OS.PTR_SIZEOF); + C.memmove (data, temp, C.PTR_SIZEOF); OS.g_object_unref (data [0]); temp = OS.g_list_next (temp); } 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 354c76efc9..03a773b14c 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -235,7 +235,7 @@ String openChooserDialog () { if (utf16Ptr != 0) { int clength = (int)/*64*/items_written [0]; char [] chars = new char [clength]; - OS.memmove (chars, utf16Ptr, clength * 2); + C.memmove (chars, utf16Ptr, clength * 2); OS.g_free (utf16Ptr); answer = new String (chars); filterPath = answer; 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 ab74e30c8e..41e75eefef 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 @@ -5710,7 +5710,7 @@ long /*int*/ signalProc (long /*int*/ gobject, long /*int*/ arg1, long /*int*/ u if (nitems [0] > 0) { byte [] buffer = new byte [nitems [0]]; - OS.memmove(buffer, data [0], buffer.length); + C.memmove(buffer, data [0], buffer.length); OS.XFree (data [0]); char[] chars = Converter.mbcsToWcs(buffer); String string = new String (chars); 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 8dad8b4521..ed86a6b733 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -130,7 +130,7 @@ String computeResultChooserDialog () { if (utf16Ptr != 0) { int clength = (int)/*64*/items_written [0]; char [] chars = new char [clength]; - OS.memmove (chars, utf16Ptr, clength * 2); + C.memmove (chars, utf16Ptr, clength * 2); OS.g_free (utf16Ptr); fullPath = new String (chars); fileNames [writePos++] = fullPath.substring (fullPath.lastIndexOf (SEPARATOR) + 1); @@ -163,7 +163,7 @@ String computeResultChooserDialog () { if (utf16Ptr != 0) { int clength = (int)/*64*/items_written [0]; char [] chars = new char [clength]; - OS.memmove (chars, utf16Ptr, clength * 2); + C.memmove (chars, utf16Ptr, clength * 2); OS.g_free (utf16Ptr); fullPath = new String (chars); fileNames = new String [1]; @@ -176,9 +176,9 @@ String computeResultChooserDialog () { if (filter != 0) { long /*int*/ filterNamePtr = OS.gtk_file_filter_get_name (filter); if (filterNamePtr != 0) { - int length = OS.strlen (filterNamePtr); + int length = C.strlen (filterNamePtr); byte[] buffer = new byte [length]; - OS.memmove (buffer, filterNamePtr, length); + C.memmove (buffer, filterNamePtr, length); //OS.g_free (filterNamePtr); //GTK owns this pointer - do not free String filterName = new String (Converter.mbcsToWcs (buffer)); for (int i = 0; i < filterExtensions.length; i++) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FontDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FontDialog.java index 2985c2ddd5..e6550f4685 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FontDialog.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FontDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -12,9 +12,9 @@ package org.eclipse.swt.widgets; import org.eclipse.swt.*; +import org.eclipse.swt.graphics.*; import org.eclipse.swt.internal.*; import org.eclipse.swt.internal.gtk.*; -import org.eclipse.swt.graphics.*; /** * Instances of this class allow the user to select a font @@ -172,9 +172,9 @@ public FontData open () { if (fontData != null) { Font font = new Font (display, fontData); long /*int*/ fontName = OS.pango_font_description_to_string (font.handle); - int length = OS.strlen (fontName); + int length = C.strlen (fontName); byte [] buffer = new byte [length + 1]; - OS.memmove (buffer, fontName, length); + C.memmove (buffer, fontName, length); font.dispose(); OS.g_free (fontName); gtk_font_chooser_set_font (handle, buffer); @@ -210,9 +210,9 @@ public FontData open () { boolean success = response == OS.GTK_RESPONSE_OK; if (success) { long /*int*/ fontName = gtk_font_chooser_get_font (handle); - int length = OS.strlen (fontName); + int length = C.strlen (fontName); byte [] buffer = new byte [length + 1]; - OS.memmove (buffer, fontName, length); + C.memmove (buffer, fontName, length); OS.g_free (fontName); long /*int*/ fontDesc = OS.pango_font_description_from_string (buffer); Font font = Font.gtk_new (display, fontDesc); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/IME.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/IME.java index fc7608d996..92540ebbbc 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/IME.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/IME.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 IBM Corporation and others. + * Copyright (c) 2007, 2017 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 @@ -258,10 +258,10 @@ long /*int*/ gtk_commit (long /*int*/ imcontext, long /*int*/ textPtr) { styles = null; caretOffset = commitCount = 0; if (textPtr != 0 && inComposition) { - int length = OS.strlen (textPtr); + int length = C.strlen (textPtr); if (length != 0) { byte [] buffer = new byte [length]; - OS.memmove (buffer, textPtr, length); + C.memmove (buffer, textPtr, length); char [] chars = Converter.mbcsToWcs (buffer); Event event = new Event(); event.detail = SWT.COMPOSITION_CHANGED; @@ -294,9 +294,9 @@ long /*int*/ gtk_preedit_changed (long /*int*/ imcontext) { caretOffset = cursorPos [0]; char [] chars = null; if (preeditString [0] != 0) { - int length = OS.strlen (preeditString [0]); + int length = C.strlen (preeditString [0]); byte [] buffer = new byte [length]; - OS.memmove (buffer, preeditString [0], length); + C.memmove (buffer, preeditString [0], length); chars = Converter.mbcsToWcs (buffer); if (pangoAttrs [0] != 0) { int count = 0; 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 8c13845cd2..ccb4faaa96 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -467,7 +467,7 @@ public int getFocusIndex () { if (path [0] == 0) return -1; long /*int*/ indices = OS.gtk_tree_path_get_indices (path [0]); int [] index = new int []{-1}; - if (indices != 0) OS.memmove (index, indices, 4); + if (indices != 0) C.memmove (index, indices, 4); OS.gtk_tree_path_free (path [0]); return index [0]; } @@ -504,9 +504,9 @@ public String getItem (int index) { OS.gtk_tree_model_get (modelHandle, iter, 0, ptr, -1); OS.g_free (iter); if (ptr [0] == 0) return null; - int length = OS.strlen (ptr [0]); + int length = C.strlen (ptr [0]); byte[] buffer2 = new byte [length]; - OS.memmove (buffer2, ptr [0], length); + C.memmove (buffer2, ptr [0], length); OS.g_free (ptr [0]); return new String (Converter.mbcsToWcs (buffer2)); } @@ -593,9 +593,9 @@ public String [] getItems () { OS.gtk_tree_model_iter_nth_child (modelHandle, iter, 0, index); OS.gtk_tree_model_get (modelHandle, iter, 0, ptr, -1); if (ptr [0] != 0) { - int length = OS.strlen (ptr [0]); + int length = C.strlen (ptr [0]); byte[] buffer = new byte [length]; - OS.memmove (buffer, ptr [0], length); + C.memmove (buffer, ptr [0], length); OS.g_free (ptr [0]); result [index] = new String (Converter.mbcsToWcs (buffer)); } @@ -670,7 +670,7 @@ public int getSelectionIndex () { if (foundIndex == false) { long /*int*/ indices = OS.gtk_tree_path_get_indices (data); if (indices !=0) { - OS.memmove (index, indices, 4); + C.memmove (index, indices, 4); foundIndex = true; } } @@ -713,7 +713,7 @@ public int [] getSelectionIndices () { long /*int*/ indices = OS.gtk_tree_path_get_indices (data); if (indices != 0) { int [] index = new int [1]; - OS.memmove (index, indices, 4); + C.memmove (index, indices, 4); treeSelection [length] = index [0]; length++; } @@ -780,7 +780,7 @@ public int getTopIndex () { if (path [0] == 0) return 0; long /*int*/ indices = OS.gtk_tree_path_get_indices (path[0]); int[] index = new int [1]; - if (indices != 0) OS.memmove (index, indices, 4); + if (indices != 0) C.memmove (index, indices, 4); OS.gtk_tree_path_free (path [0]); return index [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 6a90bdea99..a2d0927c11 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -1090,7 +1090,7 @@ public void setText (String string) { private void setAccelLabel(long /*int*/ label, String accelString) { byte[] buffer = Converter.wcsToMbcs (accelString, true); long /*int*/ ptr = OS.g_malloc (buffer.length); - OS.memmove (ptr, buffer, buffer.length); + C.memmove (ptr, buffer, buffer.length); long /*int*/ oldPtr = OS.GTK_ACCEL_LABEL_GET_ACCEL_STRING (label); OS.GTK_ACCEL_LABEL_SET_ACCEL_STRING (label, ptr); if (oldPtr != 0) OS.g_free (oldPtr); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java index 3ca9cf264b..62ca765e12 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -229,9 +229,9 @@ Point computeSizeInPixels (int wHint, int hHint, boolean changed) { } byte [] buffer1 = Converter.wcsToMbcs (string, false); long /*int*/ ptr = OS.pango_layout_get_text (layout); - int length = OS.strlen (ptr); + int length = C.strlen (ptr); byte [] buffer2 = new byte [length]; - OS.memmove (buffer2, ptr, length); + C.memmove (buffer2, ptr, length); OS.pango_layout_set_text (layout, buffer1, buffer1.length); int width, height = 0 ; OS.gtk_widget_realize (handle); @@ -557,9 +557,9 @@ public String getText () { checkWidget (); long /*int*/ str = OS.gtk_entry_get_text (handle); if (str == 0) return ""; - int length = OS.strlen (str); + int length = C.strlen (str); byte [] buffer = new byte [length]; - OS.memmove (buffer, str, length); + C.memmove (buffer, str, length); return new String (Converter.mbcsToWcs (buffer)); } @@ -603,9 +603,9 @@ public int getDigits () { String getDecimalSeparator () { long /*int*/ ptr = OS.localeconv_decimal_point (); - int length = OS.strlen (ptr); + int length = C.strlen (ptr); byte [] buffer = new byte [length]; - OS.memmove (buffer, ptr, length); + C.memmove (buffer, ptr, length); return new String (Converter.mbcsToWcs (buffer)); } @@ -618,7 +618,7 @@ long /*int*/ gtk_activate (long /*int*/ widget) { @Override long /*int*/ gtk_changed (long /*int*/ widget) { long /*int*/ str = OS.gtk_entry_get_text (handle); - int length = OS.strlen (str); + int length = C.strlen (str); if (length > 0) { long /*int*/ [] endptr = new long /*int*/ [1]; double value = OS.g_strtod (str, endptr); @@ -664,10 +664,10 @@ long /*int*/ gtk_changed (long /*int*/ widget) { long /*int*/ gtk_commit (long /*int*/ imContext, long /*int*/ text) { if (text == 0) return 0; if (!OS.gtk_editable_get_editable (handle)) return 0; - int length = OS.strlen (text); + int length = C.strlen (text); if (length == 0) return 0; byte [] buffer = new byte [length]; - OS.memmove (buffer, text, length); + C.memmove (buffer, text, length); char [] chars = Converter.mbcsToWcs (buffer); char [] newChars = sendIMKeyEvent (SWT.KeyDown, null, chars); if (newChars == null) return 0; @@ -742,10 +742,10 @@ long /*int*/ gtk_insert_text (long /*int*/ widget, long /*int*/ new_text, long / // 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]; - OS.memmove (buffer, new_text, buffer.length); + C.memmove (buffer, new_text, buffer.length); String oldText = new String (Converter.mbcsToWcs (buffer)); int [] pos = new int [1]; - OS.memmove (pos, position, 4); + C.memmove (pos, position, 4); long /*int*/ ptr = OS.gtk_entry_get_text (handle); if (pos [0] == -1) pos [0] = (int)/*64*/OS.g_utf8_strlen (ptr, -1); int start = (int)/*64*/OS.g_utf16_pointer_to_offset (ptr, pos [0]); @@ -772,7 +772,7 @@ long /*int*/ gtk_insert_text (long /*int*/ widget, long /*int*/ new_text, long / fixStart = newStart [0]; fixEnd = newEnd [0]; } - OS.memmove (position, pos, 4); + C.memmove (position, pos, 4); OS.g_signal_stop_emission_by_name (handle, OS.insert_text); } return 0; @@ -1245,7 +1245,7 @@ boolean translateTraversal (GdkEventKey keyEvent) { long /*int*/ [] preeditString = new long /*int*/ [1]; OS.gtk_im_context_get_preedit_string (imContext, preeditString, null, null); if (preeditString [0] != 0) { - int length = OS.strlen (preeditString [0]); + int length = C.strlen (preeditString [0]); OS.g_free (preeditString [0]); if (length != 0) return false; } 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 bef8da39f1..6ed9ec98b7 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 @@ -185,7 +185,7 @@ long /*int*/ cellDataProc (long /*int*/ tree_column, long /*int*/ cell, long /*i if (cell == ignoreCell) return 0; long /*int*/ path = OS.gtk_tree_model_get_path (tree_model, iter); int [] index = new int [1]; - OS.memmove (index, OS.gtk_tree_path_get_indices (path), 4); + C.memmove (index, OS.gtk_tree_path_get_indices (path), 4); TableItem item = _getItem (index[0]); OS.gtk_tree_path_free (path); if (item != null) OS.g_object_set_qdata (cell, Display.SWT_OBJECT_INDEX2, item.handle); @@ -1454,7 +1454,7 @@ TableItem getFocusItem () { long /*int*/ indices = OS.gtk_tree_path_get_indices (path [0]); if (indices != 0) { int [] index = new int []{-1}; - OS.memmove (index, indices, 4); + C.memmove (index, indices, 4); item = _getItem (index [0]); } OS.gtk_tree_path_free (path [0]); @@ -1653,7 +1653,7 @@ TableItem getItemInPixels (Point point) { TableItem item = null; if (indices != 0) { int [] index = new int [1]; - OS.memmove (index, indices, 4); + C.memmove (index, indices, 4); item = _getItem (index [0]); } OS.gtk_tree_path_free (path [0]); @@ -1826,7 +1826,7 @@ public TableItem [] getSelection () { long /*int*/ indices = OS.gtk_tree_path_get_indices (data); if (indices != 0) { int [] index = new int [1]; - OS.memmove (index, indices, 4); + C.memmove (index, indices, 4); treeSelection [length] = index [0]; length++; } @@ -1881,7 +1881,7 @@ public int getSelectionIndex () { if (foundIndex == false) { long /*int*/ indices = OS.gtk_tree_path_get_indices (data); if (indices != 0) { - OS.memmove (index, indices, 4); + C.memmove (index, indices, 4); foundIndex = true; } } @@ -1924,7 +1924,7 @@ public int [] getSelectionIndices () { long /*int*/ indices = OS.gtk_tree_path_get_indices (data); if (indices != 0) { int [] index = new int [1]; - OS.memmove (index, indices, 4); + C.memmove (index, indices, 4); treeSelection [length] = index [0]; length++; } @@ -2033,7 +2033,7 @@ public int getTopIndex () { if (path [0] == 0) return 0; long /*int*/ indices = OS.gtk_tree_path_get_indices (path[0]); int[] index = new int [1]; - if (indices != 0) OS.memmove (index, indices, 4); + if (indices != 0) C.memmove (index, indices, 4); OS.gtk_tree_path_free (path [0]); return index [0]; } @@ -2322,7 +2322,7 @@ long /*int*/ gtk_toggled (long /*int*/ renderer, long /*int*/ pathStr) { long /*int*/ indices = OS.gtk_tree_path_get_indices (path); if (indices != 0) { int [] index = new int [1]; - OS.memmove (index, indices, 4); + C.memmove (index, indices, 4); TableItem item = _getItem (index [0]); item.setChecked (!item.getChecked ()); Event event = new Event (); @@ -2598,7 +2598,7 @@ public void remove (int index) { if (item != null) { disposed = item.isDisposed (); if (!disposed) { - OS.memmove (iter, item.handle, OS.GtkTreeIter_sizeof ()); + C.memmove (iter, item.handle, OS.GtkTreeIter_sizeof ()); item.release (false); } } else { @@ -2705,7 +2705,7 @@ public void remove (int [] indices) { if (item != null) { disposed = item.isDisposed (); if (!disposed) { - OS.memmove (iter, item.handle, OS.GtkTreeIter_sizeof ()); + C.memmove (iter, item.handle, OS.GtkTreeIter_sizeof ()); item.release (false); } } else { @@ -2801,7 +2801,7 @@ void sendMeasureEvent (long /*int*/ cell, long /*int*/ width, long /*int*/ heigh if (iter != 0) { long /*int*/ path = OS.gtk_tree_model_get_path (modelHandle, iter); int [] buffer = new int [1]; - OS.memmove (buffer, OS.gtk_tree_path_get_indices (path), 4); + C.memmove (buffer, OS.gtk_tree_path_get_indices (path), 4); int index = buffer [0]; item = _getItem (index); long /*int*/ selection = OS.gtk_tree_view_get_selection (handle); @@ -2820,8 +2820,8 @@ void sendMeasureEvent (long /*int*/ cell, long /*int*/ width, long /*int*/ heigh } } int [] contentWidth = new int [1], contentHeight = new int [1]; - if (width != 0) OS.memmove (contentWidth, width, 4); - if (height != 0) OS.memmove (contentHeight, height, 4); + if (width != 0) C.memmove (contentWidth, width, 4); + if (height != 0) C.memmove (contentHeight, height, 4); if (OS.GTK3) { OS.gtk_cell_renderer_get_preferred_height_for_width (cell, handle, contentWidth[0], contentHeight, null); } @@ -2846,8 +2846,8 @@ void sendMeasureEvent (long /*int*/ cell, long /*int*/ width, long /*int*/ heigh Rectangle rect = DPIUtil.autoScaleUp (event.getBounds ()); contentWidth [0] = rect.width - imageWidth; if (contentHeight [0] < rect.height) contentHeight [0] = rect.height; - if (width != 0) OS.memmove (width, contentWidth, 4); - if (height != 0) OS.memmove (height, contentHeight, 4); + if (width != 0) C.memmove (width, contentWidth, 4); + if (height != 0) C.memmove (height, contentHeight, 4); if (OS.GTK3) { OS.gtk_cell_renderer_set_fixed_size (cell, contentWidth [0], contentHeight [0]); } @@ -2894,7 +2894,7 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo if (iter != 0) { long /*int*/ path = OS.gtk_tree_model_get_path (modelHandle, iter); int [] buffer = new int [1]; - OS.memmove (buffer, OS.gtk_tree_path_get_indices (path), 4); + C.memmove (buffer, OS.gtk_tree_path_get_indices (path), 4); int index = buffer [0]; item = _getItem (index); OS.gtk_tree_path_free (path); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java index a649772ce1..3b577afa78 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -228,9 +228,9 @@ String _getText (int index) { int modelIndex = parent.columnCount == 0 ? Table.FIRST_COLUMN : parent.columns [index].modelIndex; OS.gtk_tree_model_get (parent.modelHandle, handle, modelIndex + Table.CELL_TEXT, ptr, -1); if (ptr [0] == 0) return ""; - int length = OS.strlen (ptr [0]); + int length = C.strlen (ptr [0]); byte[] buffer = new byte [length]; - OS.memmove (buffer, ptr [0], length); + C.memmove (buffer, ptr [0], length); OS.g_free (ptr [0]); return new String (Converter.mbcsToWcs (buffer)); } 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 facbbcec68..eb41b01ef9 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 @@ -1336,9 +1336,9 @@ public char [] getTextChars () { address = OS.gtk_text_buffer_get_text (bufferHandle, start, end, true); } if (address == 0) return new char[0]; - int length = OS.strlen (address); + int length = C.strlen (address); byte [] buffer = new byte [length]; - OS.memmove (buffer, address, length); + C.memmove (buffer, address, length); if ((style & SWT.MULTI) != 0) OS.g_free (address); char [] result = Converter.mbcsToWcs (buffer); @@ -1520,10 +1520,10 @@ long /*int*/ gtk_commit (long /*int*/ imContext, long /*int*/ text) { if ((style & SWT.SINGLE) != 0) { if (!OS.gtk_editable_get_editable (handle)) return 0; } - int length = OS.strlen (text); + int length = C.strlen (text); if (length == 0) return 0; byte [] buffer = new byte [length]; - OS.memmove (buffer, text, length); + C.memmove (buffer, text, length); char [] chars = Converter.mbcsToWcs (buffer); Arrays.fill (buffer, (byte) 0); char [] newChars = sendIMKeyEvent (SWT.KeyDown, null, chars); @@ -1564,8 +1564,8 @@ long /*int*/ gtk_delete_range (long /*int*/ widget, long /*int*/ iter1, long /*i if (!hooks (SWT.Verify) && !filters (SWT.Verify)) return 0; byte [] startIter = new byte [ITER_SIZEOF]; byte [] endIter = new byte [ITER_SIZEOF]; - OS.memmove (startIter, iter1, startIter.length); - OS.memmove (endIter, iter2, endIter.length); + C.memmove (startIter, iter1, startIter.length); + C.memmove (endIter, iter2, endIter.length); int start = OS.gtk_text_iter_get_offset (startIter); int end = OS.gtk_text_iter_get_offset (endIter); byte [] zero = new byte [ITER_SIZEOF]; @@ -1667,7 +1667,7 @@ void drawMessage (long /*int*/ cr) { if (OS.GTK_VERSION >= OS.VERSION (3, 2, 0)) return; if ((style & SWT.SINGLE) != 0 && message.length () > 0) { long /*int*/ str = OS.gtk_entry_get_text (handle); - if (!OS.gtk_widget_has_focus (handle) && OS.strlen (str) == 0) { + if (!OS.gtk_widget_has_focus (handle) && C.strlen (str) == 0) { long /*int*/ window = paintWindow (); int [] w = new int [1], h = new int [1]; gdk_window_get_size (window, w, h); @@ -1788,10 +1788,10 @@ long /*int*/ gtk_insert_text (long /*int*/ widget, long /*int*/ new_text, long / 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]; - OS.memmove (buffer, new_text, buffer.length); + C.memmove (buffer, new_text, buffer.length); String oldText = new String (Converter.mbcsToWcs (buffer)); int [] pos = new int [1]; - OS.memmove (pos, position, 4); + C.memmove (pos, position, 4); long /*int*/ ptr = OS.gtk_entry_get_text (handle); if (pos [0] == -1) pos [0] = (int)/*64*/OS.g_utf8_strlen (ptr, -1); /* Use the selection when the text was deleted */ @@ -1826,7 +1826,7 @@ long /*int*/ gtk_insert_text (long /*int*/ widget, long /*int*/ new_text, long / fixStart = newStart [0]; fixEnd = newEnd [0]; } - OS.memmove (position, pos, 4); + C.memmove (position, pos, 4); OS.g_signal_stop_emission_by_name (handle, OS.insert_text); } return 0; @@ -1869,7 +1869,7 @@ long /*int*/ gtk_populate_popup (long /*int*/ widget, long /*int*/ menu) { long /*int*/ gtk_text_buffer_insert_text (long /*int*/ widget, long /*int*/ iter, long /*int*/ text, long /*int*/ length) { if (!hooks (SWT.Verify) && !filters (SWT.Verify)) return 0; byte [] position = new byte [ITER_SIZEOF]; - OS.memmove (position, iter, position.length); + C.memmove (position, iter, position.length); /* Use the selection when the text was deleted */ int start = OS.gtk_text_iter_get_offset (position), end = start; if (fixStart != -1 && fixEnd != -1) { @@ -1884,7 +1884,7 @@ long /*int*/ gtk_text_buffer_insert_text (long /*int*/ widget, long /*int*/ iter end = (int)/*64*/OS.g_utf8_offset_to_utf16_offset (ptr, end); OS.g_free(ptr); byte [] buffer = new byte [(int)/*64*/length]; - OS.memmove (buffer, text, buffer.length); + C.memmove (buffer, text, buffer.length); String oldText = new String (Converter.mbcsToWcs (buffer)); String newText = verifyText (oldText, start, end); if (newText == null) { @@ -2865,7 +2865,7 @@ boolean translateTraversal (GdkEventKey keyEvent) { long /*int*/ [] preeditString = new long /*int*/ [1]; OS.gtk_im_context_get_preedit_string (imContext, preeditString, null, null); if (preeditString [0] != 0) { - int length = OS.strlen (preeditString [0]); + int length = C.strlen (preeditString [0]); OS.g_free (preeditString [0]); if (length != 0) return false; } 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 f2798f01fe..8bf3604067 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -299,7 +299,7 @@ long /*int*/ gtk_size_allocate (long /*int*/ widget, long /*int*/ allocation) { GdkImage gdkImage = new GdkImage(); OS.memmove (gdkImage, gdkImagePtr); byte[] maskData = new byte [gdkImage.bpl * gdkImage.height]; - OS.memmove (maskData, gdkImage.mem, maskData.length); + C.memmove (maskData, gdkImage.mem, maskData.length); OS.g_object_unref (gdkImagePtr); Region region = new Region (display); for (int y = 0; y < b.height; y++) { 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 ce38d7a6ba..700922c673 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 @@ -170,7 +170,7 @@ TreeItem _getItem (long /*int*/ iter) { long /*int*/ path = OS.gtk_tree_model_get_path (modelHandle, iter); int depth = OS.gtk_tree_path_get_depth (path); int [] indices = new int [depth]; - OS.memmove (indices, OS.gtk_tree_path_get_indices (path), 4*depth); + C.memmove (indices, OS.gtk_tree_path_get_indices (path), 4*depth); long /*int*/ parentIter = 0; if (depth > 1) { OS.gtk_tree_path_up (path); @@ -2597,7 +2597,7 @@ public int indexOf (TreeItem item) { long /*int*/ indices = OS.gtk_tree_path_get_indices (path); if (indices != 0) { int[] temp = new int[1]; - OS.memmove (temp, indices, 4); + C.memmove (temp, indices, 4); index = temp[0]; } } @@ -2872,8 +2872,8 @@ void sendMeasureEvent (long /*int*/ cell, long /*int*/ width, long /*int*/ heigh } } int [] contentWidth = new int [1], contentHeight = new int [1]; - if (width != 0) OS.memmove (contentWidth, width, 4); - if (height != 0) OS.memmove (contentHeight, height, 4); + if (width != 0) C.memmove (contentWidth, width, 4); + if (height != 0) C.memmove (contentHeight, height, 4); if (OS.GTK3) { OS.gtk_cell_renderer_get_preferred_height_for_width (cell, handle, contentWidth[0], contentHeight, null); } @@ -2903,8 +2903,8 @@ void sendMeasureEvent (long /*int*/ cell, long /*int*/ width, long /*int*/ heigh Rectangle rect = DPIUtil.autoScaleUp (event.getBounds ()); contentWidth [0] = rect.width - imageWidth; if (contentHeight [0] < rect.height) contentHeight [0] = rect.height; - if (width != 0) OS.memmove (width, contentWidth, 4); - if (height != 0) OS.memmove (height, contentHeight, 4); + if (width != 0) C.memmove (width, contentWidth, 4); + if (height != 0) C.memmove (height, contentHeight, 4); if (OS.GTK3) { OS.gtk_cell_renderer_set_fixed_size (cell, contentWidth [0], contentHeight [0]); } @@ -3970,7 +3970,7 @@ void showItem (long /*int*/ path, boolean scroll) { if (depth > 1) { int [] indices = new int [depth - 1]; long /*int*/ indicesPtr = OS.gtk_tree_path_get_indices (path); - OS.memmove (indices, indicesPtr, indices.length * 4); + C.memmove (indices, indicesPtr, indices.length * 4); long /*int*/ tempPath = OS.gtk_tree_path_new (); for (int i=0; i<indices.length; i++) { OS.gtk_tree_path_append_index (tempPath, indices [i]); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java index 9b24d1b052..0d3e77c4be 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -314,9 +314,9 @@ String _getText (int index) { int modelIndex = parent.columnCount == 0 ? Tree.FIRST_COLUMN : parent.columns [index].modelIndex; OS.gtk_tree_model_get (parent.modelHandle, handle, modelIndex + Tree.CELL_TEXT, ptr, -1); if (ptr [0] == 0) return ""; //$NON-NLS-1$ - int length = OS.strlen (ptr [0]); + int length = C.strlen (ptr [0]); byte[] buffer = new byte [length]; - OS.memmove (buffer, ptr [0], length); + C.memmove (buffer, ptr [0], length); OS.g_free (ptr [0]); return new String (Converter.mbcsToWcs (buffer)); } @@ -1073,7 +1073,7 @@ public int indexOf (TreeItem item) { long /*int*/ indices = OS.gtk_tree_path_get_indices (path); if (indices != 0) { int[] temp = new int[depth]; - OS.memmove (temp, indices, 4 * temp.length); + C.memmove (temp, indices, 4 * temp.length); index = temp[temp.length - 1]; } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java index 8b5a4e7635..754d759ecf 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -1411,7 +1411,7 @@ boolean sendKeyEvent (int type, GdkEventKey keyEvent) { return event.doit; } byte [] buffer = new byte [length]; - OS.memmove (buffer, keyEvent.string, length); + C.memmove (buffer, keyEvent.string, length); char [] chars = Converter.mbcsToWcs (buffer); return sendIMKeyEvent (type, keyEvent, chars) != null; } |