Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-09-27 07:04:14 +0000
committerAlexander Kurtakov2017-09-27 07:05:09 +0000
commit5b8fa75d1f7bd7eb02164c4992685338c6ecbba4 (patch)
tree4bc9e70b68c730f6767003fe5f4d093cc222f171 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt
parent47ed256369174cc1874b1b50f12e79d3168b22c9 (diff)
downloadeclipse.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>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Cursor.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java14
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Font.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java44
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java14
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/Converter.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/ImageList.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Decorations.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FileDialog.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FontDialog.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/IME.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java32
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java14
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java4
29 files changed, 171 insertions, 171 deletions
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;
}

Back to the top