diff options
author | Silenio Quarti <silenio> | 2005-05-26 15:21:26 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2005-05-26 15:21:26 +0000 |
commit | e88f9a0dc6e6115cb55553159ce77a62a8efc17f (patch) | |
tree | 9071213a8c942d9e05421de10e16d432b3e54afe /bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/GC.java | |
parent | 86c17b0ea1ef0dc031704462129c2ba81309598e (diff) | |
download | eclipse.platform.swt-e88f9a0dc6e6115cb55553159ce77a62a8efc17f.tar.gz eclipse.platform.swt-e88f9a0dc6e6115cb55553159ce77a62a8efc17f.tar.xz eclipse.platform.swt-e88f9a0dc6e6115cb55553159ce77a62a8efc17f.zip |
96445
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/GC.java')
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/GC.java | 24 |
1 files changed, 24 insertions, 0 deletions
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 */ |