summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti <silenio>2004-03-02 19:08:29 +0000
committerSilenio Quarti <silenio>2004-03-02 19:08:29 +0000
commit6f2ef40c7150e4cdca5ddea934825087c489cb13 (patch)
tree8eb51a69dd6579a52152df62f05ae42ae4bfe5c0
parent2322f1ae6c545f31dd7bf9dbea8e44d64f10fe3c (diff)
downloadeclipse.platform.swt-6f2ef40c7150e4cdca5ddea934825087c489cb13.tar.gz
eclipse.platform.swt-6f2ef40c7150e4cdca5ddea934825087c489cb13.tar.xz
eclipse.platform.swt-6f2ef40c7150e4cdca5ddea934825087c489cb13.zip
53419
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/GC.java2
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/GCData.java1
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Composite.java60
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Control.java12
4 files changed, 46 insertions, 29 deletions
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 ccc9393c2d..e4489491af 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
@@ -2290,7 +2290,7 @@ void setGCClipping() {
/* NOTE: PgSetRegion resets the clipping rectangle */
OS.PgSetMultiClip(data.clipRectsCount, data.clipRects);
- if (widget == 0) return;
+ if (widget == 0 || data.paint) return;
int clip_tile = getClipping(widget, data.topWidget, true, true, null);
int[] clip_rects_count = new int[1];
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/GCData.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/GCData.java
index 741a6f67c7..f5e6e8a66d 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/GCData.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/GCData.java
@@ -37,4 +37,5 @@ public final class GCData {
public int lineWidth = 1;
public int clipRectsCount;
public int clipRects;
+ public boolean paint;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Composite.java
index 1eb7e9a095..04205f5de0 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Composite.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Composite.java
@@ -226,37 +226,45 @@ void drawWidget (int widget, int damage) {
if ((state & CANVAS) != 0) {
if ((style & SWT.NO_BACKGROUND) == 0) {
- /* Get the clipping tiles for children and siblings */
- int clip_tile = getClipping (handle, topHandle (), true, true);
- if (clip_tile == 0) return;
-
- /* Translate the clipping to the current GC coordinates */
- short [] abs_x = new short [1], abs_y = new short [1];
- OS.PtGetAbsPosition (handle, abs_x, abs_y);
- short [] dis_abs_x = new short [1], dis_abs_y = new short [1];
- OS.PtGetAbsPosition (OS.PtFindDisjoint (handle), dis_abs_x, dis_abs_y);
- PhPoint_t delta = new PhPoint_t ();
- delta.x = (short) (abs_x [0] - dis_abs_x [0]);
- delta.y = (short) (abs_y [0] - dis_abs_y [0]);
- OS.PhTranslateTiles(clip_tile, delta);
-
- /* Set the clipping */
- int[] clip_rects_count = new int [1];
- int clip_rects = OS.PhTilesToRects (clip_tile, clip_rects_count);
- OS.PhFreeTiles (clip_tile);
- if (clip_rects_count [0] == 0) {
- clip_rects_count [0] = 1;
- OS.free (clip_rects);
- clip_rects = OS.malloc (PhRect_t.sizeof);
+ /*
+ * Note that QNX 6.2.1 provides full widget hierarchy clipping in paint.
+ */
+ if (!(OS.QNX_MAJOR > 6 || (OS.QNX_MAJOR == 6 && (OS.QNX_MINOR > 2 || (OS.QNX_MINOR == 2 && OS.QNX_MICRO >= 1))))) {
+ /* Get the clipping tiles for children and siblings */
+ int clip_tile = getClipping (handle, topHandle (), true, true);
+ if (clip_tile == 0) return;
+
+ /* Translate the clipping to the current GC coordinates */
+ short [] abs_x = new short [1], abs_y = new short [1];
+ OS.PtGetAbsPosition (handle, abs_x, abs_y);
+ short [] dis_abs_x = new short [1], dis_abs_y = new short [1];
+ OS.PtGetAbsPosition (OS.PtFindDisjoint (handle), dis_abs_x, dis_abs_y);
+ PhPoint_t delta = new PhPoint_t ();
+ delta.x = (short) (abs_x [0] - dis_abs_x [0]);
+ delta.y = (short) (abs_y [0] - dis_abs_y [0]);
+ OS.PhTranslateTiles(clip_tile, delta);
+
+ /* Set the clipping */
+ int[] clip_rects_count = new int [1];
+ int clip_rects = OS.PhTilesToRects (clip_tile, clip_rects_count);
+ OS.PhFreeTiles (clip_tile);
+ if (clip_rects_count [0] == 0) {
+ clip_rects_count [0] = 1;
+ OS.free (clip_rects);
+ clip_rects = OS.malloc (PhRect_t.sizeof);
+ }
+ OS.PgSetMultiClip (clip_rects_count[0], clip_rects);
+ OS.free (clip_rects);
}
- OS.PgSetMultiClip (clip_rects_count[0], clip_rects);
- OS.free (clip_rects);
/* Draw the widget */
super.drawWidget (widget, damage);
- /* Reset the clipping */
- OS.PgSetMultiClip (0, 0);
+
+ if (!(OS.QNX_MAJOR > 6 || (OS.QNX_MAJOR == 6 && (OS.QNX_MINOR > 2 || (OS.QNX_MINOR == 2 && OS.QNX_MICRO >= 1))))) {
+ /* Reset the clipping */
+ OS.PgSetMultiClip (0, 0);
+ }
}
} else {
super.drawWidget (widget, damage);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Control.java
index ded8670da7..06825eb68a 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Control.java
@@ -514,7 +514,11 @@ int drawProc (int widget, int damage) {
event.y = tile.rect_ul_y;
event.width = tile.rect_lr_x - tile.rect_ul_x + 1;
event.height = tile.rect_lr_y - tile.rect_ul_y + 1;
- GC gc = event.gc = new GC (this);
+ GCData data = new GCData();
+ if (OS.QNX_MAJOR > 6 || (OS.QNX_MAJOR == 6 && (OS.QNX_MINOR > 2 || (OS.QNX_MINOR == 2 && OS.QNX_MICRO >= 1)))) {
+ data.paint = true;
+ }
+ GC gc = event.gc = GC.photon_new (this, data);
gc.setClipping (event.x, event.y, event.width, event.height);
sendEvent (SWT.Paint, event);
if (isDisposed ()) break;
@@ -530,7 +534,11 @@ int drawProc (int widget, int damage) {
event.width = tile.rect_lr_x - tile.rect_ul_x + 1;
event.height = tile.rect_lr_y - tile.rect_ul_y + 1;
Region region = Region.photon_new (tile.next);
- GC gc = event.gc = new GC (this);
+ GCData data = new GCData();
+ if (OS.QNX_MAJOR > 6 || (OS.QNX_MAJOR == 6 && (OS.QNX_MINOR > 2 || (OS.QNX_MINOR == 2 && OS.QNX_MICRO >= 1)))) {
+ data.paint = true;
+ }
+ GC gc = event.gc = GC.photon_new (this, data);
gc.setClipping (region);
sendEvent (SWT.Paint, event);
gc.dispose ();