diff options
5 files changed, 49 insertions, 6 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java index fba2933791..692cda16ee 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java @@ -1505,7 +1505,7 @@ public Pattern getBackgroundPattern() { return data.backgroundPattern; } -boolean getAdvanced() { +public boolean getAdvanced() { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); return true; } @@ -1946,7 +1946,7 @@ boolean isIdentity(float[] transform) { && transform[3] == 1 && transform[4] == 0 && transform[5] == 0; } -void setAdvanced(boolean advanced) { +public void setAdvanced(boolean advanced) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (!advanced) { setAlpha(0xFF); 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 eec03ce67b..9987d4a207 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 @@ -1628,7 +1628,7 @@ public int getAdvanceWidth(char ch) { return stringExtent(new String(new char[]{ch})).x; } -boolean getAdvanced() { +public boolean getAdvanced() { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); return data.cairo != 0; } @@ -2182,7 +2182,7 @@ boolean isIdentity(int /*long*/ matrix) { return a[0] == 1 && b[0] == 0 && c[0] == 0 && d[0] == 1 && tx[0] == 0 && ty[0] == 0; } -void setAdvanced(boolean advanced) { +public void setAdvanced(boolean advanced) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (advanced && data.cairo != 0) return; if (advanced) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/GC.java index 9f378df9d1..d2ff75c601 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/GC.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/GC.java @@ -1961,6 +1961,10 @@ public int getAdvanceWidth(char ch) { OS.XmFontListFreeFontContext(context); return 0; } +public boolean getAdvanced() { + if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); + return data.cairo != 0; +} /** * WARNING API STILL UNDER CONSTRUCTION AND SUBJECT TO CHANGE */ @@ -2825,6 +2829,26 @@ boolean isIdentity(int /*long*/ matrix) { Cairo.cairo_matrix_get_affine(matrix, a, b, c, d, tx, ty); return a[0] == 1 && b[0] == 0 && c[0] == 0 && d[0] == 1 && tx[0] == 0 && ty[0] == 0; } +public void setAdvanced(boolean advanced) { + if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); + if (advanced && data.cairo != 0) return; + if (advanced) { + try { + initCairo(); + } catch (SWTException e) {} + } else { + int /*long*/ cairo = data.cairo; + if (cairo != 0) Cairo.cairo_destroy(cairo); + int /*long*/ matrix = data.matrix; + if (matrix != 0) Cairo.cairo_matrix_destroy(matrix); + int /*long*/ inverseMatrix = data.inverseMatrix; + if (inverseMatrix != 0) Cairo.cairo_matrix_destroy(inverseMatrix); + data.cairo = data.matrix = data.inverseMatrix = 0; + data.antialias = data.textAntialias = data.interpolation = SWT.DEFAULT; + data.backgroundPattern = data.foregroundPattern = null; + setClipping(0); + } +} /** * WARNING API STILL UNDER CONSTRUCTION AND SUBJECT TO CHANGE */ diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/GC.java index 32e98489e1..5e07270b85 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/GC.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/GC.java @@ -1841,6 +1841,11 @@ public int getAdvanceWidth(char ch) { return getCharWidth(ch); } +public boolean getAdvanced() { + if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); + return false; +} + /** * WARNING API STILL UNDER CONSTRUCTION AND SUBJECT TO CHANGE */ @@ -2304,6 +2309,20 @@ public boolean isDisposed() { return handle == 0; } +public void setAdvanced(boolean advanced) { + if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); + if (!advanced) { + setAlpha(0xFF); + setAntialias(SWT.DEFAULT); + setBackgroundPattern(null); + setClipping((Rectangle)null); + setForegroundPattern(null); + setInterpolation(SWT.DEFAULT); + setTextAntialias(SWT.DEFAULT); + setTransform(null); + } +} + /** * WARNING API STILL UNDER CONSTRUCTION AND SUBJECT TO CHANGE */ diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java index 7488018750..39f56e6196 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java @@ -2352,7 +2352,7 @@ public int getAdvanceWidth(char ch) { * @see setAdvanced() * @since 3.1 */ -/*public*/ boolean getAdvanced() { +public boolean getAdvanced() { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); return data.gdipGraphics != 0; } @@ -3151,7 +3151,7 @@ float measureSpace(int font, int format) { * * @since 3.1 */ -/*public*/ void setAdvanced(boolean advanced) { +public void setAdvanced(boolean advanced) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (advanced && data.gdipGraphics != 0) return; if (advanced) { |